Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
receiving keepalive packets or IGP updates. This may result in IGP adjacency flapping or layer 2
link loss reports. The third reason is due to issues with process switching. If for some reason CEF
is disabled, the IP INPUT process can result in regular IP traffic blocking the input queues, causing
a loss of the control plane. SPD prevents this through input drops. So how does SPD work? First,
the input queue consists of two parts. One part is the regular hold queue, which is visible through
the show interface command, and the other part is the priority queue, which stores routing updates
and keepalives. The processor serves the priority queue first until it is empty, and then switches to
the regular hold-queue. Additionally, the priority queue consists of two parts, the SPD Headroom
and the SPD Extended Headroom. The Extended Headroom queue is emptied before the SPD
Headroom in a priority manner. Specifically, input packets are queued as follows:
Layer 2 keepalives and IGP packets go to the SPD Extended Headroom. If there is no space
available in the SPD Extended Headroom, packets go to the SPD Headroom. As a last resort, if
both the Extended Headroom and Headroom are full, these packets go to the regular Hold Queue.
BGP updates go directly to SPD Headroom. If the SPD Headroom is full, BGP packets hit the Hold
Queue. All other IP packets (malformed or process-switched) go to the Hold Queue. The result is
that L2 keepalive/IGP packets are serviced first, BGP next, and other packets last.
Although the Hold Queue is FIFO, it uses the RED drop procedure. Two thresholds (Minimum and
Maximum) set for hold queue define the random drop behavior. If the current hold queue length is
less than the Minimum Threshold, packets are never dropped. If the queue length grows beyond
Minimum, but is less than Maximum, every new packet is randomly dropped with the probability
proportional to queue depth:
Prob = (QueueDepth MinimumThresh)/(MaximumThresh-MinimumThresh)
If the queue depth is above Maximum Threshold, SPD drops every new incoming packet.
Note the important fact that SPD thresholds are global for all queues. SPD computes Min and Max
thresholds based on the lowest hold-queue size in the system. Therefore, if you set the hold queue
size lower on some interfaces, you will affect all other interface drop thresholds.
Finally, SPD has two modes of operation: normal and aggressive. They differ in their treatment of
malformed packets (packets that require the router to generate ICMP responses). When SPD is set
for normal mode (the default), it treats malformed packets as it would all regular IP packets; it
places them in the hold queue, subject to random drop. However, in aggressive mode, the
malformed packets are dropped as soon as the hold queue grows above the minimum threshold.
Effectively, SPD Aggressive mode replaces the random drop for malformed packets with an
unconditional drop. SPD configuration can be configured and verified as follows.
R1:
R1#
R1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#spd extended-headroom 150
R1(config)#spd headroom 120
R1(config)#ip spd mode aggressive
R1(config)#ip spd queue threshold minimum 75 maximum 150
R1(config)#int g0/0
R1(config-if)# hold-queue 150 in
R1(config-if)#
To verify, we can check the input queue size and the SPD settings using the following two show
commands.
R1#show interface GigabitEthernet 0/0
GigabitEthernet0/0 is up, line protocol is up
Hardware is CN Gigabit Ethernet, address is 0007.7d3d.94e8 (bia 0007.7d3d.94e8)
Internet address is 136.1.13.1/24
MTU 1500 bytes, BW 100000 Kbit/sec, DLY 100 usec,
reliability 255/255, txload 1/255, rxload 248/255
Encapsulation ARPA, loopback not set
Keepalive set (10 sec)
Full Duplex, 100Mbps, media type is RJ45
output flow-control is unsupported, input flow-control is unsupported
ARP type: ARPA, ARP Timeout 04:00:00
Last input 00:00:00, output 00:00:01, output hang never
Last clearing of "show interface" counters never
Input queue: 57/150/76/34987 (size/max/drops/flushes); Total output drops: 0
Queueing strategy: fifo
<output omitted>
R1#show ip spd
Current mode: normal.
Queue min/max thresholds: 75/150, Headroom: 120, Extended Headroom: 150
IP normal queue: 28, priority queue: 0.
SPD special drop mode: aggressively drop bad packets
R1#