Cisco network engineer Note: Basic switch concept

Source: Internet
Author: User

Basic switch: basic functions of LAN switches

1. Basic vswitch concepts

A lan switch is a network device that works on the data link layer.

The switch filters and forwards data frames based on the MAC address in the port data frame. It is a network connection device that completes data Frame Forwarding Based on MAC address recognition.

As the aggregation center, a vswitch connects multiple data terminal devices to form a star-shaped network. A switch is used to build a LAN.

2. LAN switch Functions

LAN switches have three basic functions:

① Create and maintain an exchange table indicating the relationship between the MAC address and the switch port;

② Establish a virtual connection between the sending and receiving nodes; virtual connection between the source port and the destination port)

③ Complete data frame forwarding or filtering.

The vswitch establishes a virtual connection between the source port and the destination port to complete data frame exchange on this dedicated virtual channel. The vswitch also provides other functions such as frame Filtering, data frame transmission control, and virtual network.

Vswitch basics: How LAN switches work

A self-learning method is used to automatically create and maintain an address query table that records the ing between the destination MAC address and the device port.

The specific operation of Frame Forwarding is that after querying the exchange table saved in the switch cache, the switch determines whether to forward or where based on the destination port number given in the table. If the destination address and Source Address of the data frame are on the same port of the switch, that is, the source port and destination port are the same. Based on some security control, the data frame is denied and the switch directly discards the data frame. Otherwise, the frame will be forwarded by the destination port number specified in the exchange table entry that matches the destination MAC address. Before forwarding data frames, create a virtual connection between the source port and the destination port to form a dedicated transmission channel. Use this channel to forward frames from the source port to the destination port to complete Frame Forwarding.

Reasons for dropping frames:

① The Destination Address and Source Address of the data frame are in the same port of the switch, that is, the source port and destination port are the same;

② Some security control.

Vswitch basics: Build and maintain the switch table content

Creating and maintaining a switch table is an important task of the switch.

1. exchange table content

The exchange table contains the destination MAC address, the corresponding vswitch module number, and the virtual subnet. The virtual subnet is represented by the VLANID.

Example 1. Switch table of large core switches:

VLANDestMAC/RouteDes [COS] DestinationPortsorVCs/[protocolType]

11800-e0-4c-73-51-4e3/6 [ALL]

Example 1. Small access switch exchange table:

DestinationaddressAddressTypeVLANDestinationPorts

0004.234e.0ddcDynamic148FastEthernet0/2

Example 1: a user with a MAC address of 00-e0-4c-73-51-4e is connected to port 3rd of module 6th of the vswitch. This user is divided into virtual subnets with VLANID 118.

FastEthernet0/6 contains two parts: one is the port type and the other is the port number. In Port 0/2, 0 is the module number, and 2 is the port number.

FastEthernet indicates Fast Ethernet; FE)

Ethernet indicates Ethernet; E)

GigabitEthernet indicates Gigabit Ethernet. GE)

2. Create an exchange table

When the switch is started, the switch table is blank.

When each frame comes in, it analyzes the MAC Destination Address in the frame and queries the exchange table.

① If it already exists in the exchange table, it will be forwarded according to the given path.

② If This item does not exist in the exchange table, a broadcast frame is sent to all switch ports except the source port. After receiving a broadcast frame, the site that owns the MAC address immediately responds, so that the switch can obtain information about the vswitch port associated with the target MAC address. Then, the vswitch creates a new table item for record.

3. Maintenance of the exchange table

The exchange table is saved in a high-speed cache of the switch. The high-speed cache space is limited, and the table items in the high-speed cache also have a time limit timestamp ).

4. Save the exchange table

The exchange table is saved in the Editable content storage CAM. CAM is a high-speed cache for storing exchange tables. You can use a switch command to display the contents of the switch table stored in CAM on the screen.

(Large and medium-sized switches) showcamdynamic

(Small switch) showmac-address-table;

Vswitch basics: switch structure

Vswitches have four types of exchange structures, including the software execution switching structure, matrix switching structure, bus switching structure, and shared storage structure.

