0% found this document useful (0 votes)
4 views

IPv4 Header

The document provides a detailed overview of the IPv4 and IPv6 headers, including their respective fields and functions. It highlights key differences between IPv4 and IPv6, such as address size, header length, and fragmentation methods. Additionally, it compares the features and configurations of both protocols, emphasizing the advancements in IPv6 over IPv4.

Uploaded by

ML Hridoy
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

IPv4 Header

The document provides a detailed overview of the IPv4 and IPv6 headers, including their respective fields and functions. It highlights key differences between IPv4 and IPv6, such as address size, header length, and fragmentation methods. Additionally, it compares the features and configurations of both protocols, emphasizing the advancements in IPv6 over IPv4.

Uploaded by

ML Hridoy
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

IPv4 Header

The following diagram represents the IPv4 header-

1. Version-

1. Version is a 4 bit field that indicates the IP version used.


2. So, this field always contains the decimal value 4.
3. Datagrams belonging to different versions have different structures.
4. So, they are parsed differently.
5. IPv4 datagrams are parsed by version-4 parsers.
6. IPv6 datagrams are parsed by version-6 parsers.

2. Header Length-

 Header length is a 4 bit field that contains the length of the IP header.
 It helps in knowing from where the actual data begins
 The initial 5 rows of the IP header are always used.
 So, minimum length of IP header = 5 x 4 bytes = 20 bytes.
 The size of the 6th row representing the Options field vary.
 The size of Options field can go up to 40 bytes.
 So, maximum length of IP header = 20 bytes + 40 bytes = 60 bytes.

3. Type Of Service-

 Type of service is a 8 bit field that is used for Quality of Service (QoS).
 The datagram is marked for giving a certain treatment using this field.

4. Total Length-

 Total length is a 16 bit field that contains the total length of the datagram (in bytes).

Total length = Header length + Payload length

 Minimum total length of datagram = 20 bytes (20 bytes header + 0 bytes data)
 Maximum total length of datagram = Maximum value of 16 bit word = 65535 bytes

5. Identification-
 Identification is a 16 bit field.
 It is used for the identification of the fragments of an original IP datagram.

When an IP datagram is fragmented,


 Each fragmented datagram is assigned the same identification number.
 This number is useful during the reassembly of fragmented datagrams.
 It helps to identify to which IP datagram, the fragmented datagram belongs to.

6.Flags- This is a three-bit field. The first bit is reserved (not used). The second bit is
called the do not fragment bit. If its value is 1, the machine must not fragment the
datagram. If it cannot pass the datagram through any available physical network, it
discards the datagram and sends an ICMP error message to the source host If its value is 0, the datagram can be fragmented if
necessary. The third bit is called the more fragment bit. If its value is 1, it means the datagram is not the last fragment; there are
more fragments after this one. If its value is 0, it means this is the last or only fragment.

7. Fragment Offset-

 Fragment Offset is a 13 bit field.


 It indicates the position of a fragmented datagram in the original unfragmented IP datagram.
 The first fragmented datagram has a fragment offset of zero.

8. Time To Live-

 Time to live (TTL) is a 8 bit field.


 It indicates the maximum number of hops a datagram can take to reach the destination.
 The main purpose of TTL is to prevent the IP datagrams from looping around forever in a routing loop.

The value of TTL is decremented by 1 when-


 Datagram takes a hop to any intermediate device having network layer.
 Datagram takes a hop to the destination.

If the value of TTL becomes zero before reaching the destination, then datagram is discarded.

9. Protocol-

 Protocol is a 8 bit field.


 It tells the network layer at the destination host to which protocol the IP datagram belongs to.
 In other words, it tells the next level protocol to the network layer at the destination side.

11. Header Checksum-

 Header checksum is a 16 bit field.


 It contains the checksum value of the entire header.
 The checksum value is used for error checking of the header.

At each hop,
 The header checksum is compared with the value contained in this field.
 If header checksum is found to be mismatched, then the datagram is discarded.
 Router updates the checksum field whenever it modifies the datagram header.

