From owner-freebsd-hackers Tue May 4 10:21:28 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from lamb.sas.com (lamb.sas.com [192.35.83.8]) by hub.freebsd.org (Postfix) with ESMTP id C4C4B14C0F for ; Tue, 4 May 1999 10:21:25 -0700 (PDT) (envelope-from brdean@unx.sas.com) Received: from mozart (mozart.unx.sas.com [192.58.184.8]) by lamb.sas.com (8.9.3/8.9.1) with SMTP id NAA17120 for ; Tue, 4 May 1999 13:21:25 -0400 (EDT) Received: from dean.pc.sas.com by mozart (5.65c/SAS/Domains/5-6-90) id AA11039; Tue, 4 May 1999 13:20:54 -0400 Received: (from brdean@localhost) by dean.pc.sas.com (8.9.3/8.9.1) id NAA22383; Tue, 4 May 1999 13:20:54 -0400 (EDT) (envelope-from brdean) From: Brian Dean Message-Id: <199905041720.NAA22383@dean.pc.sas.com> Subject: udp checksum overkill To: freebsd-hackers@freebsd.org Date: Tue, 4 May 1999 13:20:54 -0400 (EDT) X-Mailer: ELM [version 2.4ME+ PL43 (25)] Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hi, I've implemented my own OS and have recently added network boot capability to it. In the process of doing this I have implemented a TFTP download of my kernel from my FreeBSD system. It has been a very enlightening experience, especially with regard to my admittedly minimal IP stack. My question to those in the know is why does the UDP checksum not only cover it's own header and data, but also portions of the IP header, i.e., the checksum is calculated over the udp pseudo header which includes the source/dest ip addresses, the protocol, and a repeat of the udp hdr+data length? Steven's book (vol 1) indicates that it is there to provide a double check that the udp layer was delivered a packet that was actually intended for it (hence the inclusion of the ip addresses). However, isn't this checksum coverage redundant because IP has it's own header checksum (which is mandatory, unlike UDP) that covers these fields. The packet would be discarded if the IP header checksum fails, and unless the ip layer is buggy, the udp layer would never get a packet that was not intended for it. Additionally, if a host has multiple interfaces, how (without more extensive processing) can the udp layer determine (by using the checksum which includes src/dst ip addresses) that a packet was intended for it or not? I.e., wouldn't the udp checksum verification require a computation of the checksum using all possible interface addresses installed on the system before it could say whether the packet was delivered to it by mistake? It seems to me that it would be much simpler just to run down the list of interfaces and see if one of their addresses matches the dst ip address in the packet, if not, then discard it. Or am I totally missing the point of the extended coverage of the checksum? Thanks, -Brian -- Brian Dean brdean@unx.sas.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message