Configuring data buffers
Data buffers temporarily store packets to avoid packet loss.
A device has an ingress buffer and an egress buffer. Figure 28 shows the structure of ingress and egress buffers. An interface stores outgoing packets in the egress buffer when congestion occurs, and stores incoming packets in the ingress buffer when the CPU is busy.
Figure 28: Data buffer structure
A buffer uses the following types of resources:
Cell resources—Store packets. The buffer uses cell resources based on packet sizes. Suppose a cell resource provides 208 bytes. The buffer allocates one cell resource to a 128-byte packet and two cell resources to a 300-byte packet.
Packet resources—Store packet pointers. A packet pointer indicates where the packet is located in cell resources. The buffer uses one packet resource for each incoming or outgoing packet.
Each type of resources has a fixed area and a shared area.
Fixed area—Partitioned into queues, each of which is equally divided by all the interfaces on the switch, as shown in Figure 29. When congestion occurs, the following rules apply:
An interface first uses the relevant queues of the fixed area to store packets.
When a queue is full, the interface uses the corresponding queue of the shared area.
When the queue in the shared area is also full, the interface discards subsequent packets.
The system allocates the fixed area among queues as specified by the user. Even if a queue is not full, other queues cannot preempt its space. Similarly, the share of a queue for an interface cannot be preempted by other interfaces even if it is not full.
Shared area—Partitioned into queues, each of which is not equally divided by the interfaces, as shown in Figure 29. The system determines the actual shared-area space for each queue according to user configuration and the number of packets actually received and sent. If a queue is not full, other queues can preempt its space.
The system puts packets received on all interfaces into a queue in the order they arrive. When the queue is full, subsequent packets are dropped.
Figure 29: Fixed area and shared area