How to Understand ip routing and linux route tables

Source: Internet
Author: User
Article Title: How to understand ip routing and operate a linux route table. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

In ip address routing, we know that the route table plays a major role, and it determines how the ip packet will go. I remember that I had a heated discussion and verification with my roommates when I was in college. Now I still have a slight impression that I really miss my life in the experiment of the great 623 dormitory, it's almost a year. Let's get started:

Routing is actually the process of selecting a data packet transmission path, that is, how the host smoothly sends data to its destination. When the TCP/IP host sends an IP packet, the route appears and appears again when it reaches the IP router. A router is a device that sends data packets from one physical network to another. A router is usually called a gateway, and it undertakes the task of distributing data packets. For the sent host and router, you must decide where to forward data packets. When determining the route, the IP layer queries the route table in the memory, and then performs ip Routing Based on the query rules. Is it abstract? Let me talk about it, that is, the question to be discussed below.

First, let's explain how to choose the path:
(1) When a host tries to communicate with another host, the IP address first determines whether the destination host is an intranet or Internet. How can this problem be solved? Of course, the network number is used.
(2) If it is the same Intranet, it will be sent directly. This is the simplest answer.
(3) If the target host is not in the same Intranet as the sending host, that is, on the internet, ^_^ ?? Close? P queries the route table to select a route for the Internet host or Internet. Therefore, it is generally possible to specify a specific route for an Internet host. The specific problem will be analyzed later.
(4) If no clear route is found, there will be a default gateway in the routing table, which can also be called the default gateway, the IP address uses the default gateway address to transmit data to the next specified vro. Therefore, the gateway may also be a vro, or it may only be a gateway that transmits data to a specific vro through the Intranet.
(4) After the router receives the data, it queries the route for the remote host or network again. If no route is found, the packet is sent to the default gateway address of the router.

Each time a route is found, the packet is forwarded to the next-level router, which is called a "Hop". The packet is forwarded in the same way and finally sent to the destination host. If no route can accept the IP address of the packet, the sending host will receive an error message, that is, any hop may not arrive, and the final result is an error.

[1] [2] [3] [4] Next page

Related Article

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.