The Wayback Machine - https://web.archive.org/web/20240605164420/https://www.geeksforgeeks.org/internet-protocol-authentication-header/
Open In App

Internet Protocol Authentication Header

Last Updated : 16 Mar, 2023
Improve
Improve
Like Article
Like
Save
Share
Report

There are two main advantages that Authentication Header provides,

  • Message Integrity – It means, message is not modified while coming from the source.
  • Source Authentication – It means, the source is exactly the source from whom we were expecting data.

Prerequisite: Internet Protocol version 6 (IPv6) Header IP Authentication Header is used to provide connection-less integrity and data origin authentication. 

When packet is sent from source A to Destination B, it consists of data that we need to send and header which consist of information regarding packet. Authentication Header verifies origin of data and also payload to confirm if there has been modification done in between, during transmission between source and destination. However, in transit, values of some IP header fields might change (like- Hop count, options, extension headers). So, values of such fields cannot be protected from Authentication header. Authentication header cannot protect every field of IP header. It provides protection to fields which are essential to be protected.

Authentication Header : The question may arise, that how IP header will know that adjacent Extension header is Authentication Header. Well, there is protocol field in IP Header which tells type of header that is present in packet. So, protocol field in IP Header should have value of “51” in order to detect Authentication Header.

  1. Next Header – Next Header is 8-bit field that identifies type of header present after Authentication Header. In case of TCP, UDP or destination header or some other extension header it will store correspondence IP protocol number . Like, number 4 in this field will indicate IPv4, number 41 will indicate IPv6 and number 6 will indicate TCP.
  2. Payload Length – Payload length is length of Authentication header and here we use scaling factor of 4. Whatever be size of header, divide it by 4 and then subtract by 2. We are subtracting by 2 because we’re not counting first 8 bytes of Authentication header, which is first two row of picture given above. It means we are not including Next Header, Payload length, Reserved and Security Parameter index in calculating payload length. Like, say if payload length is given to be X. Then (X+2)*4 will be original Authentication header length.
  3. Reserved – This is 16-bit field which is set to “zero” by sender as this field is reserved for future use.
  4. Security Parameter Index (SPI) – It is arbitrary 32-bit field. It is very important field which identifies all packets which belongs to present connection. If we’re sending data from Source A to Destination B. Both A and B will already know algorithm and key they are going to use. So for Authentication, hashing function and key will be required which only source and destination will know about. Secret key between A and B is exchanged by method of Diffie Hellman algorithm. So Hashing algorithm and secret key for Security parameter index of connection will be fixed. Before data transfer starts security association needs to be established. In Security Association, both parties needs to communicate prior to data exchange. Security association tells what is security parameter index, hashing algorithm and secret key that are being used.
  5. Sequence Number – This unsigned 32-bit field contains counter value that increases by one for each packet sent. Every packet will need sequence number. It will start from 0 and will go till 2^{32}     – 1 and there will be no wrap around. Say, if all sequence numbers are over and none of it is left but we cannot wrap around as it is not allowed. So, we will end connection and re-establish connection again to resume transfer of remaining data from sequence number 0. Basically sequence numbers are used to stop replay attack. In Replay attack, if same message is sent twice or more, receiver won’t be able to know if both messages are sent from a single source or not. Say, I am requesting 100$ from receiver and Intruder in between asked for another 100$. Receiver won’t be able to know that there is intruder in between.
  6. Authentication Data (Integrity Check Value) – Authentication data is variable length field that contains Integrity Check Value (ICV) for packet. Using hashing algorithm and secret key, sender will create message digest which will be sent to receiver. Receiver on other hand will use same hashing algorithm and secret key. If both message digest matches then receiver will accept data. Otherwise, receiver will discard it by saying that message has been modified in between. So basically, authentication data is used to verify integrity of transmission. Also length of Authentication data depends upon hashing algorithm you choose.

Modes of operations in Authentication Header:

There are two modes in the authentication header

  • Authentication Header Transport Mode:
  • Authentication Header Tunnel Mode:  
  1. Authentication Header Transport Mode:  In the authentication header transport mode, it is lies between the original IP Header and IP Packets original TCP header.
  2. Authentication Header Tunnel Mode:  In this authentication header tunnel mode, the original IP packet is authenticated entire and the authentication header is inserted between the original IP header and new outer IP header. Here, the inner IP header contains the ultimate source IP address and destination IP address. whereas the outer IP header contains different IP address  that is IP address of the firewalls or other security gateways.

