Difference between Layer 2 Switch, Three-Floor Switch, Four-Layer Switch

xiaoxiao2021-03-13  183

(1) Layer 2 exchange

Layer 2 switching technology is a more mature, two-layer switching machine data link layer device, which can identify MAC address information in the packet, forwarded according to the MAC address, and record these MAC addresses with the corresponding port in one of its own interior. Address table.

The specific workflow is as follows: 1. When the switch receives a packet from a port, it first read the source MAC address in the header, which it knows that the machine of the source MAC address is connected to which port is connected; 2. Go to read the destination MAC address in the header and look up the appropriate port in the address table; 3. If there is a port corresponding to this purpose, the packet is copied directly to this port; 4. If the corresponding port is not found, broadcast the packet to all ports. When the machine responds to the source machine, the switch can learn which port corresponds to which port corresponds to which port, no longer needs to be required when transmitting data next time. The port is broadcast.

Constant looping process, you can learn from the MAC address information of the whole network, and the Layer 2 switch is to establish and maintain its own address table.

The following three points can be inferred from the working principle of the Layer 2: 1. Since the switch exchanges the data of the majority port, this requires a wide exchange busbar wide, if the Layer 2 switch has n ports, each port The bandwidth is M. The switch bus bandwidth exceeds N × m, then this switch can implement a line speed switch; 2. Learning the MAC address of the machine, write address table, address table (general two means: one For the BEFFER RAM, a MAC entry value), the address form size affects the access capacity of the switch; 3. There is also one of the second-layer switches generally contains an ASIC (Application Specific Integrated Circuit) specifically used to process packet forwarders. Therefore, the forwarding speed can be very fast. Since various manufacturers have different ASICs, they directly affect product performance.

The above three points are also the main technical parameters of evaluating the performance of the two-three-layer switch. At this point, please pay attention to comparison when considering equipment selection.

(2) Routing Technology

The router works in the third layer of the OSI model - network layer operation, its working mode is similar to the Layer 2, but the router works in the third layer, this difference determines the route and exchanges use different control information when transmitting the package, Implementation is different. The working principle is that there is also a table inside the router. This table indicates that if you want to go to a place, the next step should go there, if you can find the packet from the routing table, let the link layer Information plus forward; if you can't know the next step, drop this package and return to a message to give the source address.

Routing technology is essentially two functions: Decide the optimal route and forwarding packets. A variety of information is written in the routing table, calculated from the routing algorithm to the best path to the destination address, and then send the packet by a relatively simple direct forwarding mechanism. The next router that accepts data continues to forward in accordance with the same way, and push it according to the secondary, until the packet reaches the destination router.

And the maintenance of routing tables, there are two different ways. One is the update of routing information, and the partial or all routing information will be published. The router has mastered the topology of the whole network through mutual learning routing information. This type of routing protocol is called the distance vector routing protocol; another It is the router to broadcast your link status information, and learn the routing information of the whole network by mutual learning, and then calculate the best forwarding path, which is called a link status routing protocol.

Since the router needs to do a large number of path calculations, the work ability of the general processor directly determines its performance. Of course, this judgment is still in the middle and low-end routers, because high-end routers often use distributed processing system architectural design. (3) Three-layer exchange technology

In recent years, the propaganda of the three-story technology, the ears can start from the scorpion, and there is a three-story technology. Some people say that this is a very new technology. Some people say that three floors exchange, not the router and Layer 2 switch Stack, there is no new gadget, is it true? Let's take a look at the work of the three-layer switch through a simple network.

Compare IP equipment A ---------------------------------------------------------------------- ---------- Equipment B using IP B

For example, a to send data to b, known to the destination IP, then A will use the subnet mask to obtain the network address, determine if the destination IP is in the same network segment.

If in the same network, but does not know the MAC address required for forwarding the data, a will send an ARP request, b Returns its MAC address, and A uses this MAC package packet and sends it to the switch, and the switch is used to switch modules. The MAC address table forwards the packet to the corresponding port.

