netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* turning off tcp checksums.
@ 2005-01-28 17:59 sudeep list
  2005-01-28 18:10 ` Stephen Hemminger
  0 siblings, 1 reply; 2+ messages in thread
From: sudeep list @ 2005-01-28 17:59 UTC (permalink / raw)
  To: netdev

hello,

I am trying to conduct some throughput experiments using a modified
TcP/IP stack. One of the things that I would like to do is to turn off
the TcP checksum. The idea is that the application computes its own
checksum, and having tcp duplicate the effort with a weaker checksum
doesnt make sense. This still leaves the tcp header without any
checksum, but since this is a lab environment, I hope to get away with
it for now :-)

I guess this means, modifying the tcp egress path, tcp ingress, and
turning off the hardware checksum capability on the two ends. I think
I have figured out how to change the egress path, but have no clue
about the ingress path.

egress path
------------------
Modify the tcp_ioctl function in net/ipv4/tcp.c to add a command that
sets the value of sk->sk_route_caps = NETIF_F_NO_CSUM

This shall result in the following code path being executed in the
tcp_sendmsg function.
.
.
841       if (sk->sk_route_caps &
843 	         (NETIF_F_IP_CSUM | NETIF_F_NO_CSUM |
844              NETIF_F_HW_CSUM))
845 	      skb->ip_summed = CHECKSUM_HW;
..

which (I hope) shall result in turning off the checksum calculation in
downstream code.

Ingress Path
-------------------
On this path, I saw that its the driver routines that set the value of
skb->ip_summed. I guess I could also change my driver routine to set
the ip_summed value to CHECKSUM_HW but that appears too rash.
1) I suspect it will also turn off the ip header checksum
2) Its only for *some* sockets in my stack that I want to turn off the
checksum, not all.

may be I can find out the socket that the skb is destined for, and if
its for "my" socket I could set the value appropriately, but that
appears too ugly (and inefficient ?).

How do I go about doing this ? Does my tcp_sendmsg modification make
sense or are there better ways of doing this ?

regards
Sudeep

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: turning off tcp checksums.
  2005-01-28 17:59 turning off tcp checksums sudeep list
@ 2005-01-28 18:10 ` Stephen Hemminger
  0 siblings, 0 replies; 2+ messages in thread
From: Stephen Hemminger @ 2005-01-28 18:10 UTC (permalink / raw)
  To: sudeep list; +Cc: netdev

On Fri, 28 Jan 2005 10:59:31 -0700
sudeep list <sudeep.list@gmail.com> wrote:

> hello,
> 
> I am trying to conduct some throughput experiments using a modified
> TcP/IP stack. One of the things that I would like to do is to turn off
> the TcP checksum. The idea is that the application computes its own
> checksum, and having tcp duplicate the effort with a weaker checksum
> doesnt make sense. This still leaves the tcp header without any
> checksum, but since this is a lab environment, I hope to get away with
> it for now :-)

Not allowed per RFC's and "forget about it", since the copy path
does checksumming at almost no cost. If you still think it is a
real issue then get a NIC that supports hardware checksumming.

-- 
Stephen Hemminger	<shemminger@osdl.org>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-01-28 18:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-01-28 17:59 turning off tcp checksums sudeep list
2005-01-28 18:10 ` Stephen Hemminger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).