This digest is from http://www.pconline.com.cn/pcjob/ittest/network/0312/258919.html
Other literature http://www.jztop.com/s/jiaohjjs/
Comparison of three-layer switch and router
In order to meet the challenge of deepening the network application, the network has been developing rapidly in both scale and speed, the speed of LAN has been improved from the initial 10mbit/s to the 100mbit/s, and the Gigabit Ethernet technology has been widely used at present.
The
has also evolved from early shared-media LANs to current switched LANs in the network architecture. Switched LAN technology makes the dedicated bandwidth unique to users, and greatly improves the efficiency of LAN transmission. It can be said that in the network system integration technology, the direct user-oriented first-tier interface and the second-tier exchange technology has been a satisfactory answer. However, as the network core, the interconnection between the network of the router technology is not a qualitative breakthrough. In this case, a new routing technology emerges, this is the third tier switching technology: It is a router because it operates on the third layer of the network protocol and is a route-understanding device that can act as a routing decision; it's a switch because it's very fast, and it's almost the speed of a second-tier exchange. Two-tier switches, three-tier switches, and routers the three technologies who are superior to each other and what are their respective environments. To answer this question, let's start with the working principles of these three technologies:
1. Two layer switching technology
Two layer switch is a data link layer device that can read MAC address information in a packet and exchange it according to MAC address. The
Switch has an address table inside it that identifies the corresponding relationship between the MAC address and the switch port. When a switch receives a packet from a port, it first reads the source MAC address in the header. So it knows the source MAC address of the machine is connected to which port, it will be read in the header of the destination MAC address, and in the Address table to find the appropriate port, if the table has the same destination MAC address port, The packet is copied directly onto the port, if the corresponding port is not found in the table, the packet is broadcast to all ports, and when the destination machine responds to the source machine, the switch can learn the destination MAC address corresponds to which port, and will no longer need to broadcast all ports the next time the data is transferred. This is how the
Two-tier switch establishes and maintains its own address table. Since the two-layer switch generally has a wide bandwidth of the switching bus, it is possible to exchange data for many ports at the same time. If the two-tier switch has n ports, the bandwidth of each port is M, and its switch bus bandwidth exceeds NXM, then the switch can achieve wire-speed switching. The two-tier switch is not limited to broadcast packets and copies the broadcast packets to all ports. The
Two-tier switch typically contains an ASIC (application specific integrated circuit) chip specifically designed to handle packet forwarding, so the forwarding speed can be very fast.
2. Routing Technology
Routers are the third layer of the OSI seven-layer network model-the network layer operates.
There is a routing table inside the router that indicates where the next step should go if you are going somewhere. The router receives a packet from a port that first removes the header of the link layer (unpacking), read the destination IP address, then look for the routing table, if you can determine where to send the next, then add the link layer header (packaging), the packet forward; If you cannot determine the next address, return a message to the source address and throw this data packet away.
Routing technology and two-tier switching look a bit similar, in fact, the main difference between routing and switching is that the exchange takes place at the second layer of the OSI Reference Model (the Data Link layer), and the route occurs at the third level. This distinction determines that routing and switching need to use different control information in the process of transmitting data, so the two ways to achieve their respective functions are different.
Routing technology is actually composed of two basic activities, that is, deciding the optimal path and transmitting packets. Among them, the packet transmission is relatively simple and direct, and the route is more complex to determine. Routing algorithms write different kinds of information in the routing table, and routers send packets to the next router at the destination by selecting the best path to the destination where the packet is to be reached. When the next router receives the packet, it also looks at its destination address and continues to route to the back router using the appropriate path. And so on, until the packet arrives at its final destination.
Routers can communicate with each other, and they can maintain their own routing tables by transmitting different types of information. Routing update information The master is such a message, typically consisting of some or all of the routing tables. By analyzing the routing update information sent by other routers, routers can master the topology of the whole network. Link state broadcast is another kind of information passed between routers, it can send the information to the sender of the link state and notify the other routers.
3. Three-layer switching technology
A third-tier switching device is a second layer switch with a third-layer routing function, but it is a combination of the two, not simply the hardware and software of the router device is simply superimposed on the LAN switch.
From the hardware, the interface module of the second layer is through the high speed Backplane/bus (speed can up to dozens of gbit/s) Exchange data, in the third layer of switches, the router-related third-tier routing hardware module is also plugged into the high speed backplane/bus, In this way, the routing module can exchange data with other modules which need to be routed, thus breaking the traditional interface speed limit of external routers. On the software side, the third layer switch also has the important initiative, it has defined the traditional software based router software.
The practice is:
For packet forwarding: such as IP/IPX packet forwarding, these rules of the process through the hardware to achieve high-speed.
For the third-tier routing software, such as routing information update, routing table maintenance, routing calculation, routing and other functions, with optimized, efficient software implementation.
Assuming that two machines using the IP protocol communicate through a third-tier switch, machine A has a known destination IP address when it starts sending, but does not yet know what MAC address to send on the LAN. To use Address resolution (ARP) to determine the destination MAC address. Machine A compares its IP address with the destination IP address and extracts the network address from the subnet mask configured in its software to determine whether the destination machine is in the same subnet as itself. If the purpose of machine B is in the same subnet as machine A, a broadcasts an ARP request, B returns its MAC address, a obtains the destination machine B's MAC address to cache this address, and uses this MAC address packet forwarding data, the second Layer Exchange module looks for the MAC address table to determine sends the packet to the destination port. If two machines are not in the same subnet, such as sending machine A to communicate with the destination machine C, sending machine A sends an ARP packet to the default gateway, and the IP address of the "default gateway" is already set in the system software. This IP address actually corresponds to the third tier switching module of the third tier switch. So when send machine a broadcasts an ARP request to the IP address of the "default gateway", if the third-tier switching module has obtained the MAC address of the destination machine C in the previous communication process, the MAC address of the sending machine A is replied to C; otherwise, the third layer switching module broadcasts an ARP request to the destination machine according to the routing information. , the purpose of the machine C to get this ARP to reply to the third layer of the Exchange module to its MAC address, the third layer Exchange module to save this address and reply to send machine A. Later, when the packet forward between A and C is forwarded, the MAC address of the final destination machine is encapsulated, the data forwarding process is transferred to the second layer, and the information is exchanged at high speed. The so-called one-way choice, many exchanges.
The third layer Exchange has the following salient features:
The combination of organic hardware makes data exchange accelerate;
The optimized routing software makes the routing process more efficient;
In addition to the necessary routing decision process, most of the data forwarding process is handled by the second layer exchange;
Multiple subnet interconnection is only a logical connection to the third-tier switching module, and it does not require additional ports to protect the user's investment, as is the case with traditional external routers.
4. Comparison of three kinds of technology
We can see that the two-layer switch is mainly used in small LAN, the number of machines in the following 20 or 30, such a network environment, broadcast packet impact is not small, the two-tier switch fast switching function, multiple access ports and low price for small network users to provide a very complete solution. In this small network there is no need to introduce routing features to increase the difficulty and cost of management, so there is no need to use the router, of course, there is no need to use the three-tier switch.
The three-tier switch is designed for IP, the interface type is simple, has the very strong two layer package processing ability, therefore applies in the large LAN, in order to reduce the broadcast storm the harm, must put the large-scale local area network according to the function or the region and so on the factor to draw him into a small local area network, is a small network segment, This will inevitably lead to a large number of different network segments of the exchange of visits, the simple use of the two-tier switch can not achieve the network between the exchange of the simple use of routers, because of the limited number of ports, routing speed is slow, and limited the size of the network and access speed, so this environment The three-layer switch, which is organically combined with two-tier switching technology and routing technology, is most suitable.
Router port type is many, the support three layer protocol many, the route ability is strong, so suitable for the interconnection between large networks, although many three-tier switches and even two-tier switches have heterogeneous network interconnection ports, but the general large network interconnect ports are not many, interconnection equipment, the main function is not in the fast exchange between the ports, Instead, choose the best path, load-sharing, link backup, and most importantly, the routing information exchange with other networks, all of which are the function of routing completion.
In this case, it is not possible to use the two-tier switch, but whether the three-tier switch is used, depending on the situation. The main influencing factors are network traffic, response speed and investment budget. The most important purpose of the three-layer switch is to speed up the data exchange within the large LAN, and the routing function is also served for this purpose, so its routing function does not have the same grade of professional router. In the case of large network traffic, if the three-tier switch does not only exchange within the network, but also to do the routing between the network, it will greatly increase its burden, affecting the response speed. In the network traffic is very large, but also requires a high response rate of three-tier switch to do the network exchange, by the router is responsible for the network routing work, so that you can give full play to the advantages of different equipment, is a good match. Of course, if the investment budget constraints, from the three-tier switch to do network interconnection, is also a good choice. (fengnet.com)