Before talking about the principle of a router, let's briefly talk about what a router is. A router is a network device that connects multiple networks or CIDR blocks. It can translate data between different networks or CIDR blocks ", so that they can "read" each other's data to form a larger network.
Vro has two main functions: Data tunnel and control. The data channel functions include forwarding decision, backplane forwarding, and output link scheduling, which are generally completed by specific hardware. The control functions are generally implemented by software, it includes information exchange with neighboring routers, system configuration, and system management.
I. Interconnection Mode
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, and routers have 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.
2. network connected by a bridge
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.
3. Router Interconnection Network
Vro interconnection is related to the network protocol. Therefore, 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.