Networking Forums

Networking Forums > Computer Networking > Linux Networking > How do i avoid packet segmentation?

Reply
Thread Tools Display Modes

How do i avoid packet segmentation?

 
 
owolablo
Guest
Posts: n/a

 
      10-12-2006, 10:08 AM
Hi,
I'm writing a program that sends 1500 bytes of data at once, from the
client to the server. However, the packet is broken down into 3
different segments of 500 each before getting to the server. This is
detrimental to the program i'm writing as I need the server to receive
the entire 1500 bytes at once. How do I avoid this segmentation. Is it
a linux setting which I can change or is it a TCP setting? either way,
what can I do? I'm sending the packets using the C send() function.

 
Reply With Quote
 
 
 
 
Robert Harris
Guest
Posts: n/a

 
      10-12-2006, 10:45 AM
owolablo wrote:
> Hi,
> I'm writing a program that sends 1500 bytes of data at once, from the
> client to the server. However, the packet is broken down into 3
> different segments of 500 each before getting to the server. This is
> detrimental to the program i'm writing as I need the server to receive
> the entire 1500 bytes at once. How do I avoid this segmentation. Is it
> a linux setting which I can change or is it a TCP setting? either way,
> what can I do? I'm sending the packets using the C send() function.
>

TCP sends streams which the IP layer assembles into packets. If you want
one transmitted packet to correspond with one received packet, then you
need to use UDP instead (but you lose the TCP-layer error checking).

Now IP packets themselves may be split along the way to their
destination into multiple fragments which get reassembled when they
arrive; that happens if the "maximum segment size" (MSS) along the
packet's route isn't large enough to accommodate the packets -
presumably that isn't what you are worried about.

Robert
 
Reply With Quote
 
David Schwartz
Guest
Posts: n/a

 
      10-13-2006, 12:30 AM

owolablo wrote:
> Hi,
> I'm writing a program that sends 1500 bytes of data at once, from the
> client to the server. However, the packet is broken down into 3
> different segments of 500 each before getting to the server. This is
> detrimental to the program i'm writing as I need the server to receive
> the entire 1500 bytes at once. How do I avoid this segmentation. Is it
> a linux setting which I can change or is it a TCP setting? either way,
> what can I do? I'm sending the packets using the C send() function.


Nobody should ever be permitted to write any code that uses TCP until
they can demonstrate that they 100% understand this: "TCP is a
byte-stream protocol that does not preserve application message
boundaries". Goole around until you understand that completely or you
will never get TCP right.

DS

 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Network Segmentation IT-Belize Windows Networking 1 10-13-2006 07:47 PM
Network Segmentation IT-Belize Windows Networking 2 10-12-2006 06:40 PM
Network Segmentation IT-Belize Windows Networking 0 10-10-2006 10:48 PM
TCP segmentation offload ValerioZ Linux Networking 3 09-20-2004 06:26 PM
Segmentation fault need help Marcia Hon Linux Networking 4 02-16-2004 07:13 PM



1 2 3 4 5 6 7 8 9 10 11