TCP/IP Details: Routing protocol

Source: Internet
Author: User

Nineth Chapter IP Routing

Netstat-rn Show route Table

There are two ways to initialize the routing table:

Method 1: Specify static routes in the configuration file (not commonly used)

Method 2: Run the routing daemon or use the ICMP router to discover the message

Processing of routes that do not reach the destination:

The result at this time depends on whether the IP datagram was generated by the host or forwarded.

If generated by the local host, then the application sending the datagram returns a mistake ("Host unreachable Error" or "Network unreachable error");

If the IP datagram is forwarded, an ICMP host unreachable error message is sent to the original sending side.

ICMP host and network unreachable error

When the router receives an IP datagram but cannot forward it, it will send the message

ICMP Redirect Error

When the IP datagram should be sent to another router, the router receiving the datagram sends an ICMP redirect error message to the sending end of the IP datagram.

Such as:
1) We assume that the host sends a copy of the IP datagram to R1. This routing decision often occurs because R1 is the default route for that host.

2) R1 receives the datagram and checks its routing table to find that R2 is the next station to send the datagram. When it sends the datagram to R2, R1 detects that the interface it is sending is the same as the datagram arrival interface (that is, the host and the LAN on which the two routers reside). This sends the redirect message to the router to provide clues to the original sending side.

3) R1 sends an ICMP redirect message to the host, telling it to send the datagram to R2 instead of R1.

ICMP Redirection Example

ICMP redirection can help hosts to learn dynamically and build more sophisticated routing tables

ICMP router Discovery message

This is a good way to initialize the routing table!

It is generally believed that the host will broadcast or multicast a router request message after booting. One or more routers respond to a Router Advertisement message. In addition, routers periodically broadcast or multicast their router Advertisement messages, allowing each listening host to update their routing tables accordingly.

(1) Router operation

When the router starts, it periodically sends a notification message on all broadcast or multicast transport interfaces. Accurately, these notification messages are not sent on a regular basis, but are randomly transmitted to reduce the probability of collisions with other routers on the subnet. Typically 450 seconds and 600 seconds are advertised every two times. A given notification message the default life cycle is 30 minutes.

Another time to use the life cycle domain is when an interface on the router is turned off. In this case, the router can send the last notification message on the interface and set the lifetime value to 0. In addition to sending unsolicited notification messages on a regular basis, the router listens for request messages from the host and sends router notification messages in response to these request messages. If there are multiple routers on the subnet, the system administrator sets the priority level for each router. For example, the primary default router will have a higher priority than the backup router.

(2) Host operation

The host typically sends three router request messages every three seconds during boot time. Once a valid notification message is received, the request message is stopped. The host also listens for request messages from neighboring routers. These notification messages can change the host's default router. Also, if you do not receive a notification message from the current default router, the default router will time out. As long as there is a normal default router, the router will send a notification message every 10 minutes, the lifetime of the message is 30 minutes. This indicates that the default table entry for the host does not time out, even if one or two notification messages are missed.

(3) Realize

Router discovery messages are typically created and processed by the user process (daemon). In this way, there is another program that modifies the routing table, although it only adds or removes the default table entries. The daemon must be configured to use it as a router or host.

The tenth chapter dynamic route routing protocol

TCP/IP Details: Routing protocol

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.