|
|
|
|
||||||
| comp.protocols.tcp-ip TCP and IP network protocols. |
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
Hi,
I'm writing a C++ program that sends 1500 bytes of data at once, from the client to the server. However, the packet is broken down into 3 different fragments 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 fragmentation. 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. Also i did 'ifconfig' on my linux machine and MTU was already set to 1500 which is why i find it hard to understand the need for the fragmentation. Can any body tell me how to work around this? |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
"owolablo" <owolabileg@yahoo.com> writes:
> I'm writing a C++ program that sends 1500 bytes of data at once, from > the client to the server. However, the packet is broken down into 3 > different fragments 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 fragmentation. Is it > a linux setting which I can change or is it a TCP setting? either You mention TCP, but you say "fragmentation." Do you really mean IP fragmentation or do you actually mean TCP segmentation? Furthermore, you do understand that TCP is a byte-stream protocol, and that this means that application record boundaries are NOT preserved from sender to receiver, right? In other words, sending (say) 200 bytes from one side doesn't mean that the other side will read exactly that whole 200 bytes in one shot. (If you need designing networking applications, I suggest the Stevens books as a good starting point.) > way,what can I do? I'm sending the packets using the C send() function. > Also i did 'ifconfig' on my linux machine and MTU was already set to > 1500 which is why i find it hard to understand the need for the > fragmentation. Can any body tell me how to work around this? With this level of detail, it's hard to give any useful answers, but it *sounds* like a misunderstanding of what TCP actually does. -- James Carlson 42.703N 71.076W <carlsonj@workingcode.com> |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
> (If you need designing networking applications, I suggest the
> Stevens books as a good starting point.) Agreed. They contain a wealth of necessary and useful information for anyone wanting to write networked applications. The Stallings stuff isn't bad either. >> way,what can I do? I'm sending the packets using the C send() function. >> Also i did 'ifconfig' on my linux machine and MTU was already set to >> 1500 which is why i find it hard to understand the need for the >> fragmentation. Can any body tell me how to work around this? > With this level of detail, it's hard to give any useful answers, but > it *sounds* like a misunderstanding of what TCP actually does. And even if there wasn't some probable issue with TCP deciding to use an MSS of 500ish bytes (say if the two systems were remote and there was no PathMTU discovery going, or if PMTU _did_ hit to change things) a 1500 byte MTU would _still_ not allow a 1500 byte send to go from one end to the other in one piece as the IP and TCP headers have to be subtracted from the MTU to arrive at the payload size. rick jones -- web2.0 n, the dot.com reunion tour... these opinions are mine, all mine; HP might not want them anyway... ![]() feel free to post, OR email to rick.jones2 in hp.com but NOT BOTH... |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
"owolablo" <owolabileg@yahoo.com> wrote:
> Hi, > I'm writing a C++ program that sends 1500 bytes of data at once, from > the client to the server. However, the packet is broken down into 3 > different fragments 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 fragmentation. 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. > Also i did 'ifconfig' on my linux machine and MTU was already set to > 1500 which is why i find it hard to understand the need for the > fragmentation. Can any body tell me how to work around this? Are the client and servers remote, or are they in the same IP subnet and same Ethernet? Do you mean exactly 1500 bytes of data, or is that an approximation? Under normal conditions, 1500 bytes is the payload limit of the Ethernet frame. Which means, IP and TCP overhead bytes are included in that 1500 byte figure. Given that IP and and TCP overhead are typically 10 32-bit words total (and each of those headers could be longer), the max TCP segment payload would be more like 1460 bytes max. If there are non-Ethernet links between the client and the server, the MTU could be much reduced. I'm not sure why you are seeing three 500-byte TCP segments, rather than one maxed out TCP segment and one small one, unless there are some non-Ethernet links in this comm session which limit the MTU to maybe 576 bytes. Bert |
|
![]() |
| Outils de la discussion | |
|
|