11.07.2015 Views

A copy of original Thesis in full (pdf file) - SERC

A copy of original Thesis in full (pdf file) - SERC

A copy of original Thesis in full (pdf file) - SERC

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

AN EXTENSION OF MULTI LAYER IPSECFOR SUPPORTING DYNAMIC QOS ANDSECURITY REQUIREMENTSA THESISSubmitted byArnab Kundufor the award <strong>of</strong> the degree<strong>of</strong>MASTER OF SCIENCE (ENGG.)Supercomputer Education and Research CentreIndian Institute <strong>of</strong> ScienceBangaloreFebruary 2010


ACKNOWLEDGEMENTSI express my s<strong>in</strong>cere gratitude to Pr<strong>of</strong>essor N. Balakrishnan for his guidance andspecifically, for his emphasis on systematic approach, details and rigor <strong>in</strong> the process<strong>of</strong> research. I cherish the discussions I had with him and thank him for his advice andall the support throughout my research work.I am grateful to Dr. G. Athithan for his guidance and especially, for his constantencouragement for develop<strong>in</strong>g a deep passion towards research and emphasis on hardwork and rigorous experimentation. I thank him for his efforts <strong>in</strong> improvement <strong>of</strong> mywrit<strong>in</strong>g skills.I would also like to thank the faculty members <strong>of</strong> the <strong>in</strong>stitute with whom I hadfruitful <strong>in</strong>teractions dur<strong>in</strong>g my stay <strong>in</strong> the <strong>in</strong>stitute.I thank Mr. V. S. Mahal<strong>in</strong>gam, Director CAIR, for giv<strong>in</strong>g me the opportunity andallow<strong>in</strong>g me to use the facilities <strong>of</strong> the laboratory to carry out research.I thank the staff <strong>of</strong> the Supercomputer Education and Research Centre (<strong>SERC</strong>)and also the authorities <strong>of</strong> the Indian Institute <strong>of</strong> Science, Bangalore for their timelyhelp.I thank my colleagues <strong>in</strong> CAIR, with special thanks to Anupam for his supportand encouragement.


I am <strong>in</strong>debted to my parents and my wife for the care, affection and love they haveshowered on me and for their concern and support.- Arnab Kunduii


ABSTRACTKeywords: IP Security; Intermediate QoS and security service; Multi Layer IPSec;The IPSec protocol is a standard for provid<strong>in</strong>g confidentiality, <strong>in</strong>tegrity and orig<strong>in</strong>authentication for communications <strong>in</strong> Internet scenario. However, the end-to-end protectionmodel <strong>of</strong> IPSec is <strong>in</strong> direct conflict with <strong>in</strong>termediate routers provid<strong>in</strong>g QoSand other performance enhancement and security related services.The problem isthat these services would not be able to access relevant <strong>in</strong>formation from the upperlayer headers that arrive <strong>full</strong>y encrypted from the source. The Multi Layer IPSec (ML-IPSec) protocol solves this problem partially by provid<strong>in</strong>g different levels <strong>of</strong> securityto different segments <strong>of</strong> IP datagrams. For this purpose, it uses manual configuration<strong>of</strong> security parameters at all <strong>in</strong>termediate nodes.As a consequence, this approachis not suitable for Internet scenario and mobile network<strong>in</strong>g environments, where therequirement <strong>of</strong> prior knowledge <strong>of</strong> the <strong>in</strong>termediate nodes <strong>in</strong>volved can not be metalways. The ML-IPSec also ignores the presence <strong>of</strong> IP datagrams with variable sizeIP and TCP headers, which may be required for the proper work<strong>in</strong>g <strong>of</strong> applicationsat the <strong>in</strong>termediate nodes.In our research, we propose an extension to the ML-IPSec protocol to address these two issues. By add<strong>in</strong>g a dynamic key shar<strong>in</strong>g protocolto the ML-IPSec, access to the upper layer headers is provided at the <strong>in</strong>termediatenodes on need basis. The extension also proposes to use the explicit or implicit headerlength field <strong>in</strong>formation for accommodat<strong>in</strong>g IP datagrams with vary<strong>in</strong>g header lengths.The extended ML-IPSec is implemented <strong>in</strong> the L<strong>in</strong>ux kernel <strong>of</strong> IPSec process<strong>in</strong>g, andexperimental validation <strong>in</strong>volv<strong>in</strong>g standard <strong>in</strong>termediate applications is carried out.


The outcome <strong>of</strong> the experimental validation proves that the proposed extension toML-IPSec, the Dynamic Multi Layer IPSec, provides the functionality <strong>of</strong> on-the-flyshar<strong>in</strong>g <strong>of</strong> the required upper layer <strong>in</strong>formation with the <strong>in</strong>termediate nodes withoutany major overheads on packet size and process<strong>in</strong>g delay.iv


TABLE OF CONTENTSAcknowledgementsAbstractList <strong>of</strong> TablesList <strong>of</strong> FiguresAbbreviationsiiiiviiiixxiii1 INTRODUCTION 11.1 Network Security Services . . . . . . . . . . . . . . . . . . . . . . . . . 21.2 Cryptographic Techniques . . . . . . . . . . . . . . . . . . . . . . . . . 41.3 Network Security and IPSec . . . . . . . . . . . . . . . . . . . . . . . . 51.4 Objectives <strong>of</strong> the <strong>Thesis</strong> . . . . . . . . . . . . . . . . . . . . . . . . . . 91.5 Organization <strong>of</strong> the <strong>Thesis</strong> . . . . . . . . . . . . . . . . . . . . . . . . . 92 COMMUNICATION SECURITY PROTOCOLS 112.1 Layer<strong>in</strong>g at the TCP/IP protocol suite . . . . . . . . . . . . . . . . . . 112.2 Protocol layer<strong>in</strong>g and Communication Security Protocols . . . . . . . . 132.2.1 Application Level Security . . . . . . . . . . . . . . . . . . . . . 152.2.2 End-System level security . . . . . . . . . . . . . . . . . . . . . 162.2.3 Subnetwork Level Security . . . . . . . . . . . . . . . . . . . . . 172.2.4 Direct-L<strong>in</strong>k level security . . . . . . . . . . . . . . . . . . . . . . 182.3 The IPSec protocol suite . . . . . . . . . . . . . . . . . . . . . . . . . . 182.3.1 Security Association and Policies <strong>in</strong> IPSec . . . . . . . . . . . . 192.3.2 Authentication Header (AH) . . . . . . . . . . . . . . . . . . . . 212.3.3 Encapsulat<strong>in</strong>g Security Payload (ESP) . . . . . . . . . . . . . . 24


2.3.4 Mutual Authentication and key shar<strong>in</strong>g . . . . . . . . . . . . . . 272.4 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293 Problem <strong>of</strong> QoS and Network access control with IPSec 313.1 QoS Process<strong>in</strong>g at <strong>in</strong>termediate nodes . . . . . . . . . . . . . . . . . . . 313.2 Security services at <strong>in</strong>termediate nodes . . . . . . . . . . . . . . . . . . 333.3 IPSec and <strong>in</strong>termediate device <strong>in</strong>teroperability . . . . . . . . . . . . . . 343.3.1 Replac<strong>in</strong>g IPSec with a transport-layer security mechanism . . . 343.3.2 Tunnel<strong>in</strong>g one security protocol with<strong>in</strong> another . . . . . . . . . 353.3.3 Us<strong>in</strong>g a transport-friendly ESP format . . . . . . . . . . . . . . 363.3.4 Multi Layer IPSec (ML-IPSec) . . . . . . . . . . . . . . . . . . . 363.4 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 404 An Extension to ML-IPSec protocol - Dynamic Multi Layer IPSec 414.1 Elements <strong>of</strong> DML-IPSec . . . . . . . . . . . . . . . . . . . . . . . . . . 424.1.1 DML-IPSec Zone . . . . . . . . . . . . . . . . . . . . . . . . . . 424.1.2 DML-IPSec Packets . . . . . . . . . . . . . . . . . . . . . . . . . 464.1.3 Security Associations . . . . . . . . . . . . . . . . . . . . . . . . 474.2 The DML-IPSec Protocol . . . . . . . . . . . . . . . . . . . . . . . . . 494.2.1 DML-IPSec Process<strong>in</strong>g . . . . . . . . . . . . . . . . . . . . . . . 494.2.2 Key shar<strong>in</strong>g Protocol . . . . . . . . . . . . . . . . . . . . . . . . 554.2.3 Handl<strong>in</strong>g <strong>of</strong> variable Zone sizes . . . . . . . . . . . . . . . . . . 654.3 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 665 Design and Implementation <strong>of</strong> DML-IPSec <strong>in</strong> L<strong>in</strong>ux Environment 685.1 Implementation aspects <strong>of</strong> basic IPSec . . . . . . . . . . . . . . . . . . 695.1.1 Implementation <strong>of</strong> Protocols . . . . . . . . . . . . . . . . . . . . 695.1.2 User space utility . . . . . . . . . . . . . . . . . . . . . . . . . . 695.2 Implementation <strong>of</strong> the DML-IPSec protocol . . . . . . . . . . . . . . . 71vi


5.2.1 Implementation <strong>of</strong> Zones . . . . . . . . . . . . . . . . . . . . . 715.2.2 Implementation <strong>of</strong> security association . . . . . . . . . . . . . . 725.2.3 Implementation <strong>of</strong> the datagram process<strong>in</strong>g at the endpo<strong>in</strong>ts . 745.2.4 DML-IPSec process<strong>in</strong>g at the <strong>in</strong>termediate nodes . . . . . . . . 755.2.5 Security Databases configuration utility . . . . . . . . . . . . . . 775.2.6 Key Shar<strong>in</strong>g Protocol . . . . . . . . . . . . . . . . . . . . . . . 795.3 Experimental validation <strong>of</strong> the DML-IPSec protocol . . . . . . . . . . . 815.3.1 Test bed setup . . . . . . . . . . . . . . . . . . . . . . . . . . . 845.3.2 Validation with respect to <strong>in</strong>termediate services . . . . . . . . . 845.3.3 Overheads <strong>of</strong> DML-IPSec . . . . . . . . . . . . . . . . . . . . . 935.4 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 986 SUMMARY AND CONCLUSION 1006.1 Contributions <strong>of</strong> the work . . . . . . . . . . . . . . . . . . . . . . . . . 1026.2 Scope for further research . . . . . . . . . . . . . . . . . . . . . . . . . 103Bibliography 104vii


LIST OF TABLES2.1 The four Layers <strong>of</strong> the TCP/IP Protocol Suite . . . . . . . . . . . . . . . . 115.1 Applications, their use and the headers <strong>of</strong> the IP datagram accessed by them 825.2 Work<strong>in</strong>g <strong>of</strong> different <strong>in</strong>termediate application <strong>in</strong> different zone mapp<strong>in</strong>gs . . 835.3 Packet Length Comparisons (Bytes) between IPSec and DML-IPSec withtwo zones for AH and ESP <strong>in</strong> transport and tunnel modes. . . . . . . . . . 945.4 Packet Length Overhead (Bytes) <strong>in</strong> IPSec and DML-IPSec protocol with twozones over standard IP protocol. The numbers <strong>in</strong> square brackets denote them<strong>in</strong> and max values possible for that particular case . . . . . . . . . . . . . 95


LIST OF FIGURES2.1 Process<strong>in</strong>g <strong>of</strong> a HTTP Packet by different layers . . . . . . . . . . . . . . . 132.2 (i) Format <strong>of</strong> AH Header (ii) AH protocol <strong>in</strong> transport mode(iii) AH protocol<strong>in</strong> tunnel mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222.3 IPSec <strong>in</strong> both modes <strong>of</strong> operations: (i) IPSec <strong>in</strong> tunnel mode <strong>of</strong> operationbetween IPSec Gateways Gateway1 and Gateway2. (ii) IPSec <strong>in</strong> transportmode <strong>of</strong> operation between clients C11 and C21. . . . . . . . . . . . . . . . 242.4 (i)ESP Header format (ii)ESP protocol <strong>in</strong> transport mode (ii)ESP protocol<strong>in</strong> tunnel mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253.1 SSL Record Protocol Operation . . . . . . . . . . . . . . . . . . . . . . . 353.2 Zone and Zone map <strong>in</strong> ML-IPSec . . . . . . . . . . . . . . . . . . . . . . 373.3 ML-IPSec Protocol Operation . . . . . . . . . . . . . . . . . . . . . . . . 383.4 ML-IPSec Packet Format (i) Authentication Header (ii) Encapsulat<strong>in</strong>g SecurityPayload . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 394.1 Different zone mapp<strong>in</strong>gs <strong>of</strong> a HTTP Packet . . . . . . . . . . . . . . . . . 444.2 Zone Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 454.3 DML-IPSec Packet Format (i) Authentication Header (ii) Encapsulat<strong>in</strong>g SecurityPayload . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 474.4 Security association for DML-IPSec . . . . . . . . . . . . . . . . . . . . . 484.5 Outbound Process<strong>in</strong>g at DML-IPSec endpo<strong>in</strong>t . . . . . . . . . . . . . . . . 514.6 Inbound Process<strong>in</strong>g at DML-IPSec endpo<strong>in</strong>t . . . . . . . . . . . . . . . . . 534.7 Partial Inbound DML-IPSec Process<strong>in</strong>g at <strong>in</strong>termediate node . . . . . . . . 544.8 Partial Outbound DML-IPSec Process<strong>in</strong>g at <strong>in</strong>termediate node . . . . . . . 55


4.9 Key Shar<strong>in</strong>g Protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . . 564.10 Zone map and Cryptographic message format dur<strong>in</strong>g Key Shar<strong>in</strong>g Protocol . 614.11 Key Shar<strong>in</strong>g Protocol Example . . . . . . . . . . . . . . . . . . . . . . . . 645.1 SPD and SA <strong>in</strong> L<strong>in</strong>ux Implementation <strong>of</strong> IPSec . . . . . . . . . . . . . . . 705.2 Illustration <strong>of</strong> <strong>in</strong>teraction between user space utilities and Kernel . . . . . . 715.3 Zone structure and Zone specific DML-IPSec ESP SA . . . . . . . . . . . 725.4 SPD and SA structures <strong>in</strong> the DML-IPSec . . . . . . . . . . . . . . . . . . 735.5 Illustration <strong>of</strong> <strong>in</strong>teraction between user space utilities and Kernel <strong>in</strong> DML-IPSec 785.6 High level Interaction <strong>of</strong> DML-IPSec implementation . . . . . . . . . . . . 815.7 Test bed Set up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 845.8 ESP packet correspond<strong>in</strong>g to TCP request at the forward<strong>in</strong>g cha<strong>in</strong> <strong>of</strong> firewallat IN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 865.9 Partially decrypted TCP packet correspond<strong>in</strong>g to FTP request at the forward<strong>in</strong>gcha<strong>in</strong> <strong>of</strong> firewall at IN . . . . . . . . . . . . . . . . . . . . . . . . 875.10 ESP packet correspond<strong>in</strong>g to Web request at the forward<strong>in</strong>g cha<strong>in</strong> <strong>of</strong> firewallat IN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 885.11 Partially decrypted TCP packet correspond<strong>in</strong>g to Web request at the forward<strong>in</strong>gcha<strong>in</strong> <strong>of</strong> firewall at IN . . . . . . . . . . . . . . . . . . . . . . . . 885.12 P<strong>in</strong>g Traceroute Output . . . . . . . . . . . . . . . . . . . . . . . . . . . 895.13 Wireshark output for the P<strong>in</strong>g Application on eth1 <strong>in</strong>terface . . . . . . . . 905.14 Layout <strong>of</strong> captured ESP Packet on eth0 <strong>in</strong>terface <strong>of</strong> IN . . . . . . . . . . . 915.15 Layout <strong>of</strong> partially decrypted ESP packet on eth1 <strong>in</strong>terface <strong>of</strong> IN . . . . . . 92x


5.16 RTT <strong>of</strong> p<strong>in</strong>g obta<strong>in</strong>ed <strong>in</strong> different communication scenarios between GW1and GW2. (1) Normal IP communication (2) Native IPSec ESP tunnel mode(3) ML-IPSec ESP tunnel mode without any type I zone (4) ML-IPSec ESPtunnel mode with one type I zone and one type II zone <strong>of</strong> static length (5)DML-IPSec ESP tunnel mode with one type I zone and one type II zone <strong>of</strong>variable length . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 965.17 Comparison <strong>of</strong> RTT <strong>in</strong> presence <strong>of</strong> <strong>in</strong>termediate process<strong>in</strong>g obta<strong>in</strong>ed <strong>in</strong> differentcommunication scenarios between GW1 and GW2. (1) ML-IPSec ESPtunnel mode with one type I zone and one type II zone <strong>of</strong> static length (2)DML-IPSec ESP tunnel mode with one type I zone and one type II zone <strong>of</strong>variable length . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99xi


ABBREVIATIONSIPIPSecTCPTCP/IPUDPICMPIGMPATMHTTPFTPIETFRFCSMIMEPGPTLSMPLSESPAHIKEPEPQoSML-IPSecDML-IPSecOSI- Internet Protocol- Interney Protocol Secutiry- Transmission Control Protocol- Transmission Control Protocol/Internet Protocol- User Datagram Protocol- Internet Control Message Protocol- Internet Group Management Protocol- Asynchronous Transfer Mode- Hyper Text Transfer Protocol- File Transfer Protocol- Internet Eng<strong>in</strong>eer<strong>in</strong>g Task Force- Request For Comments- Secure Multipurpose Internet Mail Extensions- Pretty Good Privacy- Transport Layer Security- Multi Protocol Level Switch<strong>in</strong>g- Encapsulat<strong>in</strong>g Security Payload- Authentication Header- Internet Key Exchange- Performance Enhancement Proxy- Quality <strong>of</strong> Service- Multi layer IPSec- Dynamic Multi Layer IPSec- Open System Interfacexiii


SACSASADSPISPDICVIVRSADESAESCBCISAKMPTF-ESPEOPDHPKI- Security Association- Composite Security Association- Security Association Database- Security Parameter Index- Security Policy Database- Integrity Check Value- Initialization Vector- Rivest Shamir Adleman- Data Encryption Standard- Advanced Encryption Standard- Cipher Block Cha<strong>in</strong><strong>in</strong>g- Internet Security Association and Key Management Protocol- Transport Friendly ESP- End Of Packet- Diffie Hellman- Public Key Infrastructurexiv


CHAPTER 1INTRODUCTIONToday governments, military, corporations, f<strong>in</strong>ancial <strong>in</strong>stitutions and others exchangea great deal <strong>of</strong> confidential <strong>in</strong>formation us<strong>in</strong>g the Internet and Intranets. Protection<strong>of</strong> such confidential <strong>in</strong>formation, ensur<strong>in</strong>g data <strong>in</strong>tegrity and data orig<strong>in</strong> authenticityare <strong>of</strong> paramount importance. The Internet was however <strong>orig<strong>in</strong>al</strong>ly designed forresearch and educational purpose, not for commercial applications [1]. As such, itssecurity relied on mutual trust and openness <strong>of</strong> the users, as well as their understand<strong>in</strong>g<strong>of</strong> conduct considered appropriate on the network. As the Internet grew, the usercommunity expanded, and the exist<strong>in</strong>g security framework was found <strong>in</strong>adequate formodern day applications. This was ma<strong>in</strong>ly due to the lack <strong>of</strong> security services <strong>in</strong> theTCP/IP (Transmission Control Protocol/ Internet Protocol) [2–5] protocol suite. Thebroadcast nature <strong>of</strong> the lower layer protocols, absence <strong>of</strong> authentication mechanism atthe entire TCP/IP protocol suite, lack <strong>of</strong> protection to packet contents and easily predictableTCP sequence numbers <strong>of</strong> some TCP implementations are among the basicsecurity flaws <strong>of</strong> the TCP/IP protocol suite [6–9].In the commercial usage <strong>of</strong> Internet and TCP/IP, these problems manifest themselves<strong>in</strong> a number <strong>of</strong> ways [10] : Eavesdropp<strong>in</strong>g attacks on a network can result <strong>in</strong>the theft <strong>of</strong> private <strong>in</strong>formation such as credit card numbers and customer accountnumbers. Similarly, such attacks can result <strong>in</strong> the theft <strong>of</strong> services normally limitedto subscribers, such as <strong>in</strong>formation-based products. Data modification attacks can beused to modify the contents <strong>of</strong> certa<strong>in</strong> transactions e.g., chang<strong>in</strong>g the payee on anelectronic check or chang<strong>in</strong>g the amount be<strong>in</strong>g transferred to a bank account. Spo<strong>of</strong><strong>in</strong>g1


attacks can be used to enable one party to masquerade as another party. Repudiation<strong>of</strong> transactions can cause major problems with bill<strong>in</strong>g systems and transactionprocess<strong>in</strong>g agreements.1.1 NETWORK SECURITY SERVICESIn due course <strong>of</strong> time, safeguards were brought about to address the security relatedissues due to the <strong>in</strong>herent problems <strong>of</strong> the TCP/IP protocol suite. In the computercommunication context, the ma<strong>in</strong> security safeguards are referred to as security services[11, 12] . There are five generic security services :• Authentication Service: This service provides assurance <strong>of</strong> the identity <strong>of</strong> someentity (a person or a system).In other words, when some entity claims tohave a particular identity, an authentication service will provide a mechanismto validate this claim.Authentication is one <strong>of</strong> the most important securityservices, because all other security services depend upon it to some extent.Authentication is the means <strong>of</strong> counter<strong>in</strong>g the threat <strong>of</strong> masquerade which candirectly lead to compromise <strong>of</strong> any <strong>of</strong> the security objectives.• Access Control Service: This service protects aga<strong>in</strong>st unauthorized use or manipulation<strong>of</strong> resource.Access control is a means <strong>of</strong> enforc<strong>in</strong>g authorization.Access control directly contributes to achiev<strong>in</strong>g the security goals <strong>of</strong> confidentiality,<strong>in</strong>tegrity, availability and legitimate use. Authorization decisions governwhich <strong>in</strong>itiator may access which targets for which purposes and under whatconditions. These decisions are reflected <strong>in</strong> an access control policy. Accessrequests are filtered through an access control mechanism which enforces theaccess control policy. Another aspect <strong>of</strong> access control is prevent<strong>in</strong>g sensitive<strong>in</strong>formation from be<strong>in</strong>g transmitted through environments where it might be atrisk.2


• Confidentiality Service: This service protects aga<strong>in</strong>st <strong>in</strong>formation be<strong>in</strong>g disclosedor revealed to unauthorized entities. Achiev<strong>in</strong>g a confidentiality objectiveideally requires protect<strong>in</strong>g aga<strong>in</strong>st disclosure <strong>of</strong> <strong>in</strong>formation through any <strong>in</strong>formationchannel. In computer communications security, there are two types <strong>of</strong>confidentiality services. A data confidentiality service makes it <strong>in</strong>feasible to deducesensitive <strong>in</strong>formation from the content or size <strong>of</strong> a given data item. A trafficflow confidentiality service makes it <strong>in</strong>feasible to deduce sensitive <strong>in</strong>formationby observ<strong>in</strong>g the traffic flows.• Data Integrity service:This service complements access control service andprotects aga<strong>in</strong>st data be<strong>in</strong>g manipulated without authorization. An importantcharacteristics <strong>of</strong> a data <strong>in</strong>tegrity service is its granularity. There are three importantcases <strong>of</strong> authentication service. The first one, called connection <strong>in</strong>tegrityservice, applies to all data transmitted on a connection. The second one, calledconnectionless <strong>in</strong>tegrity service, applies to all data compris<strong>in</strong>g one connectionlessitem. The third is a selective field <strong>in</strong>tegrity service, which applies only tosome field <strong>of</strong> a data unit.• Non-repudiation: This service protects aga<strong>in</strong>st one party to a communicationexchange later falsely deny<strong>in</strong>g that the exchange occurred. Non-repudiation isfundamentally different from all other security services. Its primary purpose isto protect users <strong>of</strong> communications aga<strong>in</strong>st threats from other legitimate users;rather than from unknown attackers or eavesdroppers. One important po<strong>in</strong>t tonote is that it does not elim<strong>in</strong>ate repudiation. Rather it ensures the availability<strong>of</strong> irrefutable evidence to support the speedy resolution <strong>of</strong> any disagreementrelated to repudiation.A robust security solution for transaction process<strong>in</strong>g should provide all the fivesecurity services. The security services are implemented us<strong>in</strong>g the cryptographic tech-3


niques as described next.1.2 CRYPTOGRAPHIC TECHNIQUESCryptographic techniques, such as encryption and digital signatures, are the build<strong>in</strong>gblocks <strong>in</strong> the implementation <strong>of</strong> all security services [12–15]. The most basic build<strong>in</strong>gblock is called a cryptographic system or cryptosystem. A cryptosystem def<strong>in</strong>es a pair<strong>of</strong> data transformations. The first transformation is applied to an ord<strong>in</strong>ary data item,known as pla<strong>in</strong>text and generates a correspond<strong>in</strong>g un<strong>in</strong>telligible data item called ciphertext.The second transformation, applied to ciphertext, results <strong>in</strong> regeneration <strong>of</strong>the <strong>orig<strong>in</strong>al</strong> pla<strong>in</strong>text. An encryption transformation uses as <strong>in</strong>put both pla<strong>in</strong>text dataand an <strong>in</strong>dependent value known as encryption key. Similarly, the decryption transformationuses a decryption key along with the ciphertext to regenerate the pla<strong>in</strong>text.The transformations are most commonly called encryption and decryption respectively.There are two basic types <strong>of</strong> cryptosystems: symmetric cryptosystems and asymmetriccryptosystems. Symmetric cryptosystems are characterized by the fact that the samekey is used <strong>in</strong> encryption and decryption transformations. In contrast to symmetriccryptosystems, asymmetric cryptosystems use complementary pairs <strong>of</strong> keys for encryptionand decryption transformations. One key, the private key is kept secret like thesecret key <strong>in</strong> a symmetric cryptosystem. The other key, the public key , does not needto be kept secret. This two key approach can simplify key management by m<strong>in</strong>imiz<strong>in</strong>gthe number <strong>of</strong> keys that need to be managed and stored <strong>in</strong> the network. The keydistribution system is also much simpler as it can use unprotected medium for thedistribution <strong>of</strong> the public keys. Data <strong>in</strong>tegrity and/or data orig<strong>in</strong> authentication fora message can be provided as follows. The orig<strong>in</strong>ator <strong>of</strong> the message generates, us<strong>in</strong>gall the data bits <strong>of</strong> the message contents and a secret key, an Integrity Check Valuewhich is transmitted along with the message. The message recipient checks that the4


eceived message content and Integrity Check Values are consistent before accept<strong>in</strong>gthe message. A digital signature can be considered as a special case <strong>of</strong> a IntegrityCheck Value.The digital signature may need to be used to resolve a dispute betweenthe orig<strong>in</strong>ator and recipient <strong>of</strong> a message. Symmetric encryption based or keyedhash algorithm based approach is usually <strong>in</strong>adequate for this purpose. Asymmetriccryptosystems provide more powerful digital signatures.1.3 NETWORK SECURITY AND IPSECIn order to provide the five fundamental security services, a number <strong>of</strong> cryptographicprotocols have been proposed. While these protocols are similar <strong>in</strong> the services theyprovide and <strong>in</strong> the cryptographic techniques they use, they vary <strong>in</strong> the manner <strong>in</strong> whichthey provide the services and <strong>in</strong> their locations with respect to the rest <strong>of</strong> the TCP/IPprotocol stack. The issue <strong>of</strong> where with<strong>in</strong> the protocol stack to provide security iscontentious. Proponents <strong>of</strong> plac<strong>in</strong>g security lower <strong>in</strong> the stack argue that lower-layersecurity solutions can be implemented transparently to end users and application developers.Proponents <strong>of</strong> higher-layer solutions argue that application-layer solutionsallow application-specific security services (e.g., protect<strong>in</strong>g selected fields with<strong>in</strong> a protocol,or <strong>in</strong>dividual methods, as <strong>in</strong> HTTPS) [16].There exist protocols at different layers <strong>of</strong> TCP/IP protocol stack to provide thesesecurity services. Application level encryption viz. PGP [17,18] for secure mail transfer,TLS [19] based VPN for secure TCP communication, IPSec for provid<strong>in</strong>g IP layersecurity [20,21], MPLS based security [22] at data l<strong>in</strong>k layer are among these securitysolutions. Due to scalability and wide acceptance <strong>of</strong> the IP protocol and its application<strong>in</strong>dependent character, the IPSec protocol has become a standard for provid<strong>in</strong>gInternet security.IPSec [20,23,24] provides security services at the IP layer by enabl<strong>in</strong>g a system to5


select required security protocols, determ<strong>in</strong>e the cryptographic algorithms to use forthe services and put <strong>in</strong> place any cryptographic keys required to provide the securityservices. Two protocols are used to provide the security: an authentication protocol designedby Authentication Header (AH) [23] and a comb<strong>in</strong>ed encryption/authenticationprotocol designed by Encapsulat<strong>in</strong>g Security Protocol (ESP) [24]. The AH providesthe follow<strong>in</strong>g security services: Connectionless Integrity, Data Orig<strong>in</strong> Authenticationand Replay Protection. The ESP protocol provides confidentiality <strong>of</strong> data as well as<strong>of</strong> traffic flow on top <strong>of</strong> the services provided by the AH. IPSec also uses a separateprotocol, called Internet Key Exchange (IKE) [25–27] for establish<strong>in</strong>g cryptographicparameters. Both AH and ESP support two modes <strong>of</strong> use : transport and tunnel mode.Transport mode provides security protections for upper layer protocols, whereas tunnelmode provides protection to the entire IP packet. This is achieved by encapsulat<strong>in</strong>gthe entire IP packet <strong>in</strong>side a new IP packet. The cryptographic keys used <strong>in</strong> the IPSecsecurity services are shared only between the IPSec endpo<strong>in</strong>ts. All other <strong>in</strong>termediatenodes <strong>in</strong> a network, whether they are legitimate routers or malicious eavesdroppers canonly see the IP header when encryption is provided through ESP protocol. Even <strong>in</strong>the case <strong>of</strong> AH, the payload <strong>of</strong> IP datagram cannot be tampered by any <strong>in</strong>termediatenode without be<strong>in</strong>g detected at the IPSec endpo<strong>in</strong>t.This end-to-end model <strong>of</strong> security restricts performance enhancement and securityrelated operations <strong>of</strong> many <strong>in</strong>termediate network<strong>in</strong>g and security devices as they can’taccess/modify the <strong>orig<strong>in</strong>al</strong> IP header (<strong>in</strong> case <strong>of</strong> tunnel mode) and upper layer protocolheaders. These <strong>in</strong>termediate devices <strong>in</strong>clude routers provid<strong>in</strong>g Quality <strong>of</strong> Service(QoS), Performance Enhancement Proxies (PEP), Application level Proxy devices,Packet filter<strong>in</strong>g firewalls etc [28, 29].The <strong>in</strong>teroperability problem between IPSec and <strong>in</strong>termediate devices has beenaddressed <strong>in</strong> literature [30].Us<strong>in</strong>g transport layer security (TLS), splitt<strong>in</strong>g s<strong>in</strong>gle6


