<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>bert hubert finally blogs: Category PowerDNS</title>
    <link>http://blog.netherlabs.nl/articles/category/powerdns</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>code, musings and more</description>
    <item>
      <title>The fourteen stages of any real software project</title>
      <description>&lt;ol&gt;
&lt;li&gt;Idea - estimates for time to completion range from 3 days to 3 weeks&lt;/li&gt;
&lt;li&gt;Pretty convincing first stab &amp;#8216;look how cool this would be&amp;#8217;&lt;/li&gt;
&lt;li&gt;The Hard Slog to get something that actually works. Estimates now range from 3 months to 3 years.&lt;/li&gt;
&lt;li&gt;First real users pop up, discovery is made that all assumptions were off&lt;/li&gt;
&lt;li&gt;Starts to look good to the first real user&lt;/li&gt;
&lt;li&gt;Elation!&lt;/li&gt;
&lt;li&gt;Someone actually uses the code it for real, the bugs come out in droves&lt;/li&gt;
&lt;li&gt;A zillion bugs get addressed, harsh words are spoken&lt;/li&gt;
&lt;li&gt;Elation!&lt;/li&gt;
&lt;li&gt;The guy you had previously told that 100 million users would not &amp;#8216;in principle&amp;#8217; be a problem actually took your word for it, and deployed it on said user base. Harsh words are spoken.&lt;/li&gt;
&lt;li&gt;Fundamentals are reviewed, large fractions of the code base reworked&lt;/li&gt;
&lt;li&gt;Product now actually does what everybody hoped it would do.&lt;/li&gt;
&lt;li&gt;Even very unlikely bugs have cropped up by now, and have been addressed. Even rare use cases are now taken into account.&lt;/li&gt;
&lt;li&gt;If a user complains of a crash at this stage, you can voice doubts about the quality of his hardware or operating system.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;PowerDNS went through all these stages, and took around 5 years to do so. 
Not all parts are at &amp;#8216;stage 14&amp;#8217; yet, but for the Recursor, I seriously ask people to run &amp;#8216;memtest&amp;#8217; if they report a crash.&lt;/p&gt;

&lt;p&gt;The above 14 points are never traversed without users that care. For PowerDNS, step &amp;#8216;4&amp;#8217; was performed by Amaze Internet and step &amp;#8216;7&amp;#8217; by ISP Services. 1&amp;amp;1 (called Schlund back then) was instrumental in step &amp;#8216;10&amp;#8217; when they started using it on millions of domains.&lt;/p&gt;

&lt;p&gt;For the PowerDNS Recursor, steps &amp;#8216;4&amp;#8217; and &amp;#8216;7&amp;#8217;  not only happened over at XS4ALL, but they also paid for it all! &lt;/p&gt;

&lt;p&gt;Step &amp;#8216;10&amp;#8217; occurred over at AOL and Neuf Cegetel, who together connected the Recursor to 35 million subscribers or so.&lt;/p&gt;

&lt;p&gt;Finally, the parts of PowerDNS that have reached the end of the list above have done so because of literally hundreds if not thousands of operators that have made the effort to report their issues, or voice their wishes.&lt;/p&gt;

&lt;p&gt;Many thanks to everybody!&lt;/p&gt;

&lt;h2&gt;Hmm, the above does not sound very professional..&lt;/h2&gt;

&lt;p&gt;I&amp;#8217;ve heard the theory that some people think they can plan software development more professionally. I used to believe them too. But any real project I&amp;#8217;ve heard of went through the stages listed above. No schedule, no Microsoft Project sheet, no Gantt Chart I know about ever even came close to reality.&lt;/p&gt;

&lt;p&gt;But I&amp;#8217;d love to be wrong, because I agree fully that it would be great if software development was more predictable. &lt;/p&gt;

&lt;p&gt;This is especially true since the aforementioned &amp;#8220;process&amp;#8221; necessarily involves several very committed users, who have to voice the harsh words, but do have to stick with the project.&lt;/p&gt;

&lt;p&gt;So please comment away if your real life experiences are different - I&amp;#8217;d love to hear!&lt;/p&gt;</description>
      <pubDate>Sun, 16 Nov 2008 22:21:00 +0100</pubDate>
      <guid isPermaLink="false">urn:uuid:7fb69fc1-e1c2-40f0-a8b8-48a5275a6f5e</guid>
      <author>bert.hubert@netherlabs.nl (bert hubert)</author>
      <link>http://blog.netherlabs.nl/articles/2008/11/16/the-fourteen-stages-of-any-real-software-project</link>
      <category>PowerDNS</category>
      <category>Netherlabs</category>
    </item>
    <item>
      <title>Some debugging techniques, and &amp;quot;C++ introspection&amp;quot;</title>
      <description>&lt;p&gt;After too much posting on IETF mailing lists, and not achieving anything, I&amp;#8217;ve gone back to coding a bit more.&lt;/p&gt;

&lt;p&gt;There are two things I want to share - the first because I had a devil of a time figuring out how to do something, and I hope that posting here will help fellow-sufferers find the solution via Google. The second thing I want to talk about because, and this is getting to be rare, I programmed something &lt;em&gt;cool&lt;/em&gt;, and I just need to tell someone about it.&lt;/p&gt;

