Unit 3 IPv4 Format and IPv6
Unit 3 IPv4 Format and IPv6
AMK, CGPIT
2
IP Packet Structure
32 Bits
4-bit 4-bit 8-bit
Version Header Type of Service
16-bit Total Length (Bytes)
Length (TOS)
3-bit
16-bit Identification Flags 13-bit Fragment Offset
8-bit Time to
8-bit Protocol 16-bit Header Checksum
Live (TTL)
Header
32-bit Source IP Address
Payload
AMK, CGPIT
3
IPv4 Header
• IP Version number (4 bits)
– First 4 bits tells about version if IP protocol
– As per the value of version field, parsing is done
– “4” (for IPv4), “6” (for IPv6)
• Type-of-Service (8 bits)
– Allow packets to be treated differently based on needs
– E.g., low delay for audio, high b/w for bulk transfer
AMK, CGPIT
4
Example
The minimum number of bytes in the header must be 20. The packet has
been corrupted in transmission.
AMK, CGPIT
5
Example
The HLEN value is 8, which means the total number of bytes in the header
is 8 4 or 32 bytes.
The first 20 bytes are the main header, the next 12 bytes are the options.
AMK, CGPIT
6
IPv4 Header
4-bit
4-bit 8-bit
Version
Header
Length
Type of Service (TOS) 16-bit Total Length (Bytes)
16-bit Identification 3-bit 13-bit Fragment Offset
Flags
8-bit Time to
8-bit Protocol 16-bit Header Checksum
Live (TTL)
Payload
IPv4 Header
4-bit 4-bit 8-bit
Header Type of Service 16-bit Total Length (Bytes)
Version
Length (TOS)
16-bit Identification 3-bit 13-bit Fragment Offset
Flags
Payload
IPv4 Header
4-bit 4-bit 8-bit
Header Type of Service 16-bit Total Length (Bytes)
Version
Length (TOS)
16-bit Identification 3-bit 13-bit Fragment Offset
Flags
Payload
AMK, CGPIT
11
Multiplexing of Protocols
IPv4 Header
• Two IP addresses
– Source and destination (32 bits each)
• Destination address
– Unique identifier for receiving host
– Allows each node to make forwarding decisions
• Source address
– Unique identifier for sending host
– Enables recipient to send a reply back to source
AMK, CGPIT
13
Fragmentation
3 – Bit Flag →
AMK, CGPIT
14
Fragmentation
• Only the Data is fragmented (not the header)
• Modified header is prefixed to the data
• Reassembly is done only at the destination host as:
– Packet switched network so different paths by different
fragments are possible (independently routed)
– All the fragments reach anyhow to destination host
– Reassembly at intermediate nodes is loss of Efficiency
• Fields that are directly related to fragmentation are
– Identification, Flag, Fragmentation Offset
AMK, CGPIT
15
IPv4 Header
4-bit 4-bit 8-bit
Header Type of Service 16-bit Total Length (Bytes)
Version
Length (TOS)
16-bit Identification 3-bit 13-bit Fragment Offset
Flags
Payload
AMK, CGPIT
16
Options
• Used for testing, debugging and management
AMK, CGPIT
17
Option Format
AMK, CGPIT
18
No-Operation Option
• One byte filler between two options
• Used to align next option on 16 bit or 32 bit boundary
19
End-of-Option
• One byte option used for padding at the end of the last
option field
• Only one EOP could be used
• After this option, the receiver looks for the payload of IP
Datagram
20
Timestamp
• Option is used to record the time of datagram processing by
router
• Time is marked in millisecond from midnight
• Ideas is to estimate time of datagram travel; one router to
another
24
AMK, CGPIT
IPv4 v/s IPv6 Datagram
28
AMK, CGPIT
IPv4 v/s IPv6 Datagram
29
AMK, CCE
IPv4 v/s IPv6 Datagram
30
AMK, CGPIT
31
IPv6 Payload
• It is combination of
– Zero or more extension headers and
– Followed by data from other protocol (UDP, TCP, OSPF, …)
• Many extension headers are possible in payload
• Each extension header must have two mandatory fields
– Next header and length
• Each next header field value (code) defines type of next
header
• Last ‘Next Header’ informs protocol that is carried by
datagram
AMK, CGPIT
34
Base
Header
Payload
AMK, CGPIT