1. software execution switch structure

The software execution switching structure is a data frame switching structure that is completed by specific software in the CPU and RAM hardware environment.

Features: The switches with flexible structure, slow switching speed, difficult switch stacking, and many switch ports cause the performance of switches to decline. Therefore, the software execution switching structure is mainly used in early switch products.

2. matrix switching structure

In a matrix switch, the switching function is completely completed by hardware.

After determining the destination port number, the switch will enable the switch matrix based on the source port number and destination port number to establish a connection between the source port and destination port to form a transmission channel.

Features: It features fast switching speed, low latency, compact structure, relatively simple matrix switching implementation, not easy to expand, and is not conducive to switch performance monitoring and operation management. Some switch products currently adopt this structure.

3. Bus Switching Structure

There is a public bus on the vswitch backplane of the bus switching structure, and data frame switching is completed on the bus. The time division multiplexing (TDM) technology is used to divide the bus into multiple logical channels by time slot, and multiple-to-port connections can be established on the bus at the same time.

Features: High Performance, easy stack expansion, easy frame broadcast, easy monitoring and management, easy to implement frame transfer for one output for multiple inputs, but high bandwidth requirements.

Generally, the bus bandwidth should be the sum of the port bandwidth. If the port bandwidth is the same, the bus bandwidth should be equal to the port bandwidth multiplied by the number of ports. That is, S = B × N. S indicates the bus bandwidth, B indicates the port bandwidth, and N indicates the number of ports.

Many vswitch products use a bus exchange structure.

4 shared memory switching structure

The shared memory switching structure is a type of deformation of the bus switching structure. It replaces the public bus with the shared memory. It does not need a backplane.

Features: vswitches are easy to implement, but delay occurs when the number of vswitch ports and storage capacity are extended to a certain extent. Therefore, it is suitable for small switches. High cost.

Basic vswitch: Switch Mode

1. Switch switch mode Classification

The vswitch supports static and dynamic switching.

In a vswitch using static switching mode, the establishment of transmission channels between ports is manually preset, and these channels are fixed.

In a vswitch with dynamic switching mode, the transmission channel is created based on the destination MAC address query exchange table, and the output port provided in the table is created temporarily. After a data frame is transferred, the connection is automatically disconnected.

The dynamic switching mode includes two modes: storage forwarding and pass-through.

The direct-through switching mode supports fast forwarding and shard discard switching.

To sum up, vswitches have three switching modes: storage forwarding, fast forwarding, and fragment discarding.

2. Fast Forwarding and switching mode FastForward)

The fast forwarding and switching mode is also called the pass-through mode. It is used to forward data frames immediately after the switch receives the 6-byte Destination Address in the frame.

The whole data frame is not cached in the fast forwarding and switching mode. This switching mode starts forwarding the entire data frame before it is received. It cannot provide error checking and error correction, which has poor reliability, but has low latency and fast switching speed. Suitable for small switches.

3. FragmentFree)

The fragment discard mode is also called the non-segmentation switch mode. This switching mode filters out conflicting fragments that cause most datagram errors before forwarding data frames.

First, check whether the packet length is 64 bytes. If the packet length is smaller than 64 bytes, It is discarded directly. Any data frame larger than 64 bytes is regarded as a valid frame by the switch for forwarding.

The data frame only receives 64 bytes and starts forwarding without saving the entire data frame.

The biggest advantage of the fragment discard switching mode: filter out the conflicting fragment before forwarding the data frame to ensure that the conflicting fragment does not pass through the network, thus improving the network transmission efficiency and bandwidth utilization.

4 Storage forwarding and switching mode StoreandForward)

A switch that uses the storage and forwarding mode receives the entire data frame before it starts forwarding data frames, and stores the entire data frame in the buffer zone.

There is an error check function, but the delay is large.

It is currently the most widely used.

The basic knowledge of vswitches is introduced to you so much that we hope that new engineers can read it carefully, because they still cannot ignore this knowledge if they want to develop on the network.

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.