Monday, November 7, 2011

notes: Shaping

 

- Traffic-shaping
- Only applies to outbound traffic.
- Queueing mechanisms can be used in conjunction with traffic shaping.
- Traffic shaping delay packets to ensure that a class of packets does not exceed a defined rate. While delaying the packets, the shaping function queues the packets, by default in a FIFO queue.
- Shaping is designed to buffer/delay traffic in excess of the configured target rate.
- To accomplish this, a system of credits is used.
- Before a packet can be sent the amount of credits equalling the packet's size in bits must have been earned, like wages.
- Traffic shaping does not permit the borrowing of future credits.
- When shaping is applied to an interface, the router is given a full amount of credits. After this point all credits
must be earned.

2 Types of Shaping
    - Generic Traffic Shaping (GTS)
    - Frame-Relay Traffic Shaping (FRTS)

2 Methods of applying GTS and FRTS
  - Legacy method
  - MQC

- Serialization/Access-Rate (AR): Physical clocking, this determines the amount of data that can be encapsulated on to the wire.
- Serialization delay: A constant delay based on the access rate of the interface. It is the time needed to place data on the wire. (Can’t be changed)

Shaping CIR
- Dictates the average output rate one aims to average per second on the circuit/interface.

Tc (Time Interval)
- It is the time in milliseconds into which the second is divided.
- The Tc cannot be adjusted directly, but it can be changed by adjusting the CIR and Bc.
- The get the TC value correct for the formulas below, always use TC/1000.
- The maximum value of Tc is 125ms (1/8th of a second) and the minimum value is 10ms (1/100th of a second).
- The largest amount of traffic that can be sent in a single interval is Bc + Be.
- DO NOT use the "frame-relay tc" command to configure the Tc value, it is ONLY used for FR SVC's with a CIR=0.
- Usually just defining an average CIR will be sufficient. But if low-latency throughput is required, changing the Tc might be necessary.
- Changing the Bc value, has a direct affect on the delay/time interval.

Bc (Committed Burst)
- Is the number of committed bits allowed to be sent per interval (Tc) to conform with target-rate (CIR) per second.
- If Bc worth of bits are sent every interval in that second, the output rate is the CIR.
- The Bc bucket is refilled each new Tc.
- If there are bits left in the Bc bucket that were not used in that interval, they roll over to the Be bucket.
- If the Be bucket is full, these excess credits are lost.
- The Bc determines the Tc, as a result the amount of data to send per interval:
- Bigger Bc - more delay but more data per Tc.
- Smalled Bc - less delay but less data per Tc. (Smaller Bc are generally needed for voice)

Be (Excess Burst)
- Is the number of non-committed bits the router is allowed to send above the Bc if available credits.
- If all the Bc per interval was not used, then at a later time the router can send Be worth to average out the total amount sent up to CIR.
- There is no time limit to how long BE can "store" unused BC credits. A common misconception, is that its only from the previous interval.
- Be defaults to zero bits.

Formulas (Tc/1000):
> CIR = Bc / Tc
> Tc = Bc / CIR
> Bc = CIR x Tc
> Be = (CAR - CIR) x Tc

Generic Traffic Shaping

- Is used to control the maximum output target rate on an interface.

Generic Traffic Shaping (GTS) is a simple form of traffic shaping that is supported on most router interfaces but cannot be used with flow switching. GTS is configured and applied to an interface or subinterface. In its basic configuration, it shapes all traffic leaving the interface. You can modify that with an access list permitting the traffic to be shaped and denying any traffic that should be passed through unshaped.

commands:

- Shows the configured shaping values per DLCI

sh traffic-shape

- Shows packet/byte count, packets/bytes delayed

sh traffic-shape statistics

- Command syntax to enable traffic shaping on the interface

- AR : Configures the access rate to 64k
- Bc : The rate will not exceed 8k per time interval (Tc)
- Be : Indicates excess rate if configured. (Value of 0 here)
- Buffer-Limit is configured as 1000

traffic-shape {rate | group (acl)} {access-rate (bps)} [Bc (bits) [Be (bits)]] [buffer limit]
interface s0/0
traffic-shape rate 640000 8000 0 1000

- All traffic matching ACL-100 will match this shaping rate

traffic-shape group 100 640000 8000 0

- Configures reflection of FECNs as BECNs.
- If BECN received this interface will throttle to no lower than 32k

traffic-shape fecn-adapt
traffic-shape adaptive 32000

 

FRTS (Frame-Relay Traffic Shaping)

CIR
-  Dictates the average output rate one aims to average per second on the circuit/interface.

MINCIR
- The rate to which the router will throttle down at a minimum, if a BECN was received from the frame-relay cloud.
- Defaults to half the configured CIR.

FECN (Forward Explicit Congestion Notification)
- Sent towards the destination, to indicate congestion was experienced on the way, which will get reflected back to the source as a BECN.

