Network Stack Hash Table Memory Consumption

I stumbled across the default hash size for the different hash tables used in the network subsystem. Hash tables are used as a efficient container for different network subsystems - compared to let say list containers. The optimal complexity of a hash table is O(1), this means access in constant time, no matter how many entries are in the container. The optimum is a theoretical value and requires a hash bucket fill level from maximum ~60 percent as well as good hashing algorithms....

June 8, 2010 · 2 min · Hagen Paul Pfeifer

BPF Opcode Analysis

The following paragraphs explain the correlation between filter rules provided by any PCAP based filter program, the resulting intermediate OPCODE representation and the kernel side interpretation. The most brilliant logic within PCAP is not the sniffing functionality nor the dump file format, it is rather the optimization logic. To eliminate useless calculations, to generate efficient instruction, to skip possible IPv4 options, jump over IPv6 extension headers and so on. At the same time the optimizer must be able to eliminate useless/duplicate expressions like “IP AND IP” (this is the most trivial example, but it can be quite complex)....

June 8, 2010 · 2 min · Hagen Paul Pfeifer

Back In Munich

Three wonderful days in Paris/France: nice people, great food and gorgeous historic sites. A really lovely place on earth!

June 6, 2010 · 1 min · Hagen Paul Pfeifer

TCP Minimum RTO

Actually $user posted a regression that he measured a RTO of less then 200ms via tcpdump. Normally this is not possible because Linux bounds the minimum to 200ms. So lets see what the actual trace offers. “RFC 2988”:http://tools.ietf.org/html/rfc2988 specifies that the minimum TCP Retransmission Timeout (RTO) SHOULD be 1 second. The relative large value was selected to keep TCP conservative and avoid spurious retransmissions. The RFC was written back in 2000 and things changed....

June 4, 2010 · 2 min · Hagen Paul Pfeifer

Label as Values and Interpreter Optimizations

The GNU Compiler supports since several releases a unofficial C feature called “Label as Values”:http://gcc.gnu.org/onlinedocs/gcc/Labels-as-Values.html. This feature offers the ability to retrieve the address of a label and use it in a unconditional branch construct. foo, bar and hack are labels: static void \*array[] = { &&foo, &&bar, &&hack }; [...] goto \*array[i]; The saved condition comes with its one costs: this form is not simple to read compared to simple switch/case statements, especially in real world examples....

June 3, 2010 · 2 min · Hagen Paul Pfeifer

new blog software

Yesterday as well as today I worked meticulously to build a own blog software. This post is the first post on a self-hosting basis. In the next couple of days I will publish the software via git as usual. The technique is simple: blog posts are written with your editor of choice (e.g. vim), after that the file is checked into the git repository (database and versioning is done via git) and after that a simple ruby script generates all html pages (via git post hooks)....

June 3, 2010 · 1 min · Hagen Paul Pfeifer

Linux ML TCP Fairness Controversy

TCP fairness discussions are quite frequent for the Linux network maillingslist (netdev). This time Tom Herbert from google posted a patch where the TCP Congestion Window (CWND) can be modified through setsockopt(3). It is not easy to explain the impact of this change because it requires a lot of background information about how TCP works. To shorten the story: this option can - if employed to aggressive - lead to serious performance problems of the Internet....

June 1, 2010 · 2 min · Hagen Paul Pfeifer

MPI, Infiniband and IB cards

Normally you should interconnect cluster nodes via links with a short delay characteristic. For this purpose protocols like infiniband or IB cards are invented. OpenMPI’s default assumption is that nodes are connected in this manner. Therefore, if someone use other link interconnects (like GigE or local CMP/SMP work mode) the openmpi warns about that circumstance. If you want to shut up mpi messages call your program with “–mca btl ^udapl,openib” as an argument to mpirun:...

December 5, 2008 · 1 min · Hagen Paul Pfeifer

IPv6 Again and Again

Because I see it again and again (to highlight it: I mean in NEW software): you MUST use sockaddr, sockaddr_in and sockaddr_in6 since the beginning.Don’t use uint32_t or even worse unsigned long for IPv4 storage. But as you realize this is not protocol independent: sockaddr_in and sockaddr_in6 are container for IPv4(IP Version 4) and IPv6(IP Version 6). You will end up in switch/case statements to distinguish between both protocols. The superior solution is to use struct sockaddr_storage (big enough to also handle UNIX sockets)....

December 5, 2008 · 1 min · Hagen Paul Pfeifer

ns3 Mercurial Repository

To clone the parallelized ns-3 branch you can type the following: hg clone http://code.nsnam.org/pfeifer/ns-3-para # after some days you can update the repository via hg pull http://code.nsnam.org/pfeifer/ns-3-para # and update the local copy hg update BTW: to push the changes upstream type: hg -v push ssh://[email protected]//home/pfeifer/repositories/pfeifer/ns-3-para

December 2, 2008 · 1 min · Hagen Paul Pfeifer