Switch principle,

Source: Internet
Author: User

Switch principle,

Switch principle, the concept of switching in networks and telecommunications.

Frames on the Ethernet include the source MAC address and destination MAC address. The switch receives frames from the source device and quickly sends them to the destination address. The basic concept of exchange refers to the devices that make decisions based on the following two criteria:

? Enter the (ingress) Port

? Destination Address

The term ingress is used to describe the frame entering the device through a specific port, and egress is used to describe the device to exit the device through a specific port. When a vswitch makes a forwarding decision, it is based on the inbound port and the destination address of the message.

The LAN switch maintains a table through which data streams are forwarded. The only smart part of a LAN switch is to use this table to forward messages based on the incoming port and destination address. A lan switch has only one master switch table that defines the address and port. Therefore, messages of the same destination address always exit from the same egress regardless of the port.

Dynamic Update of MAC Address Table

To know which port is used to transmit frames, A vswitch must first learn the devices on each port. As the switch learns the relationship between the port and the device, it establishes a MAC address table or Content Addressable Storage table (CAM ). CAM is a type of memory that is used to quickly search applications. The switch records the MAC address of the device connected to the port to the MAC table, and then sends the frame to the output port device using the information in the table. The port has been specified for this device.

Remember that the switch operation mode is simple: the switch learns "Source Address" and forwards data based on "Destination Address. When a frame enters the switch, the switch "learns" the source MAC address of the received frame, adds the address to the MAC address table, or refreshes the aging register of the existing MAC Address Table item; if subsequent packets go to the MAC address, they can be forwarded according to this table. During Frame Forwarding, the switch checks the destination MAC address and compares it with the address in the MAC address table. If the address is in the table, it is forwarded to the port corresponding to the MAC address in the table. If the target MAC address is not found in the table, the switch forwards the IP address to all ports except the inbound ports ). In a network with multiple interconnected switches, the MAC address table records multiple MAC addresses for a port connected to another switch.

The following steps describe how to update the MAC address table:

1. The switch receives frames from PC 1 at port 1.

2. Check the source MAC address and compare it with the MAC address table.

? If the address is not in the table, the switch associates the source MAC address of PC 1 with the entry port 1 in the MAC address table ).

? If the MAC address table of the source address already exists, the switch resets the aging timer. A table item is usually maintained for 5 minutes.

3. Check the destination address after the switch records the source address information.

? If the destination MAC address is not included in the table or if it is a broadcast MAC address, the switch routes the frame to all ports except the inbound port.

4. the target device (PC 3) returns the unicast frame whose destination address is PC 1.

5. In the vswitch address table, enter the source MAC address and port number of PC 3. Find the destination address of the frame and the associated output port in the table.

6. The switch can now transmit frames between the source and target devices without flooding, because there are already table items for the specified associated port in the address table.

Switch forwarding method:

Store-and-Forward)

Before sending information, a switch running in the storage and forwarding mode should read the whole frame of data into the memory and check its correctness. Although this method takes more time than the pass-through method, it can store and forward data to ensure its accuracy. Because the switch running in the storage and forwarding mode does not transmit error data, it is more suitable for large-scale LAN. The storage and forwarding modes have two main features different from the direct forwarding mode:

Error Control:

Use the storage and forwarding technology switch to control incoming frames. After receiving a complete frame from the incoming port, the switch compares the frame check sequence (FCS) of the last field of the datagram with its own FCS. The FCS verification process is used to ensure that the frame has no physical or Data Link errors. If the frame verification is correct, the switch forwards the verification. Otherwise, discard.

Automatic cache:

The storage and forwarding switch enters the port cache to support mixed Ethernet connections at different rates. For example, to receive a frame at 1 Gbit/s rate and forward it to a Mbit/s Ethernet port, you need to use the storage forwarding method. When the inbound traffic does not match the output port rate, the switch places the whole frame content in the cache, computes the FCS verification, forwards the content to the output cache, and sends the frame.

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.