Re: How to handle TCP checksum, if adapter support TCP checksum offloading?

From: Stephan Wolf (stewo68_at_hotmail.com)
Date: 08/04/04


Date: 4 Aug 2004 09:24:30 -0700

IIRC, for Checksum Task Offload (CTO), the TCP/IP stack calculates the
TCP pseudo header checksum and places this value in the TCP packet's
checksum field. Hardware can then calculate the checksum over TCP
header + data (that is, *including* the already calculated pesudo
header csum) and place the result in (i.e. overwrite) the TCP header.

Now if an IM makes changes to the TCP header or data, the IM must not
do anything and CTO will take care of calculating the csum (in
hardware).

Otherwise, if the underlying miniport does not support CTO, the IM
must adjust the TCP header checksum accordingly.

If, however, the IM makes changes to any fields in the IP header and
these fields also appear in the pesudo header, then the IM must
*always* adjust the TCP header checksum accordingly.

That should work.

[Note: An IM must not modify any packet data directly but can only
modify such data in a (local) copy (local NDIS_BUFFER that points to
local copy of original data)].

See also RFC 1624 "Computation of the Internet Checksum via
Incremental Update":

 http://www.ietf.org/rfc/rfc1624.txt

Stephan



Relevant Pages

  • Re: Wrong TCP/IP checksum on server side?
    ... If you modify TCP/IP header, you should adjust the checksum. ... My TCP packets get dropped on the server ...
    (microsoft.public.development.device.drivers)
  • Re: Wrong TCp checksum on server side?
    ... TCP checksum includes the psuedo-header (some fields of the IP ... > modified anything in the TCP header and TCP data. ...
    (microsoft.public.windows.server.networking)
  • Re: Wrong TCP/IP checksum on server side?
    ... The TCP pseudo header also counts for the IP addresses. ... RFC homepage is here: ... >Do i need to adjust the TCp checksum, if i only modify the IP header. ...
    (microsoft.public.development.device.drivers)
  • Re: Wrong TCP/IP checksum on server side?
    ... My TCP packets get dropped on the server ... > TCP checksum on server side is wrong? ... > modified anything in the TCP header and TCP data. ... > When i checked the packet on client, ...
    (microsoft.public.development.device.drivers)
  • Re: Advice on a multithreaded netisr patch?
    ... cache, and the link layer will take a cache miss on the front of the ... netstat packets per second and my application's TCP ... header flowid field, and use that instead of the hash for work placement. ...
    (freebsd-net)

Quantcast