If the destination IP address is not the same network segment, then A to implement and b, there is no corresponding MAC address entry in the stream cube entry, and send the first normal packet to a default gateway, this default gateway Generally, it has been set in the operating system, corresponding to the third layer routing module, so it is visible to data that is not the same subnet, first in the MAC table is the MAC address of the default gateway; then receives the three-layer module to receive This packet, queries the routing table to determine the route to the b, which will construct a new frame header, where the MAC address of the default gateway is the source MAC address, the MAC address of the host B. Through a certain trigger mechanism, establish a correspondence between host a and b, the correspondence relationship of the MAC address of the host A and B, and record the input cache module, and the data of the sub-A to B is directly transferred to the Layer 2 exchange module. This usually said multiple times multiple times.

The above is a simple summary of the working process of the three-layer switch, and it can be seen that the characteristics of three-layer exchange: 1. High-speed forwarding of data by hardware. This is not a simple two-layer switch and the latter superposition. The three-layer routing module is directly superimposed on the high-speed backplane bus on the Layer 2, breaks through the interface rate limit of the traditional router, and the rate is up to dozens of Gbit / s. Counting the backplane bandwidth, these are two important parameters for the performance of the three-layer switch. 2. Simple routing software simplifies the routing process. Most of the data forwarded, in addition to the necessary routing, the routing software is handled, all the second-layer modules are high-speed forwarding, and the routing software is mostly the processing efficient optimization software, which is not simply moving the software in the router.

in conclusion

Layer 2 switches for small local area networks. This will not be much more, in a small LAN, the broadcast package is not affected, the fast exchange function of the Layer 2 switch, and multiple access ports and lowest prices provide a complete solution for small network users.

The advantage of the router is rich in interface type, strong three-layer function, powerful routing ability, is suitable for routing between large networks, its advantage is to choose the best route, load sharing, link backup, and other networks to route The exchange of information such as the router has functions.

The most important function of the three-layer switch is to speed up the rapid forwarding of the data inside the large local area network, which is also serving this destination. If a large network is divided into a small local area network in accordance with the department, geographical and other factors, this will result in a large number of Internet interviews, and the simple use of Layer II switches cannot achieve Internet exchange; such as a simple use of routers, due to limited number of interfaces The routing forwarding speed will limit the speed and network size of the network, and the three-layer switch with a rapid forward forwarding of routing functions is preferred. If a large network is divided into a small local area network in accordance with the department, geographical and other factors, this will result in a large number of Internet interviews, and the simple use of Layer II switches cannot achieve Internet exchange; such as a simple use of routers, due to limited number of interfaces The routing forwarding speed will limit the speed and network size of the network, and the three-layer switch with a rapid forward forwarding of routing functions is preferred.

In general, in the network data traffic, it is required to quickly forward response. If all by three-layer switches do this, it will cause the three-layer switch to be overweight, the response speed is affected, and the route of the network Different from the router, give full play to the advantages of different equipment, it is a good network strategy, of course, the premise is that the customer's pocket is very drum, otherwise it will return, let the three-layer switch also have a network interconnection.

(4) Fourth floor exchange technology

A simple definition of the fourth layer exchange is: it is a function, it determines that the transfer is not only based on the MAC address (second layer bridge) or source / target IP address (third layer rout), and according to TCP / UDP ( The fourth layer) application port number. The fourth floors exchange function is like a virtual IP, pointing to the physical server. It transfers a variety of integration protocols, HTTP, FTP, NFS, Telnet, or other protocols. These businesses require complex load balancing algorithms based on physical servers. In the IP world, the service type is determined by the terminal TCP or UDP port address, and the application section in the fourth layer exchange is determined by the source and terminal IP addresses, TCP, and UDP ports. Setup virtual IP addresses (VIPs) for each server group for search, each set of applications in the fourth-floors. Each application server address stored in the Domain Name Server (DNS) is VIP instead of a real server address. When a user applies for an application, a VIP connection request with the target server group (eg, a TCP SYN package) is sent to the server switch. The server switch selects the best server in the group, replaces the VIP in the terminal address with the IP of the actual server, and transmits the connection request to the server. Thus, all of the packages in the same interval are mapped by server switches, transmitting between users and the same server.

