ICMP Address Mask Reply - Control Messages - Redirect

Redirect requests data packets be sent on an alternative route. ICMP Redirect is a mechanism for routers to convey routing information to hosts. The message 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.

00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
Type = 5 Code Header Checksum

IP Address

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:

Code Description
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.

Read more about this topic:  ICMP Address Mask Reply, Control Messages

Other articles related to "redirect":

Diameter Credit-Control Application - Message Flows - AVP Matrix - AVPs For New Command Codes
0-1 0 Origin-Host 1 ... Origin-Realm 1 ... Origin-State-Id 0-1 0-1 Proxy-Info 0+ 0+ Redirect-Host 0 0+ Redirect-Host-Usage 0 0-1 Redirect-Max-Cache-Time 0 0-1 ...