information that it carries in its header. Thus, understanding the
mechanics and capabilities of TCP requires an appreciation for the
contents of its header.
The TCP protocol header is a minimum of 20 octets and contains the
following fields:
• TCP Source Port—The 16-bit source port field contains the number of
the port that initiates the communications session. The source port and
source IP address function as the packet's return address.
• TCP Destination Port—The 16-bit destination port field is the address
of the port for which the transmission is destined. This port contains
the interface address of the application on the recipient's computer to
which the packet's data will be passed.
• TCP Sequence Number—The 32-bit sequence number is used by the
receiving computer to reconstruct the fragmented data back into its
original form. In a dynamically routed network, it is quite possible for
some of the packets to take different routes and, consequently, to
arrive out of order. This sequencing field compensates for this
inconsistency of delivery.
• TCP Acknowledgment Number—TCP uses a 32-bit acknowledgment (ACK) of
the first octet of data contained in the next expected segment. It may
seem counterintuitive to acknowledge something that hasn't occurred yet,
but a source TCP/IP machine that receives an ACK knows that all the data
up to, but not including, that specified segment has been received. The
number used to identify each ACK is the sequence number of the packet
being acknowledged. This field is only valid if the ACK flag (see Flags,
later in this list) is set.
• Data Offset—This 4-bit field contains the size of the TCP header,
measured in a 32-bit data structure known as a "word."
• Reserved—This 6-bit field is always set to zero. It is reserved for an
as-yet unspecified future use.
• Flags—The 6-bit flag field contains six 1-bit flags that enable the
control functions of urgent field, acknowledgment of significant field,
push, reset connection, synchronize sequence numbers, and finished
sending data. The flags, in their order of appearance in the string, are
URG, ACK, PSH, RST, SYN, and FIN. Given the preceding description of
their functions, these mnemonic abbreviations should be self-apparent.
• Window Size—This 16-bit field is used by the destination machine to
tell the source host how much data it is willing to accept, per TCP segment.
• Checksum—The TCP header also contains a 16-bit error-checking field
known as a "Checksum." The source host calculates a mathematical value,
based upon the segment's contents. The destination host performs the
same calculation. If the content remained intact, the result of the two
calculations is identical, thereby proving the validity of the data.
• Urgent—The Urgent field is an optional 16-bit pointer that points to
the last octet of urgent data within the segment. This field is only
valid if the URG flag was set. If that flag is not set, the Urgent field
is pre-empted with Padding. Segments of data that are identified as
urgent are treated to expedited handling by all TCP/IP devices that lie
in the network intervening the source and destination machines.
• Options—A variable length field of at least 1 octet identifies which
options, if any, are valid for the TCP segment. If no options are set,
this 1-octet field is set equal to 0, which indicates the end of the
Options field. A value of 1 in this octet indicates that no operation is
required. A value of 2 indicates that the next four octets contain the
source machine's Maximum Segment Size (MSS). The MSS is the greatest
number of octets that the data field can be, as agreed to by the source
and destination machines.
• Data—Although not technically a part of the TCP header, it is
important to recognize that segments of application data follow the
Urgent and/or Options fields, but precede the Padding field. The field's
size is the largest MSS that can be negotiated between the source and
destination machines. Segments may be smaller than the MSS, but never
larger.
• Padding—Contrary to any indication of superfluousity that its name
might suggest, padding always serves a mathematical purpose in data
communications. That purpose is to ensure predictability of spacing,
timing, or sizing. Extra zeros are added to this field to ensure that
the TCP header is always a multiple of 32 bits.




0 comments:
Post a Comment