The ICMP type 5 contains a redirect message to send data packets on an alternative route. ICMP Redirect is a mechanism for routers to convey routing information to hosts. The Redirect Message is an ICMP message which informs a host to update its routing information (to send packets on an alternate route). If a host tries to send data through a router (R1) and R1 sends the data on another router (R2) and a direct path from the host to R2 is available (that is, the host and R2 are on the same Ethernet segment), then R1 will send a redirect message to inform the host that the best route for the destination is via R2. The host should then send packets for the destination directly to R2. The router will still send the original datagram to the intended destination. However, if the datagram contains routing information, this message will not be sent even if a better route is available. RFC1122 states that redirects should only be sent by gateways and should not be sent by Internet hosts.
|Type = 5||Code||Header Checksum|
IP Header + First 8 Bytes of Original Datagram's Data
Type must be set to 5. The code, which specifies the reason for the redirection, include the following:
|0||Redirect for Network.|
|1||Redirect for Host.|
|2||Redirect for Type of Service and Network.|
|3||Redirect for Type of Service and Host.|
The IP address is the 32-bit address of the gateway to which the redirection should be sent. The additional data is included to allow the host to match the reply with the request that caused the redirection reply.
Famous quotes containing the word message:
“Whats the use? She would only want me to take a message to dear Albert.”
—Benjamin Disraeli (18041881)