IPSec tunnel <strong>in</strong>to multiple tunnels, Multi layer IPSec (ML-IPSec) are a few <strong>of</strong> theproposed solutions. We observe that ML-IPSec provides better solution compared toother alternatives as it solves the <strong>in</strong>teroperability issue without violat<strong>in</strong>g the end-toendsecurity paradigm for the data portion, unlike the case <strong>of</strong> splitted tunnel. TheML-IPSec also provides security to the entire IP datagram as opposed to the solutionlike TLS or Transport Friendly ESP (TF-ESP) where some important header fieldsare kept out <strong>of</strong> the scope <strong>of</strong> security services. The ML-IPSec protocol [31,32] providesa novel approach for solv<strong>in</strong>g these <strong>in</strong>teroperability issues.The ML-IPSec protocolpartitions an entire IP packet <strong>in</strong>to multiple zones and provides different security todifferent zones <strong>of</strong> the packet. The cryptographic <strong>in</strong>formation <strong>of</strong> the zones spann<strong>in</strong>gover the upper layer protocol headers are made available to the legitimate <strong>in</strong>termediatenodes for their process<strong>in</strong>g. The cryptographic keys <strong>of</strong> the zones spann<strong>in</strong>g over dataportion are shared only among the ML-IPSec endpo<strong>in</strong>ts, thus reta<strong>in</strong><strong>in</strong>g the end-to-endsecurity <strong>of</strong> <strong>orig<strong>in</strong>al</strong> IPSec protocol for the data portion <strong>of</strong> an IP packet.Though the ML-IPSec protocol works well <strong>in</strong> a closed environment, the requirement<strong>of</strong> shar<strong>in</strong>g security parameters and the requirement <strong>of</strong> prefixed zone sizes becomedifficult <strong>in</strong> large scale networks and <strong>in</strong> distributed environments. The ma<strong>in</strong> issues <strong>of</strong>the ML-IPSec protocol <strong>in</strong> this regard are as follows:1. Rout<strong>in</strong>g <strong>in</strong>frastructure has to be known prior to implementation and use, as eachrouter that requires access to higher layer protocol data will need to be manuallyconfigured before communication can commence. In some cases this will breakthe <strong>in</strong>herent reliability built <strong>in</strong>to the Internet and it will not function correctlyover multiple routes unless the appropriate router <strong>in</strong> each separate route isknown and configured <strong>in</strong> advance. While this may not be a large problem <strong>in</strong>a geo-stationary satellite environment, where the satellite l<strong>in</strong>k term<strong>in</strong>ates ata s<strong>in</strong>gle terrestrial gateway, it could pose problems <strong>in</strong> a mobile or distributed7


environment where many base stations may be <strong>in</strong> use.2. The requirement <strong>of</strong> manual configuration at all the <strong>in</strong>termediate nodes makesthe assumption that ML-IPSec endpo<strong>in</strong>ts have access to and control over the<strong>in</strong>termediate routers that require partial access to the network payload. However,the ML-IPSec endpo<strong>in</strong>ts may not necessarily be trusted by an <strong>in</strong>termediaterouter provid<strong>in</strong>g QoS based service or an <strong>in</strong>termediate security device for manualconfiguration without prior arrangement.3. Security zones are designated as static byte ranges and need to be specifiedbefore communication ever commences.As a result, the exact length <strong>of</strong> theheaders need to be known prior to implementation. ML-IPSec will not functioncorrectly if the end nodes change the use <strong>of</strong> IP or TCP options, as the <strong>of</strong>fsets andlengths <strong>of</strong> the headers will change, caus<strong>in</strong>g the zone mapp<strong>in</strong>g to fail. This willalso be an issue when ML-IPSec is used with multiple clients, each <strong>of</strong> which mayuse different TCP options depend<strong>in</strong>g on the capabilities and configuration <strong>of</strong> theoperat<strong>in</strong>g systems TCP/IP stack. This makes ML-IPSec extremely <strong>in</strong>flexible,particularly when it is used <strong>in</strong> tunnel mode.4. The zone mapp<strong>in</strong>g proposed <strong>in</strong> ML-IPSec is static <strong>in</strong> nature. This forces oneto configure the zone mapp<strong>in</strong>g before the commencement <strong>of</strong> the communication.It restricts the protocol from dynamically chang<strong>in</strong>g the zone mapp<strong>in</strong>g forprovid<strong>in</strong>g access to <strong>in</strong>termediate nodes without term<strong>in</strong>at<strong>in</strong>g the exist<strong>in</strong>g ML-IPSec communication. The ML-IPSec endpo<strong>in</strong>ts can <strong>of</strong>f course, configure thezone mapp<strong>in</strong>g with maximum number <strong>of</strong> zones. This will lead to unnecessaryoverhead that <strong>in</strong>creases with the number <strong>of</strong> zones. Aga<strong>in</strong>, static zone mapp<strong>in</strong>gcould pose problems <strong>in</strong> a mobile or distributed environment, where communicationpaths may change.8


1.4 OBJECTIVES OF THE THESISThis work aims at improv<strong>in</strong>g the ML-IPSec protocol for provid<strong>in</strong>g multilayer IPSeccapabilities without the need <strong>of</strong> static configuration and for IP packets with variablesize header lengths.The thesis first aims at provid<strong>in</strong>g dynamic configurability and cryptographic <strong>in</strong>formationshar<strong>in</strong>g between the IPSec endpo<strong>in</strong>ts and <strong>in</strong>termediate devices. This willenable <strong>in</strong>termediate nodes to access required header portions <strong>of</strong> IPSec packets <strong>of</strong> anexist<strong>in</strong>g IPSec communication on need basis, rather than depend<strong>in</strong>g on the static configurationbefore the commencement <strong>of</strong> the communication. Another aim <strong>of</strong> the thesisis to accommodate TCP/IP packets with variable length headers. Through these enhancements,the thesis aims to address the issues <strong>of</strong> us<strong>in</strong>g ML-IPSec <strong>in</strong> mobile networkenvironments.The scope <strong>of</strong> the work is limited to Internet Protocol Version 4 (IPv4).1.5 ORGANIZATION OF THE THESISChapter 2 gives an overview <strong>of</strong> protocols to provide communication security at differentlayers <strong>of</strong> the TCP/IP protocol suite. It also describes the work<strong>in</strong>g <strong>of</strong> different components<strong>of</strong> the IPSec protocol suite viz. AH, ESP and IKE <strong>in</strong> detail. Chapter 3 providesa study on the <strong>in</strong>teroperability issues between IPSec and <strong>in</strong>termediate devices. It alsodiscusses about different solutions <strong>in</strong>clud<strong>in</strong>g the ML-IPSec protocol proposed <strong>in</strong> theliterature to address these <strong>in</strong>teroperability issues. Chapter 4 presents the extension tothe ML-IPSec protocol, called Dynamic ML-IPSec (DML-IPSec), for provid<strong>in</strong>g multilayer IPSec capabilities with the feature <strong>of</strong> on-the-fly access to upper layer protocolheaders to <strong>in</strong>termediate nodes. Chapter 5 gives the design and implementation details<strong>of</strong> DML-IPSec <strong>in</strong> L<strong>in</strong>ux environment. It also provides experimental validation<strong>of</strong> the protocol. Chapter 6 summarizes the research work carried out as part <strong>of</strong> this9


thesis, highlights the contributions <strong>of</strong> the work and discusses the directions for furtherresearch.10


CHAPTER 2COMMUNICATION SECURITY PROTOCOLSThe TCP/IP protocol was conceived with the primary objective <strong>of</strong> communicationbetween two remote mach<strong>in</strong>es. The security aspects <strong>of</strong> communication became importantmuch later with the growth <strong>of</strong> Internet. As such, the TCP/IP protocol suite doesnot have provisions for the security features like confidentiality, authenticity and data<strong>in</strong>tegrity etc. as part <strong>of</strong> the network standard implementation. Research efforts haveresulted <strong>in</strong> several communication security protocols at different layers <strong>of</strong> the TCP/IPprotocol suite. In this chapter we discuss the different layers <strong>of</strong> the TCP/IP protocolsuite and follow it with a discussion on the communication security protocols at theselayers.2.1 LAYERING AT THE TCP/IP PROTOCOL SUITEThe TCP/IP protocol suite <strong>in</strong>volves a whole family <strong>of</strong> protocols designated to performdifferent tasks and provide services [33]. These protocols belong to different layers <strong>of</strong>the TCP/IP protocol suite. The functionalities <strong>of</strong> the different layers are as follows:Table 2.1: The four Layers <strong>of</strong> the TCP/IP Protocol SuiteApplication Telnet, FTP,HTTP, etc.TransportNetworkL<strong>in</strong>kTCP and UDPIP,ICMP,IGMPEthernet,ATM etc.1. Application layer: It handles the details <strong>of</strong> a particular application. The standardimplementation provides support for different types <strong>of</strong> applications such11


as FTP, HTTP, Telnet and VoIP [34–36].2. Transport layer: It provides end-to-end flow <strong>of</strong> data, for the application layer. Itenables the communication between applications runn<strong>in</strong>g <strong>in</strong> different term<strong>in</strong>alsand provides port numbers to different applications. The TCP and UDP aretwo major transport layer protocols.3. Internet layer: It handles the movement <strong>of</strong> packets around the network. Rout<strong>in</strong>g<strong>of</strong> packets takes place at this layer. It makes the communication among differentnetworks transparent.It allows the transport layer to see a unique virtualnetwork. The ma<strong>in</strong> protocol is IP, although there are other associated protocolsviz. ICMP, IGMP.4. L<strong>in</strong>k layer: It manages the underly<strong>in</strong>g network. This layer is network dependent.The Ethernet, ATM are typical examples <strong>in</strong> this layer.Table 2.1 shows the different protocols present at different layers <strong>of</strong> the TCP/IPprotocol suite. As the scope <strong>of</strong> thesis is restricted to provid<strong>in</strong>g security at IP Layer,only the Internet and Transport layer are relevant to us and are discussed.In the TCP/IP protocol suite, the IP protocol operat<strong>in</strong>g at the network layerprovides unreliable service. That is, it does its best job <strong>of</strong> mov<strong>in</strong>g a packet from itssource to its f<strong>in</strong>al dest<strong>in</strong>ation, but there is no guarantee <strong>of</strong> the successful delivery <strong>of</strong> thepacket [33,37], TCP on the other hand, provides a reliable transport layer service overthe unreliable service <strong>of</strong> IP. The TCP protocol achieves this by perform<strong>in</strong>g timeoutand retransmission, <strong>in</strong> the event <strong>of</strong> the non-receipt <strong>of</strong> a packet with<strong>in</strong> a stipulatedtime [33, 38–42].However, the UDP which is the other important transport layerprotocol <strong>of</strong>fers connectionless and unreliable service.packet.Figure 2.1 depicts the process<strong>in</strong>g <strong>of</strong> different layers <strong>of</strong> TCP/IP stack for a HTTP12


ApplicationDataHTTPHeaderHTTPPayloadApplicationLayerTCPLayerTCPHeaderHTTPHeaderHTTPPayloadIPLayerIP TCP HTTP HTTPHeader Header Header PayloadL<strong>in</strong>kLayerEthernetHeaderIPHeaderTCPHeaderHTTPHeaderHTTPPayloadEthernetTrailerFig. 2.1: Process<strong>in</strong>g <strong>of</strong> a HTTP Packet by different layers2.2 PROTOCOL LAYERING AND COMMUNICATION SECURITY PRO-TOCOLSThe provisions <strong>of</strong> security protocols <strong>in</strong> a layered communication architecture, likeTCP/IP protocol suite, raise some important issues.Protocol layer<strong>in</strong>g results <strong>in</strong>encapsulation <strong>of</strong> one data item with<strong>in</strong> another data item and connection is carriedout <strong>in</strong>side another connection. Hence there are major decisions to be made as to thelayer(s) at which data item or connection-based security should be provided. However,irrespective <strong>of</strong> the level at which the security is provided, the follow<strong>in</strong>g basic servicesare essential:1. Authentication2. Authorization3. Confidentiality4. Integrity13


5. Nonrepudation6. Key managementFrom the communication protocol perspective, we can identify four different levelswhere the requirements <strong>of</strong> dist<strong>in</strong>ct security protocols arise. These four different levelsare listed below.1. Application level: Security protocols are application dependent.2. End-System level : Security protocols provide protection on end-to-end basis.3. Subnetwork level: Security protocols provide protection over a subnetwork whichis considered less trusted.4. Direct-l<strong>in</strong>k level: Security protocols provide protection over each l<strong>in</strong>k separately.The placement <strong>of</strong> security protocols at these different levels depends on severalfactors. In the follow<strong>in</strong>g discussion, we list the major decid<strong>in</strong>g factors for the placement<strong>of</strong> security protocols.• Traffic Multiplex<strong>in</strong>g: The layer<strong>in</strong>g <strong>of</strong> the TCP/IP protocol suite provides multiplex<strong>in</strong>g<strong>of</strong> several higher level services and applications through lesser number<strong>of</strong> lower layer protocols. This traffic multiplex<strong>in</strong>g provides some advantage <strong>in</strong>plac<strong>in</strong>g security protocol at lower layers.• Application dependent Protection: If the security policy is dependent on userspecific<strong>in</strong>formation, provid<strong>in</strong>g security at higher layer is necessary.• Protocol Header Protection: Security protocol at any particular layer can’t providesecurity to it’s lower layer headers. Thus, <strong>in</strong> a scenario, where lower layerheaders carry sensitive <strong>in</strong>formation, plac<strong>in</strong>g the security protection at the lowerlayer is advantageous.14


• Number <strong>of</strong> protection po<strong>in</strong>ts: Plac<strong>in</strong>g security at a very high level (i.e., applicationlevel) requires security to be implemented for every sensitive application<strong>in</strong> the system. Plac<strong>in</strong>g security at the lowest layer (i.e. direct-l<strong>in</strong>k level) requires<strong>in</strong>stallation <strong>of</strong> security at every network l<strong>in</strong>k.Plac<strong>in</strong>g the security atmiddle layer (sub-network level) is a better choice as it requires significantlyless number <strong>of</strong> <strong>in</strong>stallation <strong>of</strong> the security protocol.• Route Knowledge: At a lower layer, more knowledge <strong>of</strong> different l<strong>in</strong>ks and routesare available. In environments, where these <strong>in</strong>formation is useful for decid<strong>in</strong>gon the security requirements, plac<strong>in</strong>g security at lower layer is important.Next, we discuss the properties <strong>of</strong> the communication security protocols at thedifferent levels and the correspond<strong>in</strong>g layer <strong>of</strong> the TCP/IP protocol suite.2.2.1 Application Level SecurityThe application level security provides protection to the application layer <strong>of</strong> the TCP/IPprotocol suite. In many cases, the lower level alternatives provide better solutions withrespect to operational cost or lower number <strong>of</strong> equipment than the application levelsolutions. However, there exists many scenarios where application level security is theonly viable solution.One <strong>of</strong> which is the case, where the security service and thepolicies are application-specific either semantically or by virtue <strong>of</strong> be<strong>in</strong>g built <strong>in</strong>to aparticular application protocol. For example, the security protocol for provid<strong>in</strong>g secure<strong>file</strong> transfer, has to know the complete work<strong>in</strong>g <strong>of</strong> the <strong>file</strong> transfer protocol. Similarly,if a security protocol has to provide security to some particular fields, as <strong>in</strong> the case<strong>of</strong> electronic transaction where the PIN number has to be protected, the knowledge<strong>of</strong> the application is mandatory for the work<strong>in</strong>g <strong>of</strong> the security protocol. Thus thesecurity protocol has to be implemented along with the application itself. Next is thecase, where security services traverse application relays. Here, the application <strong>in</strong>volves15


more than two end systems, as <strong>in</strong> the case <strong>of</strong> secure mail transfer.A mail has totraverse multiple entities before reach<strong>in</strong>g the f<strong>in</strong>al dest<strong>in</strong>ation. The requirement is toprotect only the content <strong>of</strong> the mail while provid<strong>in</strong>g access to protocol headers forproper delivery <strong>of</strong> the mail.There are many popular application layer security protocols. Pretty Good Privacy(PGP),SMIME for secure mail transfer, HTTPS for secure HTTP connectionare among them. In all these application layer security protocols, authenticity andconfidentiality <strong>of</strong> the application layer are ma<strong>in</strong>ta<strong>in</strong>ed.2.2.2 End-System level securityThe end-system level security protocols are required to address the scenario, where theend-systems are trusted but not the underly<strong>in</strong>g network(s) and same security policy isenforced upon all communications <strong>in</strong>volv<strong>in</strong>g a system regardless <strong>of</strong> applications. Thussecurity protections like confidentiality, authenticity can be applied on all traffic <strong>of</strong> thesystem for all applications.One po<strong>in</strong>t to note here is that the end-to-end communication security can beachieved by us<strong>in</strong>g the application level security protocol also. However, the follow<strong>in</strong>gfactors favor an end-system level solution over a comparable application level solution.• The end-system level solution makes security services transparent to the applications.• The end-system level solution provides better performance as it has the abilityto operate on larger data units.Management <strong>of</strong> security facilities, like keymanagement service, can be achieved on per-system basis rather than <strong>in</strong>volv<strong>in</strong>g<strong>in</strong>dividual applications.• The upper layer protocol headers can be protected us<strong>in</strong>g end-system level security.16


In the TCP/IP protocol suite the end-system layer <strong>of</strong> security may be providedeither <strong>in</strong> the TCP layer or <strong>in</strong> the IP layer. The most popular protocol <strong>of</strong> provid<strong>in</strong>gsecurity at the TCP layer is Secure Socket Layer (SSL). The end-system layer securitycan be achieved by the IP layer security protocol, IPSec, also. The transport mode<strong>of</strong> the protocol provides the end-system level security at the IP layer. However, SSLhas ga<strong>in</strong>ed more popularity for provid<strong>in</strong>g end-system level security at the TCP layer.The IPSec protocol suite <strong>in</strong> the tunnel mode <strong>of</strong> operation, has become a standard forprovid<strong>in</strong>g subnetwork layer security.2.2.3 Subnetwork Level SecuritySubnetwork level security provides communication security across one or more specificsubnetworks only, <strong>in</strong> contrast to the end-to-end security. In the follow<strong>in</strong>g discussion,we describe the scenario, where provid<strong>in</strong>g subnetwork level <strong>of</strong> security is advantageousover the other levels <strong>of</strong> security.It is very common that subnetworks close to end-systems are trusted to the samelevel as that <strong>of</strong> the end-systems, because <strong>of</strong> their geographic proximity to the endsystems.Moreover, these sub-networks mostly comes under the same security adm<strong>in</strong>istration<strong>of</strong> the end-systems. This enables one to provide the subnetwork level securityat the boundary between trusted local subnetwork and the less trusted (external) subnetwork(i.e. at the gateway mach<strong>in</strong>es). In any network, the number <strong>of</strong> end-systemsusually far exceeds the number <strong>of</strong> network gateways. Thus provid<strong>in</strong>g the subnetworklevel system security at the gateway mach<strong>in</strong>es reduces the operational cost as well assecurity adm<strong>in</strong>istration related complexities.Subnetwork level <strong>of</strong> security thus has an edge over end-system level security. InTCP/IP protocol suite, subnetwork layer security can be provided at the IP layer us<strong>in</strong>gthe IPSec protocol <strong>in</strong> tunnel mode or at the data l<strong>in</strong>k layer <strong>in</strong> case <strong>of</strong> LAN. However,17


ecause <strong>of</strong> the wide acceptance <strong>of</strong> the IP protocol, IPSec <strong>in</strong> tunnel mode has becomea standard for provid<strong>in</strong>g gateway to gateway communication security [43].2.2.4 Direct-L<strong>in</strong>k level securityThe appropriate scenarios for us<strong>in</strong>g direct-l<strong>in</strong>k level security are those with comparativelyfew untrusted l<strong>in</strong>ks <strong>in</strong> an otherwise trusted network. Provision <strong>of</strong> security atthis level can be transparent to all higher layer protocols. Thus the security solutionis not tied to any communication architecture. (like TCP/IP or OSI or proprietaryprotocols). Hardware security devices can be attached to the communication device<strong>in</strong>terfaces. The ma<strong>in</strong> advantage <strong>of</strong> this solution is speed. However, this solution is notscalable and works well only on dedicated l<strong>in</strong>ks.Direct-l<strong>in</strong>k level security can be provided at the physical layer, mak<strong>in</strong>g the securityprotocol transparent to all upper layer protocols. For example, encryption may beprovided to the bit-streams pass<strong>in</strong>g through <strong>in</strong>terface po<strong>in</strong>ts. Direct-l<strong>in</strong>k level securitymay be provided at the data l<strong>in</strong>k layer also where the protection is provided at theframe level.This model is also useful <strong>in</strong> scenarios where all the mach<strong>in</strong>es are connected viadedicated l<strong>in</strong>ks. If IP network is used <strong>in</strong>stead <strong>of</strong> dedicated secure l<strong>in</strong>ks, direct l<strong>in</strong>klevelsolution at the data l<strong>in</strong>k layer security would not suffice.2.3 THE IPSEC PROTOCOL SUITEThe IPSec provides a standard, robust and extensible mechanism to ensure securityto IP and upper layer protocols. The protection takes the form <strong>of</strong> data <strong>in</strong>tegrity authentication,data confidentiality, anti-replay protection and limited traffic flow confidentiality.As discussed <strong>in</strong> the previous section, IPSec may provide end-system levelsecurity as well as subnetwork level security [44,45]. IPSec supports these two levels <strong>of</strong>18


security by us<strong>in</strong>g two modes <strong>of</strong> operation, i.e., transport and tunnel modes. It providestwo protocols, i.e., Authentication Header (AH) and Encapsulat<strong>in</strong>g Security Payload(ESP) for secur<strong>in</strong>g the IP datagrams. The AH provides data orig<strong>in</strong> authentication,connectionless <strong>in</strong>tegrity and anti replay protection. The ESP provides all the securityfunctionalities <strong>of</strong> AH along with data confidentiality and limited traffic flow confidentiality.The IPSec protocols -AH and ESP- can be used to protect either an entire IPpacket or the upper layer protocols <strong>of</strong> IP payload. In transport mode, IPSec headeris <strong>in</strong>serted between the IP header and the upper layer protocol header to protect theentire upper layer protocol. In tunnel mode, the entire IP datagram to be protected,is encapsulated <strong>in</strong>side a new IP packet and the IPSec header is <strong>in</strong>serted between theouter and <strong>in</strong>ner IP headers. The security services that IPSec provide, require sharedkeys for authentication and encryption. IPSec also provides the functionalities <strong>of</strong> bothmanual and dynamic negotiation <strong>of</strong> security parameters through a key managementprotocol called IKE.2.3.1 Security Association and Policies <strong>in</strong> IPSecBefore discuss<strong>in</strong>g the work<strong>in</strong>g <strong>of</strong> the two IPSec protocols -AH and ESP- we will def<strong>in</strong>esome basic concepts used <strong>in</strong> IPSec protocol suite.A security Association (SA) is a relationship between two end-po<strong>in</strong>ts <strong>of</strong> IPSec communicationthat describes how the entities will use security services to communicatesecurely. A SA consists <strong>of</strong> all the <strong>in</strong>formation needed to characterize and exchange securedcommunication. One po<strong>in</strong>t to note is that SA is an unidirectional relationship.Thus a pair <strong>of</strong> nodes require two separate SA to def<strong>in</strong>e the security relationship <strong>of</strong> theirbi-directional communications. The repository <strong>of</strong> the SAs is named as Security associationdatabase (SAD). A SA <strong>in</strong>cludes various pieces <strong>of</strong> <strong>in</strong>formation that the IPSecprocess<strong>in</strong>g rout<strong>in</strong>es can use to determ<strong>in</strong>e whether the SA can be applied to a particular19


<strong>in</strong>bound or outbound IP datagram. These <strong>in</strong>formation, known as selectors <strong>of</strong> the SAdecide the scope <strong>of</strong> any particular SA. The fields <strong>in</strong> this SA selectors typically <strong>in</strong>cludethe follow<strong>in</strong>g:• Source and Dest<strong>in</strong>ation IP addresses• Name, either a user ID or system name• Transport layer protocol• Source and dest<strong>in</strong>ation portsEach SA also conta<strong>in</strong>s cryptographic <strong>in</strong>formation for the IPSec process<strong>in</strong>g rout<strong>in</strong>esThese <strong>in</strong>formation <strong>in</strong>clude :• Data for provid<strong>in</strong>g authentication protection:authentication algorithm, keydetails etc.• Data for provid<strong>in</strong>g confidentiality protection: encryption algorithm, key, IV etc.• Data for provid<strong>in</strong>g anti-replay protection: sequence number counter, sequencenumber overflow flag, anti-replay counter, anti-replay w<strong>in</strong>dow.• IPSec mode: Tunnel or Transport mode.• SA lifetime: <strong>in</strong> elapsed time or number <strong>of</strong> bytes protected.The <strong>in</strong>bound process<strong>in</strong>g module <strong>of</strong> IPSec uses the SA entries from SAD to protectan IP datagram. When protected IP datagrams are sent, the sender needs to <strong>in</strong>dicatewhich SA was used to encrypt the communication, so the receiver can use the sameSA to decrypt the IPSec protected IP datagram. This is mentioned us<strong>in</strong>g a field calledSecurity Parameter Index (SPI) present at IPSec headers. Thus, the sole responsibility<strong>of</strong> SADB is to determ<strong>in</strong>e the particulars about IPSec header and cryptographicprotections on the outbound IP traffic and decapsulation <strong>of</strong> the <strong>in</strong>com<strong>in</strong>g IPSec packetat the <strong>in</strong>bound traffic.20


Another important database <strong>in</strong> IPSec process<strong>in</strong>g is the Security Policy Database(SPD). The SPD fulfills different roles for outbound and <strong>in</strong>bound process<strong>in</strong>g.Foroutbound traffic, the SPD def<strong>in</strong>es the action to be taken on the outgo<strong>in</strong>g IP datagramwhereas the <strong>in</strong>bound SPD determ<strong>in</strong>es whether the current packet can be accepted bythe receiver mach<strong>in</strong>e or not. Each SPD rule consists <strong>of</strong> one or more selector fields asmentioned <strong>in</strong> the discussion about SA and the action correspond<strong>in</strong>g to the rule.At the outbound process<strong>in</strong>g, the possible actions can be any one <strong>of</strong> the follow<strong>in</strong>g• Drop the packet.• Send out the packet without any protection.• Apply IPSec protection: In this case, SPD conta<strong>in</strong>s an entry to the correspond<strong>in</strong>gSA.In case <strong>of</strong> <strong>in</strong>bound process<strong>in</strong>g, the IPSec rout<strong>in</strong>e first decapsulates the <strong>in</strong>com<strong>in</strong>g IPpacket us<strong>in</strong>g the SA entries selected by the SPI and IP address fields <strong>of</strong> the <strong>in</strong>com<strong>in</strong>gIPSec packet. A record <strong>of</strong> the SAs that were used and the order <strong>in</strong> which they wereapplied is ma<strong>in</strong>ta<strong>in</strong>ed and passed to SPD process<strong>in</strong>g rout<strong>in</strong>e.The SPD process<strong>in</strong>grout<strong>in</strong>e <strong>of</strong> the <strong>in</strong>bound process<strong>in</strong>g ensures that each SA that protected the packet isapplied <strong>in</strong> the proper order. After successful verification, an appropriate rule is appliedto the packet.2.3.2 Authentication Header (AH)The Authentication Header (AH) <strong>of</strong> the IPSec protocol suite provides the follow<strong>in</strong>gtypes <strong>of</strong> protections.• Connectionless Integrity guarantees that the receiver has received the exact messagesent by the sender without any tamper<strong>in</strong>g happen<strong>in</strong>g <strong>in</strong> midway. The wordconnectionless signifies that the protocol does not ensure the orderly delivery <strong>of</strong>the datagram as the IP protocol itself is a state-less protocol.21


• Data Orig<strong>in</strong> Authentication ensures that the message was actually sent by theapparent orig<strong>in</strong>ator <strong>of</strong> the message and not by another user masquerad<strong>in</strong>g asthe <strong>orig<strong>in</strong>al</strong> message orig<strong>in</strong>ator.• Replay Protection ensures that the same packet is not delivered multiple timesand the packets delivered are not grossly out <strong>of</strong> order. This capability must beimplemented at the sender; the receiver may optionally enable its use.Next HeaderPayload len Reserved (set to zero)Security Parameter Index(SPI)Anti−replay sequence numberAuthentication Data(i)IP HeaderOuter IPheader(new)AH HeaderAH HeaderUpper protocol headersand dataAuthenticated FieldsInner IPheader(<strong>orig<strong>in</strong>al</strong>)Authenticated FieldsUpper protocol headersand data(ii)(iii)Fig. 2.2: (i) Format <strong>of</strong> AH Header (ii) AH protocol <strong>in</strong> transport mode(iii) AHprotocol <strong>in</strong> tunnel mode.Figure 2.2 illustrates the AH header format. The header comprises <strong>of</strong> six fields.Five <strong>of</strong> the fields have fixed length, for a total length <strong>of</strong> three 32 bit words; the sixthfield is variable length. The <strong>in</strong>dividual fields are as follows :• Next header is a 8 bit field which <strong>in</strong>dicates the payload that follows the AH [46].• Payload length field is the size <strong>of</strong> the AH header <strong>in</strong> 32 bit words m<strong>in</strong>us 2.• Reserved is a field for future use, currently all the bits are set to 0.• SPI along with the dest<strong>in</strong>ation address <strong>in</strong> the outer IP header is an <strong>in</strong>dex toSA at the receivers end.• Sequence number is a monotonically <strong>in</strong>creas<strong>in</strong>g number that keeps track <strong>of</strong> thenumber <strong>of</strong> messages sent from sender to receiver us<strong>in</strong>g the current SA. It is usedto prevent replay attacks.22


