Ipv4 Datagram format
- Version number (4bits):
Specifies IP protocol version, different IP versions use different datagram formats. Allows Router to deal with - Header length (4bits):
Since IPv4 datagram may contain variable options, header length is needed to understand from where does transport layer segment begins - Type Of Service
Allows to differentiate different types of IP datagrams to be distinguished from each other. For eg useful in distinguishing real time datagrams from non-real time traffic - Datagram length:
total length of IP datagram measured in bytes - Identifier, flags, fragmentation offset:
these three fields are related to IP fragmentation, large IP datagram is broken into several smaller IP datagrams which are sent separately to the destination - Time to live
Field ensures that IP datagrams do not circulate forever in the network
Field decrements by one each time datagram is processed by a router.
TTL reaches 0, router drops the datagram
- Protocol
defines the transport layer protocol being used to which IP datagram should be passed to (TCP ya UDP) - Header checksum
Detects bit errors in IP datagram. Sum each 2 bytes in the header and perform 1s complement this checksum is known as internet checksum
Router computes header checksum for each received IP datagram
- Source and destination IP Addresses
source inserts src IP address and inserts dest IP address in the packet - Options
some IP datagrams may allow options and some may not, due to which one cannot determine clearly where the datafield would start. IP options are not included in IPv6 headers - Data(Payload)
Contains the transport layer segment to be delivered





