TCP Segment Header
We'll now study TCP headers. They're far more complex than UDP headers and really are what allow for TCP to work properly!
Introduction
TCP headers play a crucial role in the implementation of the protocol. In fact, TCP segments without actual data and with headers are completely valid. They’re actually used quite often!
The size of the headers range from 20 - 60 bytes. Let’s discuss the header field by field.
Source and Destination Ports
The source and destination port numbers are self-explanatory. They are exactly like the source and destination ports in UDP. Just for a refresher though, the source port is the port of the socket of the application that is sending the segment and the destination port is the port of the socket of the receiving application. The size of each field is two bytes.
Sequence Number
Every byte of the TCP segment’s data is labeled with a number called a sequence number. The sequence number field in the header has the sequence number of the first byte of data in the segment.
Note: The initial sequence number is a randomly generated number between ...