Traffic Control and Shaping Configuration Case

Case Configuration Topology:
Here Insert Picture Description
2 configuration requirements Case
1, the configuration according to the IP topology,
2, between five routers running OSPF protocol, and released directly connected segment loopback interface;
3, in R3, destined 1.1.1.1 4.4. 4.4 data flow control is done, as the setting CIR 8000, bE 1000 and BC;
4, in R3, 2.2.2.2 5.5.5.5 data destined to do traffic shaping, setting CIR to 8000, bE 1000 and BC;

Case Configuration Roadmap
1. According topology configuration IP address

R1:
interface Loopback0
 ip address 1.1.1.1 255.255.255.0
 ip ospf network point-to-point
 interface Serial1/1
 ip address 13.1.1.1 255.255.255.0
 serial restart-delay 0

R2:
interface Loopback0
 ip address 2.2.2.2 255.255.255.0
 ip ospf network point-to-point
 interface Serial1/2
 ip address 23.1.1.1 255.255.255.0
 
R3:
interface Loopback0
 ip address 3.3.3.3 255.255.255.0
 interface Serial1/1
 ip address 13.1.1.2 255.255.255.0       
interface Serial1/2
 ip address 23.1.1.2 255.255.255.0
interface Serial1/4
 ip address 34.1.1.2 255.255.255.0
interface Serial1/5
 ip address 35.1.1.2 255.255.255.0
 
R4:
interface Loopback0
 ip address 4.4.4.4 255.255.255.0
 ip ospf network point-to-point
 interface Serial1/4
 ip address 34.1.1.1 255.255.255.0

R5:
interface Loopback0
 ip address 5.5.5.5 255.255.255.0
 ip ospf network point-to-point
 interface Serial1/5
 ip address 35.1.1.1 255.255.255.0
 

2. Configure OSPF

R1:
router ospf 100
 router-id 91.1.1.1
 log-adjacency-changes
 network 1.1.1.0 0.0.0.255 area 0
 network 13.1.1.0 0.0.0.255 area 0

R2:
router ospf 100
 router-id 92.2.2.2
 log-adjacency-changes
 network 2.2.2.0 0.0.0.255 area 0
 network 23.1.1.0 0.0.0.255 area 0

R3:
router ospf 100
 router-id 93.3.3.3
 log-adjacency-changes
 network 13.1.1.0 0.0.0.255 area 0
 network 23.1.1.0 0.0.0.255 area 0
 network 34.1.1.0 0.0.0.255 area 0
 network 35.1.1.0 0.0.0.255 area 0

R4:
router ospf 100
 router-id 94.4.4.4
 log-adjacency-changes
 network 4.4.4.0 0.0.0.255 area 0
 network 34.1.1.0 0.0.0.255 area 0

R5:
router ospf 100
 router-id 95.5.5.5
 log-adjacency-changes
 network 5.5.5.0 0.0.0.255 area 0
 network 35.1.1.0 0.0.0.255 area 0
 

3. Configure traffic control in R3

access-list 100 permit ip host 1.1.1.1 host 4.4.4.4	
class-map match-all 1-4					/创建类图/
 match access-group 100
policy-map 1-4							/创建策略图/
 class 1-4									/调用类图/
  police cir 8000 bc 1000 be 1000 conform-action transmit exceed-action drop			/流量管制,速率为8000 bit,BC为1000,Be为1000,正常流量传输,超出流量丢弃/

4. configure traffic shaping R3

access-list 101 permit ip host 2.2.2.2 host 5.5.5.5	
class-map match-all 2-5
 match access-group 101								
policy-map 2-5
 class 2-5
  shape average 8000 1000 1000
/做流量整形,承诺速率为8000bit,BC为1000,Be为1000,超出的流量缓存/

Case configuration
1, the configuration is complete, 1.1.1.1 to ping 4.4.4.4, packet size byte are 1000, 500byte, 300byte:
Here Insert Picture Description2, the configuration is complete, with the R2 2.2.2.2ping 5.5.5.5, packet size byte to 1000:
Here Insert Picture Description3, the configuration is complete, view the policy set in shaping the R3:

R3#show policy-map interface serial 1/2
 Serial1/2 

  Service-policy output: 2-5

    Class-map: 2-5 (match-all)
      0 packets, 0 bytes
      5 minute offered rate 0 bps, drop rate 0 bps
      Match: access-group 101
      Queueing
      queue limit 64 packets
      (queue depth/total drops/no-buffer drops) 0/0/0
      (pkts output/bytes output) 0/0
      shape (average) cir 8000, bc 1000, be 1000
      target shape rate 8000

    Class-map: class-default (match-any)
      56 packets, 13588 bytes
      5 minute offered rate 0 bps, drop rate 0 bps
      Match: any 
      
      queue limit 64 packets
      (queue depth/total drops/no-buffer drops) 0/0/0
      (pkts output/bytes output) 56/13648

4. After the configuration, with the R2 2.2.2.2ping 5.5.5.5, the packet size of 2001 byte:
Here Insert Picture DescriptionSummary and other
1, traffic control and traffic shaping token bucket calculations whether the traffic congestion;
2, the token bucket parameter has committed information rate CIR, adding the number of tokens the BC, the second bucket rate the BE;
. 3, control will flow beyond the token bucket discards;
4, will exceed the traffic shaping token bucket cached, knows the available bandwidth when enough to continue transmission;
5, shaping buffer space is limited, when the packet size exceeds the limit, the data may be discarded;

Published 231 original articles · won praise 222 · views 20000 +

Guess you like

Origin blog.csdn.net/qinshangwy/article/details/105041794