• Authentication data is a variable length field which conta<strong>in</strong>s ICV (<strong>in</strong>tegrity checkvalue) <strong>of</strong> the message contents needed to authenticate the packet. The ICV iscomputed by hash<strong>in</strong>g the contents <strong>of</strong> the message. The mandatory keyed hashalgorithms for IPSec AH are HMAC-MD5 and HMAC-SHA1 [47–51].AH protocol can provide authentication both at end-system level and as well as<strong>in</strong> subnetwork level depend<strong>in</strong>g on the mode <strong>of</strong> operation. AH protocol supports twomodes <strong>of</strong> operations. These modes are as follows:• The transport mode <strong>of</strong> AH provides end-system level security. In this mode <strong>of</strong>operation, the communication endpo<strong>in</strong>ts must be the IPSec endpo<strong>in</strong>ts. The AHheader is <strong>in</strong>serted <strong>in</strong>to the IP datagram by plac<strong>in</strong>g it immediately after the IPheader (and any OPTIONs) and before the next upper layer protocol header.Figure 2.2(ii) illustrates the layout <strong>of</strong> an AH packet <strong>in</strong> transport mode.Asdepicted <strong>in</strong> the figure, the AH protocol provides authentication security overthe entire IP datagram.• The tunnel mode <strong>of</strong> AH provides subnetwork level security.In this mode <strong>of</strong>operation, a security gateway is used to provide protection for multiple hosts ona network. An additional IP header whose source address is that <strong>of</strong> the securitygateway is placed at the beg<strong>in</strong>n<strong>in</strong>g <strong>of</strong> the packet. The address <strong>of</strong> the <strong>orig<strong>in</strong>al</strong> IPheader is kept <strong>in</strong>tact and it becomes part <strong>of</strong> the payload <strong>of</strong> the new IP header.The dest<strong>in</strong>ation IP address <strong>of</strong> the outer IP header is modified to the IP address<strong>of</strong> the dest<strong>in</strong>ation gateway mach<strong>in</strong>e, if the dest<strong>in</strong>ation network is also protectedby a security gateway. Figure 2.2(iii) shows the position <strong>of</strong> the AH header <strong>in</strong>an IP datagram <strong>in</strong> tunnel mode. AH follows the new IP header and precedesthe <strong>orig<strong>in</strong>al</strong> IP header.As shown <strong>in</strong> the figure, AH provides authenticationprotection to the entire IP datagram <strong>in</strong>clud<strong>in</strong>g the new IP header, the AHheader and the <strong>orig<strong>in</strong>al</strong> IP datagram.23


LocalNetworkClient11Client12IPSec IPSec TunnelIPSecGateway 1 Gateway 2PublicNetworkClient21Client22LocalNetworkClient1n(i)Client2mClient11IPSec Transport mode SecurityClient21LocalNetworkPublicRouter 1NetworkRouter 2LocalNetwork(ii)Fig. 2.3: IPSec <strong>in</strong> both modes <strong>of</strong> operations: (i) IPSec <strong>in</strong> tunnel mode <strong>of</strong> operationbetween IPSec Gateways Gateway1 and Gateway2. (ii) IPSec <strong>in</strong> transport mode <strong>of</strong>operation between clients C11 and C21.Fig 2.3 depicts the different network<strong>in</strong>g scenarios where the different modes <strong>of</strong>IPSec protocols can be used for provid<strong>in</strong>g sub-network level and endsystem level <strong>of</strong>security.2.3.3 Encapsulat<strong>in</strong>g Security Payload (ESP)The AH provides several crucial security services to an IP datagram, but it doesnot provide confidentiality to the IP datagram. The Encapsulat<strong>in</strong>g Security Payload(ESP) protocol <strong>of</strong> IPSec provides confidentiality to IP datagram along with the securityprotections <strong>of</strong>fered by AH.The follow<strong>in</strong>g types <strong>of</strong> protection can be provided through the use <strong>of</strong> ESP:• Confidentiality guarantees that the message contents are not available <strong>in</strong> clearto possible eavesdroppers.• Traffic analysis protection (Tunnel mode only) provides the assurance that aneavesdropper cannot determ<strong>in</strong>e the ultimate source and dest<strong>in</strong>ation <strong>in</strong>volved <strong>in</strong>communication.24


The ESP header can also provide the follow<strong>in</strong>g types <strong>of</strong> protections <strong>of</strong>fered by AH:• Connectionless <strong>in</strong>tegrity• Data orig<strong>in</strong> authentication• Replay protectionSecurity Parameters <strong>in</strong>dex(SPI)Anti−replay sequence numberPayload Data (Sepcial unencrypted data + encrypted data)IPHeaderESPHeaderUpper protocol headersand packet dataESPTrailerESPauth dataPadd<strong>in</strong>g (0−2555 bytes)Authentication DataPad lengthNext HeaderEncrypted fieldsAuthenticated fields(ii)(i)OuterIPHeaderESPHeaderInnerIPHeaderUpper protocol headersand packet dataESPTrailerESPauth dataEncrypted fieldsAuthenticated fields(iii)Fig. 2.4: (i)ESP Header format (ii)ESP protocol <strong>in</strong> transport mode (ii)ESP protocol<strong>in</strong> tunnel mode.Figure 2.4(i) illustrates the ESP header format. The header compromises sevenfields, two <strong>of</strong> which are optional. The <strong>in</strong>dividual header fields are as follows:• SPI is the <strong>in</strong>dex <strong>in</strong>to the receivers SA database.• Sequence Number field is the number <strong>of</strong> messages sent from the sender to thereceiver us<strong>in</strong>g the current SA.• Payload Data field is a variable-length field that fulfills the ma<strong>in</strong> purpose <strong>of</strong>ESP header <strong>of</strong> provid<strong>in</strong>g confidentiality. If the IP header is to be provided confidentialityprotection, this field conta<strong>in</strong>s an encrypted version <strong>of</strong> the message’scontents.25


• Padd<strong>in</strong>g is an optional field with a maximum length <strong>of</strong> 255 bytes. Padd<strong>in</strong>g isrequired to ensure that the data’s length is an <strong>in</strong>tegral multiple <strong>of</strong> the encryptionalgorithm. In that case, the effective length <strong>of</strong> the pla<strong>in</strong>text is the sum <strong>of</strong> thelengths <strong>of</strong> the unencrypted data, padd<strong>in</strong>g, the pad length field and the nextheader field.The mandatory encryption algorithms for IPSec ESP are DES-CBC [52] andnull encryption algorithm [53–55]. The later one does not provide encryptionprotection. As ESP must provide at least one <strong>of</strong> authentication and encryption,null encryption algorithm should not be used along with null authenticationalgorithm [56].If the message is to be authenticated, padd<strong>in</strong>g is required to ensure that theauthentication data field beg<strong>in</strong>s on a 4-byte boundary.• Pad length is a one byte field that represents total number <strong>of</strong> bytes <strong>of</strong> padd<strong>in</strong>gconta<strong>in</strong>ed <strong>in</strong> the payload data field.• Next header represents the type <strong>of</strong> header that follows the ESP header.• Authentication data field is an optional field that conta<strong>in</strong>s the ICV, if the packetis to be provided with authentication and <strong>in</strong>tegrity protection.The mandatory keyed hash algorithms for IPSec AH are HMAC-MD5 andHMAC-SHA1 and the null authentication algorithm [50, 51].The ESP header normally consists <strong>of</strong> four parts. These four parts are as follows:1. The <strong>in</strong>itial ESP header portion consists <strong>of</strong> SPI and sequence number.2. The data consists <strong>of</strong> the <strong>orig<strong>in</strong>al</strong> IP packet payload and the <strong>orig<strong>in</strong>al</strong> IP header<strong>in</strong> case <strong>of</strong> tunnel mode.3. The ESP trailer consists <strong>of</strong> padd<strong>in</strong>g, if any, pad length and the next headerfield.26


4. The ESP authentication data consists <strong>of</strong> the authentication data, if any.The ESP header can also be used <strong>in</strong> either transport mode or tunnel mode similar tothe AH protocol . Figure 2.4 (ii) and (iii) illustrates the placement <strong>of</strong> the differentportions <strong>of</strong> ESP header <strong>in</strong> both modes.2.3.4 Mutual Authentication and key shar<strong>in</strong>gIPSec uses a separate protocol called Internet Key Shar<strong>in</strong>g (IKE) for provid<strong>in</strong>g keyshar<strong>in</strong>g after mutual authentication among the peers [25–27,57]. The ma<strong>in</strong> goal <strong>of</strong> IKEis to negotiate an IPSec SA with a peer. That is accomplished through a two-phaseprotocol. Phase 1 establishes an Internet Security Association and Key ManagementProtocol (ISAKMP) SA which is a secure channel through which the actual IPSec SAnegotiation can take place. Phase 2 negotiates a pair <strong>of</strong> one-way SAs: one for <strong>in</strong>boundand another for outbound communications.1. IKE Phase 1:ISAKMPThe establishment <strong>of</strong> the ISAKMP SA can be accomplished through the completion<strong>of</strong> one <strong>of</strong> several different phase 1 exchanges, also referred to as modes:Ma<strong>in</strong> Mode, Aggressive Mode and Base Mode. A phase 1 exchange has threegoals.• To negotiate security parameters: The <strong>in</strong>itiator and the responder <strong>of</strong> Phase1 <strong>of</strong> IKE must agree on the the values and sett<strong>in</strong>gs <strong>of</strong> the security parametersthat will govern the phase 2 communication. They also must negotiate,which authentication method would be used to authenticate the peers.• To authenticate identities: The peers authenticate each others identitybased on some additional <strong>in</strong>formation.27


• To establish a shared secret: Once the peers have agreed on the methodsand the parameters to be used to generate phase 1 shared secret, anexchange <strong>of</strong> message transfer is used to generate the shared secret.Three authentication methods are used <strong>in</strong> IKE: preshared secret key, digitalsignature and public key encryption. Any one <strong>of</strong> these three methods is used<strong>in</strong> the phase 1 <strong>of</strong> the IKE to authenticate peers. Preshared secret key authenticationrelies on <strong>in</strong>formation (the preshared secret) shared between the IKEorig<strong>in</strong>ator and responder. The other two authentication methods require eachpair to posses its public-private key pair.The negotiation <strong>of</strong> security parameters is achieved by send<strong>in</strong>g possible securityproposals from the <strong>in</strong>itiator, and the receiver acknowledges the selected proposalas counter-proposal message. In phase 1, the <strong>in</strong>itiator proposes one or more alternativecollection <strong>of</strong> attributes. This takes the form <strong>of</strong> a s<strong>in</strong>gle SA payload,conta<strong>in</strong><strong>in</strong>g a s<strong>in</strong>gle proposal, which <strong>in</strong> turn conta<strong>in</strong>s one or more transformationpayloads. Each transformation payload def<strong>in</strong>es the exact algorithm details. Theresponder selects one <strong>of</strong> the proposal and sends that proposal back to the sender.This chosen proposal becomes the basis <strong>of</strong> ISAKMP negotiation. The attributesthat are open to negotiate are the follow<strong>in</strong>g: Encryption algorithm, Hash algorithm,Authentication method, Group description type, Keyed pseudo-randomfunction and Life duration.The above mentioned functionalities i.e. Authentication <strong>of</strong> peers and negotiation<strong>of</strong> security parameters are accomplished through the completion <strong>of</strong> one <strong>of</strong> severaldifferent phase 1 modes.2. The phase 2 <strong>of</strong> IKE: Quick ModeOnce the phase 1 negotiation is complete, an ISAKMP SA, which is a pro-28


tected channel, is established between the pairs. The phase 2 exchange uses thisISAKMP SA to negotiate IPSec SA. The only phase 2 IKE exchange that hasbeen def<strong>in</strong>ed so far is Quick mode. The phase 2 quick mode has the follow<strong>in</strong>ggoals:• To negotiate security parameters. The <strong>in</strong>itiator and the responder mustagree on the values and sett<strong>in</strong>gs <strong>of</strong> security parameters that will govern theoperation <strong>of</strong> the negotiated IPSec SA.• To prevent replay <strong>of</strong> phase 2 negotiations.• To generate key<strong>in</strong>g materials for the IPSec SA.A phase 2 Quick mode exchange consists <strong>of</strong> three messages. The first two proposalsare the proposal from the <strong>in</strong>itiator and counter-proposal from responderrespectively, similar to phase 1 <strong>of</strong> IKE. These two exchanges negotiate the IPSecSAs policy and parameters and generate key<strong>in</strong>g material <strong>in</strong> an authenticatedmanner that protects aga<strong>in</strong>st a replay <strong>of</strong> a previous negotiation.The last message, from the <strong>in</strong>itiator to the responder, concludes the exchangeand reassures the responder that the responders proposal was received.2.4 SUMMARYIn this chapter, we have described different layers <strong>of</strong> the TCP/IP protocol suite and thefunction<strong>in</strong>g <strong>of</strong> the <strong>in</strong>dividual layers. We have also discussed about the four differentlevels <strong>of</strong> security protocols along with the scenarios, where these security protocolsmay be implemented.We then discuss about communication security protocols atdifferent layers <strong>of</strong> he TCP/IP protocol suite. We observe that security protocols atdifferent levels and layers <strong>of</strong> the TCP/IP protocol suite have their own advantages anddisadvantages. The level at which the security is to be provided should be judiciously29


decided based on these considerations.Next, we review the IPSec protocol suite. We have described the security databaseorganization and their role towards the IPSec process<strong>in</strong>g.IPSec protocols (AH and ESP) def<strong>in</strong>ition and process<strong>in</strong>g.a brief discussion on the Internet Key Exchange protocol.We have expla<strong>in</strong>ed theWe have also presentedWe observe that IPSecprovides several security protection to IP datagrams. However, the encapsulation <strong>of</strong>upper layer protocol headers viz., transport, application layer headers and even the<strong>orig<strong>in</strong>al</strong> IP header <strong>in</strong> case <strong>of</strong> tunnel mode, restricts several <strong>in</strong>termediate devices fromperform<strong>in</strong>g QoS and security related process<strong>in</strong>g. In the next chapter, we discuss the<strong>in</strong>teroperability issue between IPSec protocol and QoS and security related process<strong>in</strong>gat <strong>in</strong>termediate devices.30


CHAPTER 3Problem <strong>of</strong> QoS and Network access control with IPSecThe IPSec protocol suite has become a standard for provid<strong>in</strong>g security services forInternet communications. It protects the entire IP datagram, so that no <strong>in</strong>termediatenetwork node <strong>in</strong> the public Internet can access or modify any <strong>in</strong>formation above the IPlayer <strong>in</strong> an IPSec-protected packet. However, recent advances <strong>in</strong> Internet technologyhave <strong>in</strong>troduced a rich new set <strong>of</strong> services and applications, like traffic eng<strong>in</strong>eer<strong>in</strong>g, TCPperformance enhancements, transparent proxy<strong>in</strong>g and cach<strong>in</strong>g, all <strong>of</strong> which require<strong>in</strong>termediate network nodes to access certa<strong>in</strong> parts <strong>of</strong> an IP datagram, usually theupper layer protocol <strong>in</strong>formation. This access is required to perform flow classification,constra<strong>in</strong>t-based rout<strong>in</strong>g, or other customized process<strong>in</strong>g. Some security devices toorequire access to transport and upper layer headers for provid<strong>in</strong>g traffic analysis andfirewall<strong>in</strong>g capabilities. This is <strong>in</strong> direct conflict with the IPSec mechanisms.3.1 QOS PROCESSING AT INTERMEDIATE NODESFundamentally, end-to-end protection model <strong>of</strong> IPSec and its strict layer<strong>in</strong>g pr<strong>in</strong>cipleare unsuitable for an emerg<strong>in</strong>g class <strong>of</strong> new network<strong>in</strong>g services and applications.Unlike <strong>in</strong> the traditional Internet, <strong>in</strong>termediate routers are beg<strong>in</strong>n<strong>in</strong>g to play moreand more active roles. They <strong>of</strong>ten rely on some <strong>in</strong>formation about the IP datagrampayload, such as certa<strong>in</strong> upper layer protocol header fields, to make <strong>in</strong>telligent rout<strong>in</strong>gdecisions. In other words, routers have need to participate <strong>in</strong> the process<strong>in</strong>g <strong>of</strong>layers above IP. In this regard, we discuss several <strong>in</strong>termediate applications used forprovid<strong>in</strong>g Quality <strong>of</strong> Service.31


• Traffic Eng<strong>in</strong>eer<strong>in</strong>gThe flow <strong>in</strong>formation <strong>in</strong> IPv4 is encoded <strong>in</strong> both the IP header and the upperlayerprotocol headers, such as TCP or UDP port numbers.Therefore, anymechanism that discrim<strong>in</strong>ates between flows <strong>in</strong>side the network (generally calledflow classification) will need to access the upper-layer protocol headers. If thisis done <strong>in</strong>side the network (as opposed to classification at end-po<strong>in</strong>ts), it maypotentially conflict with IPSec. Flow classification is essential <strong>in</strong> provid<strong>in</strong>g richclasses <strong>of</strong> services and quality-<strong>of</strong>-service (QoS) support.These <strong>in</strong>clude flowbasedand class-based queu<strong>in</strong>g, random early detection (RED), router-basedcongestion control and polic<strong>in</strong>g, <strong>in</strong>tegrated services [resource reservation protocol(RSVP)] and differentiated services [multi protocol level switch<strong>in</strong>g (MPLS)],etc [58–60].• Application-Layer ProxiesSome Internet routers can provide application-layer services for performancega<strong>in</strong>s. For example, an <strong>in</strong>termediate router can become a transparent web proxywhen it snoops through the TCP and HTTP header <strong>of</strong> an IP datagram todeterm<strong>in</strong>e the web page request, and serve it with the web page from the localcache. It is transparent to end-users but boosts the responsiveness, because thedelivery paths for web request and data between the <strong>in</strong>termediate router andthe web site server are elim<strong>in</strong>ated.• Transport-aware l<strong>in</strong>k layer mechanismsInternet has accommodated a very wide range <strong>of</strong> l<strong>in</strong>k technologies, but certa<strong>in</strong>transport protocols like TCP have not achieved optimal performance, when operatedover a path that <strong>in</strong>cludes lossy wireless l<strong>in</strong>ks or long-delay satellite l<strong>in</strong>ks.For example, to significantly improve the TCP performance over a wireless l<strong>in</strong>k,32


the base station at the lossy l<strong>in</strong>k must be aware <strong>of</strong> the TCP state <strong>in</strong>formation <strong>in</strong>each pass<strong>in</strong>g flow, and deliberately delay or drop certa<strong>in</strong> types <strong>of</strong> TCP packets.Such l<strong>in</strong>k-layer mechanisms for TCP performance improvement (<strong>of</strong>ten referredto as TCP Performance Enhanc<strong>in</strong>g Proxies or TCP-PEP) require <strong>in</strong>termediatenodes to access and sometimes modify the upper layer protocol headers [61–64].3.2 SECURITY SERVICES AT INTERMEDIATE NODESThe <strong>in</strong>termediate nodes not only provide services for improv<strong>in</strong>g the overall performance<strong>of</strong> the communication, they also perform several security related functionalities. These<strong>in</strong>cludes traffic analysis, access control through firewall<strong>in</strong>g etc [65].Network eng<strong>in</strong>eers and adm<strong>in</strong>istrators <strong>of</strong>ten need the ability to monitor and analyzetraffic from a network to perform a variety <strong>of</strong> tasks like diagnosis, <strong>in</strong>trusiondetections, firewall<strong>in</strong>g etc. These tasks <strong>of</strong>ten require the ability to access upper-layerprotocol headers with<strong>in</strong> packets, but the advocated proliferation <strong>of</strong> IPSec encryptioncan prevent such analysis, or limit its granularity (for example, <strong>in</strong>dividual nodes orflows are <strong>in</strong>separable <strong>in</strong> an IPSec tunnel between two gateways). The fact that suchanalysis is both necessary and essential means that we should f<strong>in</strong>d a way <strong>of</strong> accommodat<strong>in</strong>gits prerequisites.In case <strong>of</strong> provid<strong>in</strong>g firewall service for controll<strong>in</strong>g network access, the firewallmay require to access transport layer and application layer headers depend<strong>in</strong>g on thesecurity policy.For example, for provid<strong>in</strong>g stateful firewall, access to TCP headeris required, and application level firewalls require access to application layer protocolheaders.The end-to-end security <strong>of</strong> IPSec restricts the access to the upper layerheaders <strong>in</strong> these cases too.33


3.3 IPSEC AND INTERMEDIATE DEVICE INTEROPERABILITYOver the last decade or more, researchers have proposed many solutions to address theissue <strong>of</strong> <strong>in</strong>teroperability between IPSec and several <strong>in</strong>termediate devices required forprovid<strong>in</strong>g QoS or Security services. In this section, we describe some <strong>of</strong> the relevantsolutions.3.3.1 Replac<strong>in</strong>g IPSec with a transport-layer security mechanismThis approach uses a transport-layer security mechanism as an alternative to IPSec toprovide security services. The transport-layer mechanism such as secure socket layer(SSL) or transport layer security (TLS) operates above TCP payload.SSL is not a s<strong>in</strong>gle protocol, rather two layers <strong>of</strong> protocols.The SSL RecordProtocol provides security to TCP payload. Three higher layer protocols, i.e., SSLhandshake protocol, SSL change cipher spec protocol and SSL alert protocol are used<strong>in</strong> the management <strong>of</strong> SSL exchanges. The SSL Record Protocol provides the follow<strong>in</strong>gsecurity services to the TCP payload:Confidentiality: The handshake protocols def<strong>in</strong>e a shared secret key that is usedfor encryption <strong>of</strong> TCP payload us<strong>in</strong>g symmetric key cryptographic algorithm.Message Identity: The handshake protocols also def<strong>in</strong>e a shared secret key that isused to form a keyed message authentication code <strong>of</strong> the TCP payload data.Figure 3.1 depicts the overall operation <strong>of</strong> the SSL Record Protocol. The Recordprotocol takes an application message, fragments the data <strong>in</strong>to blocks, compresses thedata, applies MAC, encrypts, adds SSL record header and transmits the result<strong>in</strong>g unit<strong>in</strong> a TCP segment. Received data are decrypted, verified, decompressed, reassembledand delivered to the application level.SSL encrypts the TCP data while leav<strong>in</strong>g the TCP header <strong>in</strong> unencrypted andunauthenticated form so that <strong>in</strong>termediate nodes can make use <strong>of</strong> the TCP state <strong>in</strong>-34


Application DataFragmentCompressADD MAC¢¡¢¡¢¡¢¢¡¢Encrypt£¡£¡£¡£¡£ ¤¡¤¡¤¡¤¡¤¤¡¤¡¤¡¤¡¤ £¡£¡£¡£¡£¤¡¤¡¤¡¤¡¤ £¡£¡£¡£¡£Add SSL RecordHeader¥¡¥¡¥¡¥¡¥ ¦¡¦¡¦¡¦¡¦¦¡¦¡¦¡¦¡¦ ¥¡¥¡¥¡¥¡¥¦¡¦¡¦¡¦¡¦ ¥¡¥¡¥¡¥¡¥¦¡¦¡¦¡¦¡¦ ¥¡¥¡¥¡¥¡¥Fig. 3.1: SSL Record Protocol Operationformation encoded <strong>in</strong> the TCP header. In fact, many Internet applications alreadyimplement security with SSL or TLS, such as most web browsers (us<strong>in</strong>g HTTPS protocol)and mail programs (us<strong>in</strong>g SIMAP and SPOP). However, lett<strong>in</strong>g the entire TCPheader appear <strong>in</strong> clear text exposes several vulnerabilities <strong>of</strong> the TCP session to avariety <strong>of</strong> TCP protocol attacks (<strong>in</strong> particular traffic analysis), because the identity<strong>of</strong> sender and receiver are now visible without confidentiality protection.Further,SSL/TLS works only on TCP, and not on user datagram protocol (UDP), thus, therange <strong>of</strong> applications supported is smaller than with IPSec [66].3.3.2 Tunnel<strong>in</strong>g one security protocol with<strong>in</strong> anotherAnother solution for <strong>in</strong>teroperability advocates for tunnel<strong>in</strong>g one security protocol<strong>in</strong>side another. This solution proposes to use some transport layer security protocol (forexample SSL/TLS) for provid<strong>in</strong>g end-to-end security <strong>of</strong> the transport layer payload.The transport layer header can be protected us<strong>in</strong>g IPSec protocol <strong>in</strong> tunnel mode. Thecryptographic parameters used <strong>in</strong> IPSec protection can be shared with the <strong>in</strong>termediatenodes for their process<strong>in</strong>g keep<strong>in</strong>g the cryptographic parameters used <strong>in</strong> SSL/TLS35


secret between the endpo<strong>in</strong>ts only.However, the IPSec protocol not only encryptsthe transport layer header but also the entire transport layer payload.Thus thetransport layer payload gets encrypted twice. Moreover, the <strong>in</strong>termediate nodes requireto decrypt/encrypt the entire IP datagram just to access the transport layer headersresult<strong>in</strong>g <strong>in</strong> unnecessary overheads.3.3.3 Us<strong>in</strong>g a transport-friendly ESP formatThe Transport-Friendly-ESP (TF-ESP) proposed by Bellov<strong>in</strong> [67] modifies the <strong>orig<strong>in</strong>al</strong>ESP packet format to <strong>in</strong>clude limited TCP state <strong>in</strong>formation, such as flow identificationand sequence numbers, <strong>in</strong> a disclosure header outside the scope <strong>of</strong> encryption (butauthenticated). This approach works well for some TCP PEP mechanisms which donot require any write access on TCP header fields but fails <strong>in</strong> other cases. Further,the unencrypted TCP state <strong>in</strong>formation is made available universally, even to untrustworthynodes, which creates vulnerabilities for possible attacks. In addition, TF-ESPis not flexible enough to support all upper-layer protocols.3.3.4 Multi Layer IPSec (ML-IPSec)The ML-IPSec [30,32] uses a multilayer protection model <strong>in</strong> place <strong>of</strong> a s<strong>in</strong>gle end-to-endmodel. Unlike IPSec where the scope <strong>of</strong> encryption and authentication applies to theentire IP datagram, this scheme divides the IP datagram <strong>in</strong>to zones. It applies differentprotection schemes to different zones. Each zone has a set <strong>of</strong> security associations, aset <strong>of</strong> private keys that are not shared with other zones, and a set <strong>of</strong> access controlrules def<strong>in</strong><strong>in</strong>g which nodes <strong>in</strong> the network path have access to the zone.A zone is any portion <strong>of</strong> an IP datagram under the same security protectionscheme. The granularity <strong>of</strong> a zone is one octet. The entire IP datagram is partitioned<strong>in</strong>to non-overlapp<strong>in</strong>g zones, except for the IP header <strong>in</strong> the transport mode. A zone36


IP DatagramZone 1(2 Sub Zones)Zone 2(2 Sub Zones)Zone 3( Sub Zone)Fig. 3.2: Zone and Zone map <strong>in</strong> ML-IPSecneed not be a contiguous block <strong>in</strong> an IP datagram, but each contiguous block is calleda sub-zone. A zone map is a mapp<strong>in</strong>g relationship from octets <strong>of</strong> the IP datagram tothe associated zones for each octet. There are some important po<strong>in</strong>ts to note aboutthe zone def<strong>in</strong>ition <strong>of</strong> ML-IPSec.• The ML-IPSec zone map is static for the entire lifespan <strong>of</strong> the ML-IPSec communication.It can not be reorganized to provide service to some new <strong>in</strong>termediatenode.• The ML-IPSec zones are specified on physical byte level. Thus the accommodation<strong>of</strong> TCP/IP datagrams with variable size OPTION field is not possible.Figure 3.2 depicts a sample zone map <strong>of</strong> an IP datagram with three zones.The ML-IPSec redef<strong>in</strong>es the concept <strong>of</strong> security association <strong>of</strong> standard IPSec protocolas the <strong>in</strong>termediate nodes participate <strong>in</strong> def<strong>in</strong><strong>in</strong>g the security parameters fordifferent zones. It uses a s<strong>in</strong>gle SA for each <strong>of</strong> the zones and f<strong>in</strong>ally a composite SA(CSA) is derived for the protection <strong>of</strong> any IP datagram. The protocol uses manualmechanism for establish<strong>in</strong>g these SAs before the commencement <strong>of</strong> DML-IPSec communication.Another import po<strong>in</strong>t to note is that these SAs rema<strong>in</strong> constant for theentire lifespan <strong>of</strong> the communication.When ML-IPSec protects a traffic stream from its source to its dest<strong>in</strong>ation, itfirst partitions the IP datagram <strong>in</strong>to zones and applies zone-specific cryptographic37


