Data Sheet

Packet Types—Ethernet Controller I210
871
The TCP header is always a multiple of 32-bit words. TCP options might occupy space at the end of the
TCP header and are a multiple of 8 bits in length. All options are included in the checksum.
The checksum also covers a 96-bit pseudo header conceptually prefixed to the TCP Header (see
Table A-7). For IPv4 packets, this pseudo header contains the IP Source Address, the IP Destination
Address, the IP Protocol field, and TCP Length. Software pre-calculates the partial pseudo header sum,
which includes IPv4 SA, DA and protocol types, but NOT the TCP length, and stores this value into the
TCP checksum field of the packet. For both IPv4 and IPv6, hardware needs to factor in the TCP length
to the software supplied pseudo header partial checksum.
Note: When calculating the TCP pseudo header, the byte ordering can be tricky. One common
question is whether the Protocol ID field is added to the “lower” or “upper” byte of the 16- bit
sum.
The Protocol ID field should be added to the least significant byte (LSB) of the 16-bit pseudo
header sum, where the most significant byte (MSB) of the 16-bit sum is the byte that
corresponds to the first checksum byte out on the wire.
The TCP Length field is the TCP Header Length including option fields plus the data length in bytes,
which is calculated by hardware on a frame-by-frame basis. The TCP Length does not count the 12
bytes of the pseudo header. The TCP length of the packet is determined by hardware as:
TCP Length = min(MSS, PAYLOADLEN) + L5_LEN
The two flags that may be modified are defined as:
PSH: receiver should pass this data to the application without delay
FIN: sender is finished sending data
The handling of these flags is described in Section 7.2.4.
Payload is normally MSS except for the last packet where it represents the remainder of the payload.
Note: From RFC2460:
If the IPv6 packet contains a Routing header, the Destination Address used in the pseudo-header is
that of the final destination. At the originating node, that address will be in the last element of the
Routing header; at the recipient(s), that address will be in the Destination Address field of the IPv6
header.
The Next Header value in the pseudo-header identifies the upper-layer protocol (e.g., 6 for TCP, or
17 for UDP). It will differ from the Next Header value in the IPv6 header if there are extension
headers between the IPv6 header and the upper-layer header.
Table A-7. TCP/UDP Pseudo Header Content for IPv4 (Traditional Representation)
IPv4 Source Address
IPv4 Destination Address
Zero Layer 4 Protocol ID TCP/UDP Length
Table A-8. TCP/UDP Pseudo Header Content for IPv6 (Traditional Representation)
IPv6 Source Address
IPv6 Final Destination Address
TCP/UDP Packet Length
Zero Next Header