Comparative Analysis of Iptables and Shorewall
Total Page:16
File Type:pdf, Size:1020Kb
COMPARATIVE ANALYSIS O F IPTABLES AND SHOREWA LL Muhammad Zeeshan Ahmad This thesis is presented as a part of Degree of Bachelor of Science in Electrical Engineering Supervisor: Raja M. Khurram Shahzad School of Engineering Internet: www.bth.se/ing Blekinge Institute of Technology Phone: +46 455 38 50 00 371 79 Karlskrona, Sweden Fax: +46 455 38 50 57 “Start by doing what's necessary, then what's possible; and suddenly you are doing the impossible.” Saint Francis ii Abstract The use of internet has increased over the past years. Many users may not have good intentions. Some people use the internet to gain access to the unauthorized information. Although absolute security of information is not possible for any network connected to the Internet however, firewalls make an important contribution to the network security. A firewall is a barrier placed between the network and the outside world to prevent the unwanted and potentially damaging intrusion of the network. This thesis compares the performance of Linux packet filtering firewalls, i.e. iptables and shorewall. The firewall performance testing helps in selecting the right firewall as needed. In addition, it highlights the strength and weakness of each firewall. Both firewalls were tested by using the identical parameters. During the experiments, recommended benchmarking methodology for firewall performance testing is taken into account as described in RFC 3511. The comparison process includes experiments which are performed by using different tools. To validate the effectiveness of firewalls, several performance metrics such as throughput, latency, connection establishment and teardown rate, HTTP transfer rate and system resource consumption are used. The experimental results indicate that the performance of Iptables firewall decreases as compared to shorewall in all the aspects taken into account. All the selected metrics show that large numbers of filtering rules have a negative impact on the performance of both firewalls. However, UDP throughput is not affected by the number of filtering rules. The experimental results also indicate that traffic sent with different packet sizes do not affect the performance of firewalls. Keywords: Linux Iptables, Firewall performance, Comparison of Linux firewalls iii iv Acknowledgements “In the name of Allah, the most Gracious, the most Compassionate” Foremost, I would like to express my sincere gratitude to supervisor Raja Muhammad Khurram Shahzad for his continuous help, support, motivation and guidance during the project. I am thankful to school of engineering at Blekinge Institute of Technology for allowing to use the Network laboratory for the thesis. I am grateful to my parents for their endless love and unconditional support during the studies and life. Finally, I offer regards and blessings to all of those who supported me in the project in any way. Karlskrona 2012 Muhammad Zeeshan Ahmad [email protected] v Table of Contents 1 INTRODUCTION .................................................................................................................. 1 1.1 Aim and Scope .................................................................................................................................................... 2 1.2 Evaluation Method ............................................................................................................................................. 2 1.2.1 Performance Metrics ........................................................................................................................................ 2 1.2.2 Hypotheses ....................................................................................................................................................... 2 1.3 Outline of the Project ......................................................................................................................................... 3 2 BACKGROUND ..................................................................................................................... 4 2.1 Working of a Firewall ........................................................................................................................................ 5 2.1.1 Packet Inspection .............................................................................................................................................. 5 2.2 Types of Firewalls ............................................................................................................................................... 7 2.2.1 Packet Filtering Firewall .................................................................................................................................. 7 2.2.2 Circuit Level Gateways .................................................................................................................................... 7 2.2.3 Application Level Gateways ............................................................................................................................ 8 2.2.4 Stateful Multilayer Inspection Firewall ............................................................................................................ 8 2.3 Linux Iptables ..................................................................................................................................................... 8 2.4 Firewalls Selection .............................................................................................................................................. 8 2.5 Limitations of Firewalls ..................................................................................................................................... 9 2.6 Related Work .................................................................................................................................................... 10 3 METHODOLOGY ............................................................................................................... 11 3.1 Requirements .................................................................................................................................................... 11 3.2 Experimental steps ........................................................................................................................................... 11 3.3 Traffic Classification ........................................................................................................................................ 11 3.3.1 Real-time (Online) Evaluation ........................................................................................................................ 11 3.3.2 Off-line Evaluation ......................................................................................................................................... 11 3.4 Traffic Duration ................................................................................................................................................ 12 vi 3.5 Evaluation Procedure ....................................................................................................................................... 12 3.6 Evaluation Tools ............................................................................................................................................... 13 3.6.1 Netperf ............................................................................................................................................................ 13 3.6.2 Iperf ................................................................................................................................................................ 14 3.6.3 THTTPd.......................................................................................................................................................... 14 3.6.4 HTTPing ......................................................................................................................................................... 14 3.6.5 Nmap .............................................................................................................................................................. 15 3.6.6 Webmin .......................................................................................................................................................... 15 3.6.7 Wireshark ....................................................................................................................................................... 15 3.7 Evaluation Metrics ........................................................................................................................................... 15 3.7.1 Throughput ..................................................................................................................................................... 17 3.7.2 Latency ........................................................................................................................................................... 18 3.7.3 Connection Establishment rate ....................................................................................................................... 19 3.7.4 Connection Teardown Rate ............................................................................................................................ 20 3.7.5 HTTP Transfer Rate ....................................................................................................................................... 20 3.7.6 System Resource Consumption .....................................................................................................................