Senderany node TCP PEP node any node RecevierIPHdrESPHdrIPHdrESPHdrIPHdrESPHdrIPHdrZone1IPHdrZone1IPHdrTCPHdrTCPHdrTCPHdrTCPdataZone2 Zone2 Zone2TCPdataFig. 3.3: ML-IPSec Protocol Operationprotections. When the ML-IPSec protected datagram flows through an authorized <strong>in</strong>termediategateway, a certa<strong>in</strong> zone <strong>of</strong> the datagram may be decrypted and/or modifiedand re-encrypted, but the other zones will not be compromised. When the datagramreaches its dest<strong>in</strong>ation, the ML-IPSec will be able to reconstruct the entire datagram.Fig 3.3 depicts the operation <strong>of</strong> ML-IPSec protocol. The IP datagram is protected <strong>in</strong>tunnel mode <strong>of</strong> operation. The <strong>orig<strong>in</strong>al</strong> IP header and TCP header constitutes the firstzone and the cryptographic <strong>in</strong>formation for this zone is shared between the ML-IPSecendpo<strong>in</strong>ts and <strong>in</strong>termediate nodes, TCP PEP agents here. The other zone is spannedover TCP payload and secured <strong>in</strong> end-to-end manner between ML-IPSec endpo<strong>in</strong>ts.The same security protocols, AH and ESP, are used <strong>in</strong> ML-IPSec with relevantchanges to support multiple zones. Both AH and ESP support transport mode andtunnel mode <strong>of</strong> operation. In case <strong>of</strong> AH, the authentication header is further dividedto conta<strong>in</strong> zone specific authentication <strong>in</strong>formation. In case <strong>of</strong> ESP, the payload portionis divided <strong>in</strong>to zones. Each zone is encrypted separately after padd<strong>in</strong>g (if required).F<strong>in</strong>ally the authentication trailers <strong>of</strong> all the zones are appended after the last encryptedzone. Figure 3.4 describes the format for both the headers for a case <strong>in</strong> which the ML-IPSec protocol <strong>in</strong>volves three zones.38


Nxt Hdr Payload Len ReserveredSecurity Parameter Index (SPI)Sequence NumberAuthentication Data for zone 1Authentication Data for zone 2Authentication Data zone 3(i)Security Parameter Index (SPI)Sequence NumberEncrypted Payload for zone 1(Variable length)PadPad Length Next HeaderEncrypted Payload for zone 2(Variable length)PadPad LengthEncrypted Payload for zone 3(Variable length)Pad Pad LengthAuthentication Trailer for zone 1Authentication Trailer for zone 2Authentication Trailer for zone 3Fig. 3.4: ML-IPSec Packet Format (i) Authentication Header (ii) Encapsulat<strong>in</strong>gSecurity PayloadThe ML-IPSec protocol works well <strong>in</strong> a closed environment; however the protocolsuffers from the follow<strong>in</strong>g deficiencies [68]:(ii)• The ML-IPSec requires complete knowledge about all <strong>in</strong>termediate routers beforethe commencement <strong>of</strong> the communication. This can pose problems <strong>in</strong> Internetscenarios and also <strong>in</strong> mobile network<strong>in</strong>g environments.• All the <strong>in</strong>termediate routers need to be manually configured for ML-IPSec zonesand cryptographic <strong>in</strong>formation. This requirement causes scalability problems forthe deployment <strong>of</strong> the ML-IPSec solution.• Security zones are designated as static byte ranges and need to be specifiedbefore communication commences. As a result, the exact length <strong>of</strong> the headersneed to be known prior to implementation. The ML-IPSec will not functioncorrectly if the end nodes change IP or TCP option fields.• The static zone mapp<strong>in</strong>g <strong>of</strong> ML-IPSec forces one to configure the zone mapp<strong>in</strong>gbefore the commencement <strong>of</strong> the communication. It restricts the protocol from39


dynamically chang<strong>in</strong>g the zone mapp<strong>in</strong>g for provid<strong>in</strong>g access to new <strong>in</strong>termediatenodes without term<strong>in</strong>at<strong>in</strong>g the exist<strong>in</strong>g ML-IPSec communication.3.4 SUMMARYIn this chapter we have discussed the <strong>in</strong>teroperability issues between several <strong>in</strong>termediatenodes and IPSec protocols. We also described the possible solutions proposed <strong>in</strong>the literature to address the issues. We observe that the ML-IPSec protocol providesa novel solution <strong>of</strong> provid<strong>in</strong>g multi layer security to an IP datagram. This approachsolves the issue <strong>of</strong> the access to the upper layer headers to <strong>in</strong>termediate nodes. However,the manual key shar<strong>in</strong>g mechanism and static zone mapp<strong>in</strong>g <strong>of</strong> the protocol givesrise to some important issues with respect to scalability <strong>of</strong> the solution. In the nextchapter, we describe our extension to the ML-IPSec protocol, called DML-IPSec toaddress all these issues.40


CHAPTER 4An Extension to ML-IPSec protocol - Dynamic Multi LayerIPSecThe IPSec protocol was designed for provid<strong>in</strong>g security for communications over theIP layer primarily between two end-po<strong>in</strong>ts. Over time, the protocol had to address theissue <strong>of</strong> giv<strong>in</strong>g access to upper layer protocol headers at <strong>in</strong>termediate nodes while protect<strong>in</strong>gthe communication between end-po<strong>in</strong>ts. The ML-IPSec protocol was proposedfor resolv<strong>in</strong>g this issue. However, the current version <strong>of</strong> ML-IPSec protocol fails toaddress the requirement <strong>of</strong> dynamic key shar<strong>in</strong>g between the <strong>in</strong>termediate and sourcenodes. It is also not designed to support variable zone sizes. A partial solution tocater to variable zone sizes has been proposed <strong>in</strong> [68]. However, this solution maynot give access to application layer headers <strong>of</strong> any generic application <strong>in</strong> <strong>in</strong>termediatenodes. Additionally, it may sometimes lead to suboptimal zone partition<strong>in</strong>g result<strong>in</strong>g<strong>in</strong> unnecessary overheads both <strong>in</strong> forms <strong>of</strong> packet size and process<strong>in</strong>g delay. Also thediscussion lacks implementation details and performance related issues.Our extension to the ML-IPSec protocol, called Dynamic Multi Layer IPSec (DML-IPSec) aims to solve these issues. The DML-IPSec tries to achieve this by re-def<strong>in</strong><strong>in</strong>gsome <strong>of</strong> the IPSec fundamentals such as the packet structure, security associationetc. It also redef<strong>in</strong>es the ML-IPSec zones and zone mapp<strong>in</strong>g. A new key shar<strong>in</strong>gprotocol enables dynamical shar<strong>in</strong>g <strong>of</strong> cryptographic <strong>in</strong>formation between the sourceand <strong>in</strong>termediate nodes. F<strong>in</strong>ally a solution to the variable zone size issue <strong>of</strong> ML-IPSecprotocol is implemented through on-the-fly derivation <strong>of</strong> the zone lengths.This chapter is organized as follows.Section 4.1 presents the basic def<strong>in</strong>itions41


and term<strong>in</strong>ologies <strong>in</strong> the context <strong>of</strong> the DML-IPSec protocol. Section 4.2 presents thedetails <strong>of</strong> DML-IPSec protocol.4.1 ELEMENTS OF DML-IPSEC4.1.1 DML-IPSec ZoneIn ML-IPSec protocol, an IP packet is partitioned <strong>in</strong>to non-overlapp<strong>in</strong>g segments calledzones. A zone need not be contiguous, <strong>in</strong> which case, all contiguous portions <strong>of</strong> a zoneform a subzone <strong>of</strong> that zone. Each zone is given a cryptographic protection that is<strong>in</strong>dependent <strong>of</strong> the other zones by us<strong>in</strong>g a separate set <strong>of</strong> cryptographic parameters.A zone map is a mapp<strong>in</strong>g relationship from octets <strong>of</strong> the IP datagram to the correspond<strong>in</strong>gzones. The zone map def<strong>in</strong>es the zone boundaries for all the zones andthese boundaries rema<strong>in</strong> constant throughout the lifespan <strong>of</strong> the ML-IPSec SecurityAssociations (SAs). For each zone, all octets <strong>of</strong> all subzones are concatenated (<strong>in</strong> theorder they appear <strong>in</strong> a datagram) and then encapsulated <strong>in</strong>to the ML-IPSec PayloadData field. Dur<strong>in</strong>g <strong>in</strong>-bound process<strong>in</strong>g, <strong>orig<strong>in</strong>al</strong> IP datagrams are reconstructed fromthe decrypted zones us<strong>in</strong>g the zone mapp<strong>in</strong>g.It can be observed that though the zones themselves may not be contiguous, howeverthe position <strong>of</strong> the different protocol headers are non-overlapp<strong>in</strong>g and contiguous<strong>in</strong>side an IP datagram.This observation justifies the zones to occupy contiguoussegments <strong>in</strong> an IP datagram <strong>in</strong> our def<strong>in</strong>ition <strong>of</strong> DML-IPSec protocol. Thus, <strong>in</strong> theDML-IPSec protocol, zone is def<strong>in</strong>ed as a set <strong>of</strong> non-overlapp<strong>in</strong>g and contiguous partitions<strong>of</strong> an IP packet. This is <strong>in</strong> contrast to the case <strong>of</strong> ML-IPSec, where a zone mayconsists <strong>of</strong> many contiguous portions called subzones. All the zones are provided withcryptographic protection <strong>in</strong>dependent <strong>of</strong> other zones.We also propose to classify zones <strong>in</strong>to two separate types depend<strong>in</strong>g on the accessibilityrequirements at the <strong>in</strong>termediate nodes. The first type <strong>of</strong> zone, called type42


I zone, is def<strong>in</strong>ed on headers <strong>of</strong> IP datagram and is required for exam<strong>in</strong>ation andmodification by <strong>in</strong>termediate nodes. Thus, we can def<strong>in</strong>e different type I zones for IP,transport, application layer headers or <strong>in</strong> suitable comb<strong>in</strong>ations <strong>of</strong> these headers. Thesecond type <strong>of</strong> zone, called type II zone, is meant for the payload portion and is keptsecure between the endpo<strong>in</strong>ts <strong>of</strong> IPSec communications. The s<strong>in</strong>gle type II zone startsimmediately after the last type I zone and spans till the end <strong>of</strong> the IP datagram. So,the scope <strong>of</strong> the s<strong>in</strong>gle type II zone depends on that <strong>of</strong> the last type I zone. In ourapproach, an IP datagram is partitioned <strong>in</strong>to several type I zones followed by a f<strong>in</strong>altype II zone. Fig. 4.1 shows the case <strong>of</strong> an HTTP packet <strong>in</strong> ESP tunnel mode. Wemay def<strong>in</strong>e three type I zones, one each for <strong>in</strong>ner IP header, TCP header, and HTTPheader respectively and the type II zone is def<strong>in</strong>ed on the HTTP payload. Alternatively,we may def<strong>in</strong>e only a s<strong>in</strong>gle type I zone consist<strong>in</strong>g <strong>of</strong> <strong>in</strong>ner IP header and TCPheader and <strong>in</strong> this case the whole TCP payload (<strong>in</strong>clud<strong>in</strong>g HTTP header and HTTPpayload ) forms the s<strong>in</strong>gle type II zone. However, this partition<strong>in</strong>g depends on thelevel <strong>of</strong> access required by the <strong>in</strong>termediate nodes. For example, if no <strong>in</strong>termediateprocess<strong>in</strong>g is required dur<strong>in</strong>g the entire DML-IPSec session, the s<strong>in</strong>gle type II zonemay cover the entire portion <strong>of</strong> the datagram secured by DML-IPSec. In that case notype I zone exists <strong>in</strong> the IP datagram and this scenario resembles the case <strong>of</strong> a normalIPSec packet.This new def<strong>in</strong>ition <strong>of</strong> a zone not only facilitates all granularities <strong>of</strong> access to theprotocol headers by the <strong>in</strong>termediate nodes, but also enable us to def<strong>in</strong>e logical zoneboundaries <strong>in</strong> contrary to byte level physical zone boundary <strong>of</strong> the ML-IPSec.Asdiscussed earlier, a zone consists <strong>of</strong> headers or payload, the boundaries <strong>of</strong> which mayvary depend<strong>in</strong>g on the context. Hence the flexibility obta<strong>in</strong>ed <strong>in</strong> the def<strong>in</strong>ition <strong>of</strong> logicalzone boundaries can be used for resolv<strong>in</strong>g the issue <strong>of</strong> accommodat<strong>in</strong>g IP packets withvariable length headers.43


IPHDRESPHDRIPHDRType IZone 1TCPHDRHTTPHDRHTTPPayloadType I Type I Type IIZone 2 Zone 3 Zone 1(i)IPHDRTCPHDRHTTPHDRHTTPPayload(ii)IPHDRESPHDRIP TCPHDR HDRType I Zone 1HTTP HTTPHDR PayloadType II Zone 1(iii)Fig. 4.1: Different zone mapp<strong>in</strong>gs <strong>of</strong> a HTTP PacketThe DML-IPSec protocol also def<strong>in</strong>es zone map as the mapp<strong>in</strong>g from the octets<strong>of</strong> the IP datagram to different zones <strong>of</strong> the DML-IPSec protocol. However, unlikethe case <strong>of</strong> ML-IPSec, zone map <strong>of</strong> DML-IPSec does not specify any zone boundary.Unique <strong>in</strong>teger numbers are used to represent the scope <strong>of</strong> each zone. In case <strong>of</strong> zonesspann<strong>in</strong>g over multiple protocol headers, the <strong>in</strong>teger values for the correspond<strong>in</strong>g zonesare concatenated to represent the scope <strong>of</strong> the zone. All the zone sizes can dynamicallyvary accord<strong>in</strong>g to the concerned IP datagram. As per our def<strong>in</strong>ition <strong>of</strong> type I zones, itis the comb<strong>in</strong>ation <strong>of</strong> protocol headers. If any <strong>of</strong> these protocol headers have variablesize (as <strong>in</strong> case <strong>of</strong> IP and TCP headers with OPTION fields), the correspond<strong>in</strong>g typeI zone size varies. The length <strong>of</strong> the s<strong>in</strong>gle type II zone depends on that <strong>of</strong> the lasttype I zone. Moreover, the payload portion <strong>of</strong> any protocol may vary depend<strong>in</strong>g onapplication requirement. So, the length <strong>of</strong> the s<strong>in</strong>gle type II zone also varies. The DML-IPSec protocol derives the zone lengths dynamically from the header length fields <strong>of</strong>the protocol headers. This feature <strong>of</strong> DML-IPSec zones is important for address<strong>in</strong>gthe issue <strong>of</strong> variable header lengths. Another important feature <strong>of</strong> DML-IPSec zoneis that the zone maps need not necessarily be constant throughout the lifespan <strong>of</strong> theDML-IPSec security association. The key shar<strong>in</strong>g protocol may modify any exist<strong>in</strong>g44


zone map for provid<strong>in</strong>g service to some <strong>in</strong>termediate nodes.One important feature <strong>of</strong> the zone mapp<strong>in</strong>g <strong>of</strong> the DML-IPSec is the ability <strong>of</strong>dynamic reorganization <strong>of</strong> the type I zones without the need <strong>of</strong> renegotiation <strong>of</strong> thecryptographic parameters for the type II zone. In other words, two DML-IPSec endpo<strong>in</strong>tsmay configure only one type II zone without any type I zone to start the <strong>in</strong>itialcommunication. If some <strong>in</strong>termediate node requests the access to some upper layerheader, the zone maps are reorganized and the SAs for the type I zones are decided.The current cryptographic parameters used for the sole type II zone are used for thenew type II zone after the reorganization <strong>of</strong> zones.If any other reorganization <strong>of</strong>the zones is required, at some later time, the current cryptographic <strong>in</strong>formation forthe type II zone is used for the type II zone constructed after the reorganization <strong>of</strong>zones. This flexibility enables one to start a DML-IPSec session with s<strong>in</strong>gle type IIzone and update the zone <strong>in</strong>formation on need basis. In this way, the overhead due tounnecessary partition<strong>in</strong>g <strong>of</strong> an IP packet <strong>in</strong>to zones is avoided.No_<strong>of</strong>_Zones 4Zone 1Type IScope 1Zone 2Type IScope 2Zone 3Type IScope 3Zone 4Type IIScope 3−EOPNo_<strong>of</strong>_Zones 2Zone 1Type IScope 12Zone 2Type IIScope 2−EOP(ii)(i)Fig. 4.2: Zone MapFig 4.2 depicts the entries <strong>of</strong> the zone map for the case described <strong>in</strong> fig 4.1. Thezone map depicted <strong>in</strong> the fig 4.2(i) corresponds to the HTTP header packet with 3type I zones and s<strong>in</strong>gle type II zone as shown <strong>in</strong> fig 4.1(i). The scope <strong>of</strong> the first zone45


is restricted to the <strong>in</strong>ner IP header and hence represented as ”Scope 1”. The scopefield <strong>of</strong> zone 2 is specified as ”Scope 2” <strong>in</strong>dicat<strong>in</strong>g that the scope <strong>of</strong> the zone is overthe next header which is the TCP header. The scope <strong>of</strong> 3rd zone is represented as”Scope 3” to specify the scope over the third header which is the application header.The scope <strong>of</strong> the sole type II zone beg<strong>in</strong>s after the application layer header and spanstill the End-Of-Packet. It is represented as ”Scope 3-EOP. The zone map depicted asfig 4.2(ii) represents the zone map for the HTTP packet with two zones shown <strong>in</strong> thefig 4.1(iii). The s<strong>in</strong>gle type I zone is def<strong>in</strong>ed over the <strong>in</strong>ner IP header and transportlayer header and represented as ”Scope 12” <strong>in</strong> the zone map. The sole zone II spansover the transport layer payload and its scope is represented as ”Scope 2-EOP” <strong>in</strong> thefigure.4.1.2 DML-IPSec PacketsThe DML-IPSec supports the AH and ESP protocols <strong>of</strong> the conventional IPSec withsome modifications.In case <strong>of</strong> AH, the authentication header is almost similar toIPSec.The only difference is that the authentication data for the whole packet isfurther divided <strong>in</strong>to zone specific authentication data. The packet format <strong>of</strong> the AHis exactly similar to that <strong>of</strong> ML-IPSec.The DML-IPSec ESP payload is partitioned <strong>in</strong>to zone specific segments.Thedata for each zone, together with padd<strong>in</strong>g, padd<strong>in</strong>g length, and next header field(applicable for the s<strong>in</strong>gle type II zone only), are collectively referred to as the ciphertext block for that zone. The size <strong>of</strong> each cipher text block can be determ<strong>in</strong>ed by thealgorithm def<strong>in</strong>ition. Each zone may have a separate authentication trailer. The size<strong>of</strong> the authentication trailer depends on the algorithm used for that particular zone.In DML-IPSec ESP, the authentication trailer <strong>of</strong> each zone (if present) is appendedimmediately after the correspond<strong>in</strong>g encrypted zone data, <strong>in</strong> contrary to ML-IPSec,46


where all the authentication trailers are appended together after the encrypted data<strong>of</strong> the last zone.Nxt Hdr Payload Len ReservedSecurity Parameter Index (SPI)Sequence NumberAuthentication Data for Type I zone 1Authentication Data for Type I zone 2Authentication Data for Type II zone(i)Security Parameter Index (SPI)Sequence NumberType I Zone 1 Pay Load(Variable length)PadAuthentication TrailerPadType II Zone Pay Load(Variable length)Pad LengthType I Zone 2 Pay Load(Variable length)Authentication TrailerPad LengthPadPad Length Next HeaderAuthentication Trailer(ii)Fig. 4.3: DML-IPSec Packet Format (i) Authentication Header (ii)Encapsulat<strong>in</strong>g Security PayloadFig 4.3 depicts the layout <strong>of</strong> the AH and the ESP headers accord<strong>in</strong>g to the DML-IPSec def<strong>in</strong>ition with two type I zones and one type II zone.4.1.3 Security AssociationsThe concept <strong>of</strong> security association (SA) is fundamental to IPSec. An SA is a relationshipbetween two end-po<strong>in</strong>ts <strong>of</strong> IPSec communication that describes how the entitieswill use security services to communicate securely. However <strong>in</strong> DML-IPSec, several<strong>in</strong>termediate nodes may participate <strong>in</strong> def<strong>in</strong><strong>in</strong>g these security protections to the IPdatagram. Moreover, the scope <strong>of</strong> one particular set <strong>of</strong> security protection is valid ons<strong>in</strong>gle zone. So we def<strong>in</strong>e a s<strong>in</strong>gle SA for each zone <strong>of</strong> an IP datagram. We f<strong>in</strong>allycomb<strong>in</strong>e all these <strong>in</strong>dividual zonal SAs to represent the security relationship <strong>of</strong> theentire IP datagram. This comb<strong>in</strong>ed security relationship consists <strong>of</strong> one zone map anda set <strong>of</strong> zone lists. The zone map conta<strong>in</strong>s the common <strong>in</strong>formation for all zones alongwith the logical zone def<strong>in</strong>itions, whereas the <strong>in</strong>dividual zone list consists <strong>of</strong> security<strong>in</strong>formation related to that particular zone only.For example, fields like sequence47


number counter, anti-replay w<strong>in</strong>dow, DML-IPSec protocol mode are <strong>of</strong> common <strong>in</strong>terestto all the zones and are present <strong>in</strong> the zone map. The zone specific cryptographic<strong>in</strong>formation like encryption algorithm, encryption key, authentication algorithm andauthentication key are present at correspond<strong>in</strong>g zone specific lists.The DML-IPSec endpo<strong>in</strong>ts have the complete knowledge <strong>of</strong> the entire zone map aswell as that <strong>of</strong> all zone specific lists. The <strong>in</strong>termediate nodes have the knowledge <strong>of</strong> therelevant type I zone specific <strong>in</strong>formation. The cryptographic <strong>in</strong>formation related tothe type II zone is kept hidden from any <strong>in</strong>termediate node. The key shar<strong>in</strong>g protocolis responsible for shar<strong>in</strong>g this partial zone <strong>in</strong>formation with the <strong>in</strong>termediate nodes.The two endpo<strong>in</strong>ts <strong>of</strong> a DML-IPSec communication may re-negotiate the SA def<strong>in</strong>itionfor provid<strong>in</strong>g some service to the <strong>in</strong>termediate node hav<strong>in</strong>g the capability <strong>of</strong>partial DML-IPSec process<strong>in</strong>g.No_<strong>of</strong>_Zones 3 No_<strong>of</strong>_Zones 2Zone 1 Type I Zone 1 Type IScope 1Scope 1Zone 2 Type I Zone 2 Type IScope 2Scope 2Zone 3 Type IIScope 2−EOPAnti replay W<strong>in</strong>dowSequence NumberMode : TunnelSPI ValueAnti replay W<strong>in</strong>dowSequence NumberMode : TunnelSPI ValueZone 1Enc Alg0 : DESKey : K1Auth Alg0 : A1Key : K2Zone 2Enc Alg0 : DESKey : K3Auth Alg0 : A1Key : K4Zone 3Enc Alg0 : DESKey : K5Auth Alg0 : A1Key : K6Zone 1Enc Alg0 : DESKey : K1Auth Alg0 : A1Key : K2Zone 2Enc Alg0 : DESKey : K3Auth Alg0 : A1Key : K4DML−IPSec End Po<strong>in</strong>tsDML−IPSecIntermediate nodeFig. 4.4: Security association for DML-IPSecFig 4.4 depicts the security association both <strong>in</strong> DML-IPSec end po<strong>in</strong>ts and <strong>in</strong>termediatenodes. This scenario corresponds to the case <strong>of</strong> ESP tunnel mode with two48


type I zones, where the first type I zone spans the <strong>in</strong>ner IP header and the second typeI zone on transport layer header. The s<strong>in</strong>gle type II zone spans the transport layerpayload. As depicted <strong>in</strong> the Fig 4.4, the end-po<strong>in</strong>ts <strong>of</strong> the DML-IPSec communicationhave the complete knowledge <strong>of</strong> the zone maps as well as the zone lists for all the zones,whereas the <strong>in</strong>termediate node has <strong>in</strong>formation only about the two type I zones.4.2 THE DML-IPSEC PROTOCOLThe DML-IPSec protocol has two basic components. The first one is for the process<strong>in</strong>g<strong>of</strong> packets at the endpo<strong>in</strong>ts as well as several <strong>in</strong>termediate nodes.The secondcomponent is a protocol for shar<strong>in</strong>g <strong>of</strong> cryptographic parameters to the <strong>in</strong>termediatenodes. In this section we first describe the DML-IPSec process<strong>in</strong>g followed by the KeyShar<strong>in</strong>g Protocol. F<strong>in</strong>ally we discuss the handl<strong>in</strong>g <strong>of</strong> variable sized zones.4.2.1 DML-IPSec Process<strong>in</strong>gThe DML-IPSec process<strong>in</strong>g is different for the endpo<strong>in</strong>ts and <strong>in</strong>termediate nodes. Theendpo<strong>in</strong>ts <strong>of</strong> a DML-IPSec communication <strong>in</strong>volve two types <strong>of</strong> process<strong>in</strong>g. The firstone, called Outbound process<strong>in</strong>g, is responsible for generat<strong>in</strong>g DML-IPSec packetsfrom an IP datagram accord<strong>in</strong>g to the security policy and security association. TheInbound process<strong>in</strong>g is responsible for generat<strong>in</strong>g the <strong>orig<strong>in</strong>al</strong> IP datagram from a DML-IPSec packet us<strong>in</strong>g the security policies and security associations.• Outbound Process<strong>in</strong>gWhen the source node sends out an IP datagram, the follow<strong>in</strong>g steps take place.Derivation <strong>of</strong> ZonesThe very first operation at the outbound process<strong>in</strong>g is the derivation <strong>of</strong> thezones and zone lengths. The number <strong>of</strong> zones and scope <strong>of</strong> each zone is derived49


from the <strong>in</strong>formation <strong>of</strong> the zone map. This zone map and zone specific SAdatabases are populated either by the <strong>in</strong>itial configuration <strong>of</strong> a DML-IPSeccommunication or by the key shar<strong>in</strong>g protocol. The length <strong>of</strong> each zone mayvary from IP datagram to IP datagram. In case <strong>of</strong> type I zones, the headerlength field <strong>of</strong> the protocol headers are used to determ<strong>in</strong>e the length <strong>of</strong> eachzone; otherwise the implicit length def<strong>in</strong>ition is used to derive the zone lengths.The zone boundary <strong>of</strong> the type II zone is derived from the total length <strong>of</strong> theIP datagram and the cumulative lengths <strong>of</strong> all type I zones.Zone Specific EncryptionThe next step <strong>in</strong>volves encryption <strong>of</strong> the relevant data <strong>in</strong> each zone. At thebeg<strong>in</strong>n<strong>in</strong>g <strong>of</strong> the encryption module, the sender adds any necessary padd<strong>in</strong>g toeach zone’s Payload Data field, to meet the encryption algorithm’s block sizerequirement, if any, and to align it on a 4-byte boundary accord<strong>in</strong>g to the DML-IPSec ESP format. The sender then encrypts the result<strong>in</strong>g pla<strong>in</strong>text (payloaddata, padd<strong>in</strong>g, pad length, and next header <strong>in</strong> case <strong>of</strong> s<strong>in</strong>gle type II zone) us<strong>in</strong>gthe key, the encryption algorithm, and the encryption mode <strong>in</strong>dicated by thezonal SA and cryptographic synchronization data, if any.Zone Specific Authentication CalculationAfter the zone specific encryption, the sender calculates the authentication valuesfor the zones (if required) and appends the same after the encrypted data<strong>of</strong> the correspond<strong>in</strong>g zone. The cryptographic <strong>in</strong>formation required for the calculationis derived from the correspond<strong>in</strong>g SA entry.Fig 4.5 depicts the outbound process<strong>in</strong>g <strong>of</strong> an IP datagram with two type Izones followed by a type II zone for ESP protocol. As expla<strong>in</strong>ed <strong>in</strong> the abovediscussion, the zone map is used to derive the zone length followed by zone wise50


IP DatagramZone MapZone 1 Zone 2 Type II ZoneEncryptEncryptEncryptSA 1AuthenticationAuthenticationSA 2AuthenticationSA 3IP HDRESP HDRFig. 4.5: Outbound Process<strong>in</strong>g at DML-IPSec endpo<strong>in</strong>tencryption. F<strong>in</strong>ally the zone specific ICV’s are computed on encrypted zonedata.• Inbound Process<strong>in</strong>gOn <strong>in</strong>bound process<strong>in</strong>g, the receiver performs the follow<strong>in</strong>g steps on an IP datagram.Derivation <strong>of</strong> Zone BoundaryThe derivation <strong>of</strong> zone boundaries is significantly different from that <strong>of</strong> outboundprocess<strong>in</strong>g. The ma<strong>in</strong> difference here is that the length fields <strong>of</strong> zones rema<strong>in</strong>encrypted. After receiv<strong>in</strong>g a DML-IPSec datagram, the receiver processes thedatagram accord<strong>in</strong>g to the zone map.The receiver starts decrypt<strong>in</strong>g type Izones till it decrypts the header length field <strong>of</strong> the header. In case <strong>of</strong> a typeI zone spann<strong>in</strong>g over multiple protocol headers, partial decryption is used tillthe length <strong>of</strong> all the protocol headers is derived. The length <strong>of</strong> the s<strong>in</strong>gle typeII zone is derived us<strong>in</strong>g the total length <strong>of</strong> the IP datagram and other type Izone lengths. The partial decryption <strong>of</strong> the type I zones are done on temporarybuffers, as the encrypted data would be required <strong>in</strong> authentication verification51


step <strong>of</strong> the <strong>in</strong>bound process<strong>in</strong>g that follows the present step <strong>of</strong> zone boundaryderivation.Authentication verificationThe authentication verification <strong>in</strong> DML-IPSec is zone specific.The cryptographic<strong>in</strong>formation regard<strong>in</strong>g authentication calculation algorithm are fetchedfrom SAs correspond<strong>in</strong>g to zones.The authentication values are calculated<strong>in</strong> the same way as that <strong>of</strong> the outbound process<strong>in</strong>g, and the values are thenmatched aga<strong>in</strong>st the authentication values stored <strong>in</strong> the authentication field <strong>of</strong>each zone.If the match is perfect for all values, the authentication verificationsucceeds and the datagram is processed by next step, else the datagram isdropped.Zone Specific DecryptionThe f<strong>in</strong>al step <strong>of</strong> the <strong>in</strong>bound process<strong>in</strong>g is the zone specific decryption <strong>of</strong> theIP datagram.This is almost opposite to that <strong>of</strong> zone specific encryption atthe outbound process<strong>in</strong>g. The zone specific decryption details are fetched fromcorrespond<strong>in</strong>g SAs. After the decryption <strong>of</strong> all the zones, the <strong>orig<strong>in</strong>al</strong> IP datagramis re-constructed by trimm<strong>in</strong>g fields like pad, IV (if present) etc.The<strong>in</strong>itial portions <strong>of</strong> the type I zones which are used for partial decryption for thederivation <strong>of</strong> zone boundaries are not decrypted aga<strong>in</strong> <strong>in</strong> this step. Rather thedecrypted values from the temporary buffer position are copied and only thenecessary portions <strong>of</strong> type I zones are decrypted.Fig 4.6 depicts the <strong>in</strong>bound process<strong>in</strong>g <strong>of</strong> an DML-IPSec ESP packet with twotype I zones followed by a type II zone. As depicted <strong>in</strong> the figure the <strong>in</strong>boundprocess<strong>in</strong>g consists <strong>of</strong> derivation <strong>of</strong> zone boundaries us<strong>in</strong>g partial decryption followedby authentication verification and zone specific decryption to reconstruct52


