IPv4 Header Format
IPv4 Header Format
FORMAT
By-
Shimona Gupta
CSE Department
Invertis University
Bareilly
CONNECTIONLESS VS
CONNECTION-ORIENTED SERVICE
TCP/IP’s fundamental delivery service is
connectionless
Individual packets travel independently and contains
information that identifies the intended recipient
A reliable connection-oriented service is added on top
of the underlying connectionless service
2
DATAGRAM FORWARDING ACROSS
HETEROGENEOUS NETWORKS
3
UNRELIABLE
DATAGRAM DELIVERY
IP makes a best-effort attempt to deliver each
datagram
No guarantee of datagram delivery
Problems that can occur at layer 3
• datagram duplication due to excessive delay
• out-of-order delivery
• data corruption
• datagram loss
Higher layers of protocol software are needed to
handle these errors.
4
IP Datagram Header Format [Source:TCP/IP Protocol Suite by Forouzan]
5
Service type or differentiated services[Source:TCP/IP Protocol Suite by Forouzan]
Note
The precedence subfield was
part of version 4, but never
used.
6
IP DATAGRAM HEADER(CONT.)
Version:This 4-bit field defines the version of the IP
protocol. Currently the version is 4.
Header Length:This 4-bit field defines the total
length of the datagram header in 4-byte words. This
field is needed because the length of the header is
variable (between 20 and 60 bytes).
Service Type: In the original design of IP header, this
field was referred to as type of service (TOS) , which
defined how the datagram should be handled.
Total Length (16 bits): Total length of the datagram,
7
measured in octets, including header and data.
Identification (16 bits): A value assigned to aid in
assembly of fragments.
Flags (3 bits): Various Control Flags.
Bit 0: Reserved. Must be 0.
Bit 1: (DF) 0 = May Fragment, 1 = Don’t Fragment
Bit 2: (MF) 0 = Last Fragment, 1 = More Fragments
Time to Live (8 bits): Maximum time the datagram is
allowed to exist in the system. Each router that
handles the datagram decrements the TTL by 1.
8
Protocol:This 8-bit field defines the higher-level
protocol that uses the services of the IP layer. An IP
datagram can encapsulate data from several higher
level protocols such as TCP, UDP, ICMP, and IGMP.
Checksum: It is used to detect error in the delivery of
packet.
Source address:This 32-bit field defines the IP address
of the source.
Destination address:This 32-bit field defines the IP
address of the destination.
9
Numerical 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.