Windows route table (content: route table parsing, understanding the route table)

Source: Internet
Author: User
  1. Complete parsing of Windows route tables  
Time can be amazing in this way. People tend to think that computer technology is a high technology, but TCP/IP has appeared in various forms over the past thirty years and is ubiquitous. Therefore, the TCP/IP protocol has time to become more mature and more stable and reliable. However, when it comes to computers, things are not that simple. When the route package passes Network Sometimes, an error occurs. In this case, it is very helpful to be familiar with the Windows route table. The route table determines the destination of data packets from faulty machines. In this article, I will show you how to view the Windows route table and how to make the data contained in the Windows route table meaningful.
   View windows route tables
The route table is an important part of the Windows TCP/IP protocol stack. However, the route table is not displayed to common users in windows. If you want to see the route table, you must open a command prompt dialog box and enter the "route print" command. Then, you will see a graph similar to the one shown in Figure.
Figure A: the appearance of the Windows route table

  

Before I discuss this route table in depth, we recommend that you enter another command in the command prompt dialog box. This command is: ipconfig/all
The reason why I suggest you use the ipconfig/all command is that this command shows how the TCP/IP protocol is actually set on the machine. Indeed, you can carefully check the TCP/IP protocol on the NIC properties page. However, if you obtain this information from ipconfig, this information will be more reliable. In the past few years, I have encountered such examples that the information reported by ipconfig is completely different from the information displayed on the TCP/IP protocol settings screen on the machine. This is not common, but if this error occurs, you will encounter this mismatch. Frankly speaking, the information on the TCP/IP properties page reflects the TCP/IP protocol you want windows to set for the selected network. The information provided by ipconfig shows the Protocol actually set in windows.
Even if you haven't encountered some strange windows errors, getting your configuration information from ipconfig is still very useful. If a machine has multiple NICs, it is very difficult to remember the settings bound to each Nic. Ipconfig lists the various settings of each Nic shown in B, which is easy to read.
Figure B: ipconfig/all shows the TCP/IP settings for each Nic on this machine
  

Check Route table

When this article is about route tables, you may be wondering why I want you to execute the ipconfig/all command. The reason for this is that you generally never look at the route table unless your machine has a problem. If you encounter a problem, the best way to diagnose the fault is to compare the information provided by ipconfig with the information stored in the routing table.
As you can see in Figure B, the ipconfig/all screen displays some basic TCP/IP information, such as IP addresses and default gateways. However, the route table is not so easy to understand. Therefore, I have to spend some time discussing how to read the route table and what the information in the route table represents.
To understand the meaning of the information in these columns, you need to know a little about how the router works. The router works to coordinate the communication between one network and the other. Therefore, a vro contains multiple NICs, each of which is connected to different CIDR blocks.
When a user sends a data packet to a different network segment outside the local machine, the data packet will be sent to the router. The router will decide which network segment the data packet should be forwarded. It does not matter if the router is connected to two or more network segments. The decision-making process is the same, and the decision-making process is based on the route table.
If you want to view the content displayed on the screen after executing the "route print" command, you will find that the route table is divided into five columns. The first column is the destination network address. Lists all the CIDR blocks connected to the vro. The netmask column provides the subnet mask of the network segment, rather than the subnet mask of the network adapter connected to the network segment. This basically allows the router to determine the destination network address class.
The third column is the gateway. Once the vro determines the destination network to which the packet will be forwarded, The vro will view the gateway list. The gateway table tells the router which IP address the packet should be forwarded to achieve the destination network.
The interface column tells the vro which Nic is connected to the appropriate destination network. Technically, the interface column only tells the IP address assigned to the NIC by the router. The network adapter connects the router to the destination network. However, the router is very smart and knows which physical Nic the address is bound.
The last column is the measurement. Measurement itself is a science. However, I will try to explain to you briefly what they do. One of the best ways I have heard of interpreting this is to use the airport vocabulary. Imagine that I need to fly from Garot, North Carolina to Miami, Florida. Because Garot airport is very large, I have many options to go to Miami. I can take a flight from Northwest Airlines. The flight took me to Detroit in Michigan and then flew from Detroit to Miami. I can also fly to Houston on a continental airline flight and then to Miami. Another option is to fly directly to Miami on an American Airline plane. Which line should I choose?
In real life, there are many factors worth considering, such as the plane ticket price and departure time. However, let's assume that everything is the same. If the flights are the same except for the routes, I will select the least stopover flights. It will make me reach the destination at the fastest speed. Due to the small number of stays, there will be fewer opportunities for problems in connection, and problems such as lost luggage will also be reduced.
Routing works in the same way. In many cases, a vro has many ways to send a data packet. In this case, it is meaningful to send data packets in the shortest (or the most reliable) path. This is where measurement plays a role. Windows generally does not view measurement columns unless there are many paths to a destination. If there are multiple paths, Windows will view the measurement column to determine the shortest path. This is a very simple explanation. However, this explanation illustrates the key points.
  Additional Route Selection
