On the Generating of IP Fragments

If the IP packet size exceed the link layer maximum transmission unit (MTU, 1500 byte for Ethernet v2) a packet must be fragmented. Yesterday Changli Gao submited a patch that optimize the reassembling process in the kernel. Changli assumption was that fragments arrived in accureate ascending order. He optimized the processing behavior by optimizing the list processing of inet_frag_queue for IPv4 and IPv6 by introducing an additional pointer, called fragments_tail that points to the end of the list....

June 14, 2010 · 2 min · Hagen Paul Pfeifer

IRC License Discussions

Lately in the IRC after looking at some “Linuxtag”:http://www.linuxtag.org/ photos (19:43) < h**> http://www.flickr.com/photos/linuxtag/4699311928/ (19:44) < h**> thomas und drei linux chicks! ;-) (20:02) < n***> open-source-babes sind halt immer nur son community-produkt ;) (20:04) < l***> he, das waren nur die angestellten von Beach at the box (20:14) < c***> n***: na dafuer darfste open-source-babes nach belieben nutzen und weiterreichen ;) (20:17) < k**> yeah, und wenn sie unter einer bsd-lizenz steht darfst du die auch kommerziell weitervertreiben (20:17) < w*****> :D (20:21) < h**> ;) (20:31) < n***> jo, GPL-babes haben den weiteren nachteil, dass man jegliche modifikationen, die man an ihnen vornimmt, publizieren muss ;) (20:36) < h**> warum n0-1?...

June 14, 2010 · 1 min · Hagen Paul Pfeifer

IPSec and Quagga Automating

A tiny drawback of quagga is a missing feature to signal the host environment when routes change. So it is not simple to start/stop scripts if routes are added or deleted. For example: if you want to add or delete a security association if a route changes then it is not directly possible via quagga. But Linux and other operating systems provides a monitor mode where all relevant network events can be caught by the user space....

June 14, 2010 · 1 min · Hagen Paul Pfeifer

CPU Cycles versus Cacheline Miss

Optimization changed over time - optimization today does not address CPU cycle/instruction, rather reduced memory transaction are the key to success. Keep the code small and keep the code in the cacheline and reduce memory loads. A cache miss is equivalent to 100 instructions during a CPU stall. Therefore keeping the @.text@ footprint small can boost your application more then some sophisticated CPU tweaks. Pahole provides a feeling how the @....

June 14, 2010 · 2 min · Hagen Paul Pfeifer

BPF Analysis II

| Filter Rule | Processing Time | | — | | no filter | 469.231535129662 us | | “icmp” | 524.893505343705 us | | “icmp and host 127.0.0.1” | 367.231761850006 us | | “icmp and host 127.0.0.1 and ‘ip[6] = 64’” | 598.401917125821 us | | “icmp and host 127.0.0.1 and ‘ip[6] = 64’ and ‘ip[2:2] > 1’” | 649.767235335359 us | Processing delay sampling (needs smoothing, of course): The generated OPCODES:...

June 12, 2010 · 2 min · Hagen Paul Pfeifer

Urgent Pointer Standard and Real World Implementation

Stumbling over the Urgent Pointer code in @tcp_recvmsg()@ and reading some specs. Urgent data allows the sender to signal the receiver that “urgent data” of some form has been placed into the packet. The receiver on the other hand must deal with this condition and is forced by himself to handle this condition. If not handled the data is silently ignored. Therefore, it must be negotiated at a higher level that urgent data is transmitted and properly handled at the receiver side....

June 12, 2010 · 2 min · Hagen Paul Pfeifer

Skipping Adobe Flash

The posted flash advisory list is really long so I tried to update the player. But unfortunately Adobe skipped their 64 bit “support”:http://labs.adobe.com/technologies/flashplayer10/64bit.html (what a piece of software is this anyway - in 2010?) which actually means I had no change to run flash any more! 32 bit combat mode - no thank you, buggy software no thank you. I installed the dev version of “firefox”:http://nightly.mozilla.org/webm/ with webm support which works great....

June 12, 2010 · 1 min · Hagen Paul Pfeifer

BPF Optimizer

I started to analyse the BPF optimizer. Several options helped me: “-d” to dump the generated instructions and “-O” to disable the packet-matching code optimizer (normally only useful if you suspect a bug in the optimizer). So my modified kernel (I will post the kernel patch after I reworked the tracing ring buffer implementation) and the tcpdump possibilities we are now in the ability to analyse exactly how the optimizer works....

June 10, 2010 · 2 min · Hagen Paul Pfeifer

BPF Filter Complexity versus Execution Time

Today after some time-killing IETF debates I started to analyze the in-kernel BPF filter execution time for different BDP filters. Starting with no filter, which is translated into a simple @BPF_RET|BPF_K@ OPCODE till some more complex instructions. The average execution time lies somewhere at 300ns for no filter and somewhere above 350ns for a simple ICMP filter with 17 CPU instructions on my x86_64 (excluding call overhead). The next image illustrates this (statistically sampled data):

June 10, 2010 · 1 min · Hagen Paul Pfeifer

IETF TCPM Historicize

Lars Eggert posted today a Draft where RFC1106, RFC1110, RFC1145, RFC1146, RFC1263, RFC1379, RFC1644 and RFC1693 are declared as historic documents. But RFC1146 - TCP Alternate Checksum Options - was not superseded by a new standard nor is he defective by any sense. These both arguments are normally the statement why a RFC is declared as historic. In my eyes this is not true for this standard. In the debate Lars argued that the already assigned code points do remain assigned....

June 9, 2010 · 2 min · Hagen Paul Pfeifer