Good afternoon, everyone. It is now the top of the hour, 1 p.m. Thank you so much for being here with us today at the Packet Hacking Village. Feel free to move in. I know there's people who really want to be here for this talk. And our speaker, this speaker that we have now, right now, we are just so honored and so thrilled. When we put out the schedule of our speakers here for the speaker workshop, lots of people were blown away. They were like, oh, my God, we got Paul Vixie, who I taught, and here we are. It is now my pleasure to introduce to you, oh, what can I say? He's the CEO of... Is it Fireside Technologies? Fireside Security. And certainly a luminary in this field, especially with networking and Internet. Without much ado, ladies and gentlemen, Paul Vixie. Hello? Ah. So, for the record, that was a... That was a... That was a do. And it doesn't really matter what else I've done. Thank you for coming to hear me. I heard that you were talking about capturing packets, and since that's been a big part of my life in the last, ooh, six, seven years, I thought I would tell you how we've been doing it and how we're going to do it differently as far as DNS collection is concerned. All right. I've just been asked to project more, so... So we have an hour-long slot. That's more time than this material needs. I'm hoping for questions. I'm not sure how we're going to get questions over the music. Maybe there's a microphone we can pass. So, you measure DNS because everything that happens on the Internet, other than, of course, the peer-to-peer type applications, everything that you do on the Internet starts with a DNS transaction. That means that even bad people need good DNS, and that whatever crimes... or abuse are committed probably involve somebody registering something in the DNS that you might wish you had copies of. So this slide is a little out of date, but you can see here that in one of the real-time channels of the Security Information Exchange, we collected about 1.6 terabytes of data that day. That's not too far off of what we have now, although we have a lot more sources. We have a global... network of passive DNS sensors, and I'll explain what a passive DNS sensor is in a moment, but the point is we have 500 of them, or so, and they send an aggregate of 200,000 cash-missed transactions per second into our collection infrastructure. Now, obviously, I work for a commercial company, and we do sell this stuff, but one of the reasons I like coming here is because we make it available free of charge if you yourself are not paid for the work that you're doing with it. So if you have some research idea that you want to explore using our tools, contact me. Tell me what it's about, and we'll set you up. So 200,000 cash-misses per second translates to around, you know, maybe 100 million or 200 or 300 million cash hits per second, because in a DNS recursive name server, you are traditionally answering from cache most of the time, because most of the time, your stub resolvers will be asking a question that has just been asked not long ago, and the result will still be in the cache. For example, www.google.com, it tends to be hot in everybody's cache all the time, and maybe once every time-to-live period, it will expire and then quickly get refreshed back to cache. So what that recursive name server is doing is acting as kind of a de-duplicator. It's giving you a small upstream leak of cache-missed transactions that will tell maybe an outside observer like our sensor that somebody inside your network is interested in whatever it was that wasn't in cache. But there's a huge number of transactions below the recursive facing the actual users, and a relatively minor number of cache-missed transactions above that recursive. Since we began this project, Edward Snowden has made some disclosures. Perhaps you've heard those. And I want to say in fairness to him and his observations, we don't do surveillance. I'd never collect an end-user IP address, and although we do sell our stuff to law enforcement or even give it away in some cases, they can't really start an investigation using our tools because it's worthless for that. All you can do is enhance an existing investigation. And that reflects my personal belief that when people are using the Internet, they ought to have a certain amount of privacy. And so we're working on that. We're doing the best we can to stay on the side of the light there while still collecting enough information to find and investigate and hopefully kick in some doors or direct some lawsuits. And that's why we do this. That's why we have this big collection network. If you're looking for a mail server, you look for a certain record type in DNS called MX. If you're looking for a web server, you tend to look for an ARAM. If you're looking for an LTA record or a Quad A record, but the point is that every flow that you're going to see in NetFlow or every flow that you're actually going to witness in a packet trace will have begun with a DNS transaction. And so a lot of us are also collecting NetFlow on our networks, and we've got tools, some open source, some commercial tools that we use to process NetFlow and tell us what our users did or perhaps what criminals did to our users, but that only tells you what happened. And if you want to know how it happened or why it happened, you need to be collecting DNS. All of our tools for collecting DNS are open source. So to the extent that you want to start your own local collection empire, please take a look at our tools. We use the Apache open source license. We think our stuff is pretty good. I'll come back to that later. So historically, and some of you know that I worked on bind for a number of years and then I hired other people to work on bind for a number of years. So a lot of my experience is relative to bind. And in bind, if you want to collect a record of all the questions that you answered, that is a syslog activity. In other words, you turn on query logging and it will either send a message over to the syslog demon every time it answers a query or it might write a line of text into a new line delimited ASCII text file. Either one of those is way too slow. The maximum rate of time it takes to send a query is 20,000 events per second. So the maximum rate at which you can do that kind of thing, like talk to syslog or talk to a text file tends to be on the order of 20,000 events per second. And that's in a fairly modern system with a reasonable kernel and enough disk cache and so forth. Whereas a lot of name servers are answering 10 or even 30 times that number of queries. So if you turn on query logging, then you either stop answering queries and you start dropping a lot of questions on the floor because your name server process was busy logging to disk the last transaction or you answer all the queries but you don't log them all. One way or another, you're not going to be able to do both at the top speed. And the bottleneck in speed is going to be your logging function. So in other words, the thing that bind does is a toy by today's standards and we don't use it. And I say that with affection. I still use bind myself. It's fine software and so forth. I just don't work on it anymore. So we're doing something else. Now, success in collection of DNS transactions therefore occurs asynchronously using the lib PCAP and the BPF interface or modern equivalents of those. Basically, you do what TCP dump does. You get yourself an ancillary copy of the packets that the kernel is delivering to your application or receiving from your application. And that process is asynchronous. If it can't keep up, you will lose logging data. I view that as the right thing. If you can't keep up, then you would like to answer all the questions and not seem slow or lossy as a name server and maybe your telemetry is where the suffering should occur if a tradeoff has to be made. So I personally developed a package called NCAP, analogous to PCAP back in 2006, which was meant, and I blew it on this. I screwed up big time. So the software is junk, but it looked pretty good at the time. I was trying to replace PCAP. I was trying to modernize PCAP, give it decent time stamps, give it maybe a higher level API and, you know, make it possible for people to do this type of work without having to get quite so far into the details as lib PCAP does. But I missed the boat. I ended up with something that was far too specific for the application I had and not really generalizable into other applications that other people might have. So what I mean to say is it was great for collecting DNS and pretty much useless for collecting anything else. So we blew that away in 2010. Hired younger people who know more about how the world works today and got them to write something called NMessage. And NMessage is not designed to replace PCAP. It is actually a purpose-built sort of container language where it's built on top of Google protocol buffers, which is a very fast way to serialize and deserialize data. So it's all binary. It's all really, really complex. And it's a very, really good tool. It's really fast and it's extensible. If you want to add some fields later, you can without violating the assumptions of older applications linked against older libraries and so forth. So we're very proud of NMessage. And that's what we've been using for about the last five years to collect this type of data. I mentioned earlier that there is a deduplication activity that happens in the DNS protocol stack. You with your smart phones and tablets and laptops and servers and virtual servers and so forth occupy the position normally of a stub resolver. You're asking questions and you don't really care where the answer might have to get fetched from. You're just asking the local server, the recursive server, please tell me what records go with this name and this type. Like www.google.com for type A would be an example of a question and a set of IP addresses would be an example of an answer. As you can see in the picture, there is a cache built into the recursive server. And that cache is of a configurable size. You could, if you want, make it 100 megabytes or a gigabyte of heap space. Most name servers don't back up the cache when you restart them. So if you kill a name server, you're losing whatever was in the cache. And if you start it up again, you're going to start with an empty cache. And if you're a gigantic network, if you operate over a gigantic network, then that restart penalty is huge and you start to sort of schedule your reboots because you can't complete loss of one of these caches. And as I said earlier, we place our sensor above the recursive. In other words, when it doesn't find what it's looking for in the cache and it has to go fetch it from some authority server like VeriSign runs the servers for .com. I myself run one of the servers for the root zone which is above .com. You're probably running name servers or perhaps renting time on other people's name servers for your own vanity domain which likely ends in .com. But the point is that the authority servers is where actual content enters the DNS from outside of the DNS. Usually from a flat text file or a database or an application. And then gets into the DNS because recursive servers are told to send their questions to those authority servers. And it's that transaction that we look at. So the only IP addresses we have are the IP address of a recursive server that asked the question and the IP address of an authority server that answered it. And so, again, for the purpose of service, you're going to have to do a lot of surveillance. This is really low grade information. All you would know, let's say that you were tracking one of the four horsemen of the info apocalypse, which would be child pornography, and you knew that somebody had, you know, every look up for a certain domain name is because somebody somewhere is hurting a child. You might want to look at this data stream and you might say, hey, look, we got a look up from a recursive name server for a domain name that is just really, it's hurting children. We got to go after that. All you're going to do is look at the data stream and you're going to learn from us is that somebody in a certain city looked it up. You're never going to learn where they lived or what their IP address was or anything else. That doesn't mean that I'm in favor of hurting children. That means I'm in favor of protecting them through some method other than general surveillance. So I just want to emphasize, we are not the surveillers that you're worried about. So our sensors send the data to the Farsight security information exchange, which ultimately at its heart is just an Ethernet switch. People who want our data, we're going to send it to the Farsight security data, pretty much buy a port on the switch and plug their server into it and we start blasting traffic at them. We're using VLANs as though they were channels. And that just turned out to be the easiest way to get all that data replicated to all those different subscribers. And we have, as I mentioned, both academic and commercial and just hobby people looking at this. And if you're not paid for the work you do that requires this data, talk to me. I will put it in your hands. So we quickly create a thing called the Passive DNS Database, Farsight DNSDB, which is not the subject of this talk. I'm happy to talk about it afterward or during questions. But what I really want to focus on today is how we collect the data, what's wrong with the way we collect the data, and what we've been doing about it and what we're sort of in the process of releasing right now. So the biggest problem with a packet-based approach, and I realize we're here to capture the packet. That's the, that's the, the, the, the, the, the, the, the, the, the theme of this, this year. But if you're capturing packets, you're literally only seeing what's on the wire. And there are plenty of things that happen inside of a name server that don't make themselves known on the wire. You can impute that a time to live has expired out of cache because if you see, okay, I know what the time to live was and I know when it entered the cache and I saw another query for it right after the time to live expired, then you can say, hmm, okay, time to live expired, therefore it got purged from cache. And then you can say, hmm, a new fetch occurred. If you see that refresh event soon, sooner than the time to live expiration, then you can guess maybe the cache was full and some kind of at least recently used replacement algorithm got run so that, you know, it could have lived another several hours or several days in cache but it got pushed out by something because it wasn't popular enough. So you can impute those events by things you see on the wire. But it's much better, in my opinion, to just have it reported to you. If you buy a name server which has proper instrumentation, it will just tell you, this is what I did, this is why I did it. So the other problem with our current approach is that we're blind to TCP. So TCP is not a single request and a multi-packet response with UDP fragmentation, the way traditional DNS works. If you speak DNS over TCP port 53, you are sending the SYN, you're getting the SYN hack, you're sending the hack, then you're sending the query. This is a lot more state for us in trying to reconstruct that query stream if TCP is used. And we are lazy and we haven't gotten around to it yet. So, again, we're hoping that we don't have to implement that part because we'll be able to instrument the server directly and that we will then be able to get all of these transactions regardless of what transport protocol, TCP or UDP, was used. So, again, that's just a Lurie Walton, Lurie Wal said when he was talking about Pearl back in the early days that laziness was the great virtue of programmers and so we're trying to be that. So Van Jacobsen, when he was first talking about random early detection of congestion events, came up with this picture. And I've never seen it done better. What you're seeing here is a very fat pipe on the left and a very fat pipe on the right and a very skinny pipe in the middle. And although the pipe is a little bit thicker than the pipe in the middle is getting faster, right, a lot of us don't have 100 kilobit DSL lines at home. We've got, you know, multiple tens of megabits DSL or cable motor or whatever we have. It's still slower than our LANs, which tend to be gigabit. So this picture, although all of the dimensions are bigger, the relative sizes of those dimensions are about the same as they always were. You're always going to be able to generate more traffic on your LAN than your wide area router is going to be able to put on your LAN. So you're going to be able to get more traffic on its link. That's the nature of the Internet that will never change. And so we always have to deal with that when we're talking about, in Van's case, he was talking about TCP and how to slow down so that you could kind of only send the packets that we're likely to get through. But in our case, we have the problem of generating a lot of transactions. Again, if you're answering 200,000 queries a second or generating maybe thousands, many tens of thousands of cache miss transactions above the recursive per second, you might not have a enough upstream capacity to deliver all of that to your telemetry hub that is then going to store it and analyze it and do all that sort of thing. Which means the loss will occur. And whenever loss is going to occur, then we as designers have to make an intelligent, informed, constructive choice about where it will occur. Where in the topology will it occur and what will be the implications of that placement. So in this picture, what you're seeing is that way too many packets have been committed, and they're not going to be able to get through. So in the bottom, you have two lines, the left and the right. And they're trying to pass through on the right, and a lot of them are dropped right there where I've written the words loss region. And what you see on the far side is what survived. And this is the geometry of your data in flight. So in general, if you're going to be losing something, if you're going to lose data, you want to lose it as early as possible so that you have not wasted a lot of capacity carrying something halfway through the network that is not going to be able to get through. So all of these things make it to the far side. In other words, it's your job to efficiently utilize the network resources that are close to you in order to then sort of preserve them for other people who might be going to different destinations where there's less congestion. And one of the great, in my opinion, wonderful differences between the Internet and all of the sort of telephone company protocols that preceded it is that we demand that every endpoint cope with this problem. We don't simply commit our data to the network and let virtual circuits sort it out for us. We have a smart edge and a stupid core. That's why the Internet keeps doubling in speed every unit time. The telephone company was not going to be able to do that with their virtual circuits. But it does mean that, again, we as endpoints have to be cognizant of this. And, you know, granted, a lot of us don't. A lot of us just write whatever web application we have knowing that there's a framework around us that will take care of syslog files and all the rest. And since we're mostly answering the question, we don't have to do that. We don't have to do that. We don't have to do that. We don't have to worry about over committing the network because if we can't deliver our responses, then the questions will automatically slow down. So, you know, we do get some beautiful simplicity in our thinking about this because we don't have to think about the congestion in every endpoint. But the kernel people do and the device driver people do. And I want to shout out to Jim Geddes and Dave Tott, by the way. If you don't know about buffer bloat, then make a note to Google that later. Buffer bloat. There is way too much buffering in the Internet right now and it is hurting us. It is killing performance. Even on the wireless LAN that we're all using right here, right now, buffer bloat is killing you. And it would be good if all of us could rise up and arm ourselves with torches and march on the castles of the people who build our wireless gateways and our DSL modems and even our Ethernet drivers. Nevertheless, this thinking informed our design. And I want you to think carefully about that loss region because you should not commit packets into the network that are not going to make it. And that's what happened here. So, we created a thing called DNS TAP. It doesn't stand for anything. DNS is the domain name system. But TAP is not an acronym. This is just what some engineer decided to call it. And something called frame streams as a bearer channel for that. And these are open source libraries. If you go to dnstap.info on the web, you'll get the source code. It's in GitHub. It has an Apache open source version 2 license on it. It may have broader applicability to other problems you're solving. And I think these libraries are pretty good. And I'm going to explain why. DNS TAP is the part you have to put into your name server. That means that I have the burden inside of my security company of having to go hack bind and pay my people to hack bind. I hate that. I thought I was in the wrong. So, DNS TAP is the part you have to put into your name server. That means that you're ending that when I left Internet systems consortium. But we're also hacking it into other name servers. I'll give you the list of those. Frame stream has what we call reliable front loss. In other words, that's the thing that is able to kind of guess that if something is not going to get through, we're not going to commit resources to it. And I have some pictures about that. Implementation has sort of begun. We have quite a bit of software. But we don't have a receiver for this data yet. In other words, our sensor does not use this source code. We're this technique yet. We're trying to get more name servers to support it before we build the infrastructure capable of receiving this. On the other hand, it is open source. You guys, if you want it, could build a receiver for this. In principle, it's no different from a NetFlow receiver. It has to listen on a socket and do something with what it receives. And, you know, when I say deployment is commencing, I mean that it's running at my house. So DNS tap is a server-embedded thing. Again, it doesn't have to do UDP reassembly. Thanks to some idiot who wrote RFC 2671, we now have IP fragmentation trying to happen at scale, which does not work, was never going to work, and that the author of RFC 2671 really ought to be taken out behind the barn and beaten with a stick. But nevertheless, we have IP fragmentation happening in DNS. That's one of the reasons that DNS doesn't work so well. We're trying to build a server-embedded network, but it doesn't work so often. For example, DNSSEC requires this, but IP reassembly and IP fragmentation often just won't get through a firewall. If you think about your usual firewall rule for DNS is to allow a packet through if it is to UDP port 53 or if it's from UDP port 53. The problem is that fragments in IP version 4 don't have port numbers. And so if you want to let the fragments through also, you have to let all fragments through, or you have to let all fragments through. You have to build state into your firewall. And I have to tell you that no matter which of those things you choose, that way lies madness. So again, we should not have extended DNS to use IP fragmentation, but we did. And right now, that means we have to cope with that fragmentation even with our passive DNS sensors. And it's not just the kernel's problem. And then there's the TCP stream reassembly that we don't want to do. We're just going to get the questions and the answers directly out of the name server. At the moment, we're going to have to guess what you thought you were doing by looking at your Q name and looking at what server you sent to. So since we like to make sure that your cache, that cache pollution attempts don't make it into our logs, we've got logic in our sensor that says, ah, you were asking, let's say, for the example.com domain name, and you were sending that question to an IP address that we know is authoritative for .com. And so the answer is probably a referral. It's probably VeriSign telling you that you're not going to be able to access that domain name. And if it's telling you where to find example.com, that's okay. Or once we've seen the referral, then we'll remember those IP addresses. And if you ask the question of those name servers, then again, it's able to say, hey, you were asking the question of an IP address that we know is one of the name servers for example.com. Therefore, it's allowed. And there's a huge amount of transactions that are coming through the network that don't come from any place that they should be allowed to come from. And we drop those. And every passive DNS collector has the responsibility of dropping those. But nevertheless, you're guessing. And you can probably imagine what happens if a name server is responsible for both .com and example.com, which is that we don't know what you thought you were doing. We're going to guess that it's okay, but we don't actually know. Whereas inside the name server, you know exactly what you're doing. You're asking the .com servers because that's your best guess about where to find example.com. After you get that answer, you're asking those servers for what's called the bailiwick of example.com because you're not going to be able to find it. You're always going to send a query to the most specific matching set of servers that you have. But even though you inside the name server know exactly why you're sending this query and who you're sending it to and what you think they're responsible for, we, as a passive collector, have to kind of guess what that is. So once we move into server embedded DNS tap logic, we'll just, you know, reach directly into your transaction data structure and figure out what you thought the bailiwick was when you sent that query. Because that's what we're going to be able to do. So we're information here is it's very important to know that bailiwick if you're going to resist cash poisoning attempts. Now we also maintain quite a bit of state in our sensor. We will only care about a response if we have seen the query go out. And that's okay for smaller sites. But it can mean tens of megabytes of hash tables and heap for a large regional ISP name server just trying to keep track of what are the outstanding queries so that we can make make sure that we don't inappropriately collect a response that was sent unsolicited. That all goes away with this server embedded logic also. And I mentioned already we're using Google protocol buffers. One expert explained them to me as ASN1 for the new century. And it really is a terribly fast way to serialize and deserialize data. So if you're thinking you'd like to send data between your applications but JSON and XML are too slow and you're just not going to be able to scan forward looking for quotes and commas and braces fast enough to keep up with the data rate, please take a look at Google protocol buffers. They did some good work there and they made it completely open source. So another thing we'd like to be able to do is store more than just the packet and various metadata. For example, the identity of the server is sometimes very important. There's a lot of information. And if you do a collection for the enterprise purposes, you're planning on looking through the logs yourselves, you might like to know that a bunch of transactions that are in your log file came from the same server even though the server address itself was any casted. So all of your transactions look like they came from the same server. But in this case, you could actually get a per server identity appended to the transaction in the log. And that log. And you can also keep track of why a certain query was sent. Sometimes you're forwarding a query because it's a cache miss. Sometimes you're sending a query of your own because you need to know where the name servers for something are even though there's no query that you're forwarding at this instant that is causing you to need to know that. And so this is an opportunity to kind of put an enumerated data type there and say, by the way, these three transactions might all look the same, but they have different motivations. So the motivation becomes something we can append to the data structure in the log. And I've already said this is all about observation. We're trying to rebuild the DNS content. We're not trying to find out who's looking stuff up. Now, that having been said, if you're an enterprise and you want to know which of your employees looks something up, that is permitted by this particular library. I can't keep that out by not including it myself. It's open to the public. I can't keep it open source. Somebody can send us a patch. So it will have that capability, but in my company, we will not be using it. So I mentioned reliable front loss. Again, if you're not going to have enough capacity to get something all the way through the other end, you would like to not send it in the first place. So the TCP protocol was really first implemented in BSD. I know there were some other cheese bag little experimental things in the early 80s that did this, but they were mostly NCP things that had been redone. So really, TCP and the Berkeley socket interface co-evolved. And I think a lot of mistakes were made. And I'm happy to see that both the Windows folks and the Linux folks have realized, you know, BSD sockets is not exactly the right way to talk to the Internet. We need some additional API work here. And so things have improved since the BSD days. There's one part that has to be improved. And that's the fact that it hasn't improved. And that is the treatment of non-blocking data. Right? Because the best way to lose data would be to commit it to the kernel. And if the kernel hasn't got room in the socket buffer, then the kernel will reject it. And then you know, well, that data didn't get through. And you can make an informed decision from that failure whether you want to try and resend it later or not. And that works for UDP. Because UDP is an atomic protocol. If the kernel cannot commit your entire message into a UDP socket, then it's not going to work. And so if you try to send a 500 octet message into a TCP socket, it will reject your entire message. Thank you. That's exactly what I wanted. For TCP it is not so. If you try to send a 500 octet message into a TCP socket that's non-blocking and it only has room for 490, it's going to return 490 from the right call and you're going to be sitting there with ten bytes in your hand that you have to send later. Because that's what the far end is going to expect is the rest of the 500 bytes that you tried to send. And that means you're stuck. I don't want to be stuck. I would really love it if TCP had reliable rejection on a message boundary but the socket interface doesn't permit it. It's not a TCP problem. It is a kernel API design problem. It's the way the system calls are organized. And so we had to build a whole infrastructure in front of the kernel to cause this to happen the way it should. So we developed a library called Framestream. I don't know if you've heard of Framestream. I don't know why we don't use vowels. It's not like we need short identifiers. But anyway, it's Efstrom. And it uses a lockless single producer, single consumer ring buffer. When I say lockless, I mean that almost all of this stuff is threaded and most of the loss of performance we see in threaded applications is because they're trying to lock and unlock these fine grained semaphores. And so we wanted to avoid all of that. And so we found a method of getting this to work without having to call any of the P thread locking or the mutex handlers. That turned out to be important for performance once you get into the half million events per second range. Obviously the exact range at which you have problems is going to continue to go up as we get faster processors. But there will always be some point that you should not exceed. So we're just avoiding the whole problem. Now the Efstrom socket, the output side of the Efstrom socket toward your list of the listener, is still blocking. And so the thread that is writing to it could just block. And in this case, if you had 500 octets to write and there was only room for 490, then rather than returning you the last 10 bytes to deal with, it's a normal blocking socket. It just blocks until there's room for all 500 of them. Which means that the consumer side is not going to pick up the data out of your ring buffer until there is room in the upstream socket for it. And that's what we're trying to do. And that's how we get the reliable front loss. We have a diagram for this. This was all done in LaTeX, by the way, so you should clap now. I don't know how to do it, but the guy who wrote this is a wizard with this kind of thing. So what you're seeing here is DNS queries and responses in the red and green on your left are coming into the worker threads in the name server that are then dumping things into this circular queue. And then there is this I.O. thread, the separate thing, that is actually trying to block. And that's what we're trying to bucket things out of those circular queues. So the dashed line, the curved dashed line on the right side going from top to bottom is a normal byte stream socket. It's a TCP session somewhere. And it will block if it's full. If that DNS tap receiver down there can't keep up, then that causes the DNS tap I.O. thread to just block. At which point the circular queues that are upstream of it are overrun. And that gives us a delightful property of discarding DNS queries and getting rid of them. So that's what we're trying to do here. get rid of the oldest data. Because really, in the telemetry world, if you're going to lose something, what you want to do is lose the stuff that is going to be oldest if it got through. In other words, yesterday's newspaper is of no interest to us. So if you were trying to carry two newspapers and you're planning to read both of them, but you finally realize you can only carry one, keep today's newspaper. And that's what this logic is designed to do. And ultimately we're showing it going into a log file here, but the real game here is to do all kinds of real time analysis on it. So the log file is virtual in that sense. These are the message types that we have defined so far. So we have stub queries, authoritative queries, and the responses. Resolver queries, client queries, forwarder queries. There are a couple more. I asked for review of the slide deck. And I got told, yeah, there are some other things. But frankly, they are a fairly deep in the weeds. So if you look on the DNSTAP.info website and get the latest version of the software, you're going to see a few more message types than what I've shown you. We're thinking about ways to remember other things that happen inside of a name server. So for example, DNS is used for DDoS amplification purposes. Because we have all these immensely powerful servers that are answering UDP whose source IP addresses can be forged trivially over probably 60% of the edge of the Internet. Which means that if you don't like somebody, you can send a stream of queries having that unlikable person's IP address in them as the source and they will receive the responses. So every time you hear about spam house receiving a 400 gigabit per second DDoS, it's that. It's because UDP is so dangerous in this way. So my team back at ISC developed something called response rate limiting where you can start to keep track of, well, gee, should you be asking the same question over and over again? If you're not hearing my answer, then I'm going to stop sending it. Or maybe send you an indication that you should retry with TCP because then I will know that the address wasn't forged, that kind of thing. The problem with rate limiting is you don't have any records. And we thought perhaps DNS tap would be a great place to put an event that says, hey, we've received too many similar queries from a certain net block. We're going to have to do this again. So we've begun suppressing responses. And then later when that time's out, then we have stopped suppressing those responses. So that's the kind of thing you could do if your name server had something other than syslog as a way to record its activities. Because I got to tell you, putting this into ASCII in a log file somewhere is old. I know Splunk built a business on it, but that doesn't mean that it's, that that's what the future has to look like. I feel certain, by the way, that Splunk will come up with a receiver for DNS tap format since it's all open source and I intended to be very popular. We're also thinking about ways to do zone transfers and cache purge, cache expiry were examples I used earlier in the talk. Let's look at performance. This is Bind9's performance on a particular server. It was able to reach to about 400,000 answers per second without logging turned on. But if you turn on logging and you're logging into a hard disk, then it tops off the data and logs out at about 160,000 queries a second. Same hardware. This is the impact of logging is that you go from the blue line to the red line. This is unbound with our patches installed. And what you should be able to see is that without anything going on, we were reaching about 850,000 queries a second. Putting our logic in but disabling it did cost a little bit because there was one more if statement. So we were able to put a statement in the code to test to see whether this was enabled. But it didn't hurt much. Turning it on and then telling our logic to execute but discard cost nothing. And turning it on and actually logging to a hard disk reduced us to around 800 from around 850. And so we like the performance aspects of this far better than we like the performance aspects of syslog. I mentioned that it's a patchy OSL2. I actually rewrote the BSD license to be shorter for ISC. So if you go to Wikipedia, you'll see that there's something now called the ISC license. And what I did is I kept removing words until it made no sense and then added back the last word I had removed. And it got real short but it got so short that it doesn't actually protect you in the ways that we need to. Turns out that the Apache open source team had access to lawyers who cared passionately about this. And so their license is much longer than ISC's license or the Berkeley license. But it means the same thing. You can do whatever you want with the code as long as you don't sue them. So that's the license we're using on all of this now. In fact, I've advised my friends back at ISC maybe they should switch from their license to the Apache license. Everything is on the website. dnstap.info. We've got the protocol. We've got the reference API. Reference tool set. Any patches that have been accepted by the unbound team or the not team or the bind team once we get around to that will disappear from the website. But as long as we just have a patch that we've offered the name server implementer but they haven't integrated it yet, you'll find those patches here also. So if you want to try something out that isn't in your name server yet, then you'll find the patches here. Obviously, I am not in the non-profit. I'm not in the non-profit. I'm not in the non-profit open source world anymore. I spent 18 years at ISC. I did a lot of work with bind. I've given a lot of stuff away. At this point, I've got to put some kids through college. So this is a commercial endeavor. But it turns out that I have aligned our commercial interests with your potential commercial or non-commercial interests. Because what we want is wide adoption. And once there is wide adoption, I think you're going to see a lot more people analyzing their DNS transaction flow than has occurred up until now. So we're going to have to wait and see what happens. And eventually, we will get around to putting some pressure on Nominum and Microsoft who have proprietary commercial binary only non-open source name servers. We think that if we build an ecosystem around DNS tap, that those companies will start losing commercial deals because they can't speak the telemetry protocol that their customers have built an infrastructure for. So that's kind of the end game. And I don't mind them knowing that. I was the co-founder and first chairman of a company called Nominum. And I have many friends at Microsoft. So by now, they know what to expect from me. I am going to skip a bunch of this. Because I said I wouldn't talk about the passive DNS database. And indeed, I won't. So I may be about to give you back some time if we don't have questions. I'm really hoping for some questions. Or complaints. Yes. The question is, what can you do with DNS tap if your existing infrastructure is already collecting in PCAP format? And the answer is, we anticipate writing a tool that will do the best it can. Obviously you won't see cache purge events and the rest of it. But we're going to do the best we can with a tool that will ingest a PCAP stream or a PCAP file and turn it into DNS tap just as a data reduction and data normalization tool. But you really don't, that's, you should see that as a transition method rather than as something you'd really plan to build new infrastructure to work that way. Help me out here. I rode two days on a motorcycle to get here for this. I need complaints. I need questions. All right. So public service announcement. ISC announced a bind vulnerability about a week ago. It's like all bind 9 vulnerabilities, it's not a remote code execution problem. It is an assertion problem. But bind 8 had a lot of remote code execution errors in it. And so when I told the team what to do with bind 9, I wrote no code in bind 9. But when I told them what to do, I said, if anything ever goes wrong, I want it to die on an assertion rather than executing code that came in over the network. And so it does that. It is very assertion heavy code. And all the vulnerabilities that have been reported against bind and it's bind 9, it's long history, have been of the form, if you send it a packet that looks like this, you will, you will cause the machine to do a thing to dump core. That's now happening. It's been seen in the wild. You want to patch your name servers. If you have bind or if you think you might have bind or if you have an appliance that you suspect might have bind, make sure it's patched. Because right now it's possible for anybody who wants to send you a simple unauthenticated packet that will cause your name server to stop. So that's my public service announcement for the day. So with that, thank you all for your time. Thank you for coming. And thank you to the organizers for inviting me.