How routers and switches work (1)

Source: Internet
Author: User

A computer network is often composed of many different types of network connections. If several computer networks are physically connected together and cannot communicate with each other, then this "interconnection" is meaningless. Therefore, when talking about "interconnection", it is suggested that these computers can communicate with each other. That is to say, in terms of functions and logic, these computer networks have formed a large computer network, or an interconnected network, or Internet.

Some intermediate devices (or intermediate systems) are used to connect networks. ISO is called relay Systems. Based on the level of the relay system, there can be the following five relay systems:

1. Physical Layer (that is, the first layer and layer L1) repeater system ).

2. data link layer (Layer 2, layer L2), that is, bridge or bridge ).

3. The network layer (Layer 3, layer L3) relay system, that is, the router ).

4. A mixture of bridges and routers. brouter has the functions of bridges and routers.

5. A relay system above the network layer, that is, a gateway ).

When the relay system is a forwarder, it is generally not called network interconnection, because it only expands a network, and it is still a network. High-level gateways are rarely used due to their complexity. Therefore, network interconnection generally refers to the network in which vswitches and vrouters are interconnected. This article describes the differences between vswitches and vrouters.

2. vswitches and vrouters

"Exchange" is the most frequently used word on the network today. It can be applied on any occasions from the bridge to the ATM to the telephone system. It is hard to figure out what is the real exchange. In fact, the word exchange first appeared in the telephone system, specifically to achieve the exchange of voice signals between two different telephones, the device to complete this work is the telephone switch. Therefore, in terms of intention, exchange is only a technical concept, that is, to complete the forwarding of signals from the device entry to the exit. Therefore, any device that complies with this definition can be called an exchange device. It can be seen that "Exchange" is a widely used term. When it is used to describe the second layer of the data network, it actually refers to a bridge device; when it is used to describe the third-layer device of the data network, it also refers to a routing device.

We often mention that an Ethernet switch is actually a multi-port L2 network device based on the bridge technology, it provides low-latency and Low-overhead channels for data frame forwarding from one port to another.

It can be seen that the core of the switch should have an exchange matrix to provide a channel for communication between any two ports, or a fast exchange bus, to send data frames received by any port from other ports. In actual devices, the function of the switching matrix is usually completed by a dedicated chip (ASIC. In addition, there is an important assumption in the design philosophy of the Ethernet switch, that is, the speed of the switching core is very fast, so that the normal large-volume data will not cause congestion. In other words, the exchange capability is infinite relative to the amount of information transmitted (on the contrary, the design idea of the ATM switch is that the exchange capability is limited to the amount of information transmitted ).

Although the second layer Ethernet switch is developed based on a multi-port bridge, after all, the switch has more features, making it the best way to get more bandwidth, it also makes the network easier to manage.

A router is a group exchange device (or network layer Relay Device) in the network layer of the OSI protocol model. The basic function of a router is to transmit data (IP packets) to the correct network, including:

1. IP datagram forwarding, including path finding and transmission of the datagram;

2. subnet isolation to prevent broadcast storms;

3. Maintain the route table and exchange route information with other routers. This is the basis for IP packet forwarding.

4. IP datagram error handling and simple congestion control;

5. Filtering and accounting of IP datagram.

Vro--- Routing refers to the activity of moving information from the source location to the target location through a interconnected network. Generally, information passes through at least one or more intermediate nodes during routing. In general, people will compare routing and switching, mainly because the functions of the two are the same in the eyes of common users. In fact, the main difference between routing and switching is that switching occurs at the Layer 2 (data link layer) of the OSI reference model, while routing occurs at the Layer 3 (Network Layer. This difference determines that different control information needs to be used in the process of routing and exchange of mobile information. Therefore, the two methods to implement their respective functions are different.

Vswitch--- Switching refers to the technology collectively used to send the information to the corresponding route that meets the requirements according to the information transmission needs at both ends of the communication. A switch in the broad sense is a device that implements information exchange in a communication system.

In computer network systems, the concept of exchange is an improvement of the shared working mode. The HUB we have previously introduced is A shared device. The HUB itself cannot identify the destination address. When A host in the same LAN transmits data to host B, data packets are transmitted in a HUB-based network in broadcast mode. Each terminal verifies the address information of the data packet header to determine whether to receive the data packets. That is to say, in this way, only a group of data frames can be transmitted over the network at the same time. If a collision occurs, retry. This method is shared network bandwidth.

The vswitch has a high-bandwidth back bus and an internal switching matrix. All the ports of the vswitch are attached to the back bus. After the control circuit receives the data packet, the processing port searches for the address table in the memory to determine the target MAC address (the hardware address of the NIC) NIC is mounted to which port, and data packets are quickly transmitted to the destination port through the internal switching matrix. If the destination MAC does not exist, the packets are broadcast to all ports, after receiving the port response, the switch "learns" the new address and adds it to the internal MAC address table.

You can also use a vswitch to segment the network. By comparing the MAC address table, the vswitch only allows necessary network traffic to pass through the vswitch. Through the filtering and forwarding of vswitches, the broadcast storm can be effectively isolated to reduce the occurrence of incorrect packets and wrong packets, so as to avoid sharing conflicts.

A vswitch can transmit data between multiple port pairs at the same time. Each port can be considered as an independent network segment, and the network devices connected to it enjoy all the bandwidth alone, so they do not need to compete with other devices. When node A sends data to node D, Node B can send data to node C at the same time, and both transmission enjoy all the bandwidth of the network and all have their own virtual connections. If a 10 Mbps Ethernet switch is used here, the total traffic of the switch is 2*10 Mbps = 20 Mbps. When a 10 Mbps shared HUB is used, the total traffic of a HUB does not exceed 10 Mbps.

In short, a vswitch is a network device that can encapsulate and forward data packets based on MAC address recognition. The switch can "Learn" the MAC address and store it in the internal address table. By creating a temporary exchange path between the initiator of the data frame and the Target receiver, the data frame can reach the destination address directly from the source address.

Describes the basic working principles of L2 switches, L3 switches, and routers and the main differences between them.

1. layer-2 Exchange Technology

A layer-2 switch is a device at the data link layer. It can read the MAC address information in the data packet and exchange it based on the MAC address.

There is an address table inside the vswitch, which indicates the relationship between the MAC address and the vswitch port. When a vswitch receives a packet from a port, it first reads the source MAC address from the packet header so that it knows the port on which the machine with the source MAC address is connected, it then reads the destination MAC address in the packet header and finds the corresponding port in the address table. If there is a port corresponding to the destination MAC address in the table, the packet is copied directly to the port, 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 learn which port the target MAC address corresponds, the next time you transmit data, you no longer need to broadcast all ports.

The second-layer switch creates and maintains its own address table. Because L2 switches generally have a wide switching bus bandwidth, they can exchange data for many ports at the same time. If a L2 Switch has N ports, and the bandwidth of each port is M, and the bus bandwidth of the switch exceeds N × M, the switch can achieve line rate switching. The L2 Switch does not limit the broadcast packets. It copies the broadcast packets to all ports.

Layer-2 switches generally contain Application specific Integrated Circuit chips used to process data packet forwarding, so the forwarding speed can be very fast.


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.