One function of the router is to connect different networks, and the other function is to select the line for information transmission. Choosing a smooth and fast shortcut can greatly improve the communication speed, reduce the communication load of the network system, save network system resources, and improve the smooth rate of the network system, so that the network system can play a greater role.
From the point of view of filtering network traffic, routers function very similarly to switches and bridges. But unlike the switch that works at the physical layer of the network and divides the network segment physically, the router uses a special software protocol to logically divide the entire network. For example, a router that supports the IP protocol can divide the network into multiple subnet segments, and only network traffic directed to a specific IP address can pass through the router. For each received packet, the router recalculates its checksum value and writes a new physical address. Therefore, using a router to forward and filter data tends to be slower than a switch that only looks at the physical address of a packet. but,
For those complex networks, the use of routers can improve the overall efficiency of the network. Another obvious advantage of routers is that they can automatically filter network broadcasts. In general, the entire installation process of adding a router to a network is much more complicated than a plug-and-play switch.
Generally speaking, the interconnection of heterogeneous networks and the interconnection of multiple subnets should be completed by routers.
The main job of a router is to find an optimal transmission path for each data frame passing through the router, and to efficiently transmit the data to the destination site. It can be seen that the strategy of selecting the best path, that is, the routing algorithm, is the key to the router. In order to complete this work, the relevant data of various transmission paths - Routing Table (Routing Table) is saved in the router for use in routing. The path table stores the information of the subnet flag, the number of routers on the network, and the name of the next router. The path table can be fixed by the system administrator, or dynamically modified by the system, automatically adjusted by the router, or controlled by the host.
1. Static path table
A fixed path table set in advance by the system administrator is called a static path table, which is generally preset according to the network configuration during system installation, and will not change with future network structure changes.
2. Dynamic path table
Dynamic routing table is the routing table automatically adjusted by the router according to the operation of the network system. The router automatically learns and memorizes the network operation according to the functions provided by the Routing Protocol, and automatically calculates the best path for data transmission when needed.