TCP Packet structure

TCP Packets

Each TCP (Transmission Control Protocol) packet consists of a header followed by a data field.  The header length can vary between 20 and 60 bytes, and the total size of the packet can be up to 65535 bytes.  Actually, many systems cannot handle packets as large as the protocol allows, and a working maximum size is 576 bytes.

TCP Header Data

The header must have 5 words (of 32 bits each) of defined contents, and may have up to 10 more words of optional information.

123

Source Port

  • The (software) port number of the source host.

Destination Port

  • The (software) port number of the destination host.

Sequence Number

  • The sequence number of the first data octet in this segment.  (Not used when the SYN flag is set.)

Acknowledgement Number

  • The sequence number of the next data octet to be sent by the source.  This field is used when the ACK flag is set.

Data Offset

  • The number of 32 bit words in the TCP Header.

Reserved

  • These bits should be set to 0.

Flags

0 1 2 3 4 5
URG ACK EOL RST SYN FIN
URG
The Urgent Pointer field is significant
ACK
The Acknowledgement field is significant
EOL
End of Letter
RST
Reset the connection
SYN
Synchronize sequence numbrers
FIN
No more data from the sender

Window

  • The maximum number of octets which the sender will accept.

Checksum

  • This checksum covers both the header and data portion of the TCP packet.

Urgent Pointer

  • Points to the first urgent data byte in the packet.

Options (Variable Length, 0-44 bytes)

  • Used to specify various TCP options.

Padding

As required to make the header length a multiple of 32 bits.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s