Principles Digital Communication System & Computer Networks (Charles River Media Computer Engineering)

 < Day Day Up > 


21.14 INTERNET CONTROL MESSAGE PROTOCOL

The Internet is a dynamic network. Networks get connected and removed without the knowledge of the senders, who can be anywhere on the earth. Also, each router functions autonomously, routing the datagrams based on the destination IP address and the routing table. It is likely that a datagram cannot be forwarded or delivered to its destination, or due to congestion the datagram may have to be dropped. There must be a procedure to report errors to the source whenever there is a problem. The Internet Control Message Protocol (ICMP) is used for this purpose. Every IP implementation must support ICMP also. ICMP messages are a part of the data field of the IP datagram.

An ICMP message, which is encapsulated in the data field of the IP datagram, consists of three fields:

In addition, an ICMP message contains the first 64 data bits of the datagram that caused the problem.

The ICMP type fields and corresponding message types are given in the following table:

Type Field

ICMP Message Type

0

Echo reply

3

Destination unreachable

4

Source quench

5

Change the route (redirect)

8

Echo request

11

Time to live expired for datagram

12

Parameter problem on datagram

13

Timestamp request

14

Timestamp reply

17

Address mask request

18

Address mask reply

Echo request and echo reply messages are used to test the reachability of a system. Source sends an echo request to the receiver, and the receiver sends an echo reply to the sender. The request can contain an optional data field that is returned along with the echo reply. When an echo reply is received by the sender, this is an indication that the entire route to the destination is OK, and the destination is reachable. The system command ping is used to send the ICMP echo requests and display the reply messages.

Reports of an unreachable destination are sent by a router to the source. The possible reason is also sent in the ICMP message. The reason can be the following:

The source quench message is sent by the router to the source when congestion is experienced. This message is to inform the source to reduce its rate of datagrams because the router cannot handle such a high speed. When a router cannot handle the incoming datagrams, it discards the datagram and sends the source quench message to the source.

A change the route (redirect) message is sent by a router to the host. Generally, it is the router's function and responsibility to update its routes, and hosts keep minimal routing information. However, when a router detects that a host is using a nonoptimal route, it sends an ICMP message to the host to change the route. This message contains the IP address of the router the host has to use for the routing.

ICMP is used to report errors to the source. Information such as network or host unreachable, time-to-live field expired, fragmentation needed but do-not-fragment bit is set, and so on, are sent to the source using this protocol.

A time-to-live-expired message is sent by a router when the hop count becomes zero. As mentioned earlier, to ensure that datagrams do not keep on circulating between routers endlessly, this hop count is introduced. When hop count becomes zero, the datagram is discarded and the message is sent to the source. This message is also sent when fragment reassembly time exceeds the threshold value.

For any other problem because of which the datagram has to be discarded, the router sends a parameter problem message to the source.

Timestamp request and reply messages are used between systems to obtain the time information. Because each system acts independently, there is no mechanism for synchronizing the clocks. A system can send a timestamp request to another system and obtain the timestamp reply. This information can be used to compute the delays on the network and also to synchronize the clocks of the two systems.

Subnet address mask request and reply messages are exchanged between machines. In some IP addresses, a portion of the host address corresponds to the subnet address. The information required to interpret this address is represented by 32 bits called the subnet mask. For example, if a host wants to know the subnet mask used by a LAN, the host sends a subnet address mask request to the router on the LAN or broadcasts the message on the LAN. The subnet address mask reply will contain the subnet address mask.

In the next chapter, we will study the details of the TCP layer that runs above the IP layer.

Note 

Every IP implementation must support ICMP. ICMP messages are included in the data field of the IP datagram.

Summary

The Internet Protocol, the heart of the global Internet, is presented in this chapter. The present version of IP, running on end systems and routers, is IP Version 4. The two main functions of IP are addressing and routing. IP Version 4 has an address length of 32 bits. Each system is given a 32-bit IP address that uniquely identifies the system globally. This addressing scheme can cover at most 4 billion addresses. This turns out to be a small number for the future, particularly when we would like to connect even consumer items such as TVs, mobile phones, and such to the Internet. The latest version of IP, IP Version 6, has an address length of 128 bits.

In addition to the address length, IP Version 4 has limitations for handling secure applications and real-time applications. The detailed formats of IP Version 4 and Version 6 are presented, which bring out the salient features of both versions.

Another important function of IP is routing. We studied the routing protocols within an autonomous system and between autonomous systems. An autonomous system is a network within the administrative control of an organization. Routers within an autonomous system can share routing information using protocols such as open shortest path first (OSPF) and flooding. Routers connected to different autonomous systems can share routing information using exterior gateway protocol or border gateway protocol.

The Internet Control Message Protocol (ICMP) is used to report errors and to send management information between routers. ICMP messages are sent as part of the IP datagram. The details of ICMP are also presented in this chapter.

References

Questions

  1. Describe the format of an IP Version 4 datagram.

  2. What are the limitations of IP Version 4 and explain how IP Version 6 addresses these limitations.

  3. Describe the format of an IP Version 6 packet.

  4. Describe the protocols used for routing within autonomous systems.

  5. Describe the protocols used for routing between autonomous systems.

  6. Explain the ICMP protocol and its functionality.

Exercises

1. 

Find out the IP address of your computer.

2. 

Calculate the total number of addresses supported by class B IP address format. Note that 14 bits are used for network ID and 16 bits for host ID.

3. 

Calculate the total number of addresses supported by class C IP address format. Note that 24 bits are used for network ID and 8 bits for host ID.

4. 

Calculate the maximum number of addresses supported by IP Version 6.

5. 

Write a technical paper on IP Version 6.

Answers

1. 

You can use the procedure described in Exercise #1 of Chapter 15 to obtain the IP address of your computer.

2. 

In class B IP address format, 14 bits are used for network ID and 16 bits for host ID. Hence, 214 networks can be addressed, and each network can have 216 hosts.

3. 

In class C IP address format, 24 bits are used for network ID and 8 bits for host ID. Hence, 224 networks can be addressed and in each network 28 hosts.

4. 

The maximum number of addresses supported by IP Version 6 is 340,282,366,920,938,463,463,374,607,431,768,211,456.

5. 

You can obtain the RFC from the site http://www.ietf.org.

Projects

  1. Write a program that captures all the packets transmitted over the LAN and displays the source IP address and the destination IP address of each packet. You can use the packet driver software that comes with the Windows Device Driver Kit to develop this program.

  2. Extend the software that is written in Project #1 so that all the packets corresponding to a particular destination IP address are stored in a file. Use this software to find out the passwords of different users of the LAN. Because this software is nothing but hacking software, obtain the permission of your system administrator before testing this software. You can refine this software to develop a firewall that filters out all the packets with a specific IP address.


 < Day Day Up > 

Категории