Tech tips

TCP Header (Header length & NOP) # 2.2

Welcome to tcpipworld.com Blog Post  # 3

Success is not final, failure is not fatal: it is the courage to continue that counts. – Winston Churchill

In continuation to my previous blog, we will talk about TCP Header and NOP

Key Takeaway :

  • TCP Header Field
  • NOP (No Operation Field)

  1. TCP Header Length

TCP Header Length is a 4 bit field.

1.1 Example :

  • 1000 = 8
  • The minimum Size of TCP Header will be 20 Bytes.

Here we use a Scale of 4, or you can say multiply by 4.

  • 1000 = 8 x 4 = 32 Bytes

So TCP Header starts from 0101 = 5 x 4 = 20 Bytes

  • 1111 = 15 x 4 = 60 Bytes

Note :

0100 = 4 x 4 = 16 (It’s not possible as TCP Header. It’s not a valid number as Header Length)

Hence it starts with 0101  till 1111.

2. NOP (No Operation)

No Operation Field in TCP option field. It all starts with the TCP header length, which is multiple of 4 with the value.

Now we have some legitimate options in TCP option field.

2.1 Example :

MSS as 4 Bytes field

Window Scale as 3 Bytes field

SACK is 2 Bytes

In total TCP header will be =

20Bytes (Header) + 3Bytes (Window Scale) + 4 Bytes (MSS) + 2 Bytes (SACK) = 29 Bytes

29 Bytes which doesn’t fall in multiples of 4.

So we need padding to make it multiple of 4 Bytes.

NOP Provides 1 Byte of padding. So in this case in TCP Option we have NOP (No Operation Field)

For SACK we have two NOP and for Window Scale, we have one NOP which makes it multiple of 4.

 

Comment here