BECN (Backward Explicit Congestion Notification)
- Is sent back to the source sending the traffic as a indication to slow down the sending-rate, as there is congestion in the direction the traffic is sent, but in opposite direction of the BECN.


Adaptive Shaping
- Used to allow the router to throttle back in the event of congestion.
- The router will throttle back 25% per Tc when BECNs are received, and will continue to throttle 25% each Tc until BECN's are no longer received or until MINCIR is reached.

Common reasons to use FRTS:
- To force a router to conform to the rate subscribed from the frame-relay service provider, because the local serialization delay is much faster that the provisioned rate, or
- To throttle down higher speed site so that it does not overrun a lower speed site, typically used in partial mesh topologies.


Careful once FRTS is enabled on an interface:
- All DLCI's on that interface (including sub-interfaces) are assigned the default CIR value of 56000 bps.
- If DLCI's require a different output rate that 56k, the CIR should be adjusted.

- If FRTS is applied to a physical frame interface the config will apply to all VC configured on that interface.
- If FRTS is applied to the VC, then the config only applies to that VC.

Fragmentation:
- Prevents smaller real time packets (ie VOIP) from getting delayed behind big packets in the hardware FIFO queue.
NOTE : The fragmentation size should be set to match the Bc, that way worst delay = single Tc.

commands:

- Shows the configured shaping values

sh traffic-shape

- Shows packet/byte count, packets/bytes delayed

sh traffic-shape statistics

- Shows the configured map-class

sh run map-class frame-relay FRTS


map-class frame-relay FRTS
frame-relay cir {bps}
- Committed Information Rate (CIR), (default = 56000 bps)
frame-relay bc {bps} - Committed burst size (Bc), (default = 7000 bits)
frame-relay be {bps} - Excess burst size (Be), (default = 0 bits)
frame-relay mincir {bps} - Minimum acceptable CIR, (default = CIR/2 bps)

- Enables rate adjustment in response to BECN
frame-relay adaptive-shaping becn

- Enables rate adjustment in response to foresight messages and BECN

frame-relay adaptive-shaping foresight

frame-relay fecn-adapt - Enables shaping reflection of a received FECN as BECN
frame-relay fragment {bytes} - Specifies the maximum fragment size

- If the output queue depth exceeds the configured amount, slow down rate
frame adaptive interface-congestion {queue-depth}


interface s0/0
frame-relay traffic-shaping
- STEP 1, Enables FRTS under the physical interface
frame-relay class FRTS - STEP 2, Applies legacy FRTS to EACH VC configured on the interface OR

interface S0/0.1
frame-relay interface-dlci 405
class FRTS
- STEP 2, Applies FRTS only to this VC

MQC FRTS

Once FRTS has been enabled on the interface, all DLCIs on that interface (including sub-interfaces) are assigned the default CIR of 56kbps.

FRTS applied to Multipoint Frame-Relay interface per VC

policy-map FRTS-MQC-R1 - Creates a service-policy for VC going to R1
class class-default
shape average cir {bps}
policy-map FRTS-MQC-R2
- Creates a service-policy for VC going to R2
class class-default
shape average cir {bps}
shape max-buffers {buffer-depth}
- Increases the buffer queue depth
!
!
map-class frame-relay FRTS-R1
service-policy output FRTS-MQC
- Calls the service-policy in the map-class
map-class frame-relay FRTS-R2
service-policy output FRTS-MQC
- Calls the service-policy in the map-class
!
interface s0/0
frame map ip 10.0.0.1 501 broadcast
- Layer3-to-Layer2 mapping
frame map ip 10.0.0.2 502 broadcast - Layer3-to-Layer2 mapping
frame-relay interface-dlci 501
class FRTS-R1
- Applies the class-map FRTS-R1 only to VC 501
frame-relay interface-dlci 502
class FRTS-R2
- Applies the class-map FRTS-R2 only to VC 502

Class-Based Shaping

Class-Based Shaping (CB Shaping) is the Cisco recommended way to configure traffic shaping. It allows you to create class maps and policy maps once and then reuse them for multiple interfaces, rather than redoing the entire configuration under each individual interface. This lessens the likelihood of operator error or typos. CB Shaping also provides more granular control over the QoS operation.

CB-Shaping is GTS applied via MQC.
- CB-Shaping uses the same principles and calculations as FRTS, but does NOT adaptively shape.
- CB-Shaping is supported on non Frame-Relay interfaces.
- CB-shaping defaults to a Bc and Be = target-Rate * Tc(25ms).

image

Shape Average
> Formula: Bc = Shape-Rate * Tc

Shape Peak
> Formula: Shape-Rate = Configured-Rate ( 1 + BE/BC)

Example of CB-Shape applied to Frame-Relay interface

- Increases the buffer queue depth

policy-map FRTS-MQC
class class-default
shape average cir {bps}
shape max-buffers {buffer-depth}
!
- Normal CB-Shaping just applied to a frame-interface
interface s0/0
service-policy out FRTS-MQC

No comments:

Post a Comment