Appendix A - TCP Header
TCP Header [STEVENS94]
|
Source Port Number |
Destination Port Number |
|||||||
|
Sequence Number |
||||||||
|
Acknowledgement Number |
||||||||
|
Header Length |
Reserved |
U |
A |
P |
R |
S |
F |
Window Size |
|
TCP Checksum |
Urgent Pointer |
|||||||
|
Options |
||||||||
|
Data |
||||||||
-
Source Port Number
16 bits. The source port number. -
Destination Port Number
16 bits The destination port number. -
Sequence Number
32 bits. The sequence number of the first data octet in this segment (except when SYN is present). If SYN is present the sequence number is the initial sequence number (ISN) and the first data octet is ISN+1. -
Acknowledgment Number
32 bits. If the ACK control bit is set this field contains the value of the
next sequence number the sender of the segment is expecting to
receive. Once a connection is established this is always sent. -
Header Length
4 bits. The number of 32 bit words in the TCP Header. This indicates where the data begins. The TCP header (even one including options) is an integral number of 32 bits long. -
Reserved
6 bits. Reserved for future use. Must be zero. -
Control Bits
6 bits. (from left to right):
URG: Urgent Pointer field significant
ACK: Acknowledgment field significant
PSH: Push Function
RST: Reset the connection
SYN: Synchronize sequence numbers
FIN: No more data from sender -
Window
16 bits. The number of data octets beginning with the one indicated in the
acknowledgment field which the sender of this segment is willing to
accept. -
TCP Checksum
16 bits. The checksum field is the 16 bit one's complement of the one's
complement sum of all 16 bit words in the header and text. If a
segment contains an odd number of header and text octets to be
check summed, the last octet is padded on the right with zeros to
form a 16 bit word for checksum purposes. The pad is not
transmitted as part of the segment. While computing the checksum,
the checksum field itself is replaced with zeros.
The checksum also covers a 96 bit pseudo header conceptually
prefixed to the TCP header. This pseudo header contains the Source
Address, the Destination Address, the Protocol, and TCP length.
This gives the TCP protection against misrouted segments. This
information is carried in the Internet Protocol and is transferred
across the TCP/Network interface in the arguments or results of
calls by the TCP on the IP.
The TCP Length is the TCP header length plus the data length in
octets (this is not an explicitly transmitted quantity, but is
computed), and it does not count the 12 octets of the pseudo
header. -
Urgent Pointer
16 bits this field communicates the current value of the urgent pointer as a positive offset from the sequence number in this segment. The
urgent pointer points to the sequence number of the octet following
the urgent data. This field is only be interpreted in segments with
the URG control bit set. -
Options