From owner-freebsd-net Wed Nov 15 7:48:22 2000 Delivered-To: freebsd-net@freebsd.org Received: from whizzo.transsys.com (whizzo.TransSys.COM [144.202.42.10]) by hub.freebsd.org (Postfix) with ESMTP id DD79837B4D7; Wed, 15 Nov 2000 07:48:19 -0800 (PST) Received: from whizzo.transsys.com (localhost.transsys.com [127.0.0.1]) by whizzo.transsys.com (8.11.0/8.11.0) with ESMTP id eAFFmJG66031; Wed, 15 Nov 2000 10:48:19 -0500 (EST) (envelope-from louie@whizzo.transsys.com) Message-Id: <200011151548.eAFFmJG66031@whizzo.transsys.com> X-Mailer: exmh version 2.1.1 10/15/1999 To: Ruslan Ermilov Cc: Charles Mott , Archie Cobbs , net@FreeBSD.ORG, Ari Suutari X-Image-URL: http://www.transsys.com/louie/images/louie-mail.jpg From: "Louis A. Mamakos" Subject: Re: libalias: Incremental Update of Internet Checksum References: <200011150315.eAF3FIG60231@whizzo.transsys.com> <20001115100407.D36400@sunbay.com> <200011151436.eAFEaHG65417@whizzo.transsys.com> <20001115172435.A9724@sunbay.com> In-reply-to: Your message of "Wed, 15 Nov 2000 17:24:35 +0200." <20001115172435.A9724@sunbay.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 15 Nov 2000 10:48:19 -0500 Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org > If I compute the sum on IP PACKET, then sum can't be zero, so checksum can > never be a 0xffff. This is all explained in RFC 1624, BTW :-) I can see you you would think this, given the errornous statement from the RFC: In one's complement, there are two representations of zero: the all zero and the all one bit values, often referred to as +0 and -0. One's complement addition of non-zero inputs can produce -0 as a result, but never +0. Since there is guaranteed to be at least one non-zero field in the IP header, and the checksum field in the protocol header is the complement of the sum, the checksum field can never contain ~(+0), which is -0 (0xFFFF). It can, however, contain ~(-0), which is +0 (0x0000). However, having actually used 1's complement-based ALU's, I can assure you that one's complement addition of non-zero inputs certainlly can produce +0 as the result. I have the core plane from that machine in my office as proof :-) louie To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message