The TCP header is 20 bytes long, or up to 24 bytes with options. You need to understand what each field in the TCP segment is. The TCP segment contains the following fields:
Source port The port number of the application on the host sending the data. (Port numbers will be explained a little later in this section.)
Destination port The port number of the application requested on the destination host.
Sequence number Puts the data back in the correct order or retransmits missing or damaged data, a process called sequencing.
Acknowledgment number Defines which TCP octet is expected next.
Header length 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 in length.
Reserved Always set to zero.
Code bits Control functions used to set up and terminate a session.
Window The window size the sender is willing to accept, in octets.
Checksum The cyclic redundancy check (CRC), because TCP doesn’t trust the lower layers and checks everything. The CRC checks the header and data fields.
Urgent A valid field only if the Urgent pointer in the code bits is set. If so, this value indicates the offset from the current sequence number, in octets, where the first segment of non-urgent data begins.
Options May be 0 or a multiple of 32 bits, if any. What this means is that no options have to be present (option size of 0). However, if any options are used that do not cause the option field to total a multiple of 32 bits, padding of 0s must be used to make sure the data begins on a 32-bit boundary.
Data Handed down to the TCP protocol at the Transport layer, which includes the upper-layer headers.