No relevant resource is found in the selected language.

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Read our privacy policy>Search

Reminder

To have a better experience, please upgrade your IE browser.

upgrade

CX11x, CX31x, CX710 (Earlier Than V6.03), and CX91x Series Switch Modules V100R001C10 Configuration Guide 12

The documents describe the configuration of various services supported by the CX11x&CX31x&CX91x series switch modules The description covers configuration examples and function configurations.
Rate and give feedback:
Huawei uses machine translation combined with human proofreading to translate this document to different languages in order to help you better understand the content of this document. Note: Even the most advanced machine translation cannot match the quality of professional translators. Huawei shall not bear any responsibility for translation accuracy and it is recommended that you refer to the English document (a link for which has been provided).
Switching on Ethernet

Switching on Ethernet

This section describes Ethernet switching.

Layer 2 Switching

A Layer 2 device works at the second layer of the OSI model and forwards data packets based on media access control (MAC) addresses. Ports on a Layer 2 device send and receive data independently and belong to different collision domains. Collision domains are isolated at the physical layer so that collisions will not occur between hosts (or networks) connected through this Layer 2 device due to uneven traffic rates on these hosts (or networks).

A Layer 2 device parses and learns source MAC addresses of Ethernet frames and maintains a mapping table of MAC addresses and ports. This table is called a MAC address table. When receiving an Ethernet frame, the device searches for the destination MAC address of the frame in the MAC table to determine through which port to forward this frame.

  1. When the Layer 2 device receives an Ethernet frame, it records the source MAC address and the inbound port of the frame in the MAC address table to guide Layer 2 forwarding. If the same MAC address entry exists in the MAC address table, the device resets the aging time of the entry. An aging mechanism is used to maintain entries in the MAC address table. Entries that are not updated within the aging time are deleted from the MAC address table.
  2. The device looks up the MAC address table based on the destination MAC address of the Ethernet frame. If no matching entry is found, the device forwards the frame to all its ports except the port from which the frame is received. If the destination MAC address of the frame is a broadcast address, the device forwards the frame to all its ports except the port from which the frame is received. If a matching entry is found in the MAC address table, the device forwards the frame to the port specified in the entry.

According to the preceding forwarding process, a Layer 2 device maintains a MAC address table and forwards Ethernet frames based on destination MAC addresses. This forwarding mechanism fully uses network bandwidth and improves network performance. Figure 5-6 shows an example of Layer 2 switching

Figure 5-6 Layer 2 switching example

Although Layer 2 devices can isolate collision domains, they cannot isolate broadcast domains. As described in the Layer 2 forwarding process, broadcast packets and packets that do not match nay entry in the MAC address table are forwarded to all ports (except the port from which the frame is received). Packet broadcasting consumes much bandwidth on network links and brings security issues. Routers can isolate broadcast domains, but high costs and low forwarding performance of routers limit the application of routers in Layer 2 forwarding. The virtual local area network (VLAN) technology is introduced to solve this problem in Layer 2 switching.

Layer 3 Switching

Background of Layer 3 Switches

In early stage of network deployment, most local area networks (LANs) were established using Layer 2 switches, and routers completed communication between LANs. At that time, intra-LAN traffic accounted for most of network traffic and little traffic was transmitted between LANs. A few routers were enough to handle traffic transmission between LANs.

As data communication networks expand and more services emerge on the networks, increasing traffic needs to be transmitted between networks. Routers cannot adapt to this development trend because of their high costs, low forwarding performance, and small port quantities. New devices capable of high-speed Layer 3 forwarding are required. Layer 3 switches are such devices.

Routers use CPUs to complete Layer 3 forwarding, whereas Layer 3 switches use hardware to complete Layer 3 forwarding. Hardware forwarding has a much higher performance than software forwarding (CPU based forwarding). Switches cannot replace routers in all scenarios because routers provide rich interface types, good service class control, and powerful routing capabilities that Layer 3 switches cannot provide.

Layer 3 Forwarding Mechanism
Layer 3 switches divide a Layer 2 network into multiple VLANs. They implement Layer 2 switching within the VLANs and Layer 3 IP connectivity between VLANs. Two hosts on different networks communicate with each other through the following process:
  1. Before the source host starts communicating with the destination host, it compares its own IP address with the IP address of the destination host. If IP addresses of the two hosts have the same network ID (calculated by an AND operation between the IP addresses and masks), the hosts are located on the same network segment. In this case, the source host sends an Address Resolution Protocol (ARP) request to the destination host. After receiving an ARP reply from the destination host, the source host obtains the MAC address of the destination host and sends packets to this destination MAC address.
  2. If the source and destination hosts are located on different network segments, the source host sends an ARP request to obtain the MAC address mapping the gateway IP address. After receiving an ARP reply from the gateway, the source host sends packets to the MAC address of the gateway. In these packets, the source IP address is the IP address of the source host, and destination IP address is still the IP address of the destination host.

