Two-layer switch
The development of the two-layer switching technology is quite mature, the two-layer switch is a data link layer device, which can identify the MAC address information in the packet, forward according to the MAC address, and record the MAC address and the corresponding port in one of the address tables within oneself.
The specific work flow is as follows:
1 when the switch receives a packet from a port, it first reads the source MAC address in the header, so it knows the source MAC address machine is connected to which port;
2) to read the destination MAC address in the header and find the corresponding port in the Address table;
3 If the table has the corresponding port with this purpose MAC address, the data packet is copied directly to this port;
4 If the table can not find the appropriate port to the packet broadcast to all ports, when the target machine to respond to the source machine, the switch may record the purpose of the MAC address and which port corresponding, the next time the data transfer will no longer need to broadcast all the ports. The continuous cycle of this process, for the whole network of MAC address information can be learned, the second-tier switch is to create and maintain its own address table.
The following three points can be inferred from the working principle of the two-layer switch:
1 because the switch to the majority of the port data exchange, which requires a very wide exchange bus bandwidth, if the two-tier switch has n ports, the bandwidth of each port is M, the switch bus bandwidth over NXM, then the switch can achieve wire speed exchange;
2 Learning port connected machine MAC address, write Address table, Address table size (generally two representations: one for Beffer RAM, one for Mac table entry value), Address table size affects the access capacity of the switch;
3 There is also a two-tier switch generally contains a dedicated ASIC for processing packet forwarding (application specific integrated circuit, ASIC) chip, so the forwarding speed can be very fast. Because each manufacturer uses the ASIC different, the direct influence product performance. ( Network Application Tutorial
Three-layer switch
Let's look at the process of a three-tier switch with a simple network.
Use IP device a------layer three switch------device b
using IP (a) to send data to B, known destination IP, then a subnet mask to obtain the network address, to determine whether the destination IP and its own in the same network segment. If you are in the same network segment, but do not know to forward the data required MAC address, a to send an ARP request, B return its MAC address, a with this MAC package packet sent to the switch, switch to use two-tier switching module, look for the MAC address table, the packet forwarding to the appropriate port.
If the destination IP address does not display the same network segment, then a to implement and B communication, in the stream cache entry, there is no corresponding MAC address entry, the first normal packet sent to a default gateway, this default gateway is generally in the operating system has been set up, corresponding to the third tier routing module, So for data that is not the same subnet, the MAC address of the default gateway is first placed in the Mac table, then the three-tier module receives the packet, queries the routing table to determine the route to B, and constructs a new frame header with the MAC address of the default gateway as the source MAC address. The MAC address is the destination of the MAC address of Host B. Through a certain trigger mechanism, the corresponding relationship between the MAC address and the originator port of host A and B is established, and the data of the stream cache Entry table is recorded, and then A to B is completed directly by the two-layer switching module. This is often referred to as a route forwarding multiple times. The
above is a simple generalization of the three-tier switch process, which shows the characteristics of the three-tier exchange:
1, which enables high-speed forwarding of data with hardware. This is not a simple stack of two-tier switches and routers, the three-layer routing module is directly superimposed on the two-layer high speed backplane bus, which breaks through the interface rate limit of the traditional routers, and the rate is up to dozens of gbit/s. The backplane bandwidth is calculated, these are two important parameters of the performance of the three-layer switch.
2) Concise routing software simplifies the routing process. Most of the data forwarding, in addition to the necessary routing options to the Routing software processing, are two-tier module high-speed forwarding, routing software is mostly processed by efficient optimization software, not simply copy the software in the router. A simple definition of layer fourth exchange in
Layer four switches
is that it is a function that determines that the transmission is notOnly based on the MAC address (second tier Network Bridge) or source/destination IP address (third tier routing), and based on the TCP/UDP (layer fourth) application port number. Layer Fourth switching functions are like virtual IP, pointing to the physical server. It transmits a variety of business compliance protocols, with HTTP, FTP, NFS, Telnet, or other protocols. These services require a complex load balancing algorithm based on the physical server.
in the IP world, business types are determined by terminal TCP or UDP port addresses, and the application interval in layer fourth switching is determined by both the source and terminal IP addresses, TCP, and UDP ports. A virtual IP address (VIP) is set up for each server group for search in layer fourth exchange, and each group of servers supports some application. Each application server address that
stores in the Domain name server (DNS) is a VIP, not a real server address. When a user applies for an application, a VIP connection request (such as a TCP SYN packet) with the target server group 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 passes the connection request to the server. In this way, all packets in the same interval are mapped by the server switch and transmitted between the user and the same server. How many layers of the
switch are you clear? The above content is relatively basic and detailed, for the switch of the initial and try should be easy to understand.