IP DatagramDecryption Decryption DecryptionAuthenticationVerificattionAuthenticationVerificattionAuthenticationVerificattionDerivation <strong>of</strong> zone lengthsPartialDecryptionPartialDecryptionSA 1 SA 2 SA 3Zone MapIP HDRESP HDRFig. 4.6: Inbound Process<strong>in</strong>g at DML-IPSec endpo<strong>in</strong>tthe <strong>orig<strong>in</strong>al</strong> IP datagram.• Partial Datagram Process<strong>in</strong>g at Intermediate nodesThe <strong>in</strong>termediate nodes process an <strong>in</strong>com<strong>in</strong>g IP datagram depend<strong>in</strong>g on thepresence <strong>of</strong> the security parameters for that particular DML-IPSec communication.In the absence <strong>of</strong> the security parameters, the IP datagrams are forwardedto the dest<strong>in</strong>ation and at the same time the key shar<strong>in</strong>g protocol gets executed.After successful execution <strong>of</strong> the key shar<strong>in</strong>g protocol, all the <strong>in</strong>com<strong>in</strong>gIP datagrams get partially decrypted accord<strong>in</strong>g to the security association andzone mapp<strong>in</strong>g at the <strong>in</strong>bound process<strong>in</strong>g module. After the <strong>in</strong>bound process<strong>in</strong>g,the partially decrypted IP datagram traverses through the network<strong>in</strong>g stack <strong>of</strong>the <strong>in</strong>termediate node. Before the datagram leaves the <strong>in</strong>termediate node, it isprocessed by the outbound module to reconstruct the DML-IPSec packet.Inbound Process<strong>in</strong>g at Intermediate nodesThe <strong>in</strong>bound process<strong>in</strong>g module is almost similar to that <strong>of</strong> DML-IPSec endpo<strong>in</strong>ts.The zone boundaries <strong>of</strong> the relevant type I zones are first calculated53


followed by ICV verification and decryption <strong>of</strong> the necessary type I zones. Onexecution <strong>of</strong> these steps the <strong>in</strong>bound module gets partially decrypted data forcustomized <strong>in</strong>termediate process<strong>in</strong>g. The <strong>in</strong>bound module constructs a legitimateIP datagram us<strong>in</strong>g this partially decrypted datagram so that it can traverseTCP/IP stack <strong>of</strong> the <strong>in</strong>termediate node. This requires modification and updation<strong>of</strong> relevant fields <strong>of</strong> the newly constructed IP datagram viz., total length,checksum etc. Another po<strong>in</strong>t to note is that the DML-IPSec header and zonespecific IV, if any, after the process<strong>in</strong>g is not discarded; rather the <strong>in</strong>boundprocess<strong>in</strong>g module appends the header after the legitimate IP payload and recomputesthe length fields accord<strong>in</strong>gly.IP DatagramDecryptionDecryptionAuthenticationVerificattionAuthenticationVerificattionDerivation <strong>of</strong> zone lengthsPartialDecryptionPartialDecryptionSA 1 SA 2Zone MapIP HDRESP HDRFig. 4.7: Partial Inbound DML-IPSec Process<strong>in</strong>g at <strong>in</strong>termediate nodeFig 4.7 depicts the partial <strong>in</strong>bound process<strong>in</strong>g <strong>of</strong> a DML-IPSec ESP packet withtwo type I zones and one type II zone. Both the type I zones are decryptedto form the upper layer headers <strong>of</strong> the <strong>in</strong>termediate IP datagram, whereas thewhole type II zone gets copied to the payload portion <strong>of</strong> the <strong>in</strong>termediate IPdatagram as it is.54


Outbound Process<strong>in</strong>g at Intermediate nodesThe outbound process<strong>in</strong>g module is similar to that <strong>of</strong> DML-IPSec endpo<strong>in</strong>ts.Here the zone specific SAs are derived us<strong>in</strong>g the header fields and saved data<strong>of</strong> the partially decrypted datagram to regenerate the type I zones. F<strong>in</strong>ally thetype II zone is concatenated to reconstruct the DML-IPSec packet.IP DatagramMaster Zone MapZone 1 Zone 2EncryptEncryptSA 1AuthenticationAuthenticationSA 2IP HDRESP HDRFig.node4.8: Partial Outbound DML-IPSec Process<strong>in</strong>g at <strong>in</strong>termediateFig 4.8 depicts the partial outbound process<strong>in</strong>g <strong>of</strong> a DML-IPSec ESP packet withtwo type I zones and one type II zone. Both <strong>of</strong> the type I zones are constructedfrom the upper layer headers <strong>of</strong> the <strong>in</strong>termediate IP datagram and the typeII zone is constructed from the payload portion <strong>of</strong> the partially decrypted IPdatagram.4.2.2 Key shar<strong>in</strong>g ProtocolThe key shar<strong>in</strong>g protocol is responsible for dynamically provid<strong>in</strong>g all cryptographic<strong>in</strong>formation to <strong>in</strong>termediate nodes.When an <strong>in</strong>termediate node fails to process aDML-IPSec packet due to the absence <strong>of</strong> required security parameters, the key shar<strong>in</strong>gprotocol is <strong>in</strong>voked between the source <strong>of</strong> DML-IPSec packet and the <strong>in</strong>termediatenode. At the end <strong>of</strong> successful execution <strong>of</strong> the protocol, the relevant security asso-55


ciations are made available to the <strong>in</strong>termediate node. Whenever the current securityparameters are changed or get expired, the correspond<strong>in</strong>g action is be<strong>in</strong>g taken at the<strong>in</strong>termediate node also. The realization <strong>of</strong> these functionalities require the notification<strong>of</strong> the events and exchange <strong>of</strong> data us<strong>in</strong>g appropriate messages. We propose touse ICMP messages for all the communications required for the execution <strong>of</strong> the keyshar<strong>in</strong>g protocol. In the follow<strong>in</strong>g section, we expla<strong>in</strong> the work<strong>in</strong>g <strong>of</strong> the protocol <strong>in</strong>detail.Source NodeESP PacketIntermediate NodeForward (2)Dest<strong>in</strong>ation NodeInvocation (1)New Zone Map (3)Phase IZone map ack (4)Auth Challenge (5)Phase IIAuth Response (6)Phase IIIShared Secret (7)Shared Secret Ack (8)Phase IVZone & crypo <strong>in</strong>fo (9)Zone & crypo <strong>in</strong>fo Ack (10)ESP Packet(11)Intermediate Process<strong>in</strong>g and ForwardFig. 4.9: Key Shar<strong>in</strong>g Protocol• Invocation <strong>of</strong> the protocolWhenever a DML-IPSec packet traverses through an <strong>in</strong>termediate node, that requiresaccess to some <strong>of</strong> type I zones, the <strong>in</strong>bound security database is searched.If no entry is present <strong>in</strong> the database, the key shar<strong>in</strong>g protocol is <strong>in</strong>voked. As56


the first step <strong>of</strong> the protocol, a header <strong>in</strong>accessible message is sent from the<strong>in</strong>termediate node to the source <strong>of</strong> the DML-IPSec packet (mentioned as 1 <strong>in</strong>fig 4.9). The <strong>in</strong>termediate node also mentions the protocol headers that it requiresto access the body portion <strong>of</strong> this message.Unique <strong>in</strong>teger codes areused for identify<strong>in</strong>g different protocol headers accord<strong>in</strong>g to the same format asdescribed <strong>in</strong> the zone map related discussion <strong>of</strong> the previous section.Uponreceiv<strong>in</strong>g this header <strong>in</strong>accessible message, the source <strong>of</strong> the DML-IPSec communicationcommences the first phase <strong>of</strong> the protocol to decide whether theservice to the <strong>in</strong>termediate node can be provided or not.• Zone reorganization phaseThis first phase <strong>of</strong> the protocol is responsible for decid<strong>in</strong>g the zone mapp<strong>in</strong>g toprovide access to <strong>in</strong>termediate nodes. This phase performs the follow<strong>in</strong>g steps.First, the source <strong>of</strong> the DML-IPSec communication decides whether the access tothe requested protocol headers can be granted us<strong>in</strong>g the exist<strong>in</strong>g zone mapp<strong>in</strong>g <strong>of</strong>the DML-IPSec communication. If the present zone map can serve the requestedaccess, the next phase <strong>of</strong> the protocol commences. Otherwise the subsequentsteps <strong>of</strong> this current phase cont<strong>in</strong>ue to reorganize the zone mapp<strong>in</strong>g.Next, the source <strong>of</strong> DML-IPSec communication decides the new zone mapp<strong>in</strong>grequired for the requested access. If the requested access is possible accord<strong>in</strong>g toa new zone map, the new zone map is sent to the dest<strong>in</strong>ation <strong>of</strong> the DML-IPSecconnection by the source (<strong>in</strong>dicated as 3 and 4 <strong>in</strong> fig 4.9). Otherwise an errormessage is sent to the <strong>in</strong>termediate node and key shar<strong>in</strong>g fails. After receiv<strong>in</strong>gthis message the <strong>in</strong>termediate node may decide to request for access to a newset <strong>of</strong> headers. After this renegotiation message transfer, both the source anddest<strong>in</strong>ation update the security association and zone mapp<strong>in</strong>g databases.Itmay also be required to update the zone map and security associations <strong>of</strong> other57


exist<strong>in</strong>g <strong>in</strong>termediate nodes. In that case these <strong>in</strong>termediate nodes update theirsecurity databases.The cryptographic <strong>in</strong>formation for the new type II zone is derived from theexist<strong>in</strong>g security association for the type II zone. Only the new type I zone mapsand cryptographic <strong>in</strong>formation regard<strong>in</strong>g the new type I zones are communicated<strong>in</strong> this step. This ensures that the default security parameters, derived from themanual or automatic key exchange procedure are kept constant for the type IIzone. Because <strong>of</strong> this particular zone re-negotiation phase, the end nodes <strong>of</strong> theDML-IPSec communication may start with <strong>in</strong>itial configuration <strong>of</strong> only one zone(same as normal IPSec). Whenever a request, if any, from some <strong>in</strong>termediatenode comes, the zone maps are reorganized through renegotiation.We expla<strong>in</strong> the zone reorganization phase with an example. Suppose, two endpo<strong>in</strong>ts<strong>of</strong> a DML-IPSec session commence the communication with a s<strong>in</strong>gle typeII zone spann<strong>in</strong>g over entire IP datagram us<strong>in</strong>g ESP <strong>in</strong> tunnel mode. The zonemap and the security databases also are configured with entry for a s<strong>in</strong>gle typeII zone hav<strong>in</strong>g scope over the entire datagram (<strong>in</strong>dicated as 0-EOP <strong>in</strong> the zonemap ). If some <strong>in</strong>termediate node requires access to the <strong>in</strong>ner IP and transportlayer header, it sends a header <strong>in</strong>accessible message to the source node<strong>in</strong>dicat<strong>in</strong>g the header requirement as Scope 12 to request access <strong>of</strong> the <strong>in</strong>nerIP and transport layer header. Upon receiv<strong>in</strong>g this message, the source nodechecks the zone map to f<strong>in</strong>d out that the access is not possible accord<strong>in</strong>g to thecurrent zone map and decides to execute the zone reorganization. The sourcenode reorganizes the zone map with one type I zone spann<strong>in</strong>g over <strong>in</strong>ner IP andtransport layer header and a type II zone over transport layer payload. Thecryptographic parameters used for the previous type II zone are used for thenew type II zone. The source node also decides the cryptographic parameters58


for the sole type I zone. After this zone reorganization, the new zone map andthe cryptographic <strong>in</strong>formation for the sole type I zone are sent to the dest<strong>in</strong>ationnode. Upon receiv<strong>in</strong>g this zone reorganization message, the dest<strong>in</strong>ation nodealso updates its zone map and the security databases and acknowledges to thesource node.• Authentication PhaseThis phase <strong>of</strong> the key shar<strong>in</strong>g protocol commences, if the service requested bythe <strong>in</strong>termediate node can be granted by the source <strong>of</strong> the DML-IPSec communication.The ma<strong>in</strong> responsibility <strong>of</strong> this phase is to verify the identity <strong>of</strong>the <strong>in</strong>termediate node to the source <strong>of</strong> DML-IPSec session.If required theDML-IPSec source may provide the authentication <strong>of</strong> itself to the <strong>in</strong>termediatenode. We propose the usage <strong>of</strong> a simple challenge-response type protocol forthe purpose <strong>of</strong> authentication. The protocol uses public key cryptography forimplement<strong>in</strong>g the authentication process. All the concerned nodes, DML-IPSecendpo<strong>in</strong>ts and <strong>in</strong>termediate nodes, are to be provided with the public keys <strong>of</strong>all others. In the first step, the source <strong>of</strong> DML-IPSec session may select somerandom number R, encrypt it us<strong>in</strong>g the public key <strong>of</strong> the concerned <strong>in</strong>termediatenode and send it to the <strong>in</strong>termediate node (<strong>in</strong>dicated as 5 <strong>in</strong> fig 4.9). Uponreceiv<strong>in</strong>g this authentication request, the <strong>in</strong>termediate node decrypts R us<strong>in</strong>git’s private key and encrypts the same with the public key <strong>of</strong> the source node.This simple challenge-response protocol can prove identity <strong>of</strong> the <strong>in</strong>termediatenode to the source node (<strong>in</strong>dicated as 6 <strong>in</strong> fig 4.9). Similar challenge responseprotocol may be used to prove identity <strong>of</strong> source node to the <strong>in</strong>termediate node.If the identity <strong>of</strong> the <strong>in</strong>termediate node is proved to the source node, the lattersignals the commencement <strong>of</strong> the next phase, else an appropriate error messageis sent to the <strong>in</strong>termediate node and the key shar<strong>in</strong>g fails.59


• Shared secret establishment phaseThis phase is responsible for the establishment <strong>of</strong> a temporary shared secretbetween the source and <strong>in</strong>termediate nodes. This shared secret is to be usedas key for encrypt<strong>in</strong>g the actual message transfer <strong>of</strong> the DML-IPSec securityparameters at the next phase <strong>of</strong> the protocol us<strong>in</strong>g some symmetric encryptionalgorithm. This shared secret depends on the symmetric encryption algorithmused <strong>in</strong> the next phase <strong>of</strong> transfer <strong>of</strong> security parameters. Both the nodes mayperform some key establishment protocol like Diffie Hellman [69] to derive ashared secret. The source node may select the key and send the same to the<strong>in</strong>termediate node after encrypt<strong>in</strong>g with the public key <strong>of</strong> the <strong>in</strong>termediate node(<strong>in</strong>dicated as 7 and 8 <strong>in</strong> fig 4.9).One po<strong>in</strong>t to note here is that the actualtransfer <strong>of</strong> the security parameters may <strong>in</strong>volve zone map and cryptographic<strong>in</strong>formation <strong>of</strong> vary<strong>in</strong>g size. So the usage <strong>of</strong> symmetric cryptographic algorithmis desirable at the f<strong>in</strong>al phase.• Security parameter shar<strong>in</strong>g phaseThe f<strong>in</strong>al phase <strong>of</strong> the protocol is solely responsible for actual transfer <strong>of</strong> thesecurity parameters from the source to the <strong>in</strong>termediate nodes. This phase isalso responsible for updation <strong>of</strong> security and policy databases <strong>of</strong> the <strong>in</strong>termediatenodes. This phase consists <strong>of</strong> the follow<strong>in</strong>g steps:First, the source node constructs the message consist<strong>in</strong>g <strong>of</strong> necessary <strong>in</strong>formationfor the updation <strong>of</strong> the security databases <strong>of</strong> the <strong>in</strong>termediate nodes. Itgenerates a master list M conta<strong>in</strong><strong>in</strong>g the zone map and other common <strong>in</strong>formationlike protocol, mode, SPI, DML-IPSec endpo<strong>in</strong>ts and DML-IPSec protectednetwork addresses. The source node also prepares <strong>in</strong>dividual zone lists for allrelevant type I zones. This zone specific list conta<strong>in</strong>s cryptographic <strong>in</strong>formationsuch as encryption algorithm, encryption key, authentication algorithm, authen-60


tication key etc for that particular zone. Next,the master list and zone lists areconcatenated to form the actual message. This message is padded to meet theencryption algorithm block size (if required) and appended with the pad length.F<strong>in</strong>ally this padded message is encrypted us<strong>in</strong>g the shared secret established atthe previous phase. This encrypted message is sent to the <strong>in</strong>termediate node(<strong>in</strong>dicated as 9 <strong>in</strong> fig 4.9).Upon receiv<strong>in</strong>g this message, the <strong>in</strong>termediate node decrypts this concatenatedmessage and parses it to segregate the master zone map and zone specific lists.The policy database is updated for the process<strong>in</strong>g <strong>of</strong> the DML-IPSec packets.SA entries are created for each <strong>of</strong> the zone specific lists. Both the outboundand <strong>in</strong>bound security databases are updated us<strong>in</strong>g these <strong>in</strong>formation.Aftersuccessful updation <strong>of</strong> the databases, the <strong>in</strong>termediate node acknowledges thesame to the source node (<strong>in</strong>dicated as 10 <strong>in</strong> fig 4.9).M: {ESP,TUNNEL,gw1,gw2,nw1,nw2,spi,1}L1 {12,e1,ek1,a1,ak1}Zone List for S<strong>in</strong>gle type I ZoneM: {ESP,TUNNEL,gw1,gw2,nw1,nw2,spi,2}L1 {1,e1,ek1,a1,ak1}L2 {2,e2,ek2,a2,ak2}Zone List for two type I ZonesFig. 4.10: Zone map and Cryptographic message format dur<strong>in</strong>g KeyShar<strong>in</strong>g ProtocolWe use the fig 4.10 to expla<strong>in</strong> the message transfer at the f<strong>in</strong>al phase <strong>of</strong> theprotocol. As shown <strong>in</strong> the diagram, the first case transmits zone details correspond<strong>in</strong>gto ESP tunnel mode with only one type I zone. The scope <strong>of</strong> the s<strong>in</strong>gletype I zone spans over <strong>in</strong>ner IP header and TCP header and protected with encryptionalgorithm e1 with key ek1 and authentication algorithm a1 with keyak1. The second case corresponds to ESP tunnel mode with two type I zones.61


The scope <strong>of</strong> the first type I zone spans over <strong>in</strong>ner IP header with encryptionalgorithm e1 and key ek1 and authentication algorithm a1 along with key ak1.The second type I zone is def<strong>in</strong>ed over transport layer header with encryptionalgorithm e2 and key ek2 and authentication algorithm a2 along with key ak2.• Revocation <strong>of</strong> Security ParametersOne additional responsibility <strong>of</strong> the key shar<strong>in</strong>g protocol is the revocation orchange <strong>of</strong> the security parameters. The revocation <strong>of</strong> the security parametersis required, when the current security relationship <strong>of</strong> a DML-IPSec expires.Whenever the current security parameter expires or the exist<strong>in</strong>g DML-IPSecterm<strong>in</strong>ates, the source node communicates the same to the <strong>in</strong>termediate nodes.Special ICMP code is used to transfer the revocation message to the <strong>in</strong>termediatenode.The source node constructs the message represent<strong>in</strong>g the DML-IPSecconnection descriptor and encrypts the same with public key <strong>of</strong> the <strong>in</strong>termediatenode. This connection descriptors consist <strong>of</strong> security policy related fields suchas gateway addresses, mode, protocol, SPI etc. Upon receiv<strong>in</strong>g this message the<strong>in</strong>termediate nodes update their security databases, and all security associationsrelated to the current connection are deleted.• Zone Reorganization at the Intermediate Nodes:As described <strong>in</strong> the zone reorganization phase <strong>of</strong> the key shar<strong>in</strong>g protocol, theend po<strong>in</strong>ts <strong>of</strong> a DML-IPSec session may decide to renegotiate the exist<strong>in</strong>g zonemap def<strong>in</strong>ition for provid<strong>in</strong>g service to a new <strong>in</strong>termediate node. In that case, the<strong>in</strong>formation related to these changes has to be communicated to already exist<strong>in</strong>g<strong>in</strong>termediate nodes.The key shar<strong>in</strong>g protocol carries out this responsibilityus<strong>in</strong>g the follow<strong>in</strong>g steps:First, a special ICMP error message is sent to the currently exist<strong>in</strong>g <strong>in</strong>termediate62


node to <strong>in</strong>dicate this zone re-negotiation.Upon receiv<strong>in</strong>g this message, the<strong>in</strong>termediate node gets <strong>in</strong>volved <strong>in</strong> key shar<strong>in</strong>g protocol. Here the source nodeand the concerned <strong>in</strong>termediate node first get engaged <strong>in</strong> the establishment <strong>of</strong>a temporary shared secret. Us<strong>in</strong>g this shared secret, the source node securelysends the new zone map to the <strong>in</strong>termediate node.We elaborate the work<strong>in</strong>g <strong>of</strong> this reorganization with an example. Let us assumethat the end po<strong>in</strong>ts <strong>of</strong> DML-IPSec session <strong>in</strong>itiates the communication withonly one type II zone <strong>in</strong> tunnel mode ESP. Afterwords an <strong>in</strong>termediate node,say IN1 requests for access to both <strong>in</strong>ner IP header and transport layer header.To serve this request, the zone maps <strong>of</strong> the DML-IPSec are modified to onetype I zone spann<strong>in</strong>g over <strong>in</strong>ner IP header and transport header at the firstphase <strong>of</strong> key shar<strong>in</strong>g protocol. At the last phase <strong>of</strong> the key shar<strong>in</strong>g protocol,these zone and security <strong>in</strong>formation are sent to the <strong>in</strong>termediate node IN1. Itmay happen that after some time another <strong>in</strong>termediate node, say IN2 requestsfor access to <strong>in</strong>ner IP header only.In that case the DML-IPSec endpo<strong>in</strong>tsmay reorganize the zone map to two type I zones, where the first type I zonecovers the <strong>in</strong>ner IP header and the second type I zone spans the transport layerheader. This <strong>in</strong>formation is sent to IN2 at the last phase <strong>of</strong> the key shar<strong>in</strong>gprotocol. Moreover, this <strong>in</strong>formation about zone re-negotiation is communicatedto IN1 also us<strong>in</strong>g the zone reorganization procedure at the <strong>in</strong>termediate node asdiscussed at the previous section.• An Example <strong>of</strong> Key Shar<strong>in</strong>gWe expla<strong>in</strong> the work<strong>in</strong>g <strong>of</strong> the key shar<strong>in</strong>g protocol with an example as depicted<strong>in</strong> Fig 4.11. The key shar<strong>in</strong>g protocol uses currently unused ICMP type 1 forall types <strong>of</strong> communication with different code values. In our subsequent discussion,we represent ICMP message with type t and code c as . The63


ESP packetHeader <strong>in</strong>accessible1,1Authentication Request1,2Authentication Response1,3Shared Key (K)1,4Acknowledgement1,5Searches database andFails to f<strong>in</strong>d entryForwards the packetSecurity Parameter1,6Acknowledgement1,7ESP packetSearches database anddecrypts the header zonesRecreate the ESP packetand forwardsSource IPSecGatewayIntermediate deviceDest<strong>in</strong>ation IPSecGatewayFig. 4.11: Key Shar<strong>in</strong>g Protocol Exampletype signifies message type, for example for key shar<strong>in</strong>g between <strong>in</strong>termediatenode and source node or the zone reorganization phase. The code specifies theparticular operation specified by that message. As shown <strong>in</strong> the figure, afterreceiv<strong>in</strong>g the first ESP packet the <strong>in</strong>termediate node sends header <strong>in</strong>accessiblemessage as . The requested header access is mentioned <strong>in</strong> the body portion<strong>of</strong> that message. As the service requested by the <strong>in</strong>termediate nodecan be granted us<strong>in</strong>g current zone map <strong>of</strong> the source node, the next message isthe authentication challenge. The source node sends the challenge message as. Upon receiv<strong>in</strong>g this challenge message, the <strong>in</strong>termediate node sends theresponse to the challenge as and that marks the end <strong>of</strong> second phase. It isfollowed by the third phase <strong>of</strong> establishment <strong>of</strong> a shared secret. Here the sourcenode selects the encryption key K for the f<strong>in</strong>al phase and encrypts that withpublic key <strong>of</strong> the <strong>in</strong>termediate node. This <strong>in</strong>formation is sent as . Next,64


<strong>in</strong>termediate node acknowledges the same to source node as and the currentphase ends. In the f<strong>in</strong>al phase, the source node generates the necessaryzone map and zone lists and encrypts the same with the key K established <strong>in</strong>the previous phase. This encrypted message is sent to the <strong>in</strong>termediate node as. The f<strong>in</strong>al message is from the <strong>in</strong>termediate node to the source toacknowledge the receipt <strong>of</strong> security parameters. After these message transfers,the <strong>in</strong>termediate node is able to handle the DML-IPSec packets for <strong>in</strong>termediateprocess<strong>in</strong>g as shown <strong>in</strong> the case <strong>of</strong> the second ESP packet <strong>in</strong> the figure.4.2.3 Handl<strong>in</strong>g <strong>of</strong> variable Zone sizesThe zone size <strong>in</strong> ML-IPSec is fixed and the zone boundaries are represented by bytelevel def<strong>in</strong>ition. This restricts the access to zones with variable sizes at <strong>in</strong>termediatenodes.The lengths <strong>of</strong> the zones may vary as the length <strong>of</strong> IP and TCP headersvary between 20 bytes and 60 bytes depend<strong>in</strong>g upon the presence <strong>of</strong> the OPTIONfields.These OPTION fields are used by the IP and TCP protocols for carry<strong>in</strong>gsynchronization and other messages. For example, the OPTION fields <strong>in</strong> IP header isused <strong>in</strong> the case <strong>of</strong> source rout<strong>in</strong>g option <strong>of</strong> IP packet rout<strong>in</strong>g, mark<strong>in</strong>g the address<strong>of</strong> traversed path at the traceroute option <strong>of</strong> p<strong>in</strong>g program etc. The OPTION fields<strong>in</strong> TCP headers are used for the synchronization <strong>of</strong> TCP w<strong>in</strong>dow, MTU etc.Theaccess to these <strong>in</strong>formation carried by the OPTION fields may be required at several<strong>in</strong>termediate nodes for their function<strong>in</strong>g. Thus, provid<strong>in</strong>g access to these variable sizezones <strong>of</strong> an IP datagram is important.In this section, we discuss the handl<strong>in</strong>g <strong>of</strong> variable zone size <strong>of</strong> the DML-IPSecprotocol <strong>in</strong> detail us<strong>in</strong>g the previous discussion <strong>of</strong> the overall process<strong>in</strong>g <strong>of</strong> the protocol.As discussed <strong>in</strong> previous sections, we def<strong>in</strong>e zone as a contiguous portion <strong>of</strong> IPdatagram. Moreover, we have def<strong>in</strong>ed type I zones as protocol headers or comb<strong>in</strong>ation65


<strong>of</strong> cont<strong>in</strong>uous protocol headers. In this way, it is possible to provide access to all upperlayer headers to the <strong>in</strong>termediate nodes without compromis<strong>in</strong>g on the end-to-endsecurity <strong>of</strong> the actual payload.Dur<strong>in</strong>g outbound process<strong>in</strong>g, we derive the lengths <strong>of</strong> the type I zones from theprotocol header length fields as discussed <strong>in</strong> the previous section.Dur<strong>in</strong>g <strong>in</strong>boundprocess<strong>in</strong>g, partial decryption <strong>of</strong> the protocol headers is employed to decide the lengthfield <strong>of</strong> the headers. After the partial decryption <strong>of</strong> the protocol headers, the lengths<strong>of</strong> the zones are derived.For illustration purpose, we def<strong>in</strong>e one particular scenario, where we use ESP <strong>in</strong>tunnel mode and we def<strong>in</strong>e two zones.The only type I zone covers the whole <strong>of</strong><strong>in</strong>ner IP header and correspond<strong>in</strong>g transport layer header, whereas the s<strong>in</strong>gle type IIzone covers the transport layer payload. We use DES algorithm for the encryption<strong>of</strong> the first zone and AES with 256 bits key for the encryption <strong>of</strong> the second zone.Dur<strong>in</strong>g <strong>in</strong>bound process<strong>in</strong>g <strong>of</strong> both <strong>in</strong>termediate node and DML-IPSec endpo<strong>in</strong>ts, forhandl<strong>in</strong>g the variable size header length, we first decrypt the first two DES blocks,(first 16 octets). Upon successful decryption <strong>of</strong> these two blocks we derive the actuallength <strong>of</strong> IP header from the header length field, whereas the protocol field <strong>of</strong> the IPheader def<strong>in</strong>es the next protocol def<strong>in</strong>ition. In case <strong>of</strong> UDP and ICMP the transportlayer header lengths are derived directly. In case <strong>of</strong> TCP we cont<strong>in</strong>ue the block byblock decryption until we decrypt the 16th octet <strong>of</strong> TCP header, where we get theTCP header length value.4.3 SUMMARYIn this chapter, we have described the details <strong>of</strong> the Dynamic Multi Layer IPSec(DML-IPSec) protocol.We have redef<strong>in</strong>ed some <strong>of</strong> IPSec and ML-IPSec conceptsfor the DML-IPSec protocol. We have redef<strong>in</strong>ed the concept <strong>of</strong> zone so that packets66


