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

Netsend TCP Options

Because of massive flaming I reintroduced the TCP Option to netsend again. But this time not via the normal commandline options (this SHOULD be implemented as well), in opposite I introduced a new option “-O “. The “O” option (like Output) is introduced to replace the current machine parseable output. The advantages are clear: the current machine output use a fixed standard format that cannot be reordered or shrinked because of backward compatibility....

October 2, 2008 · 1 min · Hagen Paul Pfeifer

MD5 Options Support

Netsend supports now the MD5 socket option (TCP_MD5SIG) for TCP based sockets. This options was introduced to protect long running TCP sessions like BGP RFC 2385. The exchanged digest are introduced to hold a shared secret and prevent spoofing attacks. Only several applications utilize this option - netsend nowadays do also! ;)

July 15, 2008 · 1 min · Hagen Paul Pfeifer

2am and still bug fixing

today in the evening I received the following bug report for libhashish (especially the bloom filter implementation): [...] ../include/libhashish.h:116: syntax error before "pthread\_rwlock\_t" ../include/libhashish.h:116: warning: no semicolon at end of struct or union [...] Looks pretty forward, but hold on! One line above in the spotted code are some tricky compiler forward declarations so we checked this first with some older GCC versions - no success. After that we focused on glibc and their threading support for older versions and voilà: some today really outdated glibc versions (especially the linuxthread ones, the NPTL predecessor) require to define a additional constant....

July 15, 2008 · 1 min · Hagen Paul Pfeifer

Hash Library Locked Now Thread Clean

Libhashish is a hash library for UNIX witch support nearly all functionality seen in other hash table implementations. Furthermore, libhashish implement a lot of different ideas beside the normal hash list chaining strategy. It implement array chaining, list and array chaining with reordering functionality (most often referred elements first) and double key hashing (to lower O(n) complexity in the hash key compare function (normally strcmp()). Yesterday I added mutex lock support so that the library is now thread clean!...

July 12, 2008 · 1 min · Hagen Paul Pfeifer