The fourth layer of the fourth layer exchange is the fourth layer of the OSI model is a transport layer. The transport layer is responsible for end-to-end communication, that is, coordinating communication between network sources and target systems. This is the protocol layer where TCP (a transport protocol) and UDP (user packet protocol) are located in the IP protocol stack.

In the fourth layer, TCP and UDP headers include portNumber, which can uniquely distinguish which application protocols (such as HTTP, FTP, etc.) each data package (eg HTTP, FTP, etc.). The endpoint system uses this information to distinguish the data in the package, in particular the port number, enable a receiving computer system to determine the IP packet type it receives and hand it over to the appropriate high-level software. The combination of port numbers and device IP addresses is often referred to as an "socket". The port numbers between 1 and 255 are reserved, and they are called "well known" ports, that is, in all host TCP / IP protocol stack implementations, these port numbers are the same. In addition to the "well known" port, the standard UNIX service is assigned in the range of 256 to 1024, customized applications typically allocate port numbers above 1024. The recent list of allocated port numbers can be found on RFC1700 "Assigned NumBers". The additional information provided by the TCP / UDP port number can be used for the network switch, which is the foundation of the 4th floor exchange. Example of "Know" port number: Application protocol port number FTP 20 (data) 21 (control) Telnet 23 SMTP 25 HTTP 80 NNTP 119 NNMP 16 162 (SNMP Traps)

The additional information provided by the TCP / UDP port number can be used for the network switch, which is the foundation of the fourth layer exchange. A switch with a fourth layer function can function as a "virtual IP" (VIP) front end connected to the server. A VIP address is configured for each server and a server group that supports a single or universal application. This VIP address is sent out and registered on the domain name system. When a service request is issued, the fourth layer switch begins to identify the beginning of a session by determining the TCP. It then uses a complex algorithm to determine the best server that handles this request. Once this decision is made, the switch will link the session with a specific IP address and use the server's true IP address instead of the VIP address on the server. Each fourth layer switch holds a connection table associated with the source IP address compared with the selected server and the source TCP port. The fourth layer switch is then forwarded to this server. All subsequent packages are re-imaged and forwarded between the client and the server until the switch discovers the session. In the case of using the fourth layer exchange, access can be connected with the real server to satisfy the rules that the user is developed, such as having equal number of access to each server or allocating a transport stream using the capacity of the different servers.

How to choose the right fourth floor exchange

A. The speed is effective in the enterprise network, and the fourth-layer exchange must provide a comparable performance of the third layer line speed router. That is, the fourth floors must operate in all ports at all ports, even in multiple Gigabit Ethernet connections. Gigabit Ethernet speed is equal to the maximum speed routing of 1488,000 packets per second (assuming the worst case, that is, all packets as well as the smallest size, 64 bytes).

B. The server capacity balancing algorithm is based on the desired capacity balancing interval, and the fourth-floors have many algorithms that allocate to the server. There is a simple detection loop recent connection, detect loop delay or detection server itself. Closed loop feedback. In all predictions, closed-loop feedback provides the most accurate detection that reflects the existing traffic of the server.

C, the table capacity should be noted that the switch to the fourth layer exchange needs to distinguish and store a large number of sending entries. This is especially true when the switch is at the heart of an enterprise network. Many second / three-layer switches tend to send the size of the network to the number of network devices. For the fourth-floors, this number must multiply the number of different application protocols and sessions used in the network. Thus the size of the sending table grows rapidly with the increase in the number of endpoint devices and the number of applications. The fourth layer switch designer needs to consider this growth of the table when designing its products. Large table capacity is critical to manufacturing high-performance switches that support the fourth floors of traffic. D, and the redundant fourth-floors have functions that support redundant topology. When there is a network card fault tolerance with a double link, it is possible to establish a complete redundant system from one server to NIC, link, and server swap.

转载请注明原文地址:https://www.9cbs.com/read-129075.html

New Post(0)