Intel 82541xx Network Card User Manual


 
Receive and Transmit Description
62 Software Developer’s Manual
The TCP header is first shown in the traditional (RFC 793) representation. Because byte and bit
ordering is confusing in that representation, the TCP header is also shown in little-endian format.
The actual data is fetched from memory in little-endian format.
Figure 3-11. TCP Header (Traditional Representation)
Figure 3-12. TCP Header (Little-Endian)
The TCP header is always a multiple of 32 bit words. TCP options may 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
Figure 3-13 and Figure 3-14). The IPv4 pseudo header contains the IPv4 Source Address, the IPv4
Destination Address, the IPv4 Protocol field, and TCP Length. The IPv6 pseudo header contains
the IPv6 Source Address, the IPv6 Destination Address, the IPv6 Payload Length, and the IPv6
Next Header field. 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.
The Protocol ID field should always be added 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:
1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
Source Port Destination Port
Sequence Number
Acknowledgement Number
TCP Header
Length
Reserved
U
R
G
A
C
K
P
S
H
R
S
T
S
Y
N
F
I
N
Window
Checksum Urgent Pointer
Options
Byte3 Byte2 Byte1 Byte0
7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0
Destination Port Source Port
LSB Sequence Number MSB
Acknowledgement Number
Window
R E
S
U
R
G
A
C
K
P
S
H
R
S
T
S
Y
N
FI
N
TCP
Header
Length
Reserved
Urgent Pointer Checksum
Options