Network Routing Technology and Application

Source: Internet
Author: User

1. Introduction to related concepts
1. Concept of routing:A route is an activity that transmits information from the source address to the destination address through an interconnected network. The layer-3 routing occurs in the 0SI network reference model, that is, the network layer.
2. Route Selection:Routing rules send information packets from one address to another. A route does not specify all routes. It is only a path from the host to the gateway, and then the gateway forwards the packets to the destination host or another gateway.


Route Selection refers to selecting a route for sending packets, and gateway refers to any network device that can complete the routing selection function to connect to different networks.
The routing selection is completed at the IP layer. You do not need to complete the daemon process of routing selection on a host.
The message distance is usually expressed by the number of cross-HOP packets of the gateway, which is called METRIC. The distance from the source address to the destination address of a packet depends on the number of gateways that must pass through the packet. The number of connections between a host and its direct network is zero. If a gateway can be used to reach a specified network, the number of connections between a host and the network is 1.
3. Gateway:The gateway connects two or more networks and provides the routing selection function. The gateway selects a gateway at the network layer. A gateway receives IP data from another gateway, selects a route for it, and sends the IP datagram to another network according to the selected route. The gateway periodically checks the connected network connection status.
The gateway sends packets to the specified destination network according to the specified routes, and the destination network is responsible for sending the packets to the destination host.
4. Route type:A route does not completely describe a complete path. It only defines the path segment from a host to a gateway, or the path segment from a gateway to another gateway.
TCP/IP usually searches the route table in the following order to find the optimal route match:
(1) Host Routing: defines the route from the gateway to a specified host;
2) network route: Define a route from the gateway to a specified network segment or network;
3) default route: if neither the host route nor the network route defines a route to the destination, the default route is used.
5. Route table:The routing is defined in the Core routing table. Each entry in a route table consists of a destination IP address and a gateway address. There are three types of Route tables:
1) direct route entry: when the destination address and the local address are in the same CIDR Block, the direct route entry is used.
2) indirect route entry: when the source and Target Host IP addresses are not in the same CIDR Block, the indirect route entry is used. The destination host is accessed through one or more gateways. The source host only needs to access the first cross-gateway.
3) default route entry: if the target IP address is not in the preceding two route entries, the default route entry is used.

6. Routing Algorithm:


From the above algorithm, we can see that both the host and gateway are involved in the routing selection activity. When an application on the host tries to communicate with another host, the system generates multiple data packets. The IP routing mechanism determines the host or CIDR block to which the datagram is sent based on the network address of the destination IP address.
7. Routing Method:There are three main ways to create a route: implicit, static, and dynamic.
A route is defined in the core route selection table. Generally, up to 32 routes can be defined. These routing definitions include the local reachable network information, the gateway information connecting to the remote network, and the cross-count that reaches these networks.
Implicit routing is defined and completed when the adapter is configured.
Static Routing is set by the network administrator and requires manual maintenance.
Dynamic Routing is automatically updated by the daemon. Generally, the daemon for routing periodically listens to all routes to refresh the confidence, and broadcasts the received route selection table information so that other routers can update their route selection table.
This article mainly involves Static Routing.
2. Configure routes in WINDOWS
In WINDOWS, manually set the route mainly in the dossystem COMMAND line (in the run input column, type command or CMD.
Enter the command ROUTE and press enter to display dozens of lines in English. It mainly describes how to add, delete, and modify routes in WINDOWS. The following is a brief introduction:
The ROUTE command format is as follows:
ROUTE [-f] [-p] [command [destination] [MASK netmask] [gateway] [METRIC metric] [IF interface]
Here, the-f parameter is used to clear the route table. The-p parameter is used to permanently retain a route. That is, the route will not be lost when the system restarts, but it is invalid in Windows 95 ).
Command mainly includes PRINT), ADD), DELETE), and CHANGE.
Destination indicates the target IP address to be reached.
The MASK is the keyword of the subnet MASK. Netmask indicates the specific subnet mask. If not specified, the default is 255.255.255.255 single-Host IP address). Therefore, be careful when entering the mask. Check whether an IP address or IP address segment is added. 0.0.0.0 is available for all egress subnet masks.
Gateway indicates the egress Gateway.
Other interfaces and metric represent the number of special routing interfaces and the cost of reaching the target address.
The following describes how to set a route in WINDOWS based on a single Nic and dual Nic.