with variable header length can be accommodated dur<strong>in</strong>g DML-IPSec process<strong>in</strong>g. Inorder to provide seamless access to <strong>in</strong>termediate nodes, we have classified zones astype I and type II zones.Type I zones are def<strong>in</strong>ed as protocol headers or propercomb<strong>in</strong>ation <strong>of</strong> protocol headers. The type I zones are allowed to be accessed by the<strong>in</strong>termediate nodes.The other type <strong>of</strong> zone, called type II zone is def<strong>in</strong>ed on thepayload portion and kept secure between the endpo<strong>in</strong>ts <strong>of</strong> the DML-IPSec sessions.We have also redef<strong>in</strong>ed the security association <strong>in</strong> DML-IPSec. A s<strong>in</strong>gle IP datagrammay be processed us<strong>in</strong>g different cryptographic parameters at different zones.Wepresent the key shar<strong>in</strong>g protocol for shar<strong>in</strong>g cryptographic <strong>in</strong>formation and allied zonespecific parameters between the DML-IPSec endpo<strong>in</strong>ts and <strong>in</strong>termediate nodes. Thiskey shar<strong>in</strong>g protocol is <strong>in</strong>voked, whenever a DML-IPSec protected datagram passesthrough an <strong>in</strong>termediate node with partial DML-IPSec process<strong>in</strong>g capabilities. Wealso address the issue <strong>of</strong> zones with variable lengths <strong>in</strong> case <strong>of</strong> IP datagrams withOPTION fields. In the next chapter, we discuss the implementation details <strong>of</strong> theDML-IPSec protocol <strong>in</strong> L<strong>in</strong>ux environment.67


CHAPTER 5Design and Implementation <strong>of</strong> DML-IPSec <strong>in</strong> L<strong>in</strong>uxEnvironmentThe DML-IPSec protocol as described <strong>in</strong> the previous chapter addresses the issues<strong>of</strong> key shar<strong>in</strong>g with the <strong>in</strong>termediate nodes and that <strong>of</strong> accommodat<strong>in</strong>g packets withvariable length headers. The access to upper layer header <strong>in</strong>formation at the <strong>in</strong>termediatenodes is an issue when the upper layer protocol headers are encrypted as <strong>in</strong> thecase <strong>of</strong> ESP. Therefore, the DML-IPSec protocol assumes significance <strong>in</strong> case <strong>of</strong> ESPprotocol compared to that <strong>of</strong> the authentication only case <strong>of</strong> AH protocol. Hence, theimplementation is done for the ESP protocol. In this chapter, we discuss the designissues and provide the implementation details <strong>of</strong> the DML-IPSec protocol <strong>in</strong> L<strong>in</strong>uxOS. The implementation is carried out <strong>in</strong> L<strong>in</strong>ux kernel version 2.6.23 [70] <strong>of</strong> RHEL 4.The exist<strong>in</strong>g implementation <strong>of</strong> IPSec <strong>in</strong> L<strong>in</strong>ux kernel is modified to provide the multilayer process<strong>in</strong>g capability. The ICMP based socket programm<strong>in</strong>g is used for differentmessage transfers required for the key shar<strong>in</strong>g protocol. A user level <strong>in</strong>terface <strong>in</strong> theform <strong>of</strong> a pseudo device driver is also implemented to update the kernel level securitydatabases from the user space key shar<strong>in</strong>g utilities.We first briefly mention the implementation aspects <strong>of</strong> the IPSec protocol suitealong with special emphasis on the ESP protocol. Next, we present the implementationdetails <strong>of</strong> the DML-IPSec ESP protocol. F<strong>in</strong>ally we provide the details <strong>of</strong> the test-bedsetup and the results validat<strong>in</strong>g the design and implementation <strong>of</strong> DML-IPSec.68


5.1 IMPLEMENTATION ASPECTS OF BASIC IPSECThe L<strong>in</strong>ux kernel series 2.6.X has the implementation <strong>of</strong> IPSec protocols i.e. AH andESP built <strong>in</strong> the IP stack. User space utilities (setkey, racoon) are provided to configurethe kernel space configurations <strong>of</strong> IPSec [71]. The ma<strong>in</strong> modules <strong>of</strong> the native IPSecimplementation [72–74] are described <strong>in</strong> the follow<strong>in</strong>g sections.5.1.1 Implementation <strong>of</strong> ProtocolsThe ESP and AH protocols are implemented along with the implementation <strong>of</strong> IP.The data structures for represent<strong>in</strong>g Security Policies (SPs) and Security Association(SAs) are crucial for the implementation <strong>of</strong> IPSec. Fig 5.1 depicts the various XFRMstructures used for the representation <strong>of</strong> the SPs and SAs.The Security Policy Database (SPD) is represented us<strong>in</strong>g xfrm-policy structure.The data structure for SPD consists <strong>of</strong> bundle <strong>of</strong> SAs implemented as xfrm-dst structures.The bundle <strong>of</strong> SAs consists <strong>of</strong> <strong>in</strong>dividual SA entries implemented as xfrm-statestructures. This xfrm-state structure holds all necessary <strong>in</strong>formation for a particulartransformation. This structure conta<strong>in</strong>s <strong>in</strong>formation like replay w<strong>in</strong>dow, sequencenumber, and cryptographic <strong>in</strong>formation. The sharable <strong>in</strong>formation about encryptionand authentication algorithm are stored <strong>in</strong> xfrm-algo structure objects, while privatedata e.g., key, Initialization Vector for a particular transformation are ma<strong>in</strong>ta<strong>in</strong>ed asesp-data structure object <strong>of</strong> the xfrm-state structure.5.1.2 User space utilityUser space utility setkey is used for updat<strong>in</strong>g the structures represent<strong>in</strong>g the SPs <strong>of</strong>the SPD. The structures represent<strong>in</strong>g SAs can be updated either manually by us<strong>in</strong>gthe setkey utility or by automatic key exchange through the racoon utility. Racoonuses the IKE protocol for the automatic configuration <strong>of</strong> the SAs.69


struct xfrm_algo {char alg_name[64];<strong>in</strong>t alg_key_len;............}struct xfrm_policy{struct xfrm_policy*next;u32 priority;struct dst_entry *bundles;u16 family;u8 type;u8 action;u8 xfrm_nr;................struct xfrm_tmplxfrm_vec[XFRM_MAX_DEPTH];}struct dst_entry{struct xfrm_state*xfrm;struct dst_entry*child;}NULLstruct xfrm_state{/*Cryptographic Information*/struct xfrm_algo*aalg;struct xfrm_algo*ealg;................void*data;/*Other Information*/struct xfrm_replay_state replay;u8 replay_w<strong>in</strong>dow;................}struct xfrm_algo {char alg_name[64];<strong>in</strong>t alg_key_len;............}struct esp_data{/* Confidentiality */struct {u8*............key;}conf;/* Integrity. */struct {u8*............key;} auth;}Fig. 5.1: SPD and SA <strong>in</strong> L<strong>in</strong>ux Implementation <strong>of</strong> IPSecFigure 5.2 specifies a flow until kernel applies IPSec-SA to a packet. The numbers<strong>in</strong>dicated <strong>in</strong> the figure correspond<strong>in</strong>g to the events are expla<strong>in</strong>ed below.(1) The adm<strong>in</strong>istrator sets a policy by populat<strong>in</strong>g the structures represent<strong>in</strong>g SPsus<strong>in</strong>g setkey.(2) The kernel refers to SPD <strong>in</strong> order to make a decision <strong>of</strong> apply<strong>in</strong>g IPSec to apacket.(3) If IPSec is required, then kernel gets the key for IPSec-SA from SAD.(4) If it fails, then kernel sends a request to get the key to racoon (<strong>in</strong> the case <strong>of</strong>absence <strong>of</strong> manual SA configuration).(5) The racoon exchanges the key by us<strong>in</strong>g IKE with the other end <strong>of</strong> the IPSeccommunication.(6) The racoon updates the structures represent<strong>in</strong>g SAs.(7) The Kernel can send a packet after provid<strong>in</strong>g IPSec security accord<strong>in</strong>g to SAs.70


Setkey(1)(4)Racoon(6)IKE(5)Remote IPSec Mach<strong>in</strong>eSPD(2) (3)KernelSAD(7)Fig. 5.2: Illustration <strong>of</strong> <strong>in</strong>teraction between user space utilities andKernel5.2 IMPLEMENTATION OF THE DML-IPSEC PROTOCOLWe implemented the multi-layer IPSec functionalities <strong>in</strong>side the native L<strong>in</strong>ux implementation<strong>of</strong> IPSec protocol. The SA structure was updated to hold the necessarysecurity association <strong>in</strong>formation for multiple zones <strong>in</strong>stead <strong>of</strong> a s<strong>in</strong>gle SA <strong>of</strong> the normalIPSec. The zone mapp<strong>in</strong>g for different zones were implemented along-with thekernel implementation <strong>of</strong> security associations. The <strong>in</strong>bound and outbound modules <strong>of</strong>the IPSec endpo<strong>in</strong>ts were re-implemented to <strong>in</strong>corporate multi-layer IPSec capability.We also implemented necessary modules for provid<strong>in</strong>g partial IPSec process<strong>in</strong>g capabilitiesat the <strong>in</strong>termediate nodes. The implementation details <strong>of</strong> the major modules<strong>of</strong> the DML-IPSec protocol are described next.5.2.1 Implementation <strong>of</strong> ZonesThe concept <strong>of</strong> zone is not present <strong>in</strong> the native implementation <strong>of</strong> the IPSec-ESPprotocol. We implemented zones along with the security associations. Each zone hasa set <strong>of</strong> cryptographic parameters that may vary from zone to zone. The zone specificcryptographic <strong>in</strong>formation are implemented by modification <strong>of</strong> security association asexpla<strong>in</strong>ed <strong>in</strong> the follow<strong>in</strong>g.every ESP communication.The DML-IPSec protocol also def<strong>in</strong>es a zone map forThis zone map conta<strong>in</strong>s <strong>in</strong>formation regard<strong>in</strong>g number71


<strong>of</strong> zones and the scope <strong>of</strong> each zone.This zone map is consulted dur<strong>in</strong>g the keyshar<strong>in</strong>g protocol and also at the beg<strong>in</strong>n<strong>in</strong>g <strong>of</strong> packet process<strong>in</strong>g module to determ<strong>in</strong>ethe zone boundaries <strong>of</strong> the datagrams. We implement this zone map as a DML-zonemapstructure as depicted <strong>in</strong> Fig 5.3. This DML-zone-map conta<strong>in</strong>s the number <strong>of</strong>zones and the scope <strong>of</strong> all the zones are mentioned <strong>in</strong> the array <strong>of</strong> <strong>in</strong>teger values.F<strong>in</strong>ally, the xfrm-state structure correspond<strong>in</strong>g to a ESP tunnel holds an entry for theDML-zone-map structure.#ifdef DML_IPSECstruct DML_zone_map{__u8* scope; // Scope for Zones#ifdef DML_IPSECstruct DML_esp_data{struct DML_esp_data * next;/*SA for Next Zone*/struct esp_data *value;/*Private data for that Zone*/struct xfrm_algo * aalgo,*ealgo,*calgo;__u8 no_<strong>of</strong>_zones;/*Common algo specific datafor that zone*/// Number <strong>of</strong> Zones<strong>in</strong>t Scope; /*Scope <strong>of</strong> this Zone*/};#endif};#endifFig. 5.3: Zone structure and Zone specific DML-IPSec ESP SA5.2.2 Implementation <strong>of</strong> security associationThe DML-IPSec protocol def<strong>in</strong>es end-to-end security policies between two endpo<strong>in</strong>ts asthe <strong>in</strong>formation regard<strong>in</strong>g any <strong>in</strong>termediate node is not relevant for packet process<strong>in</strong>gat the endpo<strong>in</strong>ts. The security policies at the DML-IPSec endpo<strong>in</strong>ts are similar tonormal IPSec. Thus the security policy def<strong>in</strong>ition resembles that <strong>of</strong> normal IPSec. Onthe other hand, the security association <strong>in</strong>formation is significantly different <strong>in</strong> DML-IPSec than the standard IPSec, as the zone specific cryptographic <strong>in</strong>formation has tobe ma<strong>in</strong>ta<strong>in</strong>ed along with every security association.In normal ESP implementation every IPSec communication has a set <strong>of</strong> securityparameters represented by the structure xfrm-state. This structure <strong>in</strong> turn stores the72


algorithm specific entries <strong>in</strong> xfrm-algo structure and the <strong>in</strong>formation about key, IV etc<strong>in</strong> esp-data structure. The xfrm-state structure also holds <strong>in</strong>formation about replayw<strong>in</strong>dow and sequence number.In the DML-IPSec implementation, the xfrm-statestructure is segregated <strong>in</strong>to two parts. The first one conta<strong>in</strong>s common <strong>in</strong>formationfor all zones. The other part holds zone specific <strong>in</strong>formation through a po<strong>in</strong>ter to anew data structure, called DML-esp-data, that holds cryptographic <strong>in</strong>formation for aparticular zone. As depicted <strong>in</strong> Fig 5.4, this structure has entries for algorithm specificxfrm-algo structures and also private data represented as esp-data structures.struct xfrm_algo {charalg_name[64];<strong>in</strong>talg_key_len;............}struct xfrm_algo {charalg_name[64];<strong>in</strong>talg_key_len;}............struct xfrm_policy{struct dst_entry *bundles;................}struct dst_entry{struct xfrm_state*xfrm;................struct dst_entry*child;}struct xfrm_state/*Cryptographic Information*/void *zonal_SA;/*Other Information*/u8replay_w<strong>in</strong>dow;struct xfrm_replay_state replay;struct *DML_zone_map Map;................struct DML_esp_data{struct xfrm_algo *aalgo,*calgo,*ealgo;struct DML_esp_data*next;struct esp_data *value;}struct DML_esp_data{struct xfrm_algo *aalgo,*calgo,*ealgo;struct DML_esp_data*next;struct esp_data *value;}NULLstruct DML_zone_map{__u8* scope;__u8 no_<strong>of</strong>_zones;}struct esp_data{/* Confidentiality *//* Integrity. */}struct esp_data{/* Confidentiality *//* Integrity. */}NULLFig. 5.4: SPD and SA structures <strong>in</strong> the DML-IPSecFig. 5.4 shows the XFRM structures for ESP with one type I zone and one typeII zone. As shown <strong>in</strong> the figure, the SPD structure xfrm-policy po<strong>in</strong>ts to SA bundlestructure dst-entry that conta<strong>in</strong>s SA structure xfrm-state. The xfrm-state structureholds zone map structure DML-zone-map. The zone specific cryptographic <strong>in</strong>formationis stored <strong>in</strong> the structure DML-esp-data. Therefore, the number <strong>of</strong> <strong>in</strong>stances <strong>of</strong> this73


structure is equal to the number <strong>of</strong> zones. As there are two zones, one type I and onetype II zone <strong>in</strong> the case <strong>of</strong> Fig. 5.4, two <strong>in</strong>stances <strong>of</strong> the structure DML-esp-data ispresent. Here the first one stores cryptographic <strong>in</strong>formation for s<strong>in</strong>gle type I zone andthe second one holds the cryptographic <strong>in</strong>formation for the type II zone.5.2.3 Implementation <strong>of</strong> the datagram process<strong>in</strong>g at the endpo<strong>in</strong>tsIn DML-IPSec ESP implementation, at the outbound process<strong>in</strong>g module, the xfrmpolicystructures represent<strong>in</strong>g the SPs are first searched l<strong>in</strong>early till a match occurs.If the policy is ESP, the SA is derived from the dst-entry SA bundle. Next, the DMLzone-mapstructure is scanned from the xfrm-state structure.Us<strong>in</strong>g the zone mapdef<strong>in</strong>ition, the outgo<strong>in</strong>g IP datagram is partitioned <strong>in</strong>to multiple zones.Next, theDML-esp-data list <strong>of</strong> the xfrm-state structure is l<strong>in</strong>early accessed to provide cryptographicsecurity to zones. The common <strong>in</strong>formation for all the zones are fetched fromthe entries conta<strong>in</strong><strong>in</strong>g common <strong>in</strong>formation <strong>in</strong> xfrm-state structure.In the <strong>in</strong>bound process<strong>in</strong>g <strong>of</strong> DML-IPSec ESP, first the xfrm-state structure represent<strong>in</strong>gSAs is derived us<strong>in</strong>g the selectors conta<strong>in</strong><strong>in</strong>g SPI and the IP address. InDML-IPSec, different cryptographic parameters are applied on different zones. Moreover,the derivation <strong>of</strong> the zone boundaries depends on the encrypted header portions.In DML-IPSec, first the zone def<strong>in</strong>ition is derived from the DML-zone-map structure<strong>of</strong> the xfrm-state structure and partial decryption on the type I zones is employed forthe derivation <strong>of</strong> exact zone lengths. The DML-esp-data list <strong>of</strong> the xfrm-state structureis l<strong>in</strong>early accessed to provide cryptographic <strong>in</strong>formation specific to zones. Thisdecryption is carried out by <strong>copy</strong><strong>in</strong>g the encrypted ESP data <strong>in</strong>to temporary buffer asthe authentication verification has to be performed on the encrypted zone data. Afterthe derivation <strong>of</strong> the zone boundaries, all the zones are decrypted and the <strong>orig<strong>in</strong>al</strong>IP datagram is re-constructed back. After the decryption <strong>of</strong> the ESP packet, SPD is74


eferred through the selector field <strong>of</strong> the SA. On successful policy verification, the IPdatagram traverses through the IP stack <strong>of</strong> the <strong>in</strong>bound mach<strong>in</strong>e.5.2.4 DML-IPSec process<strong>in</strong>g at the <strong>in</strong>termediate nodesThe implementation <strong>of</strong> DML-IPSec process<strong>in</strong>g at <strong>in</strong>termediate nodes is different fromthat <strong>of</strong> the endpo<strong>in</strong>ts. The <strong>in</strong>bound module decrypts the necessary type I zones togenerate a partially decrypted IP datagram so that the upper layer headers can beexam<strong>in</strong>ed by several network<strong>in</strong>g applications <strong>of</strong> the <strong>in</strong>termediate nodes.The outboundmodule processes the partially decrypted IP datagram to reconstruct the <strong>orig<strong>in</strong>al</strong>DML-IPSec packet. The security policy and association databases are implementedas XFRM structures as discussed <strong>in</strong> the previous section. The kernel level structuresrepresent<strong>in</strong>g the SPs and SAs are updated by the key shar<strong>in</strong>g protocol.Dur<strong>in</strong>g the <strong>in</strong>bound process<strong>in</strong>g, the structures represent<strong>in</strong>g the SPs are searchedl<strong>in</strong>early. If the policy for an <strong>in</strong>com<strong>in</strong>g DML-IPSec packet is partial DML-IPSec process<strong>in</strong>g,the structures represent<strong>in</strong>g SAs for that transformation are fetched from theSPs. The structure represent<strong>in</strong>g the SA has cryptographic <strong>in</strong>formation for all necessarytype I zones represented as DML-esp-data structures as mentioned <strong>in</strong> the previoussections. Partial decryption <strong>of</strong> headers is employed to derive the zone boundaries follow<strong>in</strong>gwhich the necessary type I zones are decrypted. After successful decryption <strong>of</strong>necessary type I zones, the IP datagram is constructed us<strong>in</strong>g these partial decryptedzones. One important po<strong>in</strong>t to notice is that, <strong>in</strong>formation like sequence number <strong>of</strong> ESPheader, cryptographic synchronization <strong>in</strong>formation like <strong>in</strong>itialization vector <strong>of</strong> differentzones varies from IP datagram to datagram. So, these <strong>in</strong>formation need to be savedper packet basis at the <strong>in</strong>bound process<strong>in</strong>g module <strong>of</strong> the <strong>in</strong>termediate node.TheDML-IPSec implementation saves these <strong>in</strong>formation <strong>in</strong> the newly generated partiallydecrypted IP datagram itself. After decrypt<strong>in</strong>g necessary type I zones, the ESP header75


and IVs <strong>of</strong> the decrypted zones are appended after the partially decrypted IP datagramand the length field and checksums are re-computed.The partially decrypted ESP packets are encrypted back to reconstruct the DML-IPSec ESP packet at the outbound module <strong>of</strong> the <strong>in</strong>termediate nodes. Similar to the<strong>in</strong>bound module, the policy database is searched to f<strong>in</strong>d out the policy. In case <strong>of</strong>partial DML-IPSec process<strong>in</strong>g, the security association entry is fetched. Unlike theDML-IPSec endpo<strong>in</strong>ts, where cryptographic synchronization data and ESP header sequencenumbers are derived from kernel variables and random numbers, the outboundmodule <strong>of</strong> <strong>in</strong>termediate nodes need to use the values used by the source <strong>of</strong> the packet.The appended ESP header and synchronization values from the partially decryptedIP datagram are used along with the cryptographic <strong>in</strong>formation saved at the zonal SAs<strong>of</strong> the outbound module to reconstruct the <strong>orig<strong>in</strong>al</strong> DML-IPSec ESP packet.The <strong>in</strong>termediate nodes have to process an ESP packet which is def<strong>in</strong>ed betweentwo different DML-IPSec endpo<strong>in</strong>ts. Hence, the security policy database is def<strong>in</strong>ed fortwo other mach<strong>in</strong>es. The key shar<strong>in</strong>g protocol is responsible for updat<strong>in</strong>g the securitydatabases accord<strong>in</strong>gly.Another important po<strong>in</strong>t is that both the <strong>in</strong>bound and outbound security policyand association database entries have to be created by the key shar<strong>in</strong>g protocolitself. The security association databases <strong>of</strong> both the <strong>in</strong>bound and outbound moduleshave to be populated with same cryptographic <strong>in</strong>formation. However, the policydatabases may vary considerably.For example, ESP tunnel mode datagrams withtype I zone spann<strong>in</strong>g over <strong>in</strong>ner IP header may have different entries at the outboundpolicy database than the <strong>in</strong>bound policy database.76


5.2.5 Security Databases configuration utilityThe security policies <strong>of</strong> DML-IPSec communication are dependent only on the DML-IPSec endpo<strong>in</strong>ts and not on the <strong>in</strong>termediate nodes. The security association on thecontrary is dependent on the <strong>in</strong>formation about <strong>in</strong>termediate process<strong>in</strong>g as it decidesthe cryptographic parameters for different portions <strong>of</strong> the IP datagram. The DML-IPSec ESP implementation uses the default IPSec utility setkey for the updation <strong>of</strong>the xfrm-policy structures represent<strong>in</strong>g the SPs. The default IPSec configuration <strong>file</strong> isused for updat<strong>in</strong>g the SPD at the time <strong>of</strong> def<strong>in</strong><strong>in</strong>g secure ESP communication betweentwo DML-IPSec endpo<strong>in</strong>ts.However, the updation <strong>of</strong> the SA entries are different from that <strong>of</strong> native IPSecimplementation, as DML-IPSec require to create zone specific SA entries at the xfrmstatestructure. The type II zone is secured between the endpo<strong>in</strong>ts, whereas the type Izones might be accessed by the <strong>in</strong>termediate nodes. Thus, the <strong>in</strong>termediate nodes donot participate <strong>in</strong> the establishment <strong>of</strong> SA correspond<strong>in</strong>g to type II zone. The DML-IPSec protocol also uses the default IPSec mechanisms (setkey and racoon utilities) fordef<strong>in</strong><strong>in</strong>g the SA between two endpo<strong>in</strong>ts, i.e. the SA for the type II zone. However, theSA for type I zones which are specifically <strong>in</strong>troduced <strong>in</strong> DML-IPSec process<strong>in</strong>g needsto be updated through a separate configuration <strong>file</strong> and an <strong>in</strong>terface. The configuration<strong>file</strong> conta<strong>in</strong>s the security parameters correspond<strong>in</strong>g to type I zone SAs. The <strong>in</strong>formation<strong>in</strong> the configuration <strong>file</strong> is communicated to the kernel space through a pseudo characterdevice driver [75].This device driver is also used by the key shar<strong>in</strong>g protocol forupdat<strong>in</strong>g zone specific SA configuration at the xfrm-state structures, represent<strong>in</strong>g SA.The esp-<strong>in</strong>it-state function <strong>of</strong> the native kernel implementation, <strong>in</strong>voked by the defaultIPSec configuration utilities, is modified to create necessary entries for all type I zonesand sole type II zone at the xfrm-state structure represent<strong>in</strong>g SA.Figure 5.5 shows the steps <strong>in</strong>volved when kernel applies zonal SA accord<strong>in</strong>g to77


Setkey DML−IPSec utility Key Shar<strong>in</strong>g Protocol Racoon IKE Remote IPSec Mach<strong>in</strong>e(6)(2)(10)(5)(1)Pseudo Character(11)Device deriver(8) (7)SPD(3)Kernel(9)(12)(4)SADFig. 5.5: Illustration <strong>of</strong> <strong>in</strong>teraction between user space utilities andKernel <strong>in</strong> DML-IPSecDML-IPSec def<strong>in</strong>ition.The numbers <strong>in</strong>dicated <strong>in</strong> the figure shows the sequence <strong>of</strong>events that are described below:1. The adm<strong>in</strong>istrator sets a policy to structures represent<strong>in</strong>g SPs by us<strong>in</strong>g setkey.2. The DML-IPSec user space utility updates the type I zone specific <strong>in</strong>formationto the pseudo character device driver.3. Kernel refers to SPD <strong>in</strong> order to make a decision <strong>of</strong> apply<strong>in</strong>g IPSec to a packet.4. If DML-IPSec is required, then kernel get the Key for zonal SAs from SAD.5. If it fails to get the key, then kernel sends a request to get the zone II Key toracoon (<strong>in</strong> the case <strong>of</strong> absence <strong>of</strong> manual SA configuration).6. The racoon exchanges the Key by us<strong>in</strong>g IKE with the other end <strong>of</strong> the IPSeccommunication.7. The racoon updates the structures represent<strong>in</strong>g SAs.8. The pseudo character device driver is consulted by the SA updation functionand zonal SAs are created.9. The kernel can send a packet after provid<strong>in</strong>g DML-IPSec security accord<strong>in</strong>g toSAs.78


10. Key shar<strong>in</strong>g protocol sends the new zone specific <strong>in</strong>formation to the pseudocharacter driver11. Pseudo device driver updates the SAs accord<strong>in</strong>g to new zonal <strong>in</strong>formation12. The kernel can send a packet after provid<strong>in</strong>g DML-IPSec security accord<strong>in</strong>g toSAs negotiated by key shar<strong>in</strong>g protocol.5.2.6 Key Shar<strong>in</strong>g ProtocolThe key shar<strong>in</strong>g protocol is one <strong>of</strong> the major components <strong>of</strong> the DML-IPSec protocol.In the follow<strong>in</strong>g discussion, we present the implementation details <strong>of</strong> the key shar<strong>in</strong>gprotocol. The key shar<strong>in</strong>g protocol consists <strong>of</strong> some user space utilities, correspond<strong>in</strong>gkernel space components and a mechanism for communication between the two. Theuser space utilities carry out the <strong>in</strong>vocation <strong>of</strong> the protocol, updation <strong>of</strong> the securityassociation databases and ensure the consistency <strong>of</strong> zone mapp<strong>in</strong>g and zone specificcryptographic <strong>in</strong>formation through all concerned nodes <strong>of</strong> the DML-IPSec communication.At the kernel level, pseudo character device driver is implemented to populatethe kernel space data structures with the data received from the user space.The ma<strong>in</strong> goal <strong>of</strong> the key shar<strong>in</strong>g protocol is to share the zone mapp<strong>in</strong>g and cryptographic<strong>in</strong>formation from the source <strong>of</strong> DML-IPSec communication to an <strong>in</strong>termediatenodes. In this regard, the key shar<strong>in</strong>g protocol implements a series <strong>of</strong> message transfersbetween the source and <strong>in</strong>termediate node <strong>of</strong> DML-IPSec communication. Themessages are transferred us<strong>in</strong>g ICMP packets. The protocol employs currently unusedtype and code field <strong>of</strong> the ICMP protocol [5,76] to carry out the communication.The payload carries the actual message correspond<strong>in</strong>g to the pair <strong>of</strong> theICMP packet. The receiver <strong>of</strong> the ICMP packet decodes the message accord<strong>in</strong>g to the pair <strong>of</strong> the ICMP header. The payload <strong>of</strong> the ICMP messages are <strong>of</strong>vary<strong>in</strong>g size as it may conta<strong>in</strong> encrypted zone map, encrypted authenticated data etc.79


The sender module has to update necessary header fields like length, checksum etc forconstruct<strong>in</strong>g a legitimate ICMP packet.Apart from shar<strong>in</strong>g the zone mapp<strong>in</strong>g and cryptographic <strong>in</strong>formation betweenDML-IPSec source and <strong>in</strong>termediate nodes, the key shar<strong>in</strong>g protocol also communicatesthe same between the source and dest<strong>in</strong>ation nodes dur<strong>in</strong>g the zone reorganizationphase. The key shar<strong>in</strong>g protocol implements the zone reorganization messagesus<strong>in</strong>g ICMP packets.For authentication, the protocol uses pari library implementation <strong>of</strong> RSA encryptionalgorithm [77, 78]. L<strong>in</strong>ux operat<strong>in</strong>g system default PRNG rand is used for thegeneration <strong>of</strong> PRNG used <strong>in</strong> the protocol. We have used DSA encryption algorithmfor the encryption <strong>of</strong> the zone specific cryptographic <strong>in</strong>formation at the f<strong>in</strong>al phase <strong>of</strong>key shar<strong>in</strong>g. However all these cryptography related methods are implemented <strong>in</strong> amodular way so that replacement by user-specific rout<strong>in</strong>es can be made seamlessly.After successful key transfer, the key shar<strong>in</strong>g protocol needs to update the securitydatabases <strong>of</strong> the L<strong>in</strong>ux kernel. In the case <strong>of</strong> end nodes, Security Association Databasehas to be modified <strong>in</strong> accordance with the zone map def<strong>in</strong>ition configuration <strong>file</strong>s.Here the pseudo character device driver is used to update kernel level data structureas discussed <strong>in</strong> the previous discussion. However, <strong>in</strong> the case <strong>of</strong> <strong>in</strong>termediate nodes,the security association as well as Security Policy Database need to be updated. Thesecurity parameter <strong>in</strong>formation is first parsed to segregate the policy database andassociation database <strong>in</strong>formation. The key shar<strong>in</strong>g protocol has to update both the<strong>in</strong>bound and outbound security databases. All the relevant <strong>in</strong>formation for updat<strong>in</strong>gthese databases are communicated at the f<strong>in</strong>al phase <strong>of</strong> the key shar<strong>in</strong>g protocol itself.Fig 5.6 depicts the overall high level <strong>in</strong>teraction <strong>of</strong> the DML-IPSec implementation.As shown <strong>in</strong> the diagram, the user space key shar<strong>in</strong>g protocol uses the pseudo characterdevice driver [75] for communicat<strong>in</strong>g to the kernel level implementation <strong>of</strong> DML-IPSec80


