Rajat wrote:
> HI,
>
> I think you guys are not getting me, what I am asking.
What we don't get is _why_ you are asking. We get _what_ you are
asking but you don't like the answers or have failed tyo understand
them.
> I just want to know that,
>
> 1. Does all TCP segments are of equal size i.e. of MSS, until
whatever
> left in send buffer is less than the MSS?
NO, NO, and NO How many times must we say this? (excuse my shouting)
TCP segment size (negotiated for a _particular_ connection) will
_generally_ remain the same _unless_ you use PMTU or a monitoring
mechanism in FW/routing that resets MSS to clamp it. There is NO --
get that, NO -- reason to increase it. It is adjusted downward on
tranfers to prevent packet fragmentation which can occur at _any_ point
_between_ the connecting hosts -- a condition they have _no_ control
over except to adjust packet size _downward_ to _avoid_ fragmentation.
These adjustments are available on most platforms via a means similar
to Linux's ipsysctl mechanism.
> 2. Can we set the MSS size at application level, say using
> setsockopt()?
_Apps_ would not want to set this from code as it would require root
priviledges and there is _already_ a means to set these values to
configure the system. Besides, the TCP/IP stack _already_ handles this
and _cannot_ be disabled. Stop trying to break your networking stack.
If you insist on doing this, then read the source, Luke.
Look here for a quick review of TCP connection/data tranfer:
http://www.tcpipguide.com/free/t_TCP...gementMech.htm
Check this RFC (among many others relevant to your questions):
http://www.faqs.org/rfcs/rfc1191.html
[quote]
3.1. TCP MSS Option
A host doing PMTU Discovery must obey the rule that it not send IP
datagrams larger than 576 octets unless it has permission from the
receiver. For TCP connections, this means that a host must not send
datagrams larger than 40 octets plus the Maximum Segment Size (MSS)
sent by its peer.
[end quote]
Note: in fact PMTU does not work as reliably as it could because of
brain dead net admins and broken implementations -- thus the
"workaround" noted above re: packet framentation and clamping MSS.
Perhaps -- just a wild guess here -- if you told us _why_ you are
interested in doing this, someone could provide more appropriate
suggestions of how to go about it.
I'm done with this -- plan to enjoy my Christams.
hth,
prg
email above disabled