1. Single NIC:
In WINDOWS, there are four basic routes. For details, see enter the route print command:


The preceding route is a WINDOWS route that never disappears. If the preceding route is incomplete, it indicates that the installation and running of TCP/IP has some basic problems, or the local network configuration or installation has problems.


In the preceding table, 127.0.0.1 is used to test the loopback address. It cannot be used as a valid network address. The IP address of the local port of PC1 is 192.168.97.1, And the IP address of the local port of vro1 1 is used for Internet access) is 192.168.97.10, And the IP address of the local port of vro2 2 is 192.168.97.11.
If PC1 wants to access the Internet and the office network at the same time, it is usually because the default gateway is modified repeatedly in the WINDOWS Network attribute, and only one network segment can be accessed at a time, which is inconvenient and troublesome. To solve this problem, enter the following command in the doscommand:
Route add 0.0.0.0 maks 0.0.0.0 192.168.97.10 is used on the Internet ),
Route add 10.42.29.0 mask 255.255.255.0 192.168.97.11 is used on the office network ).
In this way, the Internet is used as the default route, and the office network is used as a special route to add. Of course, if there are other systems, you can add the same route.
To ensure that the route is correct and avoid route confusion, it is best to delete the route first and then add the route. For example, the preceding command can be changed:
Route delelte 0.0.0.0
Route add 0.0.0.0 maks 0.0.0.0 192.168.97.10
Route add 10.42.29.0 mask 255.255.255.0 192.168.97.11.
To ensure that the route settings take effect for a long time, you can add the preceding command to the AUTOEXEC. BAT file, that is, the route is automatically set as soon as the operating system starts. You can also add the-P parameter when adding a route for the first time.
The details are as follows:
Route-p add 0.0.0.0 maks 0.0.0.0 192.168.97.10
Route-p add 10.42.29.0 mask 255.255.255.0 192.168.97.11.
In this case, use route print to view the route. Two permanent routes are added to the route table.


2. Dual NICs are used as an example for multiple NICs)
If two NICs exist on the same PC and are connected to two systems with different network segments, see the following network connection:


Generally, the dual-nic and dual-gateway are added to the PC, and the two subsystems can be easily connected. However, due to WINDOWS systems, it is often prone to Gateway fluctuations or instability. For example, if you cannot PING the office automation address, but return the feedback from 192.168.97.10 vro1 1, now you can view the network route. The route table is normal and you need to refresh the route.
In fact, you can take a similar approach to a single Nic, remove the gateway in the network attribute, and manually set the route. Manual routing is more accurate and free. For example, you can manually control whether to access a website, a certain CIDR block, or all CIDR blocks.
For more information, enter the following command at the DOS prompt:
Route delete 0.0.0.0
Route add 0.0.0.0 mask 0.0.0.0 192.168.97.10 Nic 1 addressing route, on the internet, default route)
Route add 10.42.0.0 mask route 255.0.0 10.42.29.10 Nic 2 addressing route, on the office network ).
Of course, you can add the-P parameter or add the route adding information to the automatic batch processing file to make the route information take effect permanently.
3. Set routes on UNIX systems
Because AIX is widely used in the industry, this article takes the AIX operating system as an example to introduce how to set up a route on UNIX.
For static routing, the ROUTE table can be manually maintained using the SMIT or ROUTE command. Note that the SMIT command can update the corresponding routing information of the ODM database, so it can take effect permanently. The ROUTE command does not modify the ODM database, so the ROUTE will be lost when the machine restarts. The following describes how to use the ROUTE command.


A: command, including add, flush, delete, change, monitor,
B: Network family,-inet (default). xns indicates the XEROR network system, which is rarely used now ),
C: Network flag:-net (network),-host (host, default ),
D: Destination IP address: symblic name or numeric address. If the IP address is a network segment, you can only enter the network address in the IP address segment. If the host address is a complete IP address, the destination address is all network segments, you can use either 0 or 0.0.0.0.
E: Gateway: symblic name or numeric address
The following figure shows the network topology. HOST 1 and host 2 are required to be interconnected with PC2, but other machines in the 192.168.150 network segment are not allowed to access HOST 1. If the dialing terminal successfully receives a dynamic IP address in the 193.168.97.0 network segment) you can access HOST 1 through vro2 2.