12. Source IP Address-

 Source IP Address is a 32 bit field.


 It contains the logical address of the sender of the datagram.

13. Destination IP Address-


 Destination IP Address is a 32 bit field.
 It contains the logical address of the receiver of the datagram.

14. Options-

 Options is a field whose size vary from 0 bytes to 40 bytes.


 This field is used for several purposes such as-
1. Record route: A record route option is used to record the IP Address of the routers through which the datagram passes
on its way.

2. Source routing: A source routing option is used to specify the route that the datagram must take to reach the destination.

3. Padding: Addition of dummy data to fill up unused space in the transmission unit and make it conform to the standard
size is called as padding

IPv6
IPv6 fixed header is 40 bytes long and contains the following information.

Field & Description


1
Version (4-bits): It represents the version of Internet Protocol, i.e. 0110.

2
Traffic Class (8-bits): These 8 bits are divided into two parts. The most significant 6 bits are used for Type of Service to let the
Router Known what services should be provided to this packet. The least significant 2 bits are used for Explicit Congestion
Notification (ECN).

3
Flow Label (20-bits): This label is used to maintain the sequential flow of the packets belonging to a communication. The source
labels the sequence to help the router identify that a particular packet belongs to a specific flow of information. This field helps
avoid re-ordering of data packets. It is designed for streaming/real-time media.

4
Payload Length (16-bits): This field is used to tell the routers how much information a particular packet contains in its payload.
Payload is composed of Extension Headers and Upper Layer data.

5
Next Header (8-bits): This field is used to indicate either the type of Extension Header, or if the Extension Header is not present
then it indicates the Upper Layer PDU. The values for the type of Upper Layer PDU are same as IPv4’s.

6
Hop Limit (8-bits): This field is used to stop packet to loop in the network infinitely. This is same as TTL in IPv4. The value of
Hop Limit field is decremented by 1 as it passes a link (router/hop). When the field reaches 0 the packet is discarded.

7
Source Address (128-bits): This field indicates the address of originator of the packet.

8
Destination Address (128-bits): This field provides the address of intended recipient of the packet.
Differences between IPv4 and IPv6 Addresses
Here is the main difference between IPv4 and IPv6:

Basis for differences IPv4 IPv6


Size of IP address IPv4 is a 32-Bit IP Address. IPv6 is 128 Bit IP Address.
IPv6 is an alphanumeric address whose binary bits
IPv4 is a numeric address, and its
Addressing method are separated by a colon (:). It also contains
binary bits are separated by a dot (.)
hexadecimal.
Number of header
12 8
fields
Length of header filed
20 40
Checksum Has checksum fields Does not have checksum fields
Example 12.244.233.165 2001:0db8:0000:0000:0000:ff00:0042:7879
Type of Addresses Unicast, broadcast, and multicast. Unicast, multicast, and anycast.
IPv4 offers five different classes of IP lPv6 allows storing an unlimited number of IP
Number of classes
Address. Class A to E. Address.
IPv4 support VLSM (Variable Length
VLSM support IPv6 does not offer support for VLSM.
Subnet mask).
Fragmentation is done by sending and
Fragmentation Fragmentation is done by the sender.
forwarding routes.
Networks need to be configured either
manually or with DHCP. IPv4 had
Network
several overlays to handle Internet IPv6 support autoconfiguration capabilities.
Configuration
growth, which require more
maintenance efforts.
Widespread use of NAT (Network
address translation) devices which
allows single NAT address can mask
It allows direct addressing because of vast address
Best feature thousands of
Space.
non-routable addresses, making end-
to-end
integrity achievable.
Use for the designated network from
Address Mask Not used.
host portion.
Relatively constrained network
IPv6 provides interoperability and mobility
Mobility & topologies to which move restrict
capabilities which are embedded in network
Interoperability mobility and interoperability
devices.
capabilities.
Security is dependent on applications – IPSec(Internet Protocol Security) is built into the
Security IPv4 was not designed with security in IPv6 protocol, usable with
mind. a proper key infrastructure.
Packet size 576 bytes required,
Packet size 1208 bytes required without fragmentation
fragmentation optional
Packet fragmentation Allows from routers and sending host Sending hosts only
Does not identify packet flow for QoS
Packet head contains Flow Label field that specifies
Packet header handling which includes checksum
packet flow for QoS handling
options.
DNS records Address (A) records, maps hostnames Address (AAAA) records, maps hostnames
IP to MAC resolution Broadcast ARP Multicast Neighbour Solicitation
Local subnet Group Internet Group Management Protocol
Multicast Listener Discovery (MLD)
management GMP)
Does not have optional fields. But Extension headers
Optional Fields Has Optional Fields
are available.
IPSec Internet Protocol Security (IPSec) Internet Protocol Security (IPSec) Concerning
Basis for differences IPv4 IPv6
concerning network security is optional network security is mandatory
Clients have approach DHCS (Dynamic
Dynamic host A Client does not have to approach any such server
Host Configuration server) whenever
configuration Server as they are given permanent addresses.
they want to connect to a network.
Uses ARP(Address Resolution Protocol) Uses NDP(Neighbour Discovery Protocol) to map to
Mapping
to map to MAC address MAC address
IPv6 address is represented in hexadecimal, colon-
IPv4 address uses the dot-decimal
Combability with separated notation.
notation. That’s why it is not suitable
mobile devices IPv6 is better suited to mobile
for mobile networks.
networks.

