Layer of basic vswitch knowledge

Source: Internet
Author: User
Tags domain name server

L2 Switch

The development of L2 Switch Technology is relatively mature. L2 Switch is a data link layer device that can identify the MAC address information in the data packet and forward it according to the MAC address, the MAC addresses and corresponding ports are recorded in an internal address table.

The specific workflow is as follows:

1) whenVswitchWhen a packet is received from a port, it first reads the source MAC address from the packet header, so that it knows the port on which the host of the source MAC address is connected;

2) read the target MAC address in the header and find the corresponding port in the address table;

3) if the table contains a port corresponding to the destination MAC address, copy the packet directly to the port;

4) if no corresponding port is found in the table, the packet is broadcast to all ports. When the target machine responds to the source machine, the switch can record the port corresponding to the target MAC address, the next time you transmit data, you no longer need to broadcast all ports. In this process, the MAC address information of the entire network can be learned. The second-layer switch creates and maintains its own address table.

The working principle of a L2 Switch can be inferred from the following three points:

1) because the switch exchanges data on most ports at the same time, it requires a wide switching bus bandwidth. If the L2 Switch has N ports, the bandwidth of each port is M, if the bandwidth of the vswitch bus exceeds N × M, the vswitch can achieve line rate switching;

2) the MAC address of the machine connected by the Learning port, which is written to the address table. The size of the address table is generally expressed in two ways: one is beffer ram and the other is the MAC table item value ), the address table size affects the access capacity of the vswitch;

3) There is also a layer-2 switch that generally contains ASICApplication specific Integrated Circuit dedicated for data packet forwarding. Therefore, the forwarding speed can be very fast. Because different manufacturers use different ASIC, the product performance is directly affected.

The above three points are also the main technical parameters used to judge the performance of Layer 2 and Layer 3 switches. Please pay attention to the comparison when considering device selection.

L3 Switch

Next, let's take a look at the working process of a layer-3 Switch through a simple network.

Device A using IP ------ layer-3 Switch ------ Device B using IP

For example, if A wants to send data to B and the target IP address is known, A uses the subnet mask to obtain the network address and determine whether the destination IP address is in the same network segment as itself. If A is in the same network segment but does not know the MAC address required for data forwarding, A sends an ARP request, B returns its MAC address, and A uses this MAC encapsulation packet to send it to the switch concurrently, the second-layer switch module is used to find the MAC address table and forward data packets to the corresponding port.

If the destination IP address is not displayed in the same CIDR block, A needs to communicate with B, and there is no corresponding MAC address entry in the stream cache entry, send the first normal data packet to a default gateway. This default gateway is usually set in the operating system and corresponds to the layer-3 routing module. Therefore, we can see that for data not in the same subnet, the MAC address of the default gateway is first placed in the MAC table. Then, the layer-3 module receives the packet and queries the route table to determine the route to B. A new frame header is constructed, the MAC address of the default gateway is the source MAC address, and the MAC address of host B is the target MAC address. Through A certain identification trigger mechanism, it establishes the MAC address and forwarding port correspondence between host A and host B, and records the data from host A to host B in the stream cache entry table, it is directly submitted to the layer-2 Switching Module. This is generally referred to as one-time route forwarding.

The above is a brief summary of the three-layer switch process. We can see the characteristics of the three-layer switch:

1) hardware is combined to achieve high-speed data forwarding. This is not a simple superposition of Layer 2 switches and routers. The Layer 3 routing module is directly superimposed on the Layer 2 switching high-speed backplane bus, breaking through the interface speed limit of traditional routers, the speed can reach dozens of Gbit/s. Calculating the backboard bandwidth is two important parameters for the performance of a layer-3 switch.

2) The simple routing software simplifies the routing process. Most of the data forwarding, except for the necessary routing options, is handled by the routing software by the layer-2 module for high-speed forwarding. Most of the routing software is an efficient optimization software that has been processed, it is not a simple copy of the software in the router.

Layer-4 Switch

A simple definition of layer-4 switching is that it is a function that determines that transmission is not only based on the MAC address (layer-2 Bridge) or the layer-3 route of the source/Target IP address ), based on the TCP/UDP (Layer 4) application port number. The layer-4 switching function is like a virtual IP address pointing to a physical server. Its transmission services are subject to a variety of protocols, including HTTP, FTP, NFS, Telnet, or other protocols. These services require complex load balancing algorithms based on physical servers.

In the IP address world, the service type is determined by the TCP or UDP port address of the terminal. The application interval in the layer-4 switch is jointly determined by the source and terminal IP addresses, TCP and UDP ports. Set up virtual IP addresses (VIP) for each server group for search in layer-4 Switching. Each group of servers supports an application.

In the Domain Name Server DNS), the address of each application server stored is VIP, rather than the actual server address. When a user applies for an application, a VIP connection request with the target server group, such as a tcp syn packet, 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 actual Server IP address, and sends the connection request to the server. In this way, all packets in the same range are mapped by the server switch and transmitted between the user and the same server.

Are you clear the number of vswitch layers? The above content is relatively basic and detailed. It should be easy to understand the first knowledge of the switch.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.