PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Noms de domaine > comp.protocols.tcp-ip > How do I avoid packet fragmentation
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
comp.protocols.tcp-ip TCP and IP network protocols.

How do I avoid packet fragmentation

Réponse
 
LinkBack Outils de la discussion
Vieux 12/10/2006, 13h52   #1
owolablo
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut How do I avoid packet fragmentation

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?

  Réponse avec citation
Vieux 12/10/2006, 18h07   #2
James Carlson
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: How do I avoid packet fragmentation

"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>
  Réponse avec citation
Vieux 12/10/2006, 18h19   #3
Rick Jones
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: How do I avoid packet fragmentation

> (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...
  Réponse avec citation
Vieux 12/10/2006, 20h42   #4
Albert Manfredi
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: How do I avoid packet fragmentation

"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

  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 20h49.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,13879 seconds with 12 queries