TCP checksum for IPv4 When TCP runs over IPv4, the method used to compute the checksum is defined as follows: The checksum field is the 16-bit ones' complement of the ones' complement sum of all 16-bit words in the header and text. The checksum computation needs to ensure the 16-bit alignment of the data being summed. If a segment contains an odd number of header and text octets, alignment can be achieved by padding the last octet with zeros on its right to form a 16-bit word for checksum purposes. The pad is not transmitted as part of the segment. While computing the checksum, the checksum field itself is replaced with zeros.
TCP checksum for IPv4 When TCP runs over IPv4, the method used to compute the checksum is defined as follows: The checksum field is the 16-bit ones' complement of the ones' complement sum of all 16-bit words in the header and text. The checksum computation needs to ensure the 16-bit alignment of the data being summed If a segment contains an odd number of header and text octets alignment can be achieved by padding the last octet with zeros on its right to form a 16-bit word for checksum purposes The pad is not transmitted as part of the segment. While computing the checksum, the checksum field itself is replaced with zeros.