6.
7 IPv4 DATAGRAM
Presented by : Shubhangi Desai
What is IP?
IP – Internet Protocol
Work on network layer
Connectionless
Packets may take different path
Packets may arrive out of order
Packets may be discarded when network resources are
exhausted
What is IP Datagram?
IP Datagram is fundamental unit of information passed
across any network utilizing Internet Protocol
Header Area
Data Area
IP Datagram contains source & destination addresses
along with data & number of fields that define things such
as length of datagram, header, checksum & flags
IP datagram is transported from one network to
another (encapsulated in network frame)
IP Datagram
Datagram
Data in the Datagram
Header
IP Datagram
Frame
Complete Datagram treated as data
Header
MAC Frame
Datagram Format
Version
Size : 4 bits
Identifies the version of IP used to generate the
datagram
For IPv4, this is of course the number 4
The purpose of this field is to ensure compatibility
between devices that may be running different versions
of IP
A device running an older version of IP will reject
datagram created by newer implementations,
Header Length
Size : 4 bits
Specifies the length of the IP header, in 32-bit words
Includes the length of any options fields and padding.
The normal value of this field when no options are
used is 5 (5 32-bit words = 5*4 = 20 bytes or octats)
Type of Service (TOS)
TOS describes how the packet should be handled in
transit in terms of speed v/s reliability v/s throughput
Precedence : Specifies
importance of datagram
(also known as code points)
0 1 2 3 4 5 6
7
Delay : Set to 1 – low delay
Throughput: Set to 1 – high throughput
Reliability: Set to 1 – high reliability
Total Length
Size: 16 bits (2 bytes)
Specifies the total length of the IP datagram, in bytes
This field is 16 bits wide, the maximum length of an IP
datagram is 65,535 bytes
Identification
Size: 16 bits (2 bytes)
Uniquely identifies the datagram
Usually incremented by 1 each time a datagram is sent.
All fragments of a datagram contain the same
identification value.
This allows the destination host to determine which
fragment belongs to which datagram
IP Fragmentation - Encapsulation
When a host or router handles a datagram, the IP software
determines the next hop to which the datagram should be sent.
Encapsulation applies to one transmission at a time. When the
frame arrives at the next hop, the IP datagram is removed and
the frame discarded.
If the datagram most be forwarded across another network, a
new frame is created and the encapsulation is repeated
Encapsulation (cont…)
Hosts and routers store the datagram in memory; when
transmitted it is encapsulated in a frame suitable for
the network. Each hardware technology specifies the
maximum amount of data that a frame can carry. This
is called the Maximum Transmission Unit (MTU).
Host H2 can only transmit
datagram containing 1,000
octets or less to router R
can forward across network 1.
However, if host H1 transmits a 1,500-octet datagram,
router R cannot send it across network 2.
Fragmentation
IP uses a technique called fragmentation to solve the
problem of heterogeneous MTUs.
When a datagram is larger than the MTU of the
network over which it must be sent, it is divided into
smaller fragments which are each sent separately
Fragmentation (cont…)
When an IP datagram is fragmented, each fragment is
treated as a separate datagram
It is reassembles at the final destination, not at a router!!!
Why so? Because it may possible that router needs to
fragment it once again
Each fragment has its own header
Identification number is copied to each fragment
Flags
0 : Reserved (not used)
1 (DF) : Set to 1. Specifies datagram
should not be fragmented
0 1 2
2 (MF) : Set to 0. Specifies last fragment
in message.
Set to 1. Specifies more fragments are yet to come.
Note: If DF is set to 1 then surely there will be only a
single “fragment” so MF will always be set to 0
Fragment Offset
Size: 13 bits
Reflects the position of the fragment within its original
datagram
At receiver side the process of reconstructing the
original datagram is called as REASSEMBLY.
The FRAGMENT OFFSET field tells the receiver
how to order the fragments
Time to Live (TTL)
Size: 8 bits
The TIME TO LIVE field specifies how long (in
seconds) a datagram is allowed to remain on the
Internet system.
If this field is zero, the packet is destroyed
Usually decremented by one when passed from one
hop to the next
Protocol
Size: 8 bits
Uses some IDs to define datagram is using which
protocol
Note : just for information
UDP uses the number 17
TCP uses 6
ICMP uses 1
IGRP uses 88
And so on…
Header Checksum
Checksum is computed only on the header which
reduces processing time
Checksum is applied to only the values of header
field of datagram, NOT DATA
Source & Destination IP Address
Size: 32 bits (each)
IP address of ultimate sending & receiving host of the
packets
Options & Padding
Size: depending on which options are selected
Any Questions