&lt;p&gt;I pondered explaining it to my lovely son Maurits (4 months old today), but I don&amp;#8217;t want to ruin his brain. 
&lt;center&gt;
&lt;img src="http://ds9a.nl/maurits-6-september.jpg" width=90%&gt;
&lt;/center&gt;&lt;/p&gt;

&lt;h2&gt;Debugging iterators&lt;/h2&gt;

&lt;p&gt;In most programming languages there are a lot of things that compile just fine, or generate no parsing errors at runtime, but are still accidents waiting to happen.&lt;/p&gt;

&lt;p&gt;Tools abound to expose such silent errors, usually at a horrendous performance cost. But this is fine, as errors can be found by the developer, and fixed before release.&lt;/p&gt;

&lt;p&gt;As part of our arsenal, we have the veritable &lt;a href="http://www.valgrind.org"&gt;Valgrind&lt;/a&gt; that detects things such as reading from memory that had not previously been written to. In addition, other tricks are available, such as changing functions that &amp;#8216;mostly do X, and rarely Y&amp;#8217; so that they always to Y. This quickly finds programs that skipped dealing with Y (which might be a rare error condition, or realloc(2) returning a new memory address for your data).&lt;/p&gt;

&lt;p&gt;Finally, many programming environments by default perform very little checking (in the interest of speed) - for example, they will gladly allow you to compare something that points to data in collection A to something that points to collection B - a comparison that never makes sense, classical apples and oranges.&lt;/p&gt;

&lt;p&gt;My favorite C++ compiler, G++, comes with so called &amp;#8216;debugging iterators&amp;#8217; that are very strict - anything that is not absolutely correct becomes an error, sometimes at compile time, sometimes at runtime.&lt;/p&gt;

&lt;p&gt;Together with Valgrind, this is one of the techniques I like to whip out when the going gets tough. &lt;/p&gt;

