Subject: [tcpm] Checksum of TCP

From: Xiangsong Cui <[email-masked]>
Date: Mon, 30 Aug 2010 11:29:16 +0800

Hi Guys,

I'm reading RFC793, and in section 3.1, it reads:

  Checksum:  16 bits

    The checksum field is the 16 bit one's complement of the one's
    complement sum of all 16 bit words in the header and text.  If a
    segment contains an odd number of header and text octets to be
    checksummed, the last octet is padded on the right with zeros 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.

    The checksum also covers a *96* bit pseudo header conceptually
    prefixed to the TCP header.  This pseudo header contains the Source
    Address, the Destination Address, the Protocol, and TCP length.
    This gives the TCP protection against misrouted segments.  This
    information is carried in the Internet Protocol and is transferred
    across the TCP/Network interface in the arguments or results of
    calls by the TCP on the IP.

                     +--------+--------+--------+--------+
                     |           Source Address          |
                     +--------+--------+--------+--------+
                     |         Destination Address       |
                     +--------+--------+--------+--------+
                     |  zero  |  PTCL  |    TCP Length   |
                     +--------+--------+--------+--------+

      The TCP Length is the TCP header length plus the data length in
      octets (this is not an explicitly transmitted quantity, but is
      computed), and it does not count the *12* octets of the pseudo
      header.

In my impresion, TCP is an IP agnostic protocol, but in the second
paragraph, It specifies that "a *96* bit pseudo header"(the first sentence)
and "the *12* octets of the pseudo header."(the last sentence), which seems
to be coupled with IPv4.

Considering TCP over IPv6, should we remove the accurate number from the
statement? Such as " The checksum also covers a pseudo header ..." and "it
does not count the octets of the pseudo header."  Adding a note to this?

PS, I believe TCP over IPv6 has been implemented, but I havn't see any
standard fix on this issue, if it has been addressed, please tell me where
to get the new document, thanks!

Regards,
Xiangsong

---

From: "Agarwal, Anil" <[email-masked]>
Date: Mon, 30 Aug 2010 07:56:56 -0400

Xiangsong,
 
RFC 2460, section 8.1 covers this issue.
 
Anil

________________________________

From: [email-masked] on behalf of Xiangsong Cui
Sent: Sun 8/29/2010 11:29 PM
To: [email-masked]
Subject: [tcpm] Checksum of TCP

Hi Guys,

  Checksum:  16 bits

Regards,
Xiangsong

_______________________________________________
tcpm mailing list
[email-masked]
https://www.ietf.org/mailman/listinfo/tcpm <https://www.ietf.org/mailman/listinfo/tcpm>

---

From: Joe Touch <[email-masked]>
Date: Mon, 30 Aug 2010 08:54:49 -0700

> I'm reading RFC793, and in section 3.1, it reads:
...
> In my impresion, TCP is an IP agnostic protocol,

FWIW, it really is not. TCP uses a "socket pair" as a connection 
identifier, i.e.:
	source IP address
	destination IP address
	source TCP port
	destination IP port

As such, the IP addresses are an instrinsic part of a TCP connection, so 
TCP cannot exist in the absence of IP - or an emulation thereof. The 
other two fields of the pseudoheader are:
	PCTL (transport protocol number - for TCP, always "6")
	TCP segment length (computed from IP length - IP options)

These are already contained in the IP header (explicitly or implicitly), 
it are not repeated in the TCP header - so instead they are included in 
the pseudoheader.

...
> standard fix on this issue, if it has been addressed,

As noted, this was defined in RFC 2460, in which IPv6 is defined.

Joe

---

From: Xiangsong Cui <[email-masked]>
Date: Tue, 31 Aug 2010 08:55:10 +0800

I see, thank you Joe and Anil!

Regards,
Xiangsong

> -----Original Message-----
> From: Joe Touch [mailto:[email-masked]]
> Sent: Monday, August 30, 2010 11:55 PM
> To: Xiangsong Cui
> Cc: [email-masked]
> Subject: Re: [tcpm] Checksum of TCP
> 
> 
>