IP module components

The IP packet involves the following components:

The receives data from an upper layer protocol along with the destination IP address. It encapsulates the data in an IP datagram by adding the IP header.

The receives the datagram from an Interface or from the Header-adding module.

  1. Remove a datagram from one of the input queues.
  2. If the destination address matches loopback address or local address. Send the packet to Reassembly module.
  3. If the machine is a router,
    • decrease TTL.
  4. If TTL is less than or equal to 0,
    • discard the datagram.
    • else send the datagram to the .

The store the datagrams coming from the datalink layer or the upper layer protocols. The store the datagrams going to the datalink layer or the upper layer protocols. The processing module removes datagrams from the input queues. The fragmentation and reassembly modules add the datagram into the output queues.

The receives an IP packet from the processing module. The module finds the IP address of the next-hop along with the interface number to which the packet should be sent. The have two columns Interface number and MTU.

The MTU table is used by the fragmentation module to find the maximum transfer unit of a particular interface. Fragmentation module consults the MTU table to find the MTU of the specific interface number. If the length of the datagram is larger than the MTU, the fragmentation module fragments the datagrams, adds a header to each fragment and sends them to the ARP package for address resolution and delivery.

  1. Extract the size of the datagram.
  2. If size is greater than the MTU of the corresponding network.
  3. If is set, a discard the datagram. Else, divided the datagram into fragments, add header to each fragment. Add required options to each fragment. Send the datagram.
  4. Else send the datagram.

The

The value of the state field can be either “Free” or “In use”.

The source IP address field(S.A.) defines the source IP address of the datagram.

The Datagram ID(D.I.) is same as the Identification field in the Header of datagram, corresponding with the S.A. field to uniquely defines the datagram and all the fragments belonging to that original datagram.

The Time-out(T.O.) is a predetermined amount time in which all fragments must arrive.

The Fragments field is a pointer to a Linked list of fragments.

  1. If offset value is 0 and the “more fragment” bit is 0, send the datagram to the appropriate queue.
  2. Else search the reassembly table for the corresponding entry.(Same D.I. and S.A.)
  3. If not found, create a new entry.
  4. Insert the fragment at the appropriate place in the linked list.(based on the offset)
  5. If all fragments had arrived (“M”-bit and offset), reassembly the fragments, deliver the datagram to the upper layer protocol.
  6. Check the T.O., if the T.O. expired discard all fragments.