Module 4 Lec 28-30 - Introduction and Basics of IPv4 Header
Module 4 Lec 28-30 - Introduction and Basics of IPv4 Header
Disclaimer: The contents in this slide have been referred from many sources which I do not claim as my own. Some of the content has been modified for easier
understanding of the students without any malafide intention. This slide is only for educational purpose strictly, and not for the commercial purpose.
Objectives
• The objective of this module is to discus following concepts…
1. Position of Network Layer
2. Services and Responsibilities of Network Layer
3. Performance parameter at the Network Layer
4. Network Layer Protocol
1. IPv4 Datagram Format
5. Fragmentation
Example 4.1: Calculate the throughput for the diagram shown above.
Answer- 100 Kbps
Explanation:- 𝑇ℎ𝑟𝑜𝑢𝑔ℎ𝑝𝑢𝑡 = 𝑚𝑖𝑛𝑖𝑚𝑢𝑚{𝑇𝑅1 , 𝑇𝑅2 , … . . 𝑇𝑅𝑛 , }
• Packet Loss: When a router receives a packet while processing another packet, the
received packet needs to be stored in the input buffer waiting for its turn. A router,
however, has an input buffer with a limited size. A time may come when the buffer
is full and the next packet needs to be dropped. This results in packet loss. The
effect of packet loss on the Internet network layer is that the packet needs to be
resent, which in turn may create overflow and cause more packet loss.
Structure of a Router
• The overview of a router is shown below briefly.
Question: After processing a packet, if TTL becomes zero, then comment whether this packet will be sent to the next
router or not?
Question: Can a router receive a packet with TTL=0?
Note: First, the value in the checksum field is kept 0. Then the entire header is divided
into 16-bit sections and added together. The result (sum) is complemented and
inserted into the checksum field.
• Option: It is not compulsory part of the IPv4 header. Its maximum size is of 40
bytes and this field is used for network testing and debugging.
Fragmentation
What is fragmentation and why it is needed?
• Need: The value of maximum transfer unit (MTU) depends upon the physical
layer protocol. For e.g., the maximum and minimum value of MTU is 65,535 in
case of Hyperchannel and 296 in case of PPP. If size of IPv4 datagram equals to
65,535 then transmission becomes more efficient. But at the same time, it is not
possible to send this size of datagram over other than Hyperchannel network.
Hence, we need to divide a datagram into smaller datagrams such that it can pass
over any physical networks. This is called fragmentation.
Maximum Transfer Unit (MTU): It is the maximum size of the data field.
In other words, when a datagram is encapsulated in a frame, the total size of the
datagram must be less than this maximum size.
IP datagram
MTU
Header Maximum length of data to be encapsulated in a frame Trailer
Fields Related to Fragmentation
• Identification: The identification number helps the destination in
reassembling the datagram. It knows that all fragments having the
same identification value must be assembled into one datagram.
• Flags: The first bit is reserved. If D=1, then datagram can not be
fragmented. If M=1, there are more fragments after this one. If M=0, it
means this is the last or only fragment.
D M
Fig: Flags used in fragment D: Do not fragment
M: More fragment
Example 4.2: Fragmentation in a datagram with a data size of 4000 bytes if MTU
allowed is 1420 bytes only.
Yes, we need reassembly of the packets at the receiver side: It is obvious that even if each fragment follows a
different path and arrives out of order, the final destination host needs to arrange the datagram in proper order.
Answer: The original datagram from the fragments received (if none of them is lost) can be rearranged by using
the following strategy:
1. The first fragment has an offset field value of zero.
2. Divide the length of the first fragment by 8. The second fragment has an offset value equal to that result.
3. Divide the total length of the first and second fragments by 8. The third fragment has an offset value
equal to that result.
4. Continue the process. The last fragment has a more fragment bit value of 0.
Blind Rule: Divide the first data of the fragment by 8 to get the offset value
of that fragment.
Answer: It is the last fragment. However, we can’t say whether original packet is fragmented or not. A non-fragmented
packet is considered the last fragmented.