Ipv4 DATA GRAM
Ipv4 DATA GRAM
Ipv4 DATA GRAM
IPV4 Datagram
20.1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
20-2 IPv4
20.2
Figure 20.4 Position of IPv4 in TCP/IP protocol suite
20.3
Note
Payload
20.5
IPV packet has arrived with the
first few hexa decimal digits as
shown…
45000028000100000102….
45000028
00010000
0102….
20.6
IPv4 Datagram Format
Version (VER): version of the IP protocol.
Currently, the version is 4.
Header length (HLEN): the total length of the
datagram header in 4-byte words.
Length of the data gram header is divided by 4 and
inserted in this field
4 5 000028
4- version IPV 4
5 – Length in 4 bytes.. 5 x 4 = 20 bytes
Is option present or not?
20.7
IPv4 Datagram Format
20.9
IPv4 Datagram Format
Identification (16 bits): used in fragmentation (discussed
later).
Flags(3 bits): used in fragmentation (discussed later).
Fragmentation offset(13 bit): used in fragmentation
(discussed later).
Time to live(8 bits): it is used to control the maximum
number hops visited by the datagram.
Protocol(8 bits) : defines the higher-level protocol that
uses the services of the IPV4 layer.
Identify the bits for all these…
20.10
IPv4 Datagram Format
Checksum (16 bits) : 1’s compliment
checksum (introduced already).
Source address: is the IPv4 address of the
source.
Destination address: is the IPv4 address of
the source.
20.11
Note
20.12
Figure 20.7 Encapsulation of a small datagram in an Ethernet frame
20.13
Figure 20.8 Protocol field and encapsulated data
20.14
Table 20.4 Protocol values
20.15
Example 20.1
Solution
There is an error in this packet. The 4 leftmost bits (0100)
show the version, which is correct. The next 4 bits (0010)
show an invalid header length (2 × 4 = 8). The minimum
number of bytes in the header must be 20. The packet has
been corrupted in transmission.
20.16
Example 20.2
Solution
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 base header, the next 12 bytes are the options.
20.17
Example 20.3
Solution
The HLEN value is 7, which means the total number of
bytes in the header is 7 × 4, or 28 bytes (with options).
The total length is 48 bytes, which means the packet is
carrying 20 bytes of data (48 − 28).
20.18
Figure 20.9 Maximum transfer unit (MTU)
20.19
Table 20.5 MTUs for some networks
20.20
Fields Related to Fragmentation
Identification: identifies a datagram
originating from the source host. A combination
of the identification and source address must
uniquely define a datagram as it leaves the
source node.
Uses counters and increment on sending each
datagram
Flags: see next slide.
20.21
Figure 20.10 Flags (3 bits) used in fragmentation
20.22
Fields Related to Fragmentation
20.23
Figure 20.11 Fragmentation example
20.24
20.25
IPv4 Checksum
20.26
Figure 20.13 Example of checksum calculation in IPv4
20.27
GATE CS 2010
One of the header fields in an IP datagram is
the Time to Live(TTL)field.Which of the
following statements best explains the need
for this field?
(A) It can be used to prioritize packets
(B) It can be used to reduce delays
(C) It can be used to optimize throughput
(D) It can be used to prevent packet looping
20.28
GATE CS 2014
Host A (on TCP/IP v4 network A) sends an IP datagram
D to host B (also on TCP/IP v4 network B). Assume that
no error occurred during the transmission of D. When D
reaches B, which of the following IP header field(s) may
be different from that of the original datagram D?
(i) TTL (ii) Checksum (iii) Fragment Offset
(A) (i) only
(B) (i) and (ii) only
(C) (ii) and (iii) only
(D) (i), (ii) and (iii)
20.29
GATE CS 2015
20.30
20-3 IPv6
20.31
IPv6: Advantages
Larger address space.
Better header format.
New options.
Allowance for extensions.
Support for resource allocation.
Support for more security.
Figure 20.15 IPv6 datagram header and payload
20.33
Figure 20.16 Format of an IPv6 datagram
Priority
Protocol
20.34
Table 20.9 Comparison between IPv4 and IPv6 packet headers
20.35
20-4 TRANSITION FROM IPv4 TO IPv6
20.37
Figure 20.19 Dual stack
20.39
Figure 20.21 Header translation strategy
20.40