Network switch (commonly known as network switch, or IP switch)

network switch

A network switch (English: ) is a piece of network hardware that receives and forwards data to target devices by exchanging messages . It can connect different devices on a computer network . It is also generally referred to as a switch.

Avaya 's ERS 2550T-PWR 50-port network switch

A switch is a multi-port bridge that forwards data using MAC addresses at the data link layer . By introducing the routing function, some switches can also forward data at the network layer . Such switches are generally called layer-3 switches or multi-layer switches.

Ethernet switches are the most common form of network switches. The first Ethernet switch was introduced by Kalpana Corporation (acquired by Cisco in 1994 ). Switches are also ubiquitous in other types of networks, such as Fiber Channel , Asynchronous Transfer Mode , and InfiniBand .

The repeater will forward the same data on all its ports, allowing the device to judge which data it needs, but the switch is different, it will only forward the data to the device that needs to receive it.

working principle

a network with switches

ethernet switch

Switches work on the second layer of the OSI reference model , the data link layer . The CPU inside the switch will form a MAC table by matching the MAC address with the port when each port is successfully connected . In the future communication, the data packet sent to this MAC address will only be sent to its corresponding port, not all ports. Therefore, the switch can be used to divide data link layer broadcasts, that is, collision domains; but it cannot divide network layer broadcasts, that is, broadcast domains .

The forwarding of the data packets by the switch is based on the MAC address—the physical address. For the IP network protocol, it is transparent, that is, the switch does not know or need to know the source machine and the destination when forwarding the data packets. If you want to know the IP address of the computer, you only need to know its physical address.

During the operation, the switch will continuously collect data to build its own address table. This table is quite simple. It shows on which port a certain MAC address is found, so when the switch receives a TCP/ IP packet , it will check the destination MAC address of the data packet, and check its own address table to confirm from which port the data packet should be sent out. Since this process is relatively simple, and this function is performed by a brand new hardware - ASIC , the speed is quite fast. Generally, it only takes tens of microseconds for the switch to decide where to send an IP packet.

If the destination MAC address cannot be found in the address table, the switch will "flood" the IP packet, that is, send it out of each port, just like the switch does when processing a received broadcast packet. The weakness of a Layer 2 switch is that its method of processing broadcast packets is not very effective. For example, when a switch receives a broadcast packet sent from a TCP/IP workstation, it will pass the packet to all other ports. Go, even if some ports are connected to IPX or DECnet workstations. As a result, the bandwidth of non-TCP/IP nodes will be negatively affected, even if the same TCP/IP nodes, if their subnet is the same as the subnet of the workstation that sent the broadcast packet, then they will be unreasonable. Receive some network broadcasts that have nothing to do with them, and the efficiency of the entire network will be greatly reduced.

Way of working

After a switch is installed and configured, its working process is as follows:

  • Receive a packet from a computer with a MAC address of X on a network segment (set to A) to a computer with a MAC address of Y. The switch thus records that MAC address X is in network segment A. This is called learning.
  • The switch does not know which network segment MAC address Y is on, so it forwards the data packet to all network segments except A. This is called flooding.
  • The computer with MAC address Y receives the data packet and sends an acknowledgment packet to MAC address X. After receiving the packet, the switch records the network segment where the MAC address Y is located.
  • The switch forwards the confirmation packet to MAC address X. This is called forwarding.
  • The switch receives a data packet, and after checking the table, it is found that the source address and destination address of the data packet belong to the same network segment. The switch will not process the packet. This is called filtering.
  • Each record in the MAC address-network segment query table inside the switch uses a timestamp to record the time of the last access. Records older than a certain threshold (user configurable) are purged. This is called aging.

With a full-switch LAN, only one device is connected to each port of the switch, so collisions cannot occur. Switches do not need to do filtering.

Switching technology working at different levels of OSI

Modern business switches primarily use Ethernet interfaces. Providing multi-port Layer 2 bridging is the core function of an Ethernet switch, and many switches also provide other layers of services. This kind of switch that not only provides bridging functions is also called a multilayer switch. Multilayer switches can learn topology at many levels and can also forward at one or more layers.

layer

A layer of network devices that transmit data without controlling any traffic, such as hubs . Any incoming port packets are forwarded to all ports except the incoming port. Specifically, each bit or symbol is transmitted intact. Since each packet is distributed to all ports, its collisions can affect the entire network, thereby limiting its overall capabilities. By the early 2000s, the price difference between hubs and low-end switches was minimal. [1] For certain applications, hubs can still be useful for a while, such as providing a packet analyzer with a copy of network traffic. The port mirroring of the network splitter and the switch can also achieve the same function.

second floor

Item: bridge

Layer 2 switches transmit network frames at the data link layer (Layer 2) based on hardware addresses (MAC addresses). Layer 2 switches are "transparent" to routers and hosts, and mainly comply with the 802.1d standard. This standard stipulates that the switch obtains the source MAC address by observing the data frame of each port, and the switch establishes a mapping table between the MAC address and the port in the internal high-speed cache. When the destination address of the data frame accepted by the switch is found in the mapping table, the switch sends the data frame to the corresponding port. If it can't find it, it will broadcast the data frame to all ports of the virtual local area network (VLAN) to which the port belongs. If there is a response data packet, the switch will add a new corresponding relationship in the mapping table. When the switch joins the network for the first time, since the mapping table is empty, all data frames will be sent to all ports in the virtual LAN until the switch "learns" each MAC address. From this point of view, the switch is similar to the traditional shared hub when it is just started, and its performance cannot be really exerted until the mapping table is established. This method changes the way of shared Ethernet traffic rushing. It is like laying overpasses in different driving directions. Vehicles going in different directions can pass at the same time, thus greatly improving the traffic. From a VLAN perspective, performance is improved because only nodes inside the subnet compete for bandwidth. Host 1 accesses Host 2 At the same time, Host 3 can access Host 4. This advantage is even more obvious when each department has its own independent server. But this environment is undergoing tremendous changes, because servers tend to be managed centrally, and this model is not suitable for Internet applications. The communication between different VLANs needs to be completed through routers. In addition, in order to realize the communication between different network segments, routers are also required for interconnection.

three floors

The layer-3 switch can handle the layer-3 network layer protocol and is used to connect different network segments, and establish a direct connection between two network segments by querying and learning the default gateway .

A Layer 3 switch can realize all or part of the functions of a router, but it can only be used for the interconnection between the same type of LAN subnets. In this way, a Layer 3 switch can identify data packets by MAC address like a Layer 2 switch, and can also perform weak routing and forwarding between two LAN subnets like a traditional router. Its routing and forwarding is not maintained by software. Routing table, but through a dedicated ASIC chip to handle these forwarding;

four floors

The four-layer switch can handle the fourth-layer transport layer protocol , and can bind the session with a specific IP address to realize virtual IP [2] ;

seven floors

Smarter switches can make full use of bandwidth resources to filter, identify and process switching devices for application layer data conversion.

Classification

bandwidth

Network switch bandwidth is divided into: 10Mb/s, 100Mb/s, 1Gb/s , 10Gb/s , 40Gb/s, 100Gb/s .

Convert Mbps to MB/s: 1Mbps=0.125MB/s.

references

  1. Matthew Glidden. . About This Particular Macintosh blog. October 2001 [June 9, 2011]. (Original content archived on 2019-01-06).
  2. . Pacific Internet. 2004-06-08 [2014-11-18]. ( Original content archived on 2014-02-28).

see

Guess you like

Origin blog.csdn.net/weixin_40191861/article/details/131332963