TCP header size

G

Guest

Guest
Archived from groups: microsoft.public.windowsnt.protocol.tcpip (More info?)

Any tcp wizards out there?
How do i calculate the size of a TCP packets header?
I know the standard size is 5 DWORDS/20 bytes.

However all my header sizes have an extra 16 bytes? - there is a
possibility this is a programming error as I am using pointers and the
pointer is 16 bytes wrong, but this is unlikely because my pointers to
other headers (Ethenet and IP) are correct.

The offset parameter is usually set to 80 but not always.

Cheers Kris.
 
G

Guest

Guest
Archived from groups: microsoft.public.windowsnt.protocol.tcpip (More info?)

Kris Leech <krisleech@email.com> wrote:
> Any tcp wizards out there?
> How do i calculate the size of a TCP packets header?

You check to see if options are present. When options are present,
the TCP header is variably longer (increments of four bytes IIRC) than
20 octets (bytes).

rick jones
--
denial, anger, bargaining, depression, acceptance, rebirth...
where do you want to be today?
these opinions are mine, all mine; HP might not want them anyway... :)
feel free to post, OR email to raj in cup.hp.com but NOT BOTH...
 
G

Guest

Guest
Archived from groups: microsoft.public.windowsnt.protocol.tcpip (More info?)

For all those read RFC793
http://www.faqs.org/rfcs/rfc793.html
Arkady

"Rick Jones" <foo@bar.baz.invalid> wrote in message
news:pWqVc.8491$bq5.7140@news.cpqcorp.net...
> Kris Leech <krisleech@email.com> wrote:
> > Any tcp wizards out there?
> > How do i calculate the size of a TCP packets header?
>
> You check to see if options are present. When options are present,
> the TCP header is variably longer (increments of four bytes IIRC) than
> 20 octets (bytes).
>
> rick jones
> --
> denial, anger, bargaining, depression, acceptance, rebirth...
> where do you want to be today?
> these opinions are mine, all mine; HP might not want them anyway... :)
> feel free to post, OR email to raj in cup.hp.com but NOT BOTH...
 
G

Guest

Guest
Archived from groups: microsoft.public.windowsnt.protocol.tcpip (More info?)

Thanks for the responses, i worked out the header size using the offset
with in the header, which is a number from 0 to 15. If the offset is
greater than 5 then options are included, therefore the header size is:

offset = LoNibble(offsetByte)
offset * DWORD

One thing is TCP without options never seem to have a payload?

Cheers Kris.

PS. Only the first 4 bits of the offset byte are read (ie. the first
nibble of the byte), hence a number from 0 - 15.


Arkady Frenkel wrote:

> For all those read RFC793
> http://www.faqs.org/rfcs/rfc793.html
> Arkady
>
> "Rick Jones" <foo@bar.baz.invalid> wrote in message
> news:pWqVc.8491$bq5.7140@news.cpqcorp.net...
>
>>Kris Leech <krisleech@email.com> wrote:
>>
>>>Any tcp wizards out there?
>>>How do i calculate the size of a TCP packets header?
>>
>>You check to see if options are present. When options are present,
>>the TCP header is variably longer (increments of four bytes IIRC) than
>>20 octets (bytes).
>>
>>rick jones
>>--
>>denial, anger, bargaining, depression, acceptance, rebirth...
>> where do you want to be today?
>>these opinions are mine, all mine; HP might not want them anyway... :)
>>feel free to post, OR email to raj in cup.hp.com but NOT BOTH...
>
>
>
 
G

Guest

Guest
Archived from groups: microsoft.public.windowsnt.protocol.tcpip (More info?)

Kris Leech <krisleech@email.com> wrote:
> One thing is TCP without options never seem to have a payload?

It all depends on the options neggotiated/exchanged at the time of
connection establishment.

rick jones
--
firebug n, the idiot who tosses a lit cigarette out his car window
these opinions are mine, all mine; HP might not want them anyway... :)
feel free to post, OR email to raj in cup.hp.com but NOT BOTH...
 
G

Guest

Guest
Archived from groups: microsoft.public.windowsnt.protocol.tcpip (More info?)

The way isee it at the moment the min size for a TCP header is 20 bytes
(header with no options), so if the data offset (ie. header size) is
greater than 4 (4 dwords = 20 bytes) then options are included after the
header.


Rick Jones wrote:

> Kris Leech <krisleech@email.com> wrote:
>
>>One thing is TCP without options never seem to have a payload?
>
>
> It all depends on the options neggotiated/exchanged at the time of
> connection establishment.
>
> rick jones
 

TRENDING THREADS