I introduced the "route print" Command earlier. However, you can use the "Route" command to actually do many things. The parameters of the "Route" command are as follows:
Route [-F] [-p] [Command [destination] []
-The F switch is optional. This switch tells windows to clear all gateway input records in the route table. If this-F switch is used with other commands, all gateway input records will be cleared before other commands in this command are executed.
The-P switch keeps the specified route unchanged. Generally, when the server is restarted, any route you specify using the "Route" command will be deleted. The-P switch tells windows to retain this route, even if the system restarts.
The command section of the "Route" command parameter is relatively simple. This command set contains four options: print, add, delete, and change. I have introduced the "route print" command to you. This command contains other options. For example, you can use wildcards with this command. For example, if you only need to output a route related to the 192. x subnet, you can use this command: "route print 192 *".
The "route Delete" command works very similar to "route print. Simply enter the "route Delete" command, and then enter the destination address and gateway you want to delete from the routing table. For example, if you want to delete the 192.0.0.0 gateway, you can enter this command: "route Delete 192.0.0.0 ".
The basic parameters of the "route change" and "route Add" commands are the same. When you enter this command, you must specify the destination, subnet mask, and gateway. You can also specify a measurement and an interface. However, this is optional. For example, if you want to add a destination using the lowest parameter, you can enter the following command: Route add 147.0.0.0 255.0.0.0 148.100.100.100
In this command, 147.0.0.0 is your newly added destination address. 255.0.0.0 is the subnet mask of the destination address, and 148.100.100.100 is the gateway. You can use the metric and if parameters to expand the functionality of this command. Example: Route add 147.0.0.0 255.0.0.0 148.100.100.100 metric 1 if 1
You can choose to measure this parameter. However, it specifies the number of measurement or route hops. The IF parameter indicates which Nic is used by windows. In this special case, Windows uses the NIC bound to Windows as interface 1. If you do not use the if parameter, Windows will search for the best available Nic.
  Conclusion
In this article, I explained how to use the "Route" command to display windows route tables, and how to modify these route tables if necessary. If you need some extra help, enter "route /?" Command to get more parameter examples.


2. fully understand the route table

Source code :--------------------------------------------------------------------------------
Active routes:
Network destination netmask Gateway Interface Metric
0.0.0.0 0.0.0.0 192.168.123.254 192.168.123.88 1
0.0.0.0 0.0.0.0 192.168.123.254 192.168.123.68 1
127.0.0.0 255.0.0.0 127.0.0.1 127.0.0.1 1
192.168.123.0 255.255.255.0 192.168.123.68 192.168.123.68 1
192.168.123.0 255.255.255.0 192.168.123.88 192.168.123.88 1
192.168.123.68 255.255.255.255 127.0.0.1 127.0.0.1 1
192.168.123.88 255.255.255.255 127.0.0.1 127.0.0.1 1
192.168.123.255 255.255.255.255 192.168.123.68 192.168.123.68 1
192.168.123.255 255.255.255.255 192.168.123.88 192.168.123.88 1
224.0.0.0 224.0.0.0 192.168.123.68 192.168.123.68 1
224.0.0.0 224.0.0.0 192.168.123.88 192.168.123.88 1
255.255.255.255 255.255.255.255 192.168.123.68 192.168.123.68 1
Default Gateway: 192.168.123.254 ----------------------------------------------------

Current route:
Destination network segment of destination
Mask Subnet Mask
The egress IP address of the router to which the interface reaches the destination.
The IP address of the next hop router entry of the Gateway. The router defines a link to the next router through the interface and gateway. Generally, the interface and gateway are in the same network segment.
The number of metric hops. The quality of the route record. Generally, if there are multiple route records that reach the same destination, the router uses the one with a small metric value.

Article 1
Default route: that is, when the destination CIDR block of a data packet is not in your route record, where should your router send the data packet! The gateway of the default route is determined by the default gateway on your connection.
This route record means that when the destination CIDR block of a packet received is not in my route record, I will send the packet to the address 192.168.123.254 through the interface 192.168.123.88, this address is an interface of the next vro, so that this packet can be delivered to the next vro for processing, and it has nothing to do with me. Line quality 1 of this route record

Article 2
Default route: This route record indicates that when the destination network segment of a packet received is not in my route record, I will send the packet to the address 192.168.123.254 through the interface 192.168.123.68, this address is an interface of the next vro, so that this packet can be delivered to the next vro for processing, and it has nothing to do with me. Line quality 1 of this route record

Article 3
Local Loop: all the addresses in the network segment 127.0.0.0 point to their own machines. If such data is received, the route quality 1

Article 4
Route record of the direct connection CIDR Block: What to do when the router receives a packet sent to the direct connection CIDR Block? In this case, the interface and gateway of the route record are the same.
When I receive a packet whose destination CIDR block is 192.168.123.0, I will send the packet directly through the interface 192.168.123.68 because the port is directly connected to the CIDR Block 192.168.123.0, line quality 1 of this route record

Article 5
Route record of the direct network segment
When I receive a packet whose destination CIDR block is 192.168.123.0, I will send the packet directly through the interface 192.168.123.88 because the port is directly connected to the CIDR Block 192.168.123.0, line quality 1 of this route record

Article 6
Local Host Routing: How does a router handle a packet sent to itself?
When I receive a packet whose destination CIDR block is 192.168.123.68, I will accept the packet because the packet is sent to my own, the route record's line quality 1

Article 7
Local Host Routing: How does a router handle a packet sent to itself?
When I receive a packet whose destination CIDR block is 192.168.123.88, I will accept the packet because the packet is sent to my own, the route record's line quality 1

Article 8
Local broadcast route: What to do when the router receives the local broadcast sent to the direct network segment?
When I receive a broadcast packet whose destination CIDR block is 192.168.123.255, I will send the data from the 192.168.123.68 interface as a broadcast. The route record's line quality is 1.

Article 9
Local broadcast route: What to do when the router receives the local broadcast sent to the direct network segment?
When I receive a broadcast packet whose destination CIDR block is 192.168.123.255, I will send the data from the 192.168.123.88 interface as a broadcast. The route record's line quality is 1.

Article 10
Multicast Route: What to do when a vro receives a multicast packet
When I receive multicast data packets, I will send the data from the 192.168.123.68 interface in multicast mode. The route record's line quality is 1.

11th
Multicast Route: What to do when a vro receives a multicast packet
When I receive multicast data packets, I will send the data from the 192.168.123.88 interface in multicast mode. The route record's line quality is 1.

12th
Broadcast route: What should I do when the router receives an absolute broadcast?
When I receive an absolute broadcast packet, this packet is discarded.
 

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.