KERNEL SPACESA BundleSASPDZonal SAZonal SAPseudo CharacterDevice DriverNULLNULLDML−IPSecConfiguration andKey shar<strong>in</strong>g ProtocolSetkey andRacoon utilityUSER SPACEFig. 5.6: High level Interaction <strong>of</strong> DML-IPSec implementationprocess<strong>in</strong>g.5.3 EXPERIMENTAL VALIDATION OF THE DML-IPSEC PROTO-COLThis section presents experimental validation <strong>of</strong> the DML-IPSec protocol. We studyseveral <strong>in</strong>termediate applications that require access to different fields <strong>of</strong> the IP, TCP/UDPheaders. The standard IPSec protocols-AH and ESP-restrict the function<strong>in</strong>g <strong>of</strong> theseapplications at <strong>in</strong>termediate nodes as they require access to the transport layer andupper layer headers. For example, <strong>in</strong> case <strong>of</strong> tunnel mode ESP, access to the <strong>in</strong>ner IPheader is difficult as it rema<strong>in</strong>s encrypted. The access to the fields <strong>of</strong> the TCP andUDP headers is also difficult because <strong>of</strong> similar reasons. The details <strong>of</strong> the conflictsbetween <strong>in</strong>termediate process<strong>in</strong>g and IPSec security is discussed <strong>in</strong> chapter 3. We willbriefly mention the header fields required for them <strong>in</strong> the Table 5.1. Next, we present81


three zone mapp<strong>in</strong>gs accord<strong>in</strong>g to DML-IPSec ESP def<strong>in</strong>ition and show that the problem<strong>of</strong> access<strong>in</strong>g the headers at <strong>in</strong>termediate nodes can be overcome by us<strong>in</strong>g suitablezone mapp<strong>in</strong>g.Table 5.1: Applications, their use and the headers <strong>of</strong> the IP datagram accessedby themApplication Responsibility Header Fields usePerformance enhancement proxy Performance Enhancement for TCP IP, TCP HdrAppl. Proxy Performance ga<strong>in</strong> for Web IP, TCP and HTTP HdrRouters with Traffic Eng. Provid<strong>in</strong>g QoS based service IP, TCP or UDP HdrPacket filter<strong>in</strong>g Firewall Firewall<strong>in</strong>g IP,TCP,UDP HdrApplication layer Firewall Firewall<strong>in</strong>g IP,TCP, UDP,application HdrTraffic analysis Load/traffic control IP,TCP, UDP,application HdrWe consider three different zone mapp<strong>in</strong>gs for ESP tunnel mode, designated bydifferent cases as follows:• Case I : S<strong>in</strong>gle type II Zone.– Type I zone : Nil– Type II zone : Spans entire <strong>in</strong>ner IP datagram• Case II: Two zones with one type I and one type II zones– Type I zone: S<strong>in</strong>gle type I zone spans <strong>in</strong>ner IP header and transport header.– Type II zone : Spans entire transport layer payload.• Case III: Four zones with maximum <strong>of</strong> three type I zones and one type II zone– First type I zone spans the <strong>in</strong>ner IP header.– Second type I zone spans the transport layer header.– Third type I zone spans the application layer header.(For standard applicationsotherwise void)82


– Type II zone : Spans entire application layer payload for standard applicationor the entire transport layer payload.In the table we mention about the accessibility <strong>of</strong> header fields and thus work<strong>in</strong>g<strong>of</strong> different <strong>in</strong>termediate applications for different zone mapp<strong>in</strong>g mentioned above.Table 5.2: Work<strong>in</strong>g <strong>of</strong> different <strong>in</strong>termediate application <strong>in</strong> different zonemapp<strong>in</strong>gsHeader FieldsApplication that can functionCase I No access No application can functionCase II Inner IP and Transport hdr PEP,Routers with QoS,Packet Filter FWCase III Inner IP,transport and application hdr PEP,Appl Proxy,Routers,Firewall,Traffic analysisFrom table 5.1 we observe that all <strong>of</strong> the <strong>in</strong>termediate services require to access<strong>orig<strong>in</strong>al</strong> IP header and transport layer header and some <strong>of</strong> them require access toapplication layer header too. Table 5.2 shows that all these requirements can be metby one <strong>of</strong> the three typical zone mapp<strong>in</strong>g listed above as type II and III. It is to benoted that all these services are capable <strong>of</strong> process<strong>in</strong>g packets with variable size TCPand IP header. But <strong>in</strong> the presence <strong>of</strong> the exist<strong>in</strong>g ML-IPSec implementation, theyfail to get access to the OPTION fields.In the next section, we provide experimental verification <strong>of</strong> the claims <strong>of</strong> the DML-IPSec protocol with three different applications runn<strong>in</strong>g <strong>in</strong> the <strong>in</strong>termediate nodes.First, we use packet filter<strong>in</strong>g firewall to show the accessibility <strong>of</strong> the <strong>in</strong>ner IP andtransport layer header followed by application level firewall, which requires accessto IP, TCP and HTTP header. Next, we validate our claim <strong>of</strong> handl<strong>in</strong>g sessions withvariable zone sizes by provid<strong>in</strong>g access to OPTION fields <strong>of</strong> IP packets. The IP packetshav<strong>in</strong>g option fields have variable sized zones. We demonstrate it us<strong>in</strong>g a p<strong>in</strong>g programwith record rout<strong>in</strong>g feature. The presence <strong>of</strong> the IP address <strong>of</strong> the <strong>in</strong>termediate node at83


the record route output validates our claim <strong>of</strong> accessibility <strong>of</strong> OPTION field <strong>of</strong> <strong>in</strong>ner IPheader at <strong>in</strong>termediate node. In the absence <strong>of</strong> the DML-IPSec protocol, the firewallused to drop packets for not be<strong>in</strong>g able to retrieve the required headers. Similarly,the record route output did not show the IP addresses <strong>of</strong> the <strong>in</strong>termediate nodes thatdemonstrated the <strong>in</strong>accessibility <strong>of</strong> the OPTION fields <strong>of</strong> the IP datagram.5.3.1 Test bed setupClient(C11)IPSecGateway(GW1)IntermediateDevice( IN )IPSecGateway(GW2)Client(C21)140.1.4.1 140.1.4.30 140.1.4.31 140.1.4.13 140.4.4.13 140.4.4.31 140.4.4.30 140.4.4.1(eth0) (eth1) (eth0) (eth0) (eth1) (eth0) (eth1) (eth0)Fig. 5.7: Test bed Set upFigure 5.7 shows the testbed setup for the implementation <strong>of</strong> DML-IPSec. Wehave configured two L<strong>in</strong>ux servers as the ESP gateway (labeled as GW1 and GW2 <strong>in</strong>figure). We have configured another L<strong>in</strong>ux server (labeled as IN) as the <strong>in</strong>termediatenode <strong>in</strong> between GW1 and GW2 that run the different <strong>in</strong>termediate applications.All these L<strong>in</strong>ux servers are <strong>in</strong>stalled with RHEL-4 with the kernel version 2.6.23.The gateway mach<strong>in</strong>es GW1 and GW2 have the DML-IPSec implementation for ESPprotocol, whereas the <strong>in</strong>termediate node IN have the capabilities for partial DML-IPSec process<strong>in</strong>g. We have connected two client mach<strong>in</strong>es at the gateway mach<strong>in</strong>es(labeled as C11 and C21). The IP addresses <strong>of</strong> the clients and servers are shown <strong>in</strong>Fig 5.7.5.3.2 Validation with respect to <strong>in</strong>termediate servicesIn this section, we provide the details <strong>of</strong> the experiments on DML-IPSec protocol andthe correspond<strong>in</strong>g results <strong>in</strong> the presence <strong>of</strong> the follow<strong>in</strong>g <strong>in</strong>termediate applications.For all these subsequent experiments, we configure a DML-IPSec ESP tunnel between84


GW1 and GW2. The tunnel is def<strong>in</strong>ed for the entire subnet <strong>of</strong> the GW1 and GW2that also covers the clients C11 and C21. The relevant applications described next arerun <strong>in</strong> the <strong>in</strong>termediate node IN.Packet Filter<strong>in</strong>g FirewallWe carried out experiments for validat<strong>in</strong>g our solution with respect to statefulpacket filter<strong>in</strong>g us<strong>in</strong>g iptables firewall [79, 80] at IN for FTP session between C11and C21. We have chosen FTP as it uses TCP protocol <strong>in</strong> its transport layer. TheFORWARD cha<strong>in</strong> <strong>of</strong> the firewall is configured to allow only FTP packets between C11and C21. The default policy is set to DROP packets imply<strong>in</strong>g that <strong>in</strong> the event <strong>of</strong>the firewall not be<strong>in</strong>g to access the FTP port <strong>in</strong>formation encoded <strong>in</strong> the port fields<strong>of</strong> the TCP header, the packet will be dropped. We have also configured the iptablesfirewall to log all the traffic flow<strong>in</strong>g through the forward cha<strong>in</strong>. The GW1 and GW2are configured with two zone DML-IPSec ESP <strong>in</strong> tunnel mode, whereas the s<strong>in</strong>gle typeI zone spans the <strong>in</strong>ner IP header and transport layer header. The s<strong>in</strong>gle type II zonespans over the transport layer payload. The first zone is protected with DES algorithmwith HMAC-MD5 authentication and second zone is protected with AES encryptionand HMAC-MD5 authentication.At the first phase <strong>of</strong> our experimentation, we disable the execution <strong>of</strong> the user levelmodule <strong>of</strong> the key shar<strong>in</strong>g protocol at IN. Now we <strong>in</strong>itiate a FTP request from C21 toC11. The FTP session fails to establish.At the next phase, we start the key shar<strong>in</strong>g protocol with the request for the typeI zone spann<strong>in</strong>g over IP and Transport layer header.After successful execution <strong>of</strong>the key shar<strong>in</strong>g protocol, we aga<strong>in</strong> <strong>in</strong>itiate a FTP session from C21 to C11. Here thesession is established.In the first phase, the FTP session could not establish as the iptables firewallmodule is not able to access the <strong>in</strong>ner IP and TCP headers <strong>of</strong> the FTP packet. Fig-85


ure 5.10 depicts the screendump <strong>of</strong> the relevant kernel log message entries at the nodeIN correspond<strong>in</strong>g to the ESP packets seen at the <strong>in</strong>termediate node. We can noticeSRC, DST and PROTO fields <strong>in</strong> all the three packets. The SRC and DST representIP addresses <strong>of</strong> GW2 and GW1 respectively. ESP value at the PROTO field signifiesthat these packets are <strong>of</strong> ESP protocol from GW2 to GW1. From the SRC and DSTfields, it can be observed that all the packets are sent only from GW2 to GW1. Thesepackets corresponds to the ESP encapsulated TCP SYN packets from C21 to C11.These packets are retransmitted a number <strong>of</strong> times due to the non-receipt <strong>of</strong> TCP acknowledgmentpackets correspond<strong>in</strong>g to the TCP SYN packets. The acknowledgmentpacket not received as the firewall could not decrypt the ESP encapsulated TCP SYNpackets, result<strong>in</strong>g <strong>in</strong> dropp<strong>in</strong>g the SYN packets at IN itself.In the second case, we configure the key shar<strong>in</strong>g module to request the parametersfor zone request up to transport layer header.The FTP access is granted as theaccess to the <strong>in</strong>ner IP and TCP header could now be possible at the iptables firewallmodule <strong>of</strong> IN. Figure 5.9 depicts the screendump <strong>of</strong> the relevant kernel log messageentries at the node IN. We can see TCP packets flow<strong>in</strong>g between C11 and C21 <strong>in</strong>both directions as the <strong>in</strong>termediate node can decrypt the type I zone. The first threepackets correspond to the 3-way TCP handshake between C21 and C11, whereas lasttwo packets represent FTP traffic transfer(Port No 21).Fig. 5.8: ESP packet correspond<strong>in</strong>g to TCP request at the forward<strong>in</strong>gcha<strong>in</strong> <strong>of</strong> firewall at INApplication layer firewall86


Fig. 5.9: Partially decrypted TCP packet correspond<strong>in</strong>g to FTP requestat the forward<strong>in</strong>g cha<strong>in</strong> <strong>of</strong> firewall at INThe follow<strong>in</strong>g experiment validates our claim <strong>of</strong> accessibility <strong>of</strong> application layerheaders at the <strong>in</strong>termediate nodes. We configure str<strong>in</strong>g match extension module <strong>of</strong> theiptables firewall for allow<strong>in</strong>g application layer header access at the <strong>in</strong>termediate node.We configure a web server <strong>in</strong> the C11 with address c11.org. We <strong>in</strong>itially configure thepolicy as drop all packets at IN and then add required rules for allow<strong>in</strong>g only HTTPtraffic from c11.org.In the first case, with the key shar<strong>in</strong>g module disabled, the access to C11 from C21is denied. Figure 5.10 depicts the screendump <strong>of</strong> the kernel log message entries at INcorrespond<strong>in</strong>g to this case. Three ESP packets can be seen at the <strong>in</strong>termediate node.These messages correspond to the ESP encapsulated SYN packets <strong>of</strong> the 3-way TCPhandshake from C21 to C11 that are executed prior to the GET packet <strong>of</strong> the HTTPprotocol.S<strong>in</strong>ce the ESP packets can’t be partially decrypted, the firewall moduleDROPs these packets.In the second case, we configure the key shar<strong>in</strong>g module to request parameters forzones up to application layer header for HTTP traffic. The web access is granted asthe access to the HTTP header (carry<strong>in</strong>g the web address c11.org) is possible at theiptables firewall module <strong>of</strong> IN. Figure 5.11 depicts the screendump <strong>of</strong> the kernel logmessage entries relevant to this case. Here we can see TCP packets flow<strong>in</strong>g between87


C11 and C21 as the <strong>in</strong>termediate node can decrypt the type I zone. The first threepackets correspond to the TCP handshake prior to the HTTP GET message transfer,whereas last two packets represent web traffic transfer (Port No 80) conta<strong>in</strong><strong>in</strong>g theweb access as a part <strong>of</strong> the HTTP header.Fig. 5.10: ESP packet correspond<strong>in</strong>g to Web request at the forward<strong>in</strong>gcha<strong>in</strong> <strong>of</strong> firewall at INFig. 5.11: Partially decrypted TCP packet correspond<strong>in</strong>g to Web requestat the forward<strong>in</strong>g cha<strong>in</strong> <strong>of</strong> firewall at INSessions with variable zone sizesOur next experiment validates the ability <strong>of</strong> the DML-IPSec protocol to handlevariable zone size datagrams. One scenario <strong>in</strong> which an IP datagram can have variablezone size is when the IP header has the OPTION fields present. Depend<strong>in</strong>g on thenumber <strong>of</strong> such OPTIONs, the size <strong>of</strong> zone correspond<strong>in</strong>g to the IP header also varies.We use p<strong>in</strong>g application with the traceroute option (p<strong>in</strong>g -R ip-addr) between C21and C11 to demonstrate the capability <strong>of</strong> handl<strong>in</strong>g variable zone sizes. The tracerouteoption when enabled <strong>in</strong>serts the IP addresses <strong>of</strong> the <strong>in</strong>termediate nodes through which88


Fig. 5.12: P<strong>in</strong>g Traceroute Outputthe packet passes through before reach<strong>in</strong>g its dest<strong>in</strong>ation. This requires access to theOPTION fields <strong>of</strong> the IP headers <strong>of</strong> the ICMP packets as the addresses are <strong>in</strong>serted<strong>in</strong> the OPTION fields. We <strong>in</strong>itialize tunnel mode ESP communication between GW1and GW2 with two zones where the s<strong>in</strong>gle type I zone spans <strong>in</strong>ner IP header andtransport layer header and type II zone covers transport layer payload. We executethe p<strong>in</strong>g application from C21 for C11. The result <strong>of</strong> the execution is depicted <strong>in</strong> theFig 5.12. At every l<strong>in</strong>e, the round trip path for the packet is displayed. As seen <strong>in</strong>the Fig 5.12, the first output does not have the IP address <strong>of</strong> the <strong>in</strong>termediate nodeIN, i.e., 140.1.4.13 <strong>in</strong> the list <strong>of</strong> IP addresses traced <strong>in</strong> the route <strong>of</strong> the p<strong>in</strong>g packet.But, second packet onwards the entries for IN are present <strong>in</strong> the output <strong>of</strong> the p<strong>in</strong>gapplication, as the key shar<strong>in</strong>g protocol gets executed immediately after receiv<strong>in</strong>g thefirst ESP packet at IN.We further expla<strong>in</strong> the scenario with the help <strong>of</strong> Fig 5.13. This is the screen dump<strong>of</strong> wireshark packet captur<strong>in</strong>g utility [81] runn<strong>in</strong>g at the <strong>in</strong>termediate node dur<strong>in</strong>gthe execution <strong>of</strong> the p<strong>in</strong>g application discussed above.The first two ESP packetscorrespond to the first output <strong>of</strong> the p<strong>in</strong>g application when the <strong>in</strong>termediate node IN89


Fig. 5.13: Wireshark output for the P<strong>in</strong>g Application on eth1 <strong>in</strong>terfacedoes not have the cryptographic <strong>in</strong>formation for process<strong>in</strong>g the upper layer headersfor mak<strong>in</strong>g entry for own IP address. The IP addresses displayed at the start nodeare carried through the OPTION field <strong>of</strong> the <strong>in</strong>ner IP header <strong>of</strong> the DML-IPSec ESPpacket <strong>in</strong> tunnel mode. The ICMP messages 3-9 <strong>in</strong> Fig 5.13 correspond to key shar<strong>in</strong>gprotocol execution. These messages are ICMP type 1 messages (used <strong>in</strong> the key shar<strong>in</strong>gprotocol) that are not def<strong>in</strong>ed <strong>in</strong> the Wireshark application. Hence, they are markedas obsolete or malformed ICMP packets. On completion <strong>of</strong> the key shar<strong>in</strong>g protocol,between IN and GW1 the cryptographic parameters are loaded <strong>in</strong> the <strong>in</strong>termediatenode IN. The packet number 13 <strong>in</strong> Fig 5.13 is an ICMP message generated afterpartial decryption <strong>of</strong> an ESP message generated between GW1 to GW2 correspond<strong>in</strong>gto a p<strong>in</strong>g reply from C11 to C21. As we are captur<strong>in</strong>g the IP packets on the eth1<strong>in</strong>terface <strong>of</strong> IN, we can see the ESP packets com<strong>in</strong>g from the GW2 correspond<strong>in</strong>g tothe p<strong>in</strong>g request from C21 as seen <strong>in</strong> packet number 12 <strong>in</strong> Fig 5.13. But, the ESP90


packet from GW1 correspond<strong>in</strong>g to the p<strong>in</strong>g reply from C11 gets partially decryptedby the DML-IPSec process<strong>in</strong>g module before be<strong>in</strong>g captured on the eth1 <strong>in</strong>terface.Thus, we can observe the partially decrypted p<strong>in</strong>g reply as seen <strong>in</strong> packet number 13<strong>in</strong> Fig 5.13.Fig. 5.14: Layout <strong>of</strong> captured ESP Packet on eth0 <strong>in</strong>terface <strong>of</strong> INWe use the same p<strong>in</strong>g application for describ<strong>in</strong>g the layout <strong>of</strong> the partially decryptedIP packets at the <strong>in</strong>termediate node IN. We execute a p<strong>in</strong>g application atC11 for C12. The figure 5.14 depicts the output <strong>of</strong> wireshark application at the eth0<strong>in</strong>terface <strong>of</strong> IN, whereas the figure 5.15 depicts the output <strong>of</strong> wireshark applicationat the eth1 <strong>in</strong>terface. The screenshot is taken after the execution <strong>of</strong> the key shar<strong>in</strong>gprotocol. The DML-IPSec is configured for ESP <strong>in</strong> tunnel mode with two zones sameas the previous experiment <strong>of</strong> traceroute. The first zone spans over <strong>in</strong>ner IP headerand transport header and secured with DES algorithm. The second zone spans theentire transfer layer payload and encrypted with AES algorithm with 128 bits key91


Fig. 5.15: Layout <strong>of</strong> partially decrypted ESP packet on eth1 <strong>in</strong>terface<strong>of</strong> INlength. Both the zones are secured with encryption only mode without the presence<strong>of</strong> authentication.We executed the p<strong>in</strong>g application from C11 with 32 bytes <strong>of</strong> ICMP payload. Thismakes a 60 byte IP packet (20 bytes IP header + 8 bytes ICMP header + 32 bytes<strong>of</strong> ICMP payload). This ICMP packet is processed by GW1 and produces a two zoneDML-IPSec ESP packet <strong>in</strong> tunnel mode as an IP packet <strong>of</strong> 132 bytes. The s<strong>in</strong>gle typeI zone (zone1) spans the <strong>in</strong>ner IP header and transport layer header and the type IIzone (zone 2) spans the transport layer payload. The ESP packet thus formed consists<strong>of</strong> 132 bytes <strong>of</strong> data. The ESP packet consists <strong>of</strong> outer IP header <strong>of</strong> 20 bytes followedby 8 bytes <strong>of</strong> ESP header, 40 bytes <strong>of</strong> zone1 data and 64 bytes <strong>of</strong> zone 2 data. Thezone1 data is partitioned as 8 bytes <strong>of</strong> IV and 32 bytes <strong>of</strong> encrypted data.(28 bytes <strong>of</strong><strong>in</strong>ner IP header and ICMP header is padded to meet 8 byte block size requirement <strong>of</strong>DES algorithm ). The zone2 is partitioned as 16 bytes <strong>of</strong> IV and 48 bytes <strong>of</strong> encrypted92


data. (32 bytes <strong>of</strong> ICMP data and 1 byte next header field is padded to meet 16 byteblock size requirement <strong>of</strong> AES algorithm).Figure 5.15 is the capture at the eth1 <strong>of</strong> the GW1. At IN, the ESP packet depicted<strong>in</strong> Fig 5.14 is partially decrypted and the zone1 is decrypted. After that, the externalIP header, ESP header and the IV for the zone 1 is removed and we form an IP packetwhere the IP and ICMP headers <strong>of</strong> the <strong>orig<strong>in</strong>al</strong> ICMP message from C11 is used.This can be seen <strong>in</strong> the IP header and ICMP header portion <strong>of</strong> the figure 5.15. Onepo<strong>in</strong>t to note is that we have not discarded the external IP header, ESP header, IVfor zone1 as these <strong>in</strong>formation will be required for generat<strong>in</strong>g back the <strong>orig<strong>in</strong>al</strong> ESPpacket. Rather, we append these headers after the encrypted zone 2 portion. We alsodon’t discard the padd<strong>in</strong>g portions <strong>of</strong> the decrypted zone1. We update the IP headerand ICMP header to construct an ICMP packet with the <strong>orig<strong>in</strong>al</strong> ESP header lengthas can be seen <strong>in</strong> figure 5.15. This can be observed by compar<strong>in</strong>g the Total Lengthfields at the Fig 5.14 and Fig 5.15.5.3.3 Overheads <strong>of</strong> DML-IPSecThe DML-IPSec protocol allows the <strong>in</strong>termediate devices to access the various protocolheaders as well as handles sessions with variable zone sizes. However, it <strong>in</strong>troducesadditional process<strong>in</strong>g overhead and also <strong>in</strong>creases the packet size as compared to IPSecand ML-IPSec. We first analyze the effect <strong>of</strong> <strong>in</strong>crease <strong>in</strong> the packet length followed bythat <strong>of</strong> extra process<strong>in</strong>g overhead.DML-IPSec <strong>in</strong>creases the packet size compared to the standard IPSec. Such an<strong>in</strong>crease <strong>in</strong> IP packet size also takes place <strong>in</strong> the case <strong>of</strong> ML-IPSec. The <strong>in</strong>crease <strong>in</strong> IPdatagram length depends on the number <strong>of</strong> zones. As the number <strong>of</strong> zone <strong>in</strong>creasesthe overhead also <strong>in</strong>creases because <strong>of</strong> the presence <strong>of</strong> multiple authentication trailers,zone wise padd<strong>in</strong>g, presence <strong>of</strong> separate IVs for different zones. For example, when93


compared to standard IPSec, DML-IPSec with two zones will have bigger cipher textbecause <strong>of</strong> the presence <strong>of</strong> two separate IVs and separate padd<strong>in</strong>g for two zones. Moreover,the presence <strong>of</strong> two separate authentication trailer will <strong>in</strong>crease the overhead.We have enumerated the effect <strong>of</strong> <strong>in</strong>crease <strong>in</strong> packet length due to the DML-IPSecprotocol us<strong>in</strong>g a datagram with IP header length IL, Transport layer header length TLand transport layer payload <strong>of</strong> length n. We have computed the packet length <strong>in</strong> fourdifferent cases for IPSec and for the correspond<strong>in</strong>g cases <strong>of</strong> DML-IPSec. Each <strong>of</strong> thesefour cases consists <strong>of</strong> AH and ESP <strong>in</strong> transport and tunnel modes. For IPSec we haveconsidered HMAC-MD5 for authentication and AES for encryption. For DML-IPSec,we have considered two zones. In the case <strong>of</strong> transport mode, the first zone representsthe transport layer header and the type II zone spans the transport layer payload. Inthe case <strong>of</strong> tunnel mode, the sole type I zone covers <strong>in</strong>ner IP header and transportlayer header whereas the sole type II zone spans over transport layer payload. Boththe zones are protected with authentication and encryption. The authentication forboth the zones is provided us<strong>in</strong>g HMAC-MD5. The encryption is provided us<strong>in</strong>g DESand AES for zone1 and zone2 respectively. Table 5.4 shows the overhead <strong>in</strong> case <strong>of</strong> IPto IPSec and IP to DML-IPSec <strong>in</strong> all four cases.Table 5.3: Packet Length Comparisons (Bytes) between IPSec andDML-IPSec with two zones for AH and ESP <strong>in</strong> transport and tunnel modes.IPSecDML-ESP with two zonesAH Transport Mode 24+IL+TL+n 36+IL+TL+nAH Tunnel Mode 44+IL+TL+n 56+IL+TL+nESP Transport Mode 36 +IL+⌈(TL +n +2)/16⌉*16 56+IL+⌈(TL+1)/8⌉*8+⌈(n+2)/16⌉ *16ESP Tunnel Mode 56+⌈(IL+TL +n +2)/16⌉*16 76+⌈(IL+TL+1)/8⌉*8+⌈(n+2)/16⌉*16We observe that, the use <strong>of</strong> IPSec protocol adds an overhead rang<strong>in</strong>g from 24 to 73bytes. The DML-IPSec AH adds an extra 12 bytes overhead whereas the DML-IPSec94


Table 5.4: Packet Length Overhead (Bytes) <strong>in</strong> IPSec and DML-IPSec protocolwith two zones over standard IP protocol. The numbers <strong>in</strong> square bracketsdenote the m<strong>in</strong> and max values possible for that particular caseIP to IPSec IP to DML-IPSec with two zonesAH Transport Mode 24 36AH Tunnel Mode 44 56ESP Transport Mode [38,53] [59,81]ESP Tunnel Mode [58,73] [79,101]ESP <strong>in</strong>creases the overheads by maximum 28 bytes. For an average IP datagram <strong>of</strong> 500bytes, this is only a 3% to 5% <strong>in</strong>crease. The DML-IPSec protocol does not <strong>in</strong>troduceany extra overhead compared to ML-IPSec. The same overheads shown <strong>in</strong> table 5.4are applicable for ML-IPSec also. We consider the same datagram with IP headerlength IL, Transport layer header length TL and transport layer payload <strong>of</strong> length nfor ML-IPSec ESP process<strong>in</strong>g <strong>in</strong> ESP tunnel mode with two zones same as the case<strong>of</strong> DML-IPSec described above. The IP datagram will get partitioned <strong>in</strong> exactly sameway <strong>of</strong> the DML-IPSec and thus <strong>in</strong>troduce same overheads <strong>in</strong> packet size. However,the ML-IPSec protocol would not be able to handle IP datagrams with variable lengthIP and transport layer headers.We conduct experiments to study the performance on the test bed shown <strong>in</strong> Fig 5.7.We execute p<strong>in</strong>g program from C11 to C21 and use the Round Trip Time (RTT) tocompare the process<strong>in</strong>g delay <strong>in</strong> the follow<strong>in</strong>g network configurations between GW1and GW2 as described below.1. IP: The two gateways are configured without security protocol.2. IPSec : This is native ESP implementation provided with RHEL 4 L<strong>in</strong>ux distribution.We have configured tunnel mode ESP between GW1 and GW2 withAES algorithm with 128 bit key and without any authentication.3. ML-IPSec-1-zone: This is our ML-IPSec ESP implementation <strong>in</strong> tunnel mode95


and has a s<strong>in</strong>gle type II zone with AES encryption and without authentication.4. ML-IPSec-2-zones: This is our ML-IPSec ESP implementation <strong>in</strong> tunnel modewith 2 zones where the s<strong>in</strong>gle type I zone spans over the IP and transport layerheader whereas the s<strong>in</strong>gle type II zone spans over the transport layer payload.We use DES encryption for type I zone and AES for type II zone. This is animplementation where we use fixed zone sizes with the first zone spann<strong>in</strong>g over<strong>in</strong>itial 28 bytes <strong>of</strong> IP datagram whereas the second zone spans over the rest <strong>of</strong>the portion.5. DML-IPSec-2-zones: This is our DML-IPSec ESP implementation <strong>in</strong> tunnelmode with variable zone length. The type I zone covers the IP and transportlayer header and the entire transport layer payload is covered by the type IIzone. The length <strong>of</strong> the IP header can vary depend<strong>in</strong>g on the OPTION fieldand hence the size <strong>of</strong> zone1. Zonal cryptographic <strong>in</strong>formation is same to theprevious case.1.5time <strong>in</strong> sec −−−>10.501 2 3 4 5Fig. 5.16: RTT <strong>of</strong> p<strong>in</strong>g obta<strong>in</strong>ed <strong>in</strong> different communication scenariosbetween GW1 and GW2. (1) Normal IP communication (2) NativeIPSec ESP tunnel mode (3) ML-IPSec ESP tunnel mode without anytype I zone (4) ML-IPSec ESP tunnel mode with one type I zone andone type II zone <strong>of</strong> static length (5) DML-IPSec ESP tunnel mode withone type I zone and one type II zone <strong>of</strong> variable length96