The following is the detailed Layer 3 switching process.

As shown in Figure 5-7, the source and destination hosts connect to the same Layer 3 switch but belong to different VLANs (network segments). Both the two hosts are located on the directly connected network segments of the Layer 3 switch, so the routes to the IP addresses of the hosts are direct routes.

Figure 5-7 Layer 3 forwarding
Figure 5-7 shows the MAC addresses, IP addresses, and gateway addresses of the hosts, MAC address of the Layer 3 switch, and IP addresses of Layer 3 interfaces configured in VLANs on the Layer 3 switch. The process of a ping from PC A to PC B is as follows (the Layer 3 switch has not created any MAC address entry):
  1. PC A finds that the destination IP address 2.1.1.2 (PC B) is on a different network segment than its own IP address. Therefore, PC A sends an ARP request to request for the MAC address mapping the gateway address 1.1.1.1.
  2. L3 Switch receives the ARP request from PC A and finds that 1.1.1.1 is the IP address of its own Layer 3 interface. L3 switch then sends an ARP reply to PC A. The ARP reply carries the MAC address of its Layer 3 interface (MAC Switch). In addition, L3 switch adds the mapping between the IP address and MAC address of PC A (1.1.1.2 and MAC A) to its ARP table. The IP address and MAC address of PC A are carried in the ARP request sent from PC A.
  3. After PC A receives the ARP reply from the gateway (L3 Switch), it sends an ICMP request packet. In the ICMP request packet, the destination MAC address (DMAC) is MAC Switch; the source MAC address (SMAC) is MAC A; the source IP address (SIP) is 1.1.1.2; the destination IP address (DIP) is 2.1.1.2.
  4. When L3 Switch receives the ICMP request packet, it updates the matching MAC address entry according to the source MAC address and VLAN ID of the packet. Then L3 Switch looks up the MAC address table according to the destination MAC address and VLAN ID of the packet and finds the entry with the MAC address of its Layer 3 interface, the packet needs to be forwarded at Layer 3. Then L3 Switch looks up Layer 3 forwarding entries of the switching chip to guide Layer 3 forwarding.
  5. The switching chip loops up Layer 3 forwarding entries according to the destination IP address of the packet. The entry lookup fails because no entry has been created. The switching chip then sends the packet to the CPU for software processing.
  6. The CPU looks up the software routing table according to the destination IP address of the packet and finds a directly connected network segment, network segment of PC B. Then the CPU looks up its ARP table, and the lookup still fails. Therefore, L3 Switch sends an ARP request to all ports in VLAN 3 (network segment of PC B), to request the MAC address mapping IP address 2.1.1.2.
  7. After PC B receives the ARP request from L3 Switch, it checks the ARP request and finds that 2.1.1.2 is its own IP address. PC B then sends an ARP reply carrying its MAC address (MAC B). Meanwhile, PC B records the mapping between the IP address and MAC address of L3 Switch (2.1.1.1 and MAC Switch) in its ARP table.
  8. When L3 Switch receives the ARP reply from PC B, it records the mapping between the IP address and MAC address of PC B (2.1.1.2 and MAC B) in its ARP table. L3 Switch changes the destination MAC address in the ICMP request packet sent from PC A to MAC B and changes the source MAC address to its own MAC address (MAC Switch), and then sends the ICMP request to PC B. The Layer 3 forwarding entry containing the IP address and MAC address of PC B, outbound VLAN ID, and outbound port is also added to the Layer 3 forwarding of the switching chip. Subsequent packets sent from PC A to PC B are directly forwarded according to this hardware entry.
  9. When PC B receives the ICMP request packet from L3 Switch, it sends an ICMP reply packet to PC A. The forwarding process for the ICMP reply packet is similar to that for the ICMP request packet except that the ICMP reply packet is directly forwarded to PC A by the switching chip according to the hardware entry. The reason is that L3 Switch has obtained the mapping between the IP address and MAC address of PC A and added matching Layer 3 forwarding entry to the L3 forwarding table of the switching chip.
  10. Subsequent packets exchanged between PC A and PC B are forwarded following the same process: MAC address table lookup, Layer 3 forwarding table lookup, and hardware forwarding by the switching chip.
In a summary, a Layer 3 switch provides high-speed Layer 3 switching through one routing process (forwarding the first packet to the CPU and creating a hardware Layer 3 forwarding entry) and multiple switching processes (hardware forwarding of subsequent packets).
Translation
Download
Updated: 2019-08-09

Document ID: EDOC1000041694

Views: 59094

Downloads: 3623

Average rating:
This Document Applies to these Products
Related Version
Related Documents
Share
Previous Next