Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 15 Nov 2000 10:04:07 +0200
From:      Ruslan Ermilov <ru@FreeBSD.ORG>
To:        "Louis A. Mamakos" <louie@TransSys.COM>
Cc:        Charles Mott <cmott@scientech.com>, Archie Cobbs <archie@dellroad.org>, net@FreeBSD.ORG, Ari Suutari <ari@suutari.iki.fi>
Subject:   Re: libalias: Incremental Update of Internet Checksum
Message-ID:  <20001115100407.D36400@sunbay.com>
In-Reply-To: <200011150315.eAF3FIG60231@whizzo.transsys.com>; from louie@TransSys.COM on Tue, Nov 14, 2000 at 10:15:18PM -0500
References:  <Pine.BSF.4.21.0011130015100.50906-100000@carcassonne.scientech.com> <200011150315.eAF3FIG60231@whizzo.transsys.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Nov 14, 2000 at 10:15:18PM -0500, Louis A. Mamakos wrote:
> 
> Arithmetically, a value of 0xffff is identical to 0x0000 since they
> both represent the value of zero when using a one's complement binary
> representation of values.  
> 
Except you can't actually receive the value of 0xffff in a checksum field.
One's complement sum is guaranteed to be non-zero except if all items are
zeroes.  Since IP Protocol field is a non-zero value that participates in
all checksums (IP, TCP, UDP, ICMP), the checksum value (which is a one's
complement of a one's complement sum) is guaranteed to be non-0xffff.

> It turns that this property is used in some network protocols (e.g., UDP) 
> to distinguish between a checksum value that's computed as zero (represented
> as 0xffff in the packet) from a packet which has no computed checksum at all.
> This was done in the dark ages when it was deemed "too expensive" to
> compute a checksum.
> 
From the above it follows that UDP should better be using 0xffff rather than
0x0 to indicate that a packet has no computed checksum.  It is quite possible
that the computed checksum will have a zero value, in which case the receiving
UDP module will consider such a packet as with no computed checksum, which is
wrong.


-- 
Ruslan Ermilov		Oracle Developer/DBA,
ru@sunbay.com		Sunbay Software AG,
ru@FreeBSD.org		FreeBSD committer,
+380.652.512.251	Simferopol, Ukraine

http://www.FreeBSD.org	The Power To Serve
http://www.oracle.com	Enabling The Information Age


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-net" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20001115100407.D36400>