From owner-freebsd-net@FreeBSD.ORG Wed Apr 30 16:17:15 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CC9E537B401 for ; Wed, 30 Apr 2003 16:17:15 -0700 (PDT) Received: from sccrmhc01.attbi.com (sccrmhc01.attbi.com [204.127.202.61]) by mx1.FreeBSD.org (Postfix) with ESMTP id 078E543F75 for ; Wed, 30 Apr 2003 16:17:15 -0700 (PDT) (envelope-from crist.clark@attbi.com) Received: from blossom.cjclark.org (12-234-159-107.client.attbi.com[12.234.159.107]) by sccrmhc01.attbi.com (sccrmhc01) with ESMTP id <2003043023171400100nlg6he>; Wed, 30 Apr 2003 23:17:14 +0000 Received: from blossom.cjclark.org (localhost. [127.0.0.1]) by blossom.cjclark.org (8.12.8p1/8.12.3) with ESMTP id h3UNHDki004476; Wed, 30 Apr 2003 16:17:13 -0700 (PDT) (envelope-from crist.clark@attbi.com) Received: (from cjc@localhost) by blossom.cjclark.org (8.12.8p1/8.12.8/Submit) id h3UNHC8o004475; Wed, 30 Apr 2003 16:17:12 -0700 (PDT) X-Authentication-Warning: blossom.cjclark.org: cjc set sender to crist.clark@attbi.com using -f Date: Wed, 30 Apr 2003 16:17:12 -0700 From: "Crist J. Clark" To: Garrett Wollman Message-ID: <20030430231712.GC3912@blossom.cjclark.org> References: <200304292247.h3TMlpPU044307@khavrinen.lcs.mit.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200304292247.h3TMlpPU044307@khavrinen.lcs.mit.edu> User-Agent: Mutt/1.4.1i X-URL: http://people.freebsd.org/~cjc/ cc: net@FreeBSD.org Subject: Re: Reducing ip_id information leakage X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: "Crist J. Clark" List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Apr 2003 23:17:16 -0000 On Tue, Apr 29, 2003 at 06:47:51PM -0400, Garrett Wollman wrote: [snip] > Index: ip_output.c > =================================================================== > RCS file: /home/cvs/src/sys/netinet/ip_output.c,v > retrieving revision 1.187 > diff -u -r1.187 ip_output.c > --- ip_output.c 12 Apr 2003 06:11:46 -0000 1.187 > +++ ip_output.c 29 Apr 2003 22:42:55 -0000 > @@ -223,17 +223,29 @@ > pkt_dst = args.next_hop ? args.next_hop->sin_addr : ip->ip_dst; > > /* > - * Fill in IP header. > + * Fill in IP header. If we are not allowing fragmentation, > + * then the ip_id field is meaningless, so send it as zero > + * to reduce information leakage. Otherwise, if we are not > + * randomizing ip_id, then don't bother to convert it to network > + * byte order -- it's just a nonce. Note that a 16-bit counter > + * will wrap around in less than 10 seconds at 100 Mbit/s on a > + * medium with MTU 1500. See Steven M. Bellovin, "A Technique > + * for Counting NATted Hosts", Proc. IMW'02, available at > + * . > */ [snip] > - ip->ip_id = htons(ip_id++); > + ip->ip_id = ip_id++; This is actually bad with respect to the spirit of the paper and the whole idea of information leakage. If I have two FreeBSD machines, one i386 and one sparc64, they now look different to someone sniffing the traffic. If I leave the htons(), all of my FreeBSD hosts look alike. There is less information content in the IP ID field. -- Crist J. Clark | cjclark@alum.mit.edu | cjclark@jhu.edu http://people.freebsd.org/~cjc/ | cjc@freebsd.org