CPU - The Core of a Switch
Huawei switch uses the distributed architecture, including forwarding and control planes. The forwarding plane implements Layer 2 and Layer 3 forwarding; the control plane implements forwarding control.
As shown in Figure 15-1, the control plane uses the universal embedded CPU and the forwarding plane uses forwarding chip:
- The forwarding chip implements Layer 2 and Layer 3 forwarding, for example, updating the MAC address table for Layer 2 forwarding and Layer 3 forwarding table for IP forwarding. The forwarding chip implements data forwarding with a high throughput.
- The CPU maintains software entries, such as routing and ARP entries, and configures the hardware Layer 3 forwarding table in chip based on the software forwarding entries. The CPU can also provide software-based Layer 3 forwarding. However, a disadvantage of CPU is that it has a low processing capability.
Packets on a network can be classified into control packets and data packets depending on their functions. If a switch does not have any hardware forwarding entry, the first packet reaching the switch is forwarded by the CPU and a Layer 3 forwarding hardware entry is created. The follow-up packets enter the forwarding chip through the inbound interface. Figure 15-2 shows this process.
- Flow 1 (data packets) is sent out by the forwarding chip, and does not pass the CPU. The flow processing does not consume CPU resources.
- Flow 2 (control packets and a part of data packets) is forwarded to the CPU through the forwarding chip. The CPU determines whether to send the flow out or terminate it. Flow 2 consumes CPU resources, and cannot be forwarded in a high speed.
The Layer 2 and Layer 3 hardware entries in the forwarding chip determine whether a switch can implement high-speed forwarding; however, the hardware entries in the forwarding chip are created based on the software entries maintained in the CPU. Therefore, the CPU is the core of a switch.
CPU Usage
After a switch like Huawei S6730 switch starts, the CPU runs more than 200 active tasks to manage the switch and monitor Layer 3 entry learning. The number of tasks may vary according to switch models. In addition, when more features are configured on a switch, more tasks run in the system
CPU usage is the percentage of the amount of time a CPU spends processing non-idle tasks. It has the following characteristics:
- Constantly changing: A switch's CPU usage keeps changing with system operations and changes of the environment.
- Non-real-time: CPU usage data reflects CPU usage within a statistical period.
- Entity-relevant: CPU usage is calculated based on physical CPU. Generally, each service card on a switch has an independent physical CPU. Therefore, the CPU usages of different cards are calculated separately.
A CPU usage reflects task running status at a specified time point. In Figure 15-3, task A occupies CPU resource for 10 ms, task B occupies CPU resource for 30 ms, and they stop for 60 ms. Then, task A occupies CPU resource for 10 ms, task B occupies CPU resource for 30 ms, and they stop for 60 ms. In this period, the CPU usage is 40%. A high CPU usage indicates that the switch is running many tasks.
It can be found that the CPU usage is directly related to CPU performance. Therefore, the CPU usage is a key indicator of switch performance.
No comments:
Post a Comment