Network

IP Protocol

In this tutorial, we are going to see What is the IP Protocol?. The IP protocol is part of the Internet layer of the TCP/IP protocol suite. It is one of the most important protocols on the Internet because it enables the generation and transport of IP datagrams (data packets), but does not “deliver” them. In fact, the IP protocol treats IP datagrams independently by defining their representation, routing and forwarding.

The IP protocol determines the recipient of the message thanks to 3 fields:

  • The IP address field: address of the machine
  • The subnet mask field: a subnet mask allows the IP protocol to determine the part of the IP address that concerns the network
  • The default gateway field: allows the Internet protocol to know which machine to send the datagram to if the destination machine is not on the local network

 

Datagrams:

Data is sent over the Internet as datagrams (also known as packets). Datagrams are encapsulated data, i.e. data to which headers have been added corresponding to information about their transport (such as the destination IP address).

The data contained in the datagrams is analyzed (and possibly modified) by the routers that allow their transmission.

Here is what a datagram looks like:
 


Image source: www.wikimedia.org

 
Here is the meaning of the different fields:

  • Version (4 bits): it is the version of the IP protocol that we use (currently we use the version 4 IPv4) in order to verify the validity of the datagram. It is coded on 4 bits.
  • Header length, or IHL for Internet Header Length (4 bits): it is the number of words of 32 bits constituting the header (note: the minimal value is 5). This field is coded on 4 bits.
  • Type of service (8 bits): this indicates the way in which the datagram should be processed.
  • Total length (16 bits): it indicates the total size of the datagram in bytes. The size of this field is 2 bytes, so the total size of the datagram cannot exceed 65536 bytes. When used in conjunction with the header size, this field is used to determine where the data is located.
  • Identification, flags and fragment offset: are fields that allow the fragmentation of datagrams, they are explained here.
  • Time To Live (8 bits): this field indicates the maximum number of routers through which the datagram can pass. Thus this field is decremented at each transit in a router, when it reaches the critical value of 0, the router destroys the datagram. This avoids network congestion caused by lost datagrams.
  • Protocol (8 bits) : this field, in decimal notation, allows to know from which protocol the datagram comes from
    • ICMP: 1
    • IGMP : 2
    • TCP: 6
    • UDP: 17
  • Header checksum (16 bits): this field contains a value coded on 16 bits which makes it possible to control the integrity of the header in order to determine if this one was not altered during the transmission. The checksum is the complement to one of all the 16-bit words of the header (excluding the checksum field). It is in fact such that when the header fields are summed (including the checksum), a number is obtained with all the bits set to 1
  • Source IP address (32 bits): This field represents the IP address of the sending machine, it allows the recipient to answer
  • Destination IP address (32 bits): IP address of the message recipient

 
IP FragmentationIP FragmentationIn this tutorial, we are going to see What is the IP Fragmentation and how it works? As we have seen previously, the maximum size…Read More

mcq-networking-question-answerComputer Network MCQ – Questions and Answers – Part 1Networking MCQs questions with answers to prepare for exams, tests, and certifications. These questions are taken from a real written exam and some parts are…Read More

Leave a Reply

Your email address will not be published. Required fields are marked *