How does the header deals with Replay attack?

  • In a replay attack, the attacker a copy of an authenticated packet and then send to the intended destination. As the same packet received twice, the destination user can face some problems. To reduce this problem, the authentication header use a sequence number field. 
  • At this initial stage, the value of this field is set to 0. whenever the sender sends the packets to the same receiver over the same SA, it increments the fields value by 1. If the number of packets over the same increase this number, then communication with the receiver sender must establishing a new SA with the receiver.
  •  At the receiver side, the receiver maintains a sliding window size to W. The default value of W is 64. This window right edge represents the highest sequence number N received so far for a valid packet.                                                 When the receiver gets a packet from the sender, it perform some action. The appropriate action depends on the sequence number of the packet.       

Conclusion: How Authentication Header can be useful?

  • Message Integrity is also known as Connection-less Integrity
  • Source Authentication
  • Replay attack protection

Previous Article
Next Article

Similar Reads

Internet Protocol version 6 (IPv6) Header
Prerequisite: Introduction to Internet Protocol version 6 IP version 6 is the new version of Internet Protocol, which is way better than IP version 4 in terms of complexity and efficiency. Let's look at the header of IP version 6 and understand how it is different from the IPv4 header. IP version 6 Header Format : Version (4-bits): Indicates versio
4 min read
Difference between Serial Line Internet Protocol (SLIP) and Point-to-Point Protocol (PPP)
The main difference between the Serial Line Internet Protocol (SLIP) and Point-to-Point Protocol (PPP) is that Serial Line Internet Protocol is the Predecessor protocol of Point-to-Point Protocol. On the other hand, Point-to-Point Protocol is the Successor protocol of Serial Line Internet Protocol. Features of SLIP: Simple: SLIP is a simple protoco
4 min read
Difference between single-factor authentication and multi-factor authentication
1. Single-factor authentication: This authentication process is much simpler and is also considerably faster. With this Authentication process, we don’t have to face any complexity. So the first single authentication system that came out is the combination of the username and the password. The username determines the unique name of the user and the
2 min read
internet vs Internet
The term "internet" and "Internet" might seem to be a mistake in writing, but it is originally different in meaning also and refers to different concepts. In this article, we will look into what is the difference in the meaning of the terms "internet" and "Internet". What is Internet (uppercase "I")?The Internet is a much broader concept, the world
3 min read
Challenge Handshake Authentication Protocol (CHAP)
Challenge Handshake Authentication Protocol (CHAP) is a Point-to-point protocol (PPP) authentication protocol developed by IETF (Internet Engineering Task Force). It is used at the initial startup of the link. Also, it performs periodic checkups to check if the router is still communicating with the same host. Features : It uses 3-way handshaking p
5 min read
Password Authentication Protocol (PAP)
There are simply two methods to authenticate PPP links namely Password Authentication Protocol (PAP) and Challenge Handshake Authentication Protocol (CHAP). From these two authentication protocols, PAP is less secured as the password is sent in clear text and is performed only at the initial link establishment. Password Authentication Protocol (PAP
3 min read
Network Time Protocol (NTP) Security and Authentication
In the powerful scene of PC organizations, where accuracy is foremost, the Network Time Protocol (NTP) assumes an essential part in coordinating a consistent worldly dance among gadgets. As the foundation of time synchronization, NTP guarantees that divergent frameworks can walk as one, working with strong and proficient tasks across an organizatio
7 min read
Internet Telephony Protocol | H.323
Internet Telephony Protocol is also called Voice Over IP . It is a real-time interactive audio/video application. As from the name Internet Telephony, it uses internet as a telephone network with additional features. To communicate between two parties, it uses packet-switched Internet. There are two different types of protocols that enable Internet
2 min read
Types of ICMP (Internet Control Message Protocol) Messages
Pre-Requisite: Internet Control Message Protocol (ICMP) Internet Control Message Protocol is a protocol used for error handling and debugging in the network layer. It is mainly used in network devices such as routers for sending errors and operations. The main work of the Internet Control Message Protocol is of reporting errors, between any two dev
4 min read
What is IGMP(Internet Group Management Protocol)?
IGMP is acronym for Internet Group Management Protocol. IGMP is a communication protocol used by hosts and adjacent routers for multicasting communication with IP networks and uses the resources efficiently to transmit the message/data packets. Multicast communication can have single or multiple senders and receivers and thus, IGMP can be used in s
7 min read
Article Tags :