&lt;p&gt;Sadly, Debugging iterators (which are turned on by adding &lt;a href="http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt12ch30s03.html"&gt;-D&lt;em&gt;GLIBCXX&lt;/em&gt;DEBUG&lt;/a&gt; conflict with one of my favorite C++ libraries, &lt;a href="http://www.boost.org"&gt;Boost&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;To make a long story short, to compile a version of Boost with debugging iterators, issue:&lt;/p&gt;

&lt;pre&gt;
$ bjam define=_GLIBCXX_DEBUG
&lt;/pre&gt;

&lt;p&gt;This single line of text may not look all that important, but it took me half a day of debugging to figure this out. So if you get this error:&lt;/p&gt;

&lt;pre&gt;
dnsgram.o:
(.rodata._ZTVN5boost15program_options11typed_valueISscEE[vtable for 
boost::program_options::typed_value&lt;std::basic_string&lt;char, 
std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;, char&gt;]+0x18): 
undefined reference to 
`boost::program_options::value_semantic_codecvt_helper&lt;char&gt;::parse(boost::any&amp;, 
std::__debug::vector&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, 
std::allocator&lt;char&gt; &gt;, std::allocator&lt;std::basic_string&lt;char, 
std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; &gt; &gt; const&amp;, bool) const'
&lt;/pre&gt;

&lt;p&gt;Then compile your own version of boost as outlined above.&lt;/p&gt;

&lt;h2&gt;C++ Introspection &amp;amp; Statistics&lt;/h2&gt;

&lt;p&gt;C++ is an old-school language, perhaps the most modern language of the old school. This means that it sacrifices a lot of things to allow programs to run at stunning &amp;#8216;near bare metal&amp;#8217; speeds. One of the things that C++ does not offer therefore is &amp;#8216;introspection&amp;#8217;&lt;/p&gt;

&lt;p&gt;What this means is that if you have a class called &amp;#8220;ImportantClass&amp;#8221;, that class does not know its own name at runtime. When a program is running, it is not possible to ask by name for an &amp;#8220;ImportantClass&amp;#8221; to be instantiated.&lt;/p&gt;

&lt;p&gt;If you need this ability, you need to register your ImportantClass manually by its name &amp;#8220;ImportantClass&amp;#8221;, and store a pointer to a function that creates an ImportantClass for you when you need it.&lt;/p&gt;

&lt;p&gt;Doing so manually is usually not a problem, except of course when it is. In PowerDNS, I allocate a heap (or a stack even) of runtime statistics. Each of those statistics is a variable (or a function) with a certain name.&lt;/p&gt;

&lt;p&gt;In more modern languages, it would probably be easy to group all these variables together (with names like numQueries, numAnswers, nomUDPQueries etc), and allow these statistics to be queried using their names. So, an external program might call &amp;#8216;get stat numQueries&amp;#8217;, and PowerDNS would look up the numQueries name, and return its value.&lt;/p&gt;

&lt;p&gt;No such luck in C or C++!&lt;/p&gt;

&lt;p&gt;So - can we figure out something smart, say, with a macro? Yes and no. The problem is that when we declare a variable in C which we want to be accessible from elsewhere in the program, it needs to happen either inside a struct or class, or at global scope. This in turn means that we can&amp;#8217;t execute code there. So, what we&amp;#8217;d like to do, but can&amp;#8217;t is:&lt;/p&gt;

&lt;pre&gt;
struct Statistics {
         uint64_t numPackets;
         registerName(&amp;numPackets, "numPackets");
         uint64_t numAnswers;
         registerName(&amp;numAnswers, "numAnswers");
} stats;
&lt;/pre&gt;

&lt;p&gt;stats.numPackets is indeed available, but the line after its definition will generate an error. This is sad, since the above could easily be generated from a macro, so we could do:&lt;/p&gt;

&lt;p&gt;DEFINESTAT(numPackets, &amp;#8220;Number of packets received&amp;#8221;);&lt;/p&gt;

&lt;p&gt;Which would simultaneously define numPackets, as well as make it available as &amp;#8220;numPackets&amp;#8221;, and store a nice description of it somewhere.&lt;/p&gt;

&lt;p&gt;But alas, this is all not possible because of the reasons outlined above.&lt;/p&gt;

&lt;p&gt;So - how do we separate the data structure from the &amp;#8216;registerName()&amp;#8217; calls, while retaining the cool &amp;#8216;DEFINESTAT&amp;#8217; feature where everything is in one place?&lt;/p&gt;

&lt;p&gt;In C++, files can be included using the #include statement. Most of the time, this is used to include so called &amp;#8216;header&amp;#8217; files - but nothing is stopping us from using this feature for our own purposes.&lt;/p&gt;

&lt;p&gt;The trick is to put all the &amp;#8216;DEFINESTAT&amp;#8217; statements in an include file, and include it not once, but twice!&lt;/p&gt;

&lt;p&gt;First we do:&lt;/p&gt;

&lt;pre&gt;
#define DEFINESTAT(name, desc) uint64_t name;
struct Statistics {
#include "statistics.h"
} stats;
&lt;/pre&gt;

&lt;p&gt;This defines the Statistics struct, containing all the variables we want to make available. These are nicely expanded using our DEFINESTAT definition.&lt;/p&gt;

&lt;p&gt;Secondly, we #undefine DEFINESTAT again, and redefine it as:&lt;/p&gt;

&lt;pre&gt;
#define DEFINESTAT(name, desc) registerName(&amp;stats.name, #name, desc);
&lt;/pre&gt;

&lt;p&gt;Then we insert this in a function:&lt;/p&gt;

&lt;pre&gt;
void registerAllNames()
{
#include "statistics.h"
}
&lt;/pre&gt;

&lt;p&gt;This will cause the same statistics.h file to be loaded again, with the same DEFINESTAT lines in there, but this time DEFINESTAT expands to a call that registers each variable, its name (#name expands to &amp;#8220;name&amp;#8221;), and its description.&lt;/p&gt;

&lt;p&gt;The rest of our source can now call &amp;#8216;stats.numPackets++&amp;#8217;, and if someone wants to query the &amp;#8220;numPackets&amp;#8221; variable, it is available easily enough through its name since it has been registered using registerName.&lt;/p&gt;

&lt;p&gt;The upshot of this all is that we have gained the ability to &amp;#8216;introspect&amp;#8217; our Statistics structure, without any runtime overhead nor any further language support.&lt;/p&gt;

&lt;p&gt;As stated above, more modern languages make this process easier.. but not as fast!&lt;/p&gt;

&lt;p&gt;I hope you enjoyed this arcane coolness as much as I did. But I doubt it :-)&lt;/p&gt;</description>
      <pubDate>Thu, 18 Sep 2008 21:44:00 +0200</pubDate>
      <guid isPermaLink="false">urn:uuid:2dea2a0a-d535-458b-be86-f7daf276eeaf</guid>
      <author>bert.hubert@netherlabs.nl (bert hubert)</author>
      <link>http://blog.netherlabs.nl/articles/2008/09/18/some-debugging-techniques-and-c-introspection</link>
      <category>Linux</category>
      <category>PowerDNS</category>
      <category>Netherlabs</category>
    </item>
    <item>
      <title>Some thoughts on the recent DNS vulnerability</title>
      <description>&lt;p&gt;Yesterday it &lt;a href="http://www.kb.cert.org/vuls/id/800113"&gt;was announced&lt;/a&gt; that there is an unspecified but major DNS vulnerability, and that Microsoft, Nominum and ISC had fixes available.&lt;/p&gt;

&lt;p&gt;It is amusing to note that this has been hailed as a &lt;a href="http://www.doxpara.com/?p=1162"&gt;major feat of cooperation&lt;/a&gt;, with the vulnerable parties spinned as being part of &lt;a href="http://news.bbc.co.uk/1/hi/technology/7496735.stm"&gt;secret industry cabal&lt;/a&gt; that has just saved the world from very bad things.&lt;/p&gt;

&lt;p&gt;To say the least, I find this a funny way of presenting things! The vulnerability is still not public, but the secret cabal shared it with me. Perhaps it is fair to say I am part of the cabal - I nearly traveled to the secret meeting at the Microsoft campus, but the imminent birth of &lt;a href="http://blog.netherlabs.nl/articles/2008/05/24/maurits-hubert-has-been-born"&gt;my son&lt;/a&gt; made me decide not to go. &lt;/p&gt;

&lt;p&gt;The DNS vulnerability that has been presented yesterday is indeed a very serious problem, and I am glad steps are now taken to fix the broken software that was vulnerable. &lt;a href="http://ioactive.com"&gt;Dan Kaminksy&lt;/a&gt; is to be praised for discovering the issue and coordinating the release.&lt;/p&gt;

&lt;p&gt;However - the parties involved aren&amp;#8217;t to be lauded for their current fix. Far from it. It has been known since 1999 that all nameserver implementations were vulnerable for issues like the one we are facing now. In 1999, &lt;a href="http://cr.yp.to/djb.html"&gt;Dan J. Bernstein&lt;/a&gt; released his nameserver (&lt;a href="http://cr.yp.to/djbdns.html"&gt;djbdns&lt;/a&gt;), which already contained the countermeasures being rushed into service now. Let me repeat this. Wise people already saw this one coming 9 years ago, and had a fix in place.&lt;/p&gt;

&lt;p&gt;In 2006 when my own resolving nameserver entered the scene, I decided to use the same security strategy as implemented in djbdns (it is always better to steal a great idea than to think up a mediocre one!). Some time after that, I realised none of the other nameservers had chosen to do so, and I &lt;a href="http://blog.netherlabs.nl/articles/2006/05/09/i-bit-the-bullet-and-wrote-an-rfc-to-be"&gt;embarked on an effort&lt;/a&gt; to move the IETF DNS-EXT working group to standardise and thus mandate this high security behaviour.&lt;/p&gt;

&lt;p&gt;This didn&amp;#8217;t really go anywhere, but some months ago I noticed particularly strenuous resistance in the standardisation of the so called &lt;a href="http://tools.ietf.org/html/draft-ietf-dnsext-forgery-resilience"&gt;&amp;#8216;forgery resilience draft&amp;#8217;&lt;/a&gt;, and after some prodding it became clear it was felt my draft was in danger of drawing attention to the then unannounced DNS vulnerability, and that it were best if we&amp;#8217;d all shut up about it for a few months, perhaps until July 2008 until all the vendors would have had time to get their act together.&lt;/p&gt;

&lt;p&gt;And now we&amp;#8217;ve seen the release, and it is being hailed as great news. But it isn&amp;#8217;t. Dan Bernstein has been ignored since 1999 when he said something should be done. I&amp;#8217;ve been ignored since 2006. The IETF standardisation languished for two years. &lt;/p&gt;

&lt;p&gt;This is not a success story. It has in fact been a remarkable failure.&lt;/p&gt;

&lt;p&gt;To end on a positive note - I am very glad Dan Kaminsky&amp;#8217;s work caused some collective eye opening, and I hope good things come from this. DNS has long lacked critical attention, and in the end this might bring about sorely needed improvements.&lt;/p&gt;

&lt;p&gt;DNS very recently celebrated its 25th birthday - I look forward to seeing the venerable Domain Name System succeed in the coming 25 years!&lt;/p&gt;</description>
      <pubDate>Wed, 09 Jul 2008 21:31:00 +0200</pubDate>
      <guid isPermaLink="false">urn:uuid:d38d8a59-f79c-4c6a-bc32-8d4905dce853</guid>
      <author>bert.hubert@netherlabs.nl (bert hubert)</author>
      <link>http://blog.netherlabs.nl/articles/2008/07/09/some-thoughts-on-the-recent-dns-vulnerability</link>
      <category>PowerDNS</category>
      <category>Netherlabs</category>
    </item>
    <item>
      <title>Secrets in Public: Diffie-Hellman key exchange</title>
      <description>&lt;p&gt;While running the risk of turning this blog into a lecture series, I can&amp;#8217;t
resist. This post will dive into cryptography, and I hope to be able to
transfer the sense of wonder that caught me when I first read about Diffie-Hellman
key exchange many years ago.&lt;/p&gt;

&lt;p&gt;Let&amp;#8217;s assume you are in a room with two other people, and that you want to
share a secret with one of them, but not with the other. In the tradition of
cryptography, we&amp;#8217;ll call these three people Alice (you), Bob (your friend)
and Eve (who wants to &amp;#8216;Eavesdrop&amp;#8217; on your secrets).&lt;/p&gt;

&lt;p&gt;Let&amp;#8217;s also assume that the room is very quiet, so you can&amp;#8217;t whisper, and
everybody can hear what everybody else is saying. Furthermore, you are far enough away that you can&amp;#8217;t pass paper messages.&lt;/p&gt;

&lt;p&gt;So how could you (Alice) share a secret with Bob? Anything you want to tell
Bob, will be overheard by Eve. You might try to think up a code, but you&amp;#8217;ll
still have to explain the code, and both Bob and Eve will hear it.&lt;/p&gt;

&lt;p&gt;It turns out that using the magic of public key cryptography, this is
possible - sharing a secret while people are listening in.&lt;/p&gt;

&lt;p&gt;The room with Alice, Bob and Eve is not a very relevant example, but replace
Alice by &amp;#8216;The allied forces&amp;#8217;, &amp;#8216;Bob&amp;#8217; by a resistance fighter equipped with a
radio, and &amp;#8216;Eve&amp;#8217; by the occupying enemy, and things start to make sense.&lt;/p&gt;

&lt;p&gt;Or, in today&amp;#8217;s terms, replace Bob by Amazon.com, and Eve by a hacker
interested in getting your credit card number.&lt;/p&gt;

&lt;h2&gt;So how does it work?&lt;/h2&gt;

&lt;p&gt;To send a secret, two things are needed: an &amp;#8216;algorithm&amp;#8217; and a &amp;#8216;key&amp;#8217;. A famous
algorithm is the &amp;#8216;Caesar cypher&amp;#8217;, which consists of shifting all letters by
a fixed amount. So an A might become a B, a B would become a C etc etc. &lt;/p&gt;

&lt;p&gt;The key in this case is how much you want to shift the letters, in the
sample above the key is &amp;#8216;1&amp;#8217;. If the key had been &amp;#8216;2&amp;#8217;, an A would&amp;#8217;ve become a
C, a B would&amp;#8217;ve become a D etc.&lt;/p&gt;

&lt;p&gt;Typically, you can discuss the algorithm in public, but you need to keep the
key secret. In terms of Alice and Bob, they will be able to communicate in
secret once they&amp;#8217;ve been able to establish a key that Eve does not know
about.&lt;/p&gt;

&lt;p&gt;Once everybody has agreed to use the Caesar cypher, the problem shifts to
exchanging how many letters we will shift. We can&amp;#8217;t just say this out loud,
since both Bob and Eve will hear it.&lt;/p&gt;

&lt;h2&gt;Diffie-Hellman&lt;/h2&gt;

&lt;p&gt;Way back in 1976, Whitfield Diffie and Martin Hellman published the details
of what has become known as the Diffie-Hellman key exchange algorithm,
although they both credit Ralph Merkle with some of the key ideas.&lt;/p&gt;

&lt;p&gt;The process basically works as follows. Alice and Bob each think of a random
number, that they keep a secret. Then they both do some calculations based
on this number, and say the result of those calculations out loud.&lt;/p&gt;

&lt;p&gt;Then both Alice and Bob combine the results of the calculations with their own
secret random number, and out pops a shared random secret number. This
shared random secret number is now known by Alice and Bob, but not by Eve.
And it is this secret that now becomes the key.&lt;/p&gt;

&lt;h2&gt;How is this possible?&lt;/h2&gt;

&lt;p&gt;Eve heard both Alice and Bob say a random number, exactly the same numbers
that Alice and Bob heard. Yet only Alice and Bob now know the shared secret.
How is this possible?&lt;/p&gt;

&lt;p&gt;The trick lies in the calculation, by which means Alice and Bob only shared
parts of the numbers they chose initially. Then both Alice and Bob combined
those parts with their full random numbers.&lt;/p&gt;

&lt;p&gt;It is this trick of revealing only parts of random numbers, and then
combining the part of the other party with your full number, that leads to a
shared secret.&lt;/p&gt;

&lt;h2&gt;Show me&lt;/h2&gt;

&lt;p&gt;On &lt;a href="http://ds9a.nl/tmp/dh.html"&gt;this page&lt;/a&gt; I wrote a very simple Diffie-Hellman example program that runs entirely within your web browser. You can either use it alone, or with a friend - which is the most fun. It works over the phone, or over an instant messenger (IRC, MSN etc). Follow the instructions, encode a message, paste it to your friend, and if your friend followed the instructions, and he pastes the encoded message into the decoder, he should see your secret message!&lt;/p&gt;

&lt;p&gt;This is even more fun in a chat room with actual Eve&amp;#8217;s present.&lt;/p&gt;

&lt;p&gt;Please be aware that the sample is a joke - don&amp;#8217;t use it to share real secrets! However, the technology it employs is real, and this truly is how people exchange keys - only the numbers are far larger (300 digits), and the actual encryption is not a Caesar cypher.&lt;/p&gt;

&lt;h2&gt;So how does it really work?&lt;/h2&gt;

&lt;p&gt;More information can be found on the &lt;a href="http://en.wikipedia.org/wiki/Diffie-Hellman"&gt;wikipedia page about Diffie-Hellman&lt;/a&gt;, especially in the &amp;#8216;external links&amp;#8217; section.&lt;/p&gt;</description>
      <pubDate>Sun, 11 Nov 2007 11:36:00 +0100</pubDate>
      <guid isPermaLink="false">urn:uuid:df7952aa-fba3-4638-8620-9e3294adbdda</guid>
      <author>bert.hubert@netherlabs.nl (bert hubert)</author>
      <link>http://blog.netherlabs.nl/articles/2007/11/11/secrets-in-public-diffie-hellman-key-exchange</link>
      <category>PowerDNS</category>
    </item>
    <item>
      <title>DNS &amp;amp; Crypto Power Lunch</title>
      <description>&lt;p&gt;&lt;img width="100%" src="http://ds9a.nl/djb-ahu-small.jpg"&gt;
&lt;p&gt;
Enjoyed a fun and stimulating &amp;#8220;DNS &amp;amp; Crypto Power Lunch&amp;#8221; with &lt;a href="http://cr.yp.to"&gt;Dan Bernstein&lt;/a&gt; (left) and &lt;a href="http://www.hyperelliptic.org/tanja/"&gt;Tanja Lange&lt;/a&gt; (not in picture). As was to be expected, the intersection of cryptography and (secure) DNS was discussed, and some evil plans might ensue! If implemented in djbdns and PowerDNS, we might actually achieve something..&lt;/p&gt;</description>
      <pubDate>Wed, 21 Feb 2007 23:13:00 +0100</pubDate>
      <guid isPermaLink="false">urn:uuid:59c727ac-a186-4076-a430-7c9c6a280bb4</guid>
      <author>bert.hubert@netherlabs.nl (bert hubert)</author>
      <link>http://blog.netherlabs.nl/articles/2007/02/21/dns-crypto-power-lunch</link>
      <category>PowerDNS</category>
      <category>Netherlabs</category>
      <category>Life</category>
    </item>
    <item>
      <title>ISOC presentation on &amp;quot;The Future of VoIP2&amp;quot;</title>
      <description>&lt;p&gt;Just a quick note that I&amp;#8217;ll be presenting at &lt;a href="http://isoc.nl/activ/2007-FoV-II/index.htm#english"&gt;The future of VoIP 2&lt;/a&gt; event as organised by the Internet Society of The Netherlands, part of the (global) &lt;a href="http://isoc.org"&gt;&amp;#8220;Internet Society&amp;#8221;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The event takes place on the 15th of March, in The Hague. For more details, see the links above.&lt;/p&gt;

&lt;p&gt;As always, I love to meet PowerDNS users, or in fact, anybody interested in doing interesting things with DNS. So should you be there, it would be good to talk.&lt;/p&gt;</description>
      <pubDate>Thu, 08 Feb 2007 22:39:00 +0100</pubDate>
      <guid isPermaLink="false">urn:uuid:91029a48-7fa8-4506-bba0-c838871e2527</guid>
      <author>bert.hubert@netherlabs.nl (bert hubert)</author>
      <link>http://blog.netherlabs.nl/articles/2007/02/08/isoc-presentation-on-the-future-of-voip2</link>
      <category>PowerDNS</category>
    </item>
    <item>
      <title>This draft is a work item of the DNS Extensions Working Group of the IETF!</title>
      <description>&lt;p&gt;The workings of the Internet are described, or even proscribed, by the so called &amp;#8216;Requests For Comments&amp;#8217;, or RFCs. These are the laws of the internet.&lt;/p&gt;

&lt;p&gt;Today the IETF DNS Extensions working group accepted an &amp;#8220;Internet-Draft&amp;#8221;  &lt;a href="http://virtu.nl"&gt;Remco van Mook&lt;/a&gt; and I have been working on. And the cool bit is that over time, many such accepted &amp;#8220;Internet-Drafts&amp;#8221; turn into RFCs!&lt;/p&gt;

&lt;p&gt;Read about it what our draft does 
&lt;a href="http://blog.netherlabs.nl/articles/2006/05/09/i-bit-the-bullet-and-wrote-an-rfc-to-be"&gt;here&lt;/a&gt;
and &lt;a href="http://blog.netherlabs.nl/articles/2006/05/13/in-violation-of-my-own-draft-draft-rfc"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The actual Internet-Draft can be found &lt;a href="http://www.ietf.org/internet-drafts/draft-ietf-dnsext-forgery-resilience-00.txt"&gt;over at the IETF&lt;/a&gt;, or over here &lt;a href="http://ds9a.nl/tmp/draft-ietf-dnsext-forgery-resilience.html"&gt;as pretty HTML&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;In short, this RFC documents and standardises some of the stuff DJBDNS and PowerDNS have been doing to make the DNS a safer place.&lt;/p&gt;

&lt;p&gt;Besides the fact that it is important to update the DNS standards to reflect this practice, it is also rather a cool thought to actually be writing an RFC, especially one that has the magic stanzas &amp;#8220;Standards Track&amp;#8221; and &amp;#8220;Updates 1035&amp;#8221; in it.&lt;/p&gt;

&lt;p&gt;So we are well pleased! Over the coming months we&amp;#8217;ll have to tune the draft so it confirms with the consensus of the DNSEXT working group, and hopefull somewhere around March, it will head towards the IESG, after which an actual RFC should be issued.&lt;/p&gt;

&lt;p&gt;Exciting!&lt;/p&gt;</description>
      <pubDate>Fri, 12 Jan 2007 22:16:00 +0100</pubDate>
      <guid isPermaLink="false">urn:uuid:332bd24c-7b93-4fd2-a46e-17e5eb75618a</guid>
      <author>bert.hubert@netherlabs.nl (bert hubert)</author>
      <link>http://blog.netherlabs.nl/articles/2007/01/12/this-draft-is-a-work-item-of-the-dns-extensions-working-group-of-the-ietf</link>
      <category>Linux</category>
      <category>PowerDNS</category>
      <category>Netherlabs</category>
      <category>Life</category>
    </item>
    <item>
      <title>Wishing you a good 2007!</title>
      <description>&lt;p&gt;I wish everybody a very good 2007! For PowerDNS, it certainly has been a very good year.&lt;/p&gt;

&lt;p&gt;In some (large) places, the Recursor now commands a 40% market share, while the authoritative server is also expanding its user base around the world, with multi-million domain deployments now no longer as newsworthy as they once were.&lt;/p&gt;

&lt;p&gt;The &lt;a href="http://en.wikipedia.org/wiki/Chaos_Computer_Club"&gt;Chaos Computer Club&lt;/a&gt; held its &lt;a href="http://en.wikipedia.org/wiki/Chaos_Communication_Congress"&gt;annual congress&lt;/a&gt; last week, and they chose the PowerDNS Recursor to provide the DNS service to go with their 10 gigabit connection. I&amp;#8217;m pleased to report that the PowerDNS process was fired up only once, and that it held steady for the entire congress, with no complaints. This would usually not be that strange, but the CCC clientèle are among the most critical internet users to be found on the planet.&lt;/p&gt;

&lt;p&gt;Many thanks to Stefan Schmidt and other CCC admins for their vote of confidence!&lt;/p&gt;

&lt;h2&gt;Rails&lt;/h2&gt;

&lt;p&gt;I&amp;#8217;m working on understanding &amp;#8216;Ruby on Rails&amp;#8217;, which will probably end up as a HOWTO aimed at seasoned programmers. The internet abounds with &amp;#8220;you won&amp;#8217;t believe how easy Ruby on Rails is&amp;#8221; demonstrations, but the hard truth is that below the surface, a lot of magic is happening. The kind of magic the discerning programmer wants to grasp so as to make the most of it.&lt;/p&gt;

&lt;p&gt;A very small start to this HOWTO can be found &lt;a href="http://ds9a.nl/ror-hard-way"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;It may also allow experience programmers to teach themselves Ruby in less time than it would take them to read a 750 page book.&lt;/p&gt;</description>
      <pubDate>Mon, 01 Jan 2007 16:58:00 +0100</pubDate>
      <guid isPermaLink="false">urn:uuid:c95eab70-b67c-4470-8e15-afcc75dd1886</guid>
      <author>bert.hubert@netherlabs.nl (bert hubert)</author>
      <link>http://blog.netherlabs.nl/articles/2007/01/01/wishing-you-a-good-2007</link>
      <category>Linux</category>
      <category>PowerDNS</category>
      <category>Netherlabs</category>
      <category>Life</category>
    </item>
    <item>
      <title>PowerDNS speedups</title>
      <description>&lt;p&gt;After PowerDNS 3.1.4 turned out to be boringly stable, fixing all reported crashes, I decided it was time to do the massive speedup I&amp;#8217;d been promising people for some time.&lt;/p&gt;

&lt;p&gt;With some help from my friends over at &lt;a href="http://offtopic2.net"&gt;#offtopic2&lt;/a&gt;, I was able to use the TSC register of my CPU to measure down to the nanosecond how much time things were taking within PowerDNS. Previously I&amp;#8217;d concentrated on profiling macro performance, but nanosecond resolution allows one to study fully how much time is spent within each function.&lt;/p&gt;

&lt;p&gt;Using this technique, it became apparent we take a whopping 60 microseconds to answer even the most basic of questions. We make up for this by being pretty fast at complicated questions. But 60 microseconds mean we are limited to about 15000 questions/second, max.&lt;/p&gt;

&lt;p&gt;First I started shaving microseconds. It turns out &lt;code&gt;snprintf&lt;/code&gt; is truly slow, taking up to 5 microseconds for some strings. Additionally, we wasted a lot of time on needlessly copying &lt;code&gt;std::strings&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The unsurpassed Boost::Multi_Index container has a spectacular feature, called &amp;#8216;compatible keys&amp;#8217;, which means we can lookup answers using a question key that is a bare piece of memory instead of a proper &lt;code&gt;std::string&lt;/code&gt;. This again saved a few microseconds.&lt;/p&gt;

&lt;p&gt;Put together, this brought down the 60 usec to perhaps 40, which is nice, but not stunning.&lt;/p&gt;

&lt;p&gt;But the big savings only came when I did the only thing that actually makes code fast: do less.&lt;/p&gt;

&lt;p&gt;So - when encoding the answer to a question, we no longer do the whole &amp;#8220;DNS label compression&amp;#8221;-routine, as we know the &amp;#8220;label&amp;#8221; of the answer to a question can always be encoded as the fixed bytes 0xc00c - we don&amp;#8217;t need to calculate it.&lt;/p&gt;

&lt;p&gt;Going beyond that, when generating a simple answer, don&amp;#8217;t generate an answer packet, but simply tack on the answer to the original question, and update the &amp;#8216;answer count&amp;#8217;.&lt;/p&gt;

&lt;p&gt;Also, if we see we have an &amp;#8216;instant answer&amp;#8217; available for a question, don&amp;#8217;t bother to launch a whole &amp;#8216;MThread&amp;#8217; to generate it, but return synchronously.&lt;/p&gt;

&lt;p&gt;The upshot of all this is that we can now answer most questions in&amp;#8230; 4 microseconds, down from 60. 15-fold speedups are rather rare usually.&lt;/p&gt;

&lt;p&gt;We didn&amp;#8217;t speedup everything that much though, only the majority of queries. However, even the uncached queries will benefit from the microsecond shaving performed earlier, and run around twice as fast.&lt;/p&gt;

&lt;p&gt;I can&amp;#8217;t wait to do a live benchmark on all this. I&amp;#8217;m estimating we should now be able to do over 50000 &amp;#8220;real&amp;#8221; queries/second on a 3GHz P4, which would put us an order of magnitude above the open source competition, and even beat, by a large factor, the numbers I hear quoted for commercial alternatives. These are hard to compare as their numbers are under NDA.&lt;/p&gt;

&lt;p&gt;It might not even be easy to generate that much testing data..&lt;/p&gt;

&lt;p&gt;Will keep you posted!&lt;/p&gt;</description>
      <pubDate>Thu, 14 Dec 2006 22:21:00 +0100</pubDate>
      <guid isPermaLink="false">urn:uuid:5a67e3b9-1e38-4bf5-8851-4111e50a61dc</guid>
      <author>bert.hubert@netherlabs.nl (bert hubert)</author>
      <link>http://blog.netherlabs.nl/articles/2006/12/14/powerdns-speedups</link>
      <category>Linux</category>
      <category>PowerDNS</category>
      <category>Netherlabs</category>
    </item>
    <item>
      <title>Visited ASML yesterday, wow</title>
      <description>&lt;p&gt;Yesterday I visited a &amp;#8220;software development seminar&amp;#8221; of &lt;a href="http://www.asml/com"&gt;ASML&lt;/a&gt;, a rather well disguised recruiting event of this Dutch manufacturer of the world&amp;#8217;s most advanced lithography machines.&lt;/p&gt;

&lt;p&gt;When I studied physics, I organized the &lt;a href="http://ddb.tudelft.nl"&gt;Delftse Bedrijvendagen&lt;/a&gt;, the then largest carreer fair for university students of The Netherlands. As part of that, I was exposed to almost all recruiters of large Dutch companies, including ASML. And the ASML people never failed to leave me light headed.&lt;/p&gt;

&lt;p&gt;In brief, lithography is a major piece of the process of actually making chips. It is the part where you actually put the chip on the substrate, using high energy photons. Current 65nm chips consist of many layers, each of these layers needs to be overlaid with the previous one to a precision of a few nanometres.&lt;/p&gt;

&lt;p&gt;To achieve this precision, the individual positioning tolerances of the wafer need to be exact within a nanometre. This is a stunning achievement in itself. For those of you in the non-metric world, there are around 25 million nanometres to an inch. So you should be impressed.&lt;/p&gt;

&lt;p&gt;However, this is nothing yet. The lithography machines (&amp;#8216;wafer steppers&amp;#8217;) are very expensive, as is the facility that hosts them. And, as there are many layers in a chip, the actual speed of the wafer stepper is of utmost importance.&lt;/p&gt;

&lt;p&gt;The machines ASML builds actually illuminate the &amp;#8216;reticle&amp;#8217; at speeds exceeding 5 metres a second. This is 11 miles/hour. At nanometre precision.&lt;/p&gt;

&lt;p&gt;You should have progressed beyond &amp;#8220;impressed&amp;#8221; to &amp;#8220;stunned&amp;#8221; by now.&lt;/p&gt;

&lt;p&gt;But this is nothing yet. As in microscopy, where water is used to improve resolution, it makes sense to immerse your chip in water while it is being exposed. So the ASML people do that. At nanometre precisions, at those stunning speeds.&lt;/p&gt;

&lt;p&gt;To put things in perspective, the wafer is NOT flat to within a nanometre, it bends a bit. So to achieve the precision desired, the wafer is first scanned, so all its imprecisions can be compensated for. &lt;/p&gt;

&lt;p&gt;Extreme stuff. I&amp;#8217;m sure they don&amp;#8217;t have this in &amp;#8220;Star Trek&amp;#8221;.&lt;/p&gt;

&lt;p&gt;I left the event deeply confused - I&amp;#8217;m already completely busy with everything I do, and PowerDNS is getting to be quite the empire. The rest of my business is doing great as well. &lt;/p&gt;

&lt;p&gt;But my physics background makes me appreciate the incredible things happening over at ASML. Oh well. Like any job, I&amp;#8217;m sure it would have downsides. Also, I&amp;#8217;m not the kind of person to hold a regular job. But if you want to do stuff on the leading edge of technology, you should at least consider &lt;a href="http://www.asml.com/asmldotcom/show.do?ctx=1314&amp;amp;continent=eu"&gt;working there&lt;/a&gt;. I hear they have 300 vacancies planned for software engineers. They also have some &lt;a href="http://www.asml.com/asmldotcom/show.do?ctx=21825"&gt;blogs&lt;/a&gt;, by the way.&lt;/p&gt;

&lt;p&gt;Their current challenge is to move their 15 million lines of C to a new platform that will control their next generation of devices, some of which need to move terabyte amounts of data in under a second.&lt;/p&gt;

&lt;p&gt;Anyhow, the seminar was interesting. &lt;a href="http://www.gilb.com"&gt;Tom Gilb&lt;/a&gt; presented his &amp;#8220;Evolutionary Project Management&amp;#8221; concepts, which match rather well with how I tend to manage my projects. One of his main points is that when people start to apply &amp;#8220;waterfall&amp;#8221; diagrams to software projects, you are lost anyhow. I thought so all along, but it is nice to hear a &amp;#8220;guru&amp;#8221; confirm it.&lt;/p&gt;

&lt;p&gt;Inspired by the breakthrough technologies over at ASML, I&amp;#8217;ve picked up my own speech recognition research again, after an 18 month hiatus. The initial results bode well. I get very good frequency and time definition on real speech, with code totalling 750 lines. I hope to get some actual recognition going in the coming week.&lt;/p&gt;</description>
      <pubDate>Fri, 24 Nov 2006 22:55:00 +0100</pubDate>
      <guid isPermaLink="false">urn:uuid:1eb73ded-1205-4f93-8c30-b94d9cbb614c</guid>
      <author>bert.hubert@netherlabs.nl (bert hubert)</author>
      <link>http://blog.netherlabs.nl/articles/2006/11/24/visited-asml-yesterday-wow</link>
      <category>PowerDNS</category>
      <category>Netherlabs</category>
      <category>Life</category>
    </item>
  </channel>
</rss>
