Performance Evaluation of Tcpdump
Total Page:16
File Type:pdf, Size:1020Kb
Performance Evaluation of Tcpdump Farhan Jiva University of Georgia Abstract performed relatively similar with respect to packet loss. FreeBSD performed the worst out of the op- With the onset of high-speed networks, using erating systems tested, while Windows usually dis- tcpdump in a reliable fashion can become prob- plays seemingly random spikes of packet loss. For lematic when facing the poor performance of mod- each of the datasets we tested, we found that Fedora ern operating systems. Because of this limitation, performs the best. The rest of the paper is laid out the amount of packet loss a user is willing to face as follows: is an important factor when choosing an operating system for a specific task. In this paper, we evaluate the performance of tcpdump on five modern operat- • In Section 2 we discuss some related work. ing systems. 1 Introduction • Section 3 covers our evaluation, along with our experimental setup and experimental results. The reliable usage of tcpdump as a network an- alyzing/debugging/monitoring tool is arguably a non-trivial task. With the onset of high-speed net- • In Section 4, we discuss our conclusions. works, using tcpdump in a reliable fashion can become problematic when facing the poor perfor- mance of modern operating systems. It is because of this limitation that the amount of packet loss be- 2 Related Work comes an inevitable factor when choosing an oper- ating system for a specific task. For example, a re- One approach to increasing the performance of searcher who needs to extract binary executable files packet capturing is explained by Deri et al. [1] In from a live network interface will require there to their paper, they introduce a new type of socket be zero packet loss in tcpdump when choosing an (PF RING) based on circular buffers which is opti- operating system (because the loss of even a single mized for packet capturing. They show that by mak- packet can be severely detrimental to his work). ing certain modifications to the Linux kernel, they In this paper, we provide a performance eval- were able to decrease packet loss substantially, even uation of tcpdump on five, popular, out-of-the- on commodity hardware. Whereas Deri et al. pro- box installations of modern operating systems. The vide insight on methods for increasing the perfor- operating systems we evaluate are Ubuntu Server mance for packet capturing, the work presented in 10.10, Debian 5.0, FreeBSD 8.1, Fedora 14, and this paper provides only a survey of how modern op- Windows 7. In performing the evaluation, we have erating systems stand-up to packet loss, and makes found that tcpdump on Ubuntu Server and Debian no attempt to increase or decrease performance. 3 Evaluation 100 3.1 Experimental Setup 80 In the following section, we will describe our experimental setup. In addition, we will discuss the 60 datasets that were used for the evaluation, as well Percent as provide some statistics about them. 40 TCP UDP Other Testing platform. To carry out our evalua- 20 tion, we chose a variety of operating systems. Included were Ubuntu Server 10.10, Debian 5.0, 0 HTTP Flash Skype Mixed Fedora 14, FreeBSD 8.1, and Windows 7. Each Dataset operating system was installed on partitioned hard disks spanning across two machines. These Figure 1: Breakdown of UDP and TCP packets for machines contained IntelR CoreTMi7 processors each dataset (2.80Ghz) and contained 8GB of DDR3 memory. Each also had a 1 terabyte SATA hard disk running About 75% of the Mixed dataset were made up at 7,200 RPMs. After the operating systems were of TCP packets while the other 25% percent were installed, no patches or updates were performed. made up of UDP packets. Datasets. For our evaluation, we used a total Distribution of packet lengths. To get a bet- of 4 datasets. These datasets were in the form ter idea of the frequency of packet lengths in each of packet-capture (pcap) files, each containing a dataset, we provide frequency distribution graphs. different type of activity that a user would normally Note that each of these frequency distribution perform on the Internet. Each dataset was generated graphs is binned at every 100th interval. Figures by us and was captured using tcpdump: 2 and 3 show the frequency distribution for the • HTTP dataset. This dataset contained a web HTTP and Flash dataset, respectively. As shown in browsing session. It contained mainly HTML these figures, these two datasets follow a similar and image content. distribution pattern with respect to UDP and TCP packets. In the TCP distribution, it can be seen that • Flash dataset. This dataset strictly contained for both of these datasets, the packet lengths 1518 flash content. The content was gathered while bytes (maximum length of an Ethernet frame) and browsing Youtube and Trance.fm. 66 bytes occur most frequently. Skype dataset. This dataset contained Skype • Figures 4 and 5 show the frequency distribu- Voice-over-IP traffic. tion for the Skype and Mixed dataset, respectively. • Mixed dataset. This dataset was a combi- As mentioned earlier, the Skype dataset is made up nation of the above three datasets. The pro- almost entirely of UDP packets. This is because gram mergecap1 was used to combine these Skype’s protocol is based on UDP. In this dataset, datasets. UDP packets of length 1429 bytes occurred most frequently. The maximum UDP packet lengths Figure 1 displays the breakdown of TCP and for the Skype dataset are noticeably larger than UDP packets for each of the dataset. Most packets the ones seen in HTTP and Flash dataset. These in the HTTP and Flash dataset contained TCP pack- packets likely contain the voice data. It can ets, whereas the Skype dataset consisted almost also be seen from this distribution that there is entirely of UDP packets. Much of the UDP packets a frequency spike in the 0-200 byte range. It is in the HTTP dataset were related to DNS queries. speculated that Skype’s control traffic has packet 2 UDP packets in HTTP dataset UDP packets in Skype dataset Frequency Frequency 0 100 300 500 0 5000 15000 100 200 300 400 500 0 200 400 600 800 1000 1200 1400 Packet length Packet length TCP packets in HTTP dataset TCP packets in Skype dataset Frequency Frequency 0 2000 6000 0 50 100 150 0 500 1000 1500 0 500 1000 1500 Packet length Packet length Figure 2: Frequency distribution of packet lengths Figure 4: Frequency distribution of packet lengths in the HTTP dataset in the Skype dataset UDP packets in Flash dataset UDP packets in Mixed dataset Frequency Frequency 0 20 40 60 0 5000 15000 100 200 300 400 0 200 400 600 800 1000 1200 1400 Packet length Packet length TCP packets in Flash dataset TCP packets in Mixed dataset Frequency Frequency 0 20000 60000 0 20000 60000 0 500 1000 1500 0 500 1000 1500 Packet length Packet length Figure 3: Frequency distribution of packet lengths Figure 5: Frequency distribution of packet lengths in the Flash dataset in the Mixed dataset set in tcpreplay which tells it to transmit the lengths in this range. As shown in Figure 5, pcap file ”as fast as it can.” For each of these bitrate the frequency distribution of the Mixed dataset is intervals, we run 10 rounds of tests and gather a combination of the other frequency distributions. the statistics-output from tcpdump. This output contains information regarding the number of Performance tests. To conduct the perfor- dropped packets, the number of packets captured, tcpdump mance tests on , we set up a mirror port and the number of packets received by the filter. on a Cisco 2950 Gigabit Switch. For each of the Using this information, we define a formula for the tcpdump2 operating systems, we set to listen and packet loss ratio (PLR): capture3 on this mirror port. On another port, we used tcpreplay45 to replay each of the datasets over the network. tcpreplay can be configured NumberOfDroppedPacketsi such that it will replay the pcap file at a given P LRi = NumberOfPacketsReceivedByFilteri bitrate. For our evaluation, we used bitrate intervals of {100Mbps, 200Mbps, ..., 900Mbps, topspeed}. where i is a round from {1-10}. For each 10 topspeed is a command-line switch that can be rounds of tests for each bitrate interval, we calculate 3 the PLR. From these 10 PLRs, we select the median tcpreplay is not the true bitrate at which it value along with its corresponding bitrate interval transfers data. To overcome this discrepancy, and use this information to report our results. The we conducted a small experiment to observe the actual setup for this experiment is described as fol- differences between specified bitrate speeds in lows: tcpreplay and actual bitrate speeds. • Start tcpreplay on looped-mode at a partic- For this experiment, we measured the discrep- ular bitrate interval on one machine. ancy in tcpreplay’s bitrate by using tcpdump. This experiment was done using a single network • Shortly after, start tcpdump(with the -c flag set to 100000 and -s flag set to 1518)67 on the interface on one of the machines described above. tcpdump second machine which is connected to the mir- By using some meta-information that ror port. provides (byte size of captured pcap file, time it took to capture the file), we can use it as a tool • tcpdump is run for 10 rounds at this particu- to test the actual speed it took for the capture to lar bitrate interval, saving the captured packets take place. We explain the steps of the experiment onto disk.