Comparison between IPv4 and IPv6 Headers:


The following shows the comparison between IPv4 and IPv6 headers.
❑ The header length field is eliminated in IPv6 because the length of the header is
fixed in this version.
❑ The service type field is eliminated in IPv6. The traffic class and flow label fields
together take over the function of the service type field.
❑ The total length field is eliminated in IPv6 and replaced by the payload length
field.
❑ The identification, flag, and offset fields are eliminated from the base header in
IPv6. They are included in the fragmentation extension header.
❑ The TTL field is called hop limit in IPv6.
❑ The protocol field is replaced by the next header field.
❑ The header checksum is eliminated because the checksum is provided by upper
layer protocols; it is therefore not needed at this level.
❑ The option fields in IPv4 are implemented as extension headers in IPv6.

IPv4 IPv6

IPv4 has a 32-bit address length IPv6 has a 128-bit address length

It Supports Manual and DHCP address


configuration It supports Auto and renumbering address configuration

In IPv4 end to end, connection integrity is


Unachievable In IPv6 end to end, connection integrity is Achievable

Address space of IPv6 is quite large it can produce


9
It can generate 4.29×10 address space 3.4×1038 address space

The Security feature is dependent on application IPSEC is an inbuilt security feature in the IPv6 protocol

Address representation of IPv4 is in decimal Address Representation of IPv6 is in hexadecimal

Fragmentation performed by Sender and


forwarding routers In IPv6 fragmentation performed only by the sender

In IPv6 packet flow identification are Available and uses the


In IPv4 Packet flow identification is not available flow label field in the header
IPv4 IPv6

In IPv4 checksum field is available In IPv6 checksum field is not available

In IPv6 multicast and anycast message transmission


It has broadcast Message Transmission Scheme scheme is available

In IPv4 Encryption and Authentication facility not In IPv6 Encryption and Authentication are provided
provided

IPv6 has header of 40 bytes fixed


IPv4 has a header of 20-60 bytes.

IPv4 can be converted to IPv6 Not all IPv6 can be converted to IPv4

IPv4 consist of 4 fields which are separated by


dot (.) IPv6 consist of 8 fields, which are separated by colon (:)

IPv4’s IP addresses are divided into five


different classes. Class A , Class B, Class C ,
Class D , Class E. IPv6 does not have any classes of IP address.

IPv4 supports VLSM(Variable Length subnet


mask). IPv6 does not support VLSM.

Example of IPv6:
Example of IPv4: 66.94.29.13 2001:0000:3238:DFE1:0063:0000:0000:FEFB

You might also like