In the past decade, with the continuous expansion of computer networks and the rapid development of large-scale interconnected networks such as the Internet, routing technology has gradually become a key part of network technology, routers also become the most important network devices. Users' Needs Promote the Development of routing technology and the popularization of routers. People are not satisfied with sharing information only on local networks, we hope to maximize the use of various types of network resources in various regions around the world. In the current situation, any computer network with a certain scale, such as enterprise network, campus network, and smart building, can be quickly used with the big network technology and FDDI technology, or ATM technology, it is inseparable from routers, otherwise it will be unable to operate and manage normally.
1. Network Interconnection
Connecting your network with other networks, getting more information from the network, and publishing your own messages to the network is the main driving force for network interconnection. There are multiple network interconnection methods, among which the most commonly used are bridge interconnection and router interconnection.
1.1 network connected by bridges
The second layer in the OSI model, that is, the link layer. Complete data frame) forwarding, the main purpose is to provide transparent communication between Connected Networks. Bridge Forwarding is based on the source address and destination address in the data frame to determine whether a frame should be forwarded and to which port. The address in the frame is called the "MAC" address or "hardware" address, which is generally the address of the NIC.
A bridge connects two or more networks to provide transparent communication. Devices on the network cannot see the existence of a bridge, and communication between devices is as convenient as on an Internet. Because the bridge forwards data frames, it can only connect data frames with the same or similar network structures, such as Ethernet and token ring, for different types of network data frame structures), such as Ethernet and X.25, the bridge is powerless.
Bridges expand the network scale, improve network performance, and facilitate network applications. In the past, bridges were widely used. However, bridge interconnection also brings many problems: one is a broadcast storm, where the bridge does not block the broadcast messages in the network. When the network is large, several bridges and multiple Ethernet segments ), broadcast storm may occur), and the whole network is full of broadcast information until it is completely paralyzed. The second problem is that when connecting to an external network, the bridge combines the internal network with the external network to become a network, and both parties automatically open their network resources to the other party. This interconnection method is obviously unacceptable when it is connected to an external network. The main cause of the problem is that the bridge only maximizes network communication, regardless of the information transmitted.
1.2 vro Interconnection Network
Vro interconnection is related to the network protocol. We discuss the limitations of the TCP/IP network.
The Layer 3 router in the OSI model, that is, the network layer. Vro uses the network address (IP address) defined in the "logic" of the network layer to differentiate different networks, achieve network interconnection and isolation, and maintain the independence of each network. Vrouters do not forward broadcast messages, but restrict broadcast messages to their respective networks. Data sent to other networks is first sent to the vro and then forwarded by the vro.
The IP router only forwards IP groups and blocks the remaining parts from the network, including the broadcast), so as to maintain the independence of each network, which can form a number of network subnets) large interconnected networks. Because of the interconnection at the network layer, the router can easily connect different types of networks. As long as the network layer runs the IP protocol, the router can connect.
Devices in the network communicate with each other by using their network addresses, which are IP addresses in the TCP/IP network. An IP address is a "logical" address unrelated to a hardware address. The router forwards data only by IP address. The IP address structure consists of two parts: one part defines the network number and the other part defines the host number in the network. Currently, the subnet mask is used in Internet networks to determine the network address and host address in the IP address. The subnet mask is also 32bit like the IP address, and the two are one-to-one correspondence. it is specified that the part of the subnet mask whose number is "1" is the network number, the master ID corresponding to "0. The network and host numbers are combined to form a complete IP address. Host IP addresses in the same network must have the same network number. This network is called an IP subnet.
Communication can only be performed between IP addresses with the same network number. To communicate with hosts with other IP address subnets, the communication must go through a vro or gateway on the same network. IP addresses of different network numbers cannot communicate directly, even if they are connected together.
A vro has multiple ports used to connect multiple IP subnets. The network number of the IP address of each port must be the same as the network number of the connected IP subnet. Different ports have different network numbers and correspond to different IP subnets. In this way, the hosts in each subnet can send the requested IP addresses to the vro through their own subnet IP addresses.
2. Routing Principle
When one host in the IP subnet sends an IP group to another host in the same IP subnet, it will directly send the IP Group to the network, and the other party will receive it. To send the IP address to a host on the internet, you need to select a router that can reach the destination subnet and send the IP address group to the router. The router is responsible for sending the IP address group to the destination. If such a router is not found, the host sends the IP Group to a router called "default gateway. The "Default Gateway" is a configuration parameter on each host. It is the IP address that is connected to a vro port on the same network.
When forwarding an IP group, the router selects an appropriate port based on the network number of the destination IP address of the IP Group and sends the IP Group out. Like a host, the vro must determine whether the port is connected to the destination subnet. If yes, the group is directly sent to the network through the port. Otherwise, the next vro must be selected to send the group. The router also has its default gateway to send IP groups that do not know where to send them. In this way, the router correctly forwards IP groups that know how to transfer them, and the IP groups that do not know are sent to the "Default Gateway" router. In this way, the IP Group will eventually be sent to the destination, IP groups that cannot be sent to the destination are discarded by the network.
Currently, all TCP/IP networks are interconnected through routers. The Internet is an international network that connects thousands of IP subnets through routers. This type of network is called router-based network ". In "inter-network", routers are not only responsible for forwarding IP groups, but also responsible for communicating with other routers to jointly determine the routing selection and maintenance route table of "inter-network.
The routing action includes two basic items: path finding and forwarding. The routing algorithm is used to determine the optimal path to the destination. Because different routing protocols and routing algorithms are involved, it is relatively complicated. To determine the optimal route, the routing algorithm must start and maintain the route table containing route information. The routing information varies depending on the routing algorithm used. The routing algorithm fills in different information collected in the routing table, and tells the router about the relationship between the destination network and the next stop nexthop according to the route table. The router interconnection information is updated, and the route table is updated and maintained so that the network topology changes are correctly reflected. The optimal path is determined by the router according to the measurement. This is the routing protocol), such as the routing information protocol RIP), Open Shortest Path Priority protocol OSPF) and Border Gateway protocol BGP.
Forward refers to the information transfer group along the best path for path searching. The router first looks up in the routing table and determines whether the router knows how to send the group to the next station router or host). If the router does not know how to send the group, the router usually discards the group; otherwise, the group is sent to the next site based on the corresponding table items in the route table. If the destination network is directly connected to the vro, The vro sends the group directly to the corresponding port. This is the route forwarding protocol (routed protocol ).
The routing forwarding protocol and the routing selection protocol are mutually compatible and independent. The former uses the route table maintained by the latter, and the latter uses the functions provided by the former to publish the Routing Protocol Data grouping. The routing protocols mentioned below, unless otherwise stated, refer to the routing selection protocols, which are also common habits.
3. Routing Protocol
Typical routing methods include Static Routing and dynamic routing.
Static Routing is a fixed route table set in a vro. The static route does not change unless the network administrator intervene. Because Static Routing cannot reflect network changes, it is generally used in a network with a small network size and a fixed topology. Static Routing is simple, efficient, and reliable. Among all the routes, static routes have the highest priority. When a dynamic route conflicts with a static route, the static route prevails.
Dynamic routing is a process in which routers in the network communicate with each other, transmit route information, and update the router table using the received route information. It can adapt to network structure changes in real time. If the route update information indicates that the network has changed, the route selection software recalculates the route and sends new route update information. This information is transmitted through various networks, causing routers to restart their routing algorithms and update their route tables to dynamically reflect network topology changes. Dynamic Routing is suitable for networks with large networks and complex network topologies. Of course, various dynamic routing protocols occupy network bandwidth and CPU resources to varying degrees.
Static Routing and dynamic routing have their own characteristics and applicability. Therefore, dynamic routing is usually used as a supplement to Static Routing in the network. When a group is used to find the route in the vro, The vro first searches for the static route. If yes, the vro。 forwards the route according to the corresponding static route forwarding group. Otherwise, the vro searches for the dynamic route.
Dynamic Routing Protocols are divided into internal gateway protocol IGP and external gateway protocol EGP based on whether they are used in an autonomous domain ). The Autonomous Region refers to a network with a unified management organization and a unified routing policy. The routing protocol used in the autonomous region is called the internal gateway protocol, which is commonly used with RIP and OSPF. The external gateway protocol is mainly used for routing selection between multiple autonomous regions, common are BGP and BGP-4. The following is a brief introduction.