TCP Segment Header Fields Flashcards
This is the 16 bit port number of the process that originated the TCP segment on the source device. This will normally be an ephemeral port number for a request sent by a client to a server, or a well-known/registered port number for a replay from a server to a client
Source Port (2 bytes)
This is the 16 bit port number of the process that is the ultimate intended recipient of the message on the destination device. This will usually be a well-known/registered port number for a client request, or an ephemeral port number for a server reply.
Destination Port (2 bytes)
For normal transmission, this is the sequence number of the first byte of data in this segment. In a connection request (SYN) message, this carries the ISN of the source TCP. The first byte of data will be given the next sequence number after the contents of this field
Sequence Number (4 bytes)
When the ACK bit is set, this segment is serving as an acknowledgement (in addition to other possible duties), and this field contains the sequence number the source is next expecting the destination to send.
Acknowledgement Number (4 bytes)
This specifies the number of 32 bit words of data in the TCP header. In other words, this value times four equals the number of bytes in the header, which must always be a multiple of four. It indicates by how many 32-bit words the start of the data is offset from the beginning of the TCP segment.
Data Offset (4 BITs)
This field is reserved for future use, sent as zero
Reserved (6 BITs)
TCP does not use a separate format for control messages. Instead, certain bits are set to indicate the communication of control information.
Control Bits (6 BITs)
This indicates the number of octets of data the sender of this segment is willing to accept from the receiver at one time. This normally corresponds to the current size of the buffer allocated to accept data for this connection. In other words, this field is the current receive window size for the device sending this segment, which is also the send window for the recipient of the segment.
Window (2 bytes)
This is for data integrity protection, computed over the entire TCP datagram, plus a special pseudo header of the fields. It is used to protect the entire TCP segment against errors in transmission as well as errors in delivery. Optional alternate methods to calculate this are also supported
Checksum (2 bytes)
This is used in conjunction with the URG control bit for priority data transfer. This field contains the sequence number of the last byte of urgent data.
Urgent Pointer (2 bytes)
TCP includes a generic mechanism for including one of more sets of optional data in a TCP segment. Each of the options can be either one byte in length of variable in length. The first byte is the Option-Kind subfield, and its value specifies the type of option, which in turn indicates whether the option is just a single byte of multiple bytes. Options that are many bytes consist of three fields.
Options (Variable)
If the Options field is not a multiple of 32 bits in length, enough zeroes are added to pad the header so it is a multiple of 32 bits
Padding (Variable)
This is the bytes of data being sent in the segment
Data (Variable)
When set to 1, indicates that the priority data transfer feature has been invoked for this segment, and that the Urgent Pointer field is valid
URG (Urgent Bit)
When set to 1, indicates that this segment is carrying an acknowledgement, and the value of the Acknowledgement Number field is valid and carrying the next sequence expected from the destination of this segment
ACK (Acknowledgement Bit)