Run the following command on Host 1 as ROOT:
# Route add-host 192.168.150.2 133.56.9.82
# Route add-host 192.168.150.3 133.56.9.82
# Route add-net 193.168.97 133.56.9.29
PING the host on host 2 and PC2, and perform a dial-up connection test. A successful connection prompt is displayed. Likewise, a success prompt is displayed for the devices before the host is pinged. However, the network between PC1, PC2, and host 2 is disconnected, which indicates that the route settings are correct.


If a route or route is set incorrectly, run the "# route add-net 192.168.150.0 133.56.9.98" command again to display "0821-279 writing to routing socket: Do not specify an existing file.133.56.9.98 net 192.168.150.0: gateway 133.56.9.98: 0821-285 ioctl returns 17 Do not specify an existing file. "prompt, You can command change to change the route at this time, but if there are not many routes, You can first refresh and delete the route), and manually add the route again, although this is a bit of trouble, but the routing is clearer.
Of course, to make the routing settings take effect permanently, add the preceding command to the/etc/rc. bat file.
If you use the SMIT command, it may be easier for new users to use SMIT using an interface tool ). To meet the same requirements, run the following command to configure a static route using SMIT:
1. # smit tcpip
Minimum Configuration & Startup
Further Configuration
Use DHCP for TCPIP Configuration & Startup
........
Configure IP Security (IPv6)

2. Select Further Configuration
Hostname
Static Routes
Network Interfaces
............
Stop TCPIP Daemons
Authentication Configuration
3. Select Static Routes
List All Routes
Add a Static Route
Remove a Static Route
Flush Routing Table
4. Enter relevant route information


Press enter to confirm the network connection between host 1 and host 2. Add the other two routes in the same way. It is very convenient to use SMIT to add, delete, and modify routes. Especially for new users, if an option is incorrect, an error is prompted. Therefore, we recommend that you use SMIT to set routes.


4. Set a route on the vro
Currently, CISCO and 3COM routers are popular. dynamic routing protocols such as RIP, IGRP, OSPF, and VPN are widely used to achieve network interconnection. Let's take the CISCO router as an example.
If a small or medium-sized network does not have or only has a small network to expand, manually enter static routes and manage them. However, if the network increases or the network changes frequently, the static route management overhead will be very large.
Static Routing has the following advantages: 1) In terms of bandwidth, there is no overhead for Static Routing. In dynamic routing, the routing protocol has a bandwidth problem to maintain its relationship with neighboring routers. In particular, Distance Vector-based protocols require higher bandwidth. 2) in terms of security, static routing can manually limit the access permissions of IP addresses. Therefore, it is necessary for a high security network.
There are many books on how to set routes on CISCO. Here we will briefly introduce the following static route addition methods.
Static Routing is set using the ip route command. The command is complete as follows:
CISCO (config) # ip route A. B .C.D E.F. G. h I. J. K. L/interface X.
Here, A. B .C.D is the destination network address, E.F. G. H is the subnet mask, I. J. K. L is the IP address of the next hop, or the Interface is the Interface Name of the next hop. X represents the distance from 1 to 255 ).
Currently, a bank is connected to a water plant (using a DDN physical link) to collect water fees for it. Both parties add a network firewall on their respective network ends. The specific network topology and network configuration are as follows:


To route between vro1 1 and vro2 2, add the following routes on vro1 1 and vro2 2 respectively:
Ip route 0.0.0.0 0.0.0.0 162.0.0.2router1)
Ip route 0.0.0.0 0.0.0.0 162.0.0.1 (rotuer2)
In this way, the communication between the two routes can be realized. Of course, the network security policy can be defined on the firewall by using the port inner swivel chair or IP address ing and the application port restriction method ).
You can use the ME-IP command to configure a route On 3COM to enter the configuration menu. The operation is also very simple.


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.