[e2e] ICMP & TCP segments with IP ID = 0?

Vernon Schryver vjs at calcite.rhyolite.com
Wed May 16 13:23:41 PDT 2001

> From: Andi Kleen <ak at muc.de>

> ...
> The problem is that generating them is relatively costly for various
> reasons in current linux (it's a longer story why that is so)

That sounds like either a bug or basic misundersteanding of IP ID's.
It is surely a bug if whatever currently puts 0 into the ID field
could not instead do the equivalent of "field = ++counter" (and ignore
locking and possible duplicates if done on a multi-processor without
coherent memory).  It would be a basic misunderstanding to think that
IP ID's must be unique, because they cannot be except at low packet
rates.  If the MSL is on the order of 100 seconds, then IP ID's cannot
be unique if you send more than 650 IP datagrams per second.

> Also I generally don't believe IP IDs are very useful for anything anymore 
> with current network speeds, the 16bit space is simply far too small and 
> wraps in a jiffy on any reasonable network 
> (fortunately fragmentation is not too common anymore and mostly only used
> on low latency links, otherwise it would be surely a bigger problem). 

Yes, and so why not do the equivalent of "field += cnt"?

Contrary to recent statements about the Berzerkly TCP code of old, this
business in Linux sounds like simple sloppiness combined with a
conveniently hazy reading of standards.  It's one thing to, for example,
insist on TCP keepalives because they solve a real problems.  It's
something else to not bother to stuff a semi-random value into a header.

(The IP checksum could not be the issue, because adjusting a previously
computed IP checksum to cover a change from a 0 to a non-zero ID needs
only about 3 lines of C or two 80*86 instructions.)

Contrary to a recent statement, I doubt that the IP ID has been used
to find more than real problems in routing, bridging and so forth than
could be counted on the fingers of one hand.  Real packets almost
always have plenty of serial numbers, time stamps, TTL's, and other
stigmata at least as unique as the IP ID.

It's not that a constant 0 IP ID is in itself so wrong and evil, but that
it suggests things about whoever wrote the code that no one wants to say.
It sounds too much like what gave Linux's old TCP/IP code the reputation
it had as being even worse that Micrsoft's (back before Microsoft started
shipping the BSD TCP code in Winsock 2).

Vernon Schryver    vjs at rhyolite.com

More information about the end2end-interest mailing list