From owner-freebsd-net@FreeBSD.ORG Fri Nov 9 08:08:53 2012 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 180186B6 for ; Fri, 9 Nov 2012 08:08:53 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) by mx1.freebsd.org (Postfix) with ESMTP id 6DF1B8FC12 for ; Fri, 9 Nov 2012 08:08:52 +0000 (UTC) Received: (qmail 71583 invoked from network); 9 Nov 2012 09:43:49 -0000 Received: from c00l3r.networx.ch (HELO [127.0.0.1]) ([62.48.2.2]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 9 Nov 2012 09:43:49 -0000 Message-ID: <509CBA0C.3070008@freebsd.org> Date: Fri, 09 Nov 2012 09:08:44 +0100 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121010 Thunderbird/16.0.1 MIME-Version: 1.0 To: Adrian Chadd Subject: Re: svn commit: r242739 - stable/9/sys/dev/ti References: <201211080206.qA826RiN054539@svn.freebsd.org> <20121108023858.GA3127@michelle.cdnetworks.com> <509BC2E2.4030907@freebsd.org> <509C4684.2030102@freebsd.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: pyunyh@gmail.com, FreeBSD Net , Pyun YongHyeon X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Nov 2012 08:08:53 -0000 On 09.11.2012 01:19, Adrian Chadd wrote: > On 8 November 2012 15:55, Andre Oppermann wrote: > >> At the risk of repeating myself: when a routed packet is fragmented >> the payload (layer 4, eg. TCP/UDP/SCTP) is NOT recalculated or changed >> or anything else. It remains as originally calculated by the sender >> unchanged in the first fragment L4 header. Only the IPv4 header >> checksum, which DOES NOT include any payload data, has to be calculated >> for every fragment. The IPv4 header checksum is offloaded with CSUM_IP >> and continues to work as expected. :) > > NAT and firewalling? :) Firewalling doesn't change the packet and no checksum is needed. NAT does change the packet and the pesky pseudo-header in the TCP/ UDP checksum. However here only the pseudo-header checksum is recalculated and reintegrated into the one-complement payload checksum. The payload itself is not being looked at, except for protocols that do contain IP addresses in their internal commands or such. There the payload is modified. The same reintegration trick can be used. In the majority of cases these packets are very small though and the entire checksum is simply recalculated. As the packets are very small no fragmentation is occuring. The IPv4 header checksum is never ever a problem and always works. Can we please put this to rest now. -- Andre