Figure 5.16 depicts the round trip time <strong>of</strong> p<strong>in</strong>g application with 56 bytes <strong>of</strong> ICMPpayload sent from C11 to C21. We have taken the mean RTT value over 10 iterations<strong>of</strong> p<strong>in</strong>g program where each iteration consists <strong>of</strong> 100 p<strong>in</strong>g packets. We can see around50% <strong>in</strong>crease <strong>in</strong> RTT from normal IP to native IPSec. Next we can see around 12%<strong>in</strong>crease <strong>in</strong> RTT over native IPSec <strong>in</strong> case <strong>of</strong> ML-IPSec with only one type II zone.This <strong>in</strong>crease is due to the extra process<strong>in</strong>g and access to data structures <strong>in</strong>volved<strong>in</strong> ML-IPSec. There is around 30% <strong>in</strong>crease <strong>in</strong> RTT for ML-IPSec with two staticzones compared to one static zone. This <strong>in</strong>crease is due to <strong>in</strong>vocation <strong>of</strong> two differentencryption algorithms and also because <strong>of</strong> partion<strong>in</strong>g <strong>of</strong> s<strong>in</strong>gle IP datagram <strong>in</strong>to twozones. F<strong>in</strong>ally, we notice 10% <strong>in</strong>crease <strong>in</strong> RTT when we move to DML-IPSec with twodynamic zones from two static zones <strong>in</strong> ML-IPSec. This is because <strong>of</strong> the on-the-flyderivation <strong>of</strong> the zone length related process<strong>in</strong>g delay.The experiment measures the process<strong>in</strong>g delay due to the dynamic zone boundaryfeature <strong>of</strong> DML-IPSec protocol. The <strong>in</strong>termediate node <strong>in</strong> all five cases functions onlyas a forward<strong>in</strong>g device without do<strong>in</strong>g any DML-IPSec partial process<strong>in</strong>g and other<strong>in</strong>termediate process<strong>in</strong>g. Any extra process<strong>in</strong>g activity by an <strong>in</strong>termediate node mayadd to further delays. Next, we try to figure out the process<strong>in</strong>g delay <strong>in</strong>curred dueto the partial DML-IPSec process<strong>in</strong>g along with packet filter<strong>in</strong>g firewall<strong>in</strong>g operation.We execute p<strong>in</strong>g from C11 to C21 with 56 bytes <strong>of</strong> ICMP payload <strong>in</strong> the follow<strong>in</strong>gnetwork<strong>in</strong>g configurations:1. ML-IPSec-2-zones: This is our ML-IPSec ESP implementation <strong>in</strong> tunnel modewith 2 zones where the s<strong>in</strong>gle type I zone spans the IP and transport layer headerwhereas the s<strong>in</strong>gle type II zone spans the transport layer payload. We use DESencryption for type I zone and AES for type II zone. This is an implementationwhere we use fixed zone sizes with the first zone spann<strong>in</strong>g over <strong>in</strong>itial 28 bytes<strong>of</strong> IP datagram whereas the second zone spans over the rest <strong>of</strong> the portion.97


2. DML-IPSec-2-zones: This is our DML-IPSec ESP implementation <strong>in</strong> tunnelmode with variable zone length. The type I zone covers the IP and transportlayer header whereas the entire transport layer payload is covered by the typeII zone. Zonal cryptographic parameters are same as the previous case.In the first experiment, we observed the <strong>in</strong>crease <strong>in</strong> RTT <strong>in</strong> case <strong>of</strong> ML-IPSecwhereas, the second experiment compares the same for DML-IPSec. Both the experimentsconsists <strong>of</strong> two phases. In the first phase <strong>of</strong> the first experiment, we configurean ESP tunnel between GW1 and GW2. The <strong>in</strong>termediate node IN is not configuredwith the cryptographic protection. The firewall at IN is configured to allow ESP trafficbetween GW1 and GW2. In the second phase <strong>of</strong> the first experiment, we configurean ESP tunnel between GW1 and GW2. The <strong>in</strong>termediate node IN is configured todecrypt the data conta<strong>in</strong>ed the s<strong>in</strong>gle type I zone. The firewall at IN is configured toallow ICMP packets between C11 and C21.The second experiment is almost similar to the first with only a difference that weuse our DML-IPSec implementation with dynamic zones <strong>in</strong>stead <strong>of</strong> static ML-IPSec.The RTT values <strong>in</strong> these two experiments are depicted <strong>in</strong> fig 5.17 as 1 and 2. Theblack colored bar represents the RTT <strong>in</strong> the absence <strong>of</strong> <strong>in</strong>termediate IPSec process<strong>in</strong>gwhereas the other one represents the RTT <strong>in</strong> presence <strong>of</strong> partial IPSec process<strong>in</strong>g atIN. We observe around 20% <strong>of</strong> RTT <strong>in</strong>crease <strong>in</strong> case <strong>of</strong> <strong>in</strong>termediate node process<strong>in</strong>gfor the first experiment. This <strong>in</strong>crease is around 24% <strong>in</strong> the second experiment, whereDML-IPSec with variable zones are used.5.4 SUMMARYIn this chapter, we have described the design and implementation details <strong>of</strong> the DML-IPSec protocol <strong>in</strong>side L<strong>in</strong>ux kernel. We have provided the details about the new datastructures and their relationship with the exist<strong>in</strong>g kernel data structures. We have also98


1.81.61.4time <strong>in</strong> sec −−−>1.210.80.60.40.201 2Fig. 5.17: Comparison <strong>of</strong> RTT <strong>in</strong> presence <strong>of</strong> <strong>in</strong>termediate process<strong>in</strong>gobta<strong>in</strong>ed <strong>in</strong> different communication scenarios between GW1 and GW2.(1) ML-IPSec ESP tunnel mode with one type I zone and one type IIzone <strong>of</strong> static length (2) DML-IPSec ESP tunnel mode with one type Izone and one type II zone <strong>of</strong> variable lengthprovided experimental validation <strong>of</strong> our implementation <strong>in</strong> the context <strong>of</strong> <strong>in</strong>termediateapplications. Next, we have provided an analysis about the packet size overhead andthe overhead due to the change <strong>in</strong> packet process<strong>in</strong>g <strong>of</strong> DML-IPSec.99


CHAPTER 6SUMMARY AND CONCLUSIONThe research work beg<strong>in</strong>s with a study <strong>of</strong> security requirements <strong>in</strong> the TCP/IP networksand a review <strong>of</strong> approaches for provid<strong>in</strong>g communication security at differentlayers <strong>of</strong> the TCP/IP protocol stack. The IPSec protocol suite, has become a standardfor provid<strong>in</strong>g IP layer communication security services. The IPSec protocol suite, however,conflicts with the work<strong>in</strong>g <strong>of</strong> several <strong>in</strong>termediate applications for the purpose<strong>of</strong> performance enhancement and security <strong>of</strong> the overall network. TCP-PEP, Applicationlevel proxy, firewalls are some <strong>of</strong> these <strong>in</strong>termediate applications. Us<strong>in</strong>g transportfriendly ESP, TLS <strong>in</strong>stead IPSec, Splitt<strong>in</strong>g S<strong>in</strong>gle IPSec tunnels <strong>in</strong>to multiple tunnels,us<strong>in</strong>g Multi layer IPSec(ML-IPSec) are among the proposed solutions <strong>in</strong> literature toaddress this issue <strong>of</strong> conflict. The ML-IPSec protocol solves this <strong>in</strong>teroperability problemwithout violat<strong>in</strong>g the end-to-end security for the data or expos<strong>in</strong>g some importantheader fields unlike the other solutions. The ML-IPSec protocol applies different securityto different portions <strong>of</strong> an IP datagram represented as zones. The <strong>in</strong>termediatenodes can decrypt/encrypt the relevant header portions <strong>of</strong> an IP datagram and performtheir functionalities. However, the ML-IPSec protocol suffers from the problem<strong>of</strong> requirement <strong>of</strong> pre-configuration <strong>of</strong> cryptographic parameters and zone mapp<strong>in</strong>g fordifferent zones <strong>of</strong> an IP datagram. The requirement <strong>of</strong> static zone boundary can notcater TCP/IP packets with variable header sizes.Our extension to the ML-IPSec protocol, called Dynamic Multi Layer IPSec (DML-IPSec) proposes a multi layer variant with the capabilities <strong>of</strong> dynamic zone configurationand shar<strong>in</strong>g <strong>of</strong> cryptographic parameters between IPSec endpo<strong>in</strong>ts and <strong>in</strong>ter-100


mediate nodes.It also accommodates IP datagrams with variable length headers.The DML-IPSec supports the AH and ESP protocols <strong>of</strong> the conventional IPSec withsome modifications required for provid<strong>in</strong>g separate cryptographic protection to differentzones <strong>of</strong> an IP datagram. This extended protocol redef<strong>in</strong>es zone, zone map andSecurity Association (SA) and also redef<strong>in</strong>es IPSec process<strong>in</strong>g.The DML-IPSec protocol has two basic components. The first one is for process<strong>in</strong>g<strong>of</strong> datagrams at the endpo<strong>in</strong>ts as well as <strong>in</strong>termediate nodes. The second componentis the key shar<strong>in</strong>g protocol. The DML-IPSec endpo<strong>in</strong>ts are responsible for generat<strong>in</strong>gDML-IPSec datagrams from IP datagram and vice versa us<strong>in</strong>g the zone mapp<strong>in</strong>gand zone specific cryptographic <strong>in</strong>formation. The <strong>in</strong>termediate nodes are responsiblefor partial encryption/decryption <strong>of</strong> upper layer headers for <strong>in</strong>termediate process<strong>in</strong>g.The key shar<strong>in</strong>g protocol for shar<strong>in</strong>g zone related cryptographic <strong>in</strong>formation amongthe <strong>in</strong>termediate nodes is responsible for dynamically enabl<strong>in</strong>g <strong>in</strong>termediate nodes toaccess zonal <strong>in</strong>formation as required for perform<strong>in</strong>g specific services relat<strong>in</strong>g to qualityor security.The key shar<strong>in</strong>g protocol consists <strong>of</strong> four phases for reorganization <strong>of</strong>zones, authentication verification <strong>of</strong> the <strong>in</strong>termediate node, establishment <strong>of</strong> sharedsecret and actual transfer <strong>of</strong> the cryptographic <strong>in</strong>formation to the <strong>in</strong>termediate nodeus<strong>in</strong>g the shared secret.The DML-IPSec for ESP protocol is implemented accord<strong>in</strong>g to the new def<strong>in</strong>ition<strong>of</strong> zones along with the key shar<strong>in</strong>g protocol. RHEL version 4 and L<strong>in</strong>ux kernel version2.6.23.14 are used <strong>in</strong> this implementation for IPv4.Detailed experiments are carried out for validat<strong>in</strong>g the solution with respect t<strong>of</strong>irewall<strong>in</strong>g services.Stateful packet filter<strong>in</strong>g us<strong>in</strong>g iptables is employed along withstr<strong>in</strong>g match extension. The DML-IPSec protocol <strong>in</strong>troduces some process<strong>in</strong>g overheadand also <strong>in</strong>creases the datagram size as compared to IPSec and ML-IPSec. It <strong>in</strong>creasesthe datagram size compared to the standard IPSec.However, this <strong>in</strong>crease <strong>in</strong> IP101


datagram size is present <strong>in</strong> the case <strong>of</strong> ML-IPSec as well. The <strong>in</strong>crease <strong>in</strong> IP datagramlength depends on the number <strong>of</strong> zones. As the number <strong>of</strong> zones <strong>in</strong>creases this overheadalso <strong>in</strong>creases. We have used RTT <strong>of</strong> p<strong>in</strong>g program to determ<strong>in</strong>e the process<strong>in</strong>g delaydue to DML-IPSec process<strong>in</strong>g at endpo<strong>in</strong>ts and <strong>in</strong>termediate nodes. We observe around10% <strong>in</strong>crease <strong>of</strong> RTT time due to the DML-IPSec process<strong>in</strong>g.6.1 CONTRIBUTIONS OF THE WORKThe contributions <strong>of</strong> the research work carried out as a part <strong>of</strong> this thesis are as follows:First, it analyzes the problems <strong>of</strong> Intermediate services <strong>in</strong> the presence <strong>of</strong> endto-endsecurity protection <strong>of</strong> the IPSec protocol.It also reviews the solutions forthis problem <strong>of</strong> <strong>in</strong>teroperability between IPSec and <strong>in</strong>termediate services viz. TCP-PEP, routers provid<strong>in</strong>g QoS, firewall<strong>in</strong>g devices etc. The issues <strong>in</strong> us<strong>in</strong>g Multi LayerIPSec(ML-IPSec), especially <strong>in</strong> mobile environments are highlighted.Next, an extension to ML-IPSec is proposed to sort out these issues. Called DML-IPSec, this extension redef<strong>in</strong>es some <strong>of</strong> the IPSec and ML-IPSec primitives and process<strong>in</strong>gto achieve this. A new protocol for dynamically shar<strong>in</strong>g cryptographic parametersto <strong>in</strong>termediate nodes is also proposed. It is capable <strong>of</strong> dynamic modification <strong>of</strong> zonesand shar<strong>in</strong>g <strong>of</strong> cryptographic parameters between endpo<strong>in</strong>ts and <strong>in</strong>termediate nodesus<strong>in</strong>g a key shar<strong>in</strong>g protocol. The DML-IPSec also accommodates datagrams with variableheader lengths. The above mentioned features enable any <strong>in</strong>termediate node todynamically access required header portions <strong>of</strong> any DML-IPSec protected datagrams.Consequently they make the DML-IPSec suited for provid<strong>in</strong>g IPSec over mobile anddistributed networks. A complete implementation <strong>of</strong> DML-IPSec ESP protocol is alsocarried out as a part <strong>of</strong> the research work.F<strong>in</strong>ally, experimental validations <strong>of</strong> the the research work are provided. It alsoprovides experimental data for the calculation <strong>of</strong> overheads due to the extra process<strong>in</strong>g102


<strong>of</strong> DML-IPSec and also that <strong>of</strong> packet size. The DML-IPSec provides the dynamicsupport for QoS and security services without any significant extra overhead comparedto that <strong>of</strong> ML-IPSec.6.2 SCOPE FOR FURTHER RESEARCHThe research work carried out focuses on provid<strong>in</strong>g Dynamic Multi Layer IPSec onIPv4 networks. Work can be directed towards the adaptability <strong>of</strong> the current solutionfor IPv6 scenario. The extension headers <strong>of</strong> the IPv6 header are responsible for manyQoS and rout<strong>in</strong>g functionalities. In ESP tunnel mode scenario, all these extensionheaders rema<strong>in</strong> encrypted between the IPSec endpo<strong>in</strong>ts.Thus, <strong>in</strong>termediate nodesmay require to dynamically access these extension headers for perform<strong>in</strong>g QoS androut<strong>in</strong>g related functionalities. Moreover, IPv6 headers may conta<strong>in</strong> any number <strong>of</strong>extension headers.Thus the requirement <strong>of</strong> accommodation <strong>of</strong> IPv6 packets withvariable extension headers is also important.103


BIBLIOGRAPHY[1] D. Clark, “The Design Philosophy <strong>of</strong> the DARPA Internet Protocols,” ACM SIGCOMMComputer Communication Review, vol. 18, pp. 106–114, Aug. 1988.[2] J. Postel, “Internet Protocol,” RFC: 791, 1981.[3] J. Postel, “Transmission Control Protocol,” RFC: 793, 1981.[4] J. Postel, “User Datagram Protocol,” RFC: 768, 1980.[5] J. Postel, “Internet Control Message Protocol,” RFC 792, Sep. 1981.[6] S. Bellov<strong>in</strong>., “Security Problems <strong>in</strong> the TCP/IP Protocol Suite,” ACM SIGCOMMComputer Communication Review, vol. 19, pp. 32–48, Apr. 1989.[7] O. Adey<strong>in</strong>ka, “Internet Attack Methods and Internet Security Technology,” Proc. <strong>of</strong> theSecond Asia International Conference on Modell<strong>in</strong>g and Simulation, vol. 19, pp. 77–82,2008.[8] M. de Vivo, G. O. de Vivo, and G. Isern, “Internet security attacks at the basic levels,”ACM SIGOPS Operat<strong>in</strong>g Systems Review, vol. 32, pp. 4–15, Apr. 1998.[9] R. K. Marco de Vivo, Gabriela O. de Vivo and G. Isern, “Internet vulnerabilities relatedto TCP/IP and T/TCP,” ACM SIGCOMM Computer Communication Review, vol. 29,pp. 81–85, Jan. 1999.[10] A. Bhimani, “Secur<strong>in</strong>g the commercial Internet,” Communications <strong>of</strong> the ACM, vol. 39,pp. 29–35, June 1996.[11] W. Ford, Computer Communications Security – Pr<strong>in</strong>ciples, Standard Protocols andTechniques. PTR,Prentice Hall, 1994.[12] C. Kaufman, R. Perlman, and M. Spenc<strong>in</strong>er, Network Security – Private Communication<strong>in</strong> a Public World. PTR,Prentice Hall, 2002.[13] R. A. DeMillo, N. A. Lynch, and M. J. Merritt, “Cryptographic Protocols,” Proceed<strong>in</strong>gs<strong>of</strong> the fourteenth annual ACM symposium on Theory <strong>of</strong> comput<strong>in</strong>g, vol. 19, pp. 383–400,1982.[14] R. DeMillo and M. Merritt, “Protocols for Data Security,” IEEE Jnl on Computer,vol. 16, no. 2, pp. 39–51, 1983.[15] A. Menezes, P. van Oorschot, and S. Vanstone, Handbook <strong>of</strong> Applied Cryptography. CRCPress, 1996.[16] V.L.Voydock and S.T.Kent, “Security Mechanisms <strong>in</strong> high-level Network Protocols,”ACM Comput<strong>in</strong>g Surveys, vol. 15, pp. 135–171, June. 1983.104


[17] J. Callas, L. Donnerhacke, H. F<strong>in</strong>ney, and R. Thayer, “OpenPGP Message Format,”RFC: 2440, Nov. 1998.[18] P. Zimmermann, PGP User’s Guide. The MIT Press, 1995.[19] T. Dierks and C. Allen, “The TLS Protocol : Version 1.0,” RFC: 2246, Jan. 1999.[20] S. Kent and R. Atk<strong>in</strong>son, “Security Architecture for the Internet Protocol,” RFC 2401,1998.[21] B. Gleeson, A. L<strong>in</strong>, J. He<strong>in</strong>anen, T. F<strong>in</strong>land, G. Armitage, and A. Malis, “A Frameworkfor IP Based Virtual Private Networks,” RFC 2764, Feb. 2000.[22] E. Rosen, A. Viswanathan, and R. Callon, “Multiprotocol Label Switch<strong>in</strong>g Architecture,”RFC: 3031, Jan. 2001.[23] S. Kent and R. Atk<strong>in</strong>son, “IP Authentication Header,” RFC 2402, Nov. 1998.[24] S. Kent and R. Atk<strong>in</strong>son, “IP Encapsulat<strong>in</strong>g Security Payload,” RFC 2406, Nov. 1998.[25] D. Hark<strong>in</strong>s and D. Carrel, “The Internet Key Exchange (IKE),” RFC 2409, Nov. 1998.[26] D. Maughan, M. Schertler, M. Schneider, and J. Turner, “Internet Security Associationand Key Management Protocol (ISAKMP),” RFC 2408, Nov. 1998.[27] R. Perlman and C. Kaufman, “Key exchange <strong>in</strong> IPSec: analysis <strong>of</strong> IKE,” InternetComput<strong>in</strong>g, IEEE, vol. 4, pp. 50–56, Nov.-Dec. 2000.[28] I. Faynberg, S. Kasera, G. Sundaram, S. Mizikovsky, and T. Woo, “Intermediary-Based Transport Services, Performance Optimization Mechanisms, and Relevant Requirements,”INTERNET-DRAFT : draft-faynberg-<strong>in</strong>termediary-transport-00.txt, Feb.2002.[29] P. Srisuresh, J. Kuthan, J. Rosenberg, A. Molitor, and A. Rayhan, “Middlebox communicationarchitecture and framework,” RFC : 3303, Feb. 2002.[30] Y. Zhang, “A Multilayer IP Security Protocol for TCP Performance Enhancement<strong>in</strong> Wireless Network,” IEEE Journal on Selected Areas In Communications, vol. 22,pp. 767–776, May 2004.[31] M. Karir, “IPSEC and the Internet,” Masters Dissertation, Number: CSHCN MS 1999-9, 1999.[32] Y. Zhang and B. S<strong>in</strong>gh, “A multi-layer IPsec protocol,” Proc. Usenix Security Symp,pp. 213–228, Aug. 2000.[33] W. Stevens, The TCP/IP Illustrated Vol I : The Protocols. Addision-Wesley, 1995.[34] J. Postel and J. Reynolds, “File Transfer Protocol (FTP),” RFC : 959, Oct. 1985.[35] R. Field<strong>in</strong>g, J. Gettys, J. Mogul, H. Frystyk, L. Mas<strong>in</strong>ter, P. Leach, and T. Berners-Lee,“Hypertext Transfer Protocol – HTTP/1.1,” RFC : 2616, June 1999.105


[36] J. Postel and J.Reynolds, “TELNET Protocol Specification,” RFC : 854, May 1983.[37] R. Perlman, Interconnections: Bridges, Routers, Switches, and Internetwork<strong>in</strong>g Protocols.Addison-Wesley, 2000.[38] M. Allman, V. Paxson, and W. Stevens, “TCP Congestion Control,” RFC : 2581, Apr.1999.[39] S. Floyd, “Limited Slow-Start for TCP with Large Congestion W<strong>in</strong>dows,” RFC : 3742,March 2004.[40] W. Stevens, “TCP slow start, congestion avoidance, fast retransmit, and fast recoveryalgorithms,” RFC : 2001, 1997.[41] M. Chan and R. Ramjee, “TCP/IP performance over 3G wireless l<strong>in</strong>ks with rate anddelay variations,” Proc. <strong>of</strong> ACM Mobicom, pp. 71–82, Sept. 2002.[42] B. Guha and B. Mukherjee, “Network security via reverse eng<strong>in</strong>eer<strong>in</strong>g <strong>of</strong> TCP code:Vulnerability analysis and proposed solutions,” Proc. IEEE Infocom ’96, vol. 2, pp. 603–610, March 1996.[43] R. Oppliger, “Security at the Internet layer,” IEEE JNL on Computer, vol. 31, pp. 43–47, Sep. 1998.[44] N. Doraswamy and D. Hark<strong>in</strong>s, IPSec, 2nd Edn. Pearson Education, 2002.[45] S. Frankel, Demystif<strong>in</strong>g the IPSec Puzzle. Artech House Publishers, 2001.[46] J. Reynolds and J. Postel, “Assigned Numbers,” RFC 1700, Oct. 1994.[47] R. Rivest, “The MD5 Message-Digest Algorithm,” RFC : 1321, April 1992.[48] M. Oehler and R. Glenn, “HMAC-MD5 IP Authentication with Replay Prevention,”RFC : 2085, Feb. 1997.[49] P. Metzger and W. Simpson, “IP Authentication us<strong>in</strong>g Keyed SHA,” RFC : 1852, Sep.1995.[50] C. Madson and R. Glenn, “The Use <strong>of</strong> HMAC-MD5-96 with<strong>in</strong> ESP and AH,” RFC2403, Nov. 1998.[51] C. Madson and R. Glenn, “The Use <strong>of</strong> HMAC-SHA-1-96 with<strong>in</strong> ESP and AH,” RFC2404, Nov. 1998.[52] C. Madson and N. Doraswamy, “The ESP DES-CBC Cipher Algorithm With ExplicitIV,” RFC 2405, Nov. 1998.[53] P. Karn, P. Metzger, and W. Simpson, “The ESP DES-CBC Transform,” RFC : 1829,Aug. 1995.[54] P. Karn, P. Metzger, and W. Simpson, “The ESP Triple DES Transform,” RFC : 1851,Sep. 1995.106


[55] R. Glenn and S. Kent, “The NULL Encryption Algorithm and its Use with IPsec,” RFC2410, Nov. 1998.[56] N. Ferguson and B. Schneier, “A Cryptographic Evaluation <strong>of</strong> IPSec,” onl<strong>in</strong>e athttp://www.counterpane. com/ipsec.html, Apr. 1999.[57] H. Orman, “The OAKLEY Key Determ<strong>in</strong>ation Protocol,” RFC 2412, 1998.[58] B. Braden, D. Clark, J. Crowcr<strong>of</strong>t, B. Davie, S. Deer<strong>in</strong>g, D. Estr<strong>in</strong>, S.Floyd, V. Jacobson,G. M<strong>in</strong>shall, C. Partridge, L. Peterson, K. Ramakrishnan, S. Shenker, J.Wroclawski, andL. Zhang, “Recommendations on queue management and congestion avoidance <strong>in</strong> theInternet,” IETF, RFC 2309, 1998.[59] S. Floyd and V. Jacobson, “Random early detection gateways for congestion avoidance,”IEEE/ACM Trans. on Network<strong>in</strong>g, vol. 1, pp. 397–413, Aug. 1993.[60] S. Floyd and K. Fall, “Promot<strong>in</strong>g the use <strong>of</strong> end-to-end congestion control <strong>in</strong> the Internet,”IEEE/ACM Trans. on Network<strong>in</strong>g, vol. 7, pp. 458–472, Aug. 1999.[61] A. Bakre and B. R. Badr<strong>in</strong>ath, “I-TCP: Indirect TCP for mobile hosts,” Proc. 15th Int.Conf. Distributed Comput<strong>in</strong>g Systems (ICDCS), pp. 136–143, May 1995.[62] H. Balakrishnan, S. Seshan, E. Amir, and R. H. Katz, “Improv<strong>in</strong>g TCP/IP performanceover wireless networks,” Proc. 1st Annu. Int.Conf. Mobile Comput<strong>in</strong>g and Network<strong>in</strong>g(MobiCom95), pp. 2–11, 1995.[63] H. Balakrishnan, V. Padmanabhan, S. Seshan, and R. Katz, “A comparison <strong>of</strong> mechanismfor improv<strong>in</strong>g TCP performance over wireless l<strong>in</strong>ks,” IEEE/ACM Trans. on Network<strong>in</strong>g,vol. 5, pp. 756–769, Dec. 1997.[64] B. Bakshi, P. Krishna, N. H. Vaidya, and D. K. Pradhan, “Improv<strong>in</strong>g performance<strong>of</strong> TCP over wireless networks,” Proc. 17th Int. Conf.Distributed Comput<strong>in</strong>g Systems(ICDCS-17), pp. 365–373, May 1997.[65] S. McCreary and K. C. Claffy, “Trends <strong>in</strong> wide area IP traffic patterns:A view fromames Internet exchange,” ITC Specialist Sem<strong>in</strong>ar, Monterey, CA.[Onl<strong>in</strong>e]. Available:http://www.caida.org/outreach/papers/2000/AIX0005/, vol. 7, pp. 458–472, Sep. 2000.[66] A. Alshamsi and T. Saito, “A Technical Comparison <strong>of</strong> IPSec and SSL,” Proc. <strong>of</strong> the19th International Conference on Advanced Information Network<strong>in</strong>g and Applications(AINA05), 2005.[67] S. Bellov<strong>in</strong>, “Transport-friendly ESP (or layer violation for fun and pr<strong>of</strong>it),” IETF-44TF-ESP BOF, March 1999.[68] J. S<strong>in</strong>gh and B. Soh, “A Critical Analysis <strong>of</strong> Multilayer IP Security Protocol,” Proc <strong>of</strong>Third International Conf. on Information Tech. and Application, 2005.[69] E. Rescorla, “Diffie-Hellman Key Agreement Method,” RFC 2631, June 1999.[70] The L<strong>in</strong>ux Kernel Archives: www.kernel.org .107


[71] D. McDonald, C. Metz, and B. Phan, “PF-KEY key management API, version 2,” IETFRFC 2367, July 1998.[72] D. P. Bovet and M. Cesati, Understand<strong>in</strong>g the L<strong>in</strong>ux Kernel, Second Edition. O’Reilly,December 2002.[73] D. Bovet and M. Cesati, Understand<strong>in</strong>g the L<strong>in</strong>ux Network<strong>in</strong>g Kernel, Second Edition.O’Reilly, December 2002.[74] W. Stevens and G.R.Wright, The TCP/IP Illustrated Vol II : The Implementation.Addision-Wesley, 1995.[75] J. Corbet, A. Rub<strong>in</strong>i, and G. Kroah-Hartman, L<strong>in</strong>ux Device Drivers, Third Edition.O’Reilly, February 2005.[76] S. Hares and C. Wittbrodt, “Essential Tools for the OSI Internet,” RFC 1574, Feb.1994.[77] R. Rivest, A. Shamir, and L. Adleman, “A Method for Obta<strong>in</strong><strong>in</strong>g Digital Signaturesand Public-Key Cryptosystems,” Communications <strong>of</strong> the ACM, vol. 21, pp. 120–126,Feb. 1978.[78] C. Batut, K. Belabas, D. Bernardi, H. Cohen, and M. Olivier, Users Guide to the PARIlibrary (version 2.3.1) http://pari.math.u-bordeaux.fr.[79] The netfilter.org iptables project. http://www.netfilter.org/.[80] O. Andreasson, Iptables Tutorial 1.2.2. http://iptables-tutorial.frozentux.net/iptablestutorial.html.[81] G. Combs, Wireshark : Network Protocol Analyzer for Unix and W<strong>in</strong>dows. Availableat www.wireshark.org.108

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!