that host. It also forwards the original datagram on to its destination. Redirect
messages are limited to interactions between a gateway and a host on the same
network.
If the host that sends the original datagram is an AS/400, it receives the ICMP
redirect message from the gateway and uses this information to update its internal
routing table. The next datagram is then sent using the more optimum route
received from the gateway. You can see the updated routing table by using
NETSTAT, option 2. A route created by the ICMP redirect mechanism is recorded in
the IP dynamic routing table and remains there as long as an upper level protocol is
using it. When the last upper-level protocol user has completed its unit of work
using a route created by the ICMP redirect mechanism, the route is then removed
from the routing table. When TCP/IP is restarted, this process is repeated.
In Figure 55, host A1 in network 2 is an AS/400 system that sends a message to
host A2 in network 3. The routing table in host A1 indicates that the first hop to host
A2 is through gateway G1, which connects networks 1 and 2. When this gateway
receives the datagram, it forwards the datagram to gateway G2, which sends it to
the host A2. Gateway G1 then sends an ICMP redirect message to host A1 to
inform it that a better route to host A2 is to use gateway G2 as the first hop. This
information updates the internal routing table in host A1, and the next datagram to
host A2 in network 3 is sent to gateway G2 as the first hop. The gateway then
sends the datagram to host A2. When the TCP/IP services are stopped, the
collected routing information is deleted and host A1 starts the learning process
again.
To see routing changes due to ICMP redirect messages, select NETSTAT menu 2
or NETSTAT *RTE and then press PF11. Comparing the next hop in this display
with the next hop present in the routing table, you can verify whether a route has
been dynamically changed.
Figure 55. Example of ICMP Redirect
Chapter 3. TCP/IP: Operation, Management, and Advanced Topics 77