Module 3 - Recorded Lecture - Animesh Giri
Module 3 - Recorded Lecture - Animesh Giri
Queue Management
I n th i s Se g m e n t
• Queue management mechanisms
– FIFO
– Fair Queuing
– Priority Queuing
– Weighted Fair Queuing
Qu e u e Ma n a g e m e n t
• Where does queuing occur?
• Congestion occurs when the rate of ingress traffic is greater than what can be
successfully processed and serialized on an egress interface
• Common causes for congestion include:
• The speed of an ingress interface is higher than the egress interface
• The combined traffic of multiple ingress interfaces exceeds the capacity of a single egress
interface
• The switch/router CPU is insufficient to handle the size of the forwarding table
Qu e u e Ma n a g e m e n t Me c h a n i s m s
• Packet scheduler at the output port must choose one packet among those
queued for transmission – how is this done?
• FIFO
• First In First Out
Qu e u e Ma n a g e m e n t Me c h a n i s m s
• Packet scheduler at the output port must choose one packet among those
queued for transmission – how is this done?
• Fair Queuing
• Maintain a separate queue for
each flow currently being handled
by the router
• The router then services these
queues in a round-robin fashion
Qu e u e Ma n a g e m e n t Me c h a n i s m s
• Packet scheduler at the output port must choose one packet among those
queued for transmission – how is this done?
• Priority Queuing
• Mark each packet with a priority, e.g., in the IP TOS field
• Routers implement multiple queues, one for each priority class
• The router always transmits packets out of the highest-priority queue if
that queue is non-empty before moving on to the next priority queue
• Within each priority, packets are managed in a FIFO manner
• Disadvantage – Risk of starvation and packet drops for low priority
queues
Qu e u e Ma n a g e m e n t Me c h a n i s m s
• Packet scheduler at the output port must choose one packet among those
queued for transmission – how is this done?
• Drop-tail
• Drop the incoming packet if the buffer is full
• New terms
• TCP synchronization
• TCP starvation
T CP S y n c h r o n i z a t i o n
• Impact of RED:
• TCP sessions slow down to the approximate rate of output-link bandwidth
• Average queue size is small (much less than the maximum queue size)
• TCP sessions are desynchronized by random drops
Mo re a b o u t RE D
• Algorithms/techniques for packet-dropping and -marking policies
• If the average queue length is less than a minimum threshold, minth, when a packet arrives, the
packet is admitted to the queue
• If the queue is full or the average queue length is greater than a maximum threshold, maxth, when
a packet arrives, the packet is marked or dropped
• If the packet arrives to find an average queue length in the interval [minth, maxth], the packet is
marked or dropped with a probability that is typically some function of the average queue length,
minth, and maxth
• Max threshold
• When the size of queue becomes larger than the maximum threshold, all arriving packets are
dropped (tail drop behaviour)
• Initial small value of sending window even though the network may be capable
of more
• Short connections having small congestion window may not have enough
packets to activate the duplicate ACK mechanism – retransmissions will be
triggered only on timeout, not duplicate ack
• Proposed Solution
• Preferential treatment to short TCP flows
• Employ an Active Queue Management policy inside the network - can significantly enhance their
transmission time, without degrading long flow performance
• Diffserv-like architecture to classify flows into short and long at the edge of the network
Pro p o s e d S o l u t i o n
• A Diffserv-like scalable active domain management architecture is suggested
where
• Edge routers of an administrative domain perform all the per-flow information
maintenance tasks
• Edge routers classify flows into 2 classes: short flow & long flow
• Core routers only need to actively manage per-class flows – done by employing RIO
queue management policy
Ed g e Ro u t e rs & Co r e Ro u t e rs
• Classification Mechanism:
• Threshold-based approximation mechanism
• For each active flow, maintain a counter that tracks how many packets have been observed so
far
• Once the counter exceeds a certain threshold i.e. L t packets, the flow is considered to be “Long”
• Out packets: Packets that are outside of their service allocation profile
• Assumes that edge routers will mark packets conforming to SLA as in-profile and
offending packets as out-of-profile
RI O – RE D wi t h I n a n d Ou t
• When network is congested, queue management will drop packets marked as
out-of-profile first - Drop “out” packet earlier than “in” packet
• In the network core, the “in” and “out” packets are treated with different drop
priorities
• Since the “in” packets start being dropped only when the queue size crosses a
higher threshold than in the case of “out” packets, they get dropped with a lower
probability than “out” packets
RI O – RE D wi t h I n a n d Ou t
• Look at RIO as having two RED
profiles
– One drops the out packets from
a min threshold queue-fill
percentage to a max threshold,
and then tail drops all the
incoming packets
– The other begins to drop in
packets from this max threshold
queue-fill percentage to 100%
queue occupancy in increasing
probability
RI O-P S
RIO queue with Preferential treatment to Short Flows
RIO-PS (RIO with
preferential treatment
to short flows)
Short flow ”in” pkt
Long flow “out” pkt
Impact of Preferential Treatment— Link utilization under Drop Tail, RED, and RIO-PS
Su m m a ry
• Distinguishing between short flows and long flows
• Preferential treatment for short flows
• RIO (RED with In and Out)
• Reference: “The War between Mice & Elephants”, Lian Guo; Ibrahim Matta
BITS Pilani
Pilani | Dubai | Goa | Hyderabad
• CM sends the contents of the config file to the CMTS during the registration
process
• CMTS has to manage the bandwidth allocation based on the information in the
CM config file
Ca b l e Mo d e m Co n f i g F i l e
• In a cable modem config file you define:
• Service flows
• Classifiers
• Classifiers are used to identify what particular type of data uses which flow
• Specifies one or more packet header attributes, such as source MAC address, destination IP
address, or protocol type
• Also specifies the service flow to be used when a packet matches this particular combination of
headers
• For example, if we want voice traffic to have a higher priority we would create two service flows
one for normal data, and one for voice data
• And then create a classifier that identifies the voice data by port or dest IP address etc.. and have
the modem use the voice service flow for this
• Each cable modem can be configured with multiple packet classifiers
Cl a ss i f i e r s & S e r v i c e F l o ws
• Service Flows
• Similar to IP flows - which specify the priority, bandwidth, scheduling type (for upstream) and a
few other parameters
• Separate classifiers are used for downstream and upstream service flows
• Each cable modem can be configured with multiple service flows
Creating Classifiers
With additional Basic
service flows
CM Co n f i g F i l e
With a defined
QoS
Co n f i g u r i n g S e r v i c e Cl a s s f r o m CMT S
• cable service-class command
• Allows the operator to configure service flows from the CMTS
• Operators provision the modems with the service class name; the implementation of the name is
configured at the CMTS
• The implementation of a service flow can be modified to local circumstances without changing
the CM config file
• For example, some scheduling parameters might need to be set differently for two different
CMTSxs to provide the same service
• Allows higher-layer protocols to create a service flow by its service class name
Co n f i g u r i n g S e r v i c e Cl a s s f r o m CMT S
“cable service class” command allows configuration of a service class to which a service flow can be associated
class-index Specifies the class ID for the class to be modified. Valid range is 1 to 255.
activity-timeout Specifies the activity timeout (0 to 65,535).
admission- Specifies the admitted timeout (0 to 65,535).
timeout
downstream Specifies that the service class is for the downstream direction (from the CMTS to the CM). (The
default direction is upstream.)
grant-interval Specifies the grant interval (0 to 4,294,967,295 microseconds).
grant-jitter Specifies the grant jitter (0 to 4,294,967,295 microseconds).
grant-size Specifies the grant size (0 to 65,535 bytes).
grants-per- Specifies the grants per interval (0 to 127 grants).
interval
max-burst Specifies the maximum transmission burst (1522 to 4,294,967,295 bytes).
Note The recommended value range is 1600 to 1800 bytes. Using a value of 0 or greater than 1800
bytes can cause latency issues for Voice-over-IP. A value of less than 1522 bytes can prevent the
upstream transmission of large ethernet frames for any CM or CMTS not implementing
fragmentation.
max-buff-size Specifies the maximum buffer size of the upstream service-flow queue (or buffer) on the CM.
The valid range is from 0 to 4294967295 bytes. The default value is 0.
max-concat- Specifies the maximum concatenation burst (0 to 65,535 bytes).
burst
max-latency Specifies the maximum latency allowed (0 to 4,294,967,295 microseconds).
Co n f i g u r i n g S e r v i c e Cl a s s f r o m CMT S
“cable service class” command parameters
max-rate Specifies the maximum rate (0 to 4,294,967,295 bps).
min-buff-size Specifies the minimum buffer size of the upstream service-flow queue (or buffer) on the CM. The valid range is
from 0 to 4294967295 bytes. The default value is 0.
min-packet-size Specifies the minimum packet size for reserved rate (0 to 65,535 bytes).
min-rate Specifies the minimum rate (0 to 4,294,967,295 bps).
name Specifies the service class name string.
peak-rate Specifies the peak rate (0 to 4,294,967,295 bps). Default value is zero, which represents the line rate.
Note The peak-rate option is not supported on the DOCSIS 1.0 modems.
poll-interval Specifies the poll interval (0 to 4,294,967,295 microseconds).
poll-jitter Specifies the poll jitter (0 to 4,294,967,295 microseconds).
priority Specifies the priority (0 to 7, where 7 is the highest priority).
req-trans-policy Specifies the request transmission policy bit field (0 to FFFFFFF in hexadecimal).
sched-type Specifies the service class schedule type:
2–Best-Effort Schedule Type 3–Non-Real-Time Polling Service Schedule Type (supported only in Cisco 12.2(4)BC
and later releases) 4–Real-Time Polling Service Schedule Type 5–Unsolicited Grant Service with Activity
Detection Schedule Type 6–Unsolicited Grant Service Schedule Type
tar-buff-size Specifies the target or desired size of the upstream service-flow queue (or buffer) on the CM. The valid range is
from 0 to 4294967295 bytes. The default value is 0.
tos-overwrite or- Overwrites the ToS byte by first ANDing the TOS value with the and-mask value and then ORing the result of
mask and-mask that operation with the or-mask value. Both parameters must be specified in hexadecimal. The and-mask value
can range from 0x0 to 0xFF and the or-mask value can range from 0x0 to 0xFF.
Co n f i g u r i n g S e r v i c e Cl a s s f r o m CMT S
“cable service class” parameters
upstream Specifies that the service class is for the upstream direction (from the CM to
the CMTS). This is the default direction.
downstream Specifies that the service class is for the downstream direction (from the
CMTS to the CM).
req-attr-mask Specifies the required attribute mask bit field (0 to FFFFFFF in hexadecimal).
forb-attr-mask Specifies the forbidden attribute mask bit field (0 to FFFFFFF in hexadecimal).
Co n f i g u r i n g S e r v i c e Cl a s s f r o m CMT S
UpstreamServiceFlow
On CM config file
SfReference = 1
SfClassName = "UP_UGS"
SfQosSetType = 7
SfTrafficPriority = 7
SfMaxTrafficRate = 256000
SfSchedulingType= 6
SfRqTxPolicy = 256 • Router(config)# cable service class 1 name UP_UGS
Router(config)# cable service class 1 sched-type 6
Router(config)# cable service class 1 grant-size 100
Router(config)# cable service class 1 grant-interval 20000
On CMTS Router(config)# cable service class 1 grant-jitter 4000
Router(config)# cable service class 1 grants-per-interval 1
Router(config)# cable service class 1 min-packet-size 100
Router(config)# cable service class 1 req-trans-policy 0x1FF
Router(config)# cable service class 1 tos-overwrite 0x1F 0xE0
Router(config)# cable service class 1 activity-timeout 30
Router(config)# cable service class 1 admission-timeout 30
Mo re s u p p o r t ( r o u t e r d e p e n d e n t )
• Dynamic addition/deletion of service flows from CMTS
• Upstream rate limiting per upstream channel
• Configuring percentage overbooking rate per channel
• Service flow admission control to gracefully manage service flow admission
requests when one or more resources are not available to process an incoming
service request
• Provision to define class maps and traffic policies, per interface
• Eg of traffic policy: RED/WRED config, DSCP, BW, drop policy, fair-queuing etc.
Mo re s u p p o r t ( r o u t e r d e p e n d e n t )
• Router(config)# class-map class1
Creating class-
• Router(config-cmap)# match access-group 101
• Router(config-cmap)# exit
maps
• Router(config)# class-map class2
• Router(config-cmap)# match access-group 102
• Router(config-cmap)# exit
• Router(config-pmap)# exit
• random-detect precedence precedence
• Router(config-pmap)# class class2 min-threshold max-threshold mark-prob-
• Router(config-pmap-c)# bandwidth 2000 denominator
• Router(config-pmap)# exit
with policy-
interface
• Router(config-if)# exit
Su m m a ry
• A case study with DOCSIS networks
– Network elements
– Service flows, classifiers
– How QoS is configured on the DOCSIS network
BITS Pilani
Pilani | Dubai | Goa | Hyderabad
• Routing
– Determining the route taken by packets as they flow from a sender to a receiver
– Network-wide process to determine end to end paths
– Routing table
• Switch fabric
– Connects the router’s input ports to its output ports
– Network inside the router
• Output ports
– Stores packets received from the switching fabric
– Transmits these packets on the outgoing link by performing the necessary link- & physical-layer functions
– Links can be bidirectional
• Routing processor
– Executes routing protocols, maintains routing tables, computes forwarding tables
Ro u t i n g
Swi tc h i n g
• Filtering
– Switch function that determines whether a frame should be forwarded to some interface or be dropped
• Forwarding
– Switch function that determines the interfaces to which a frame should be directed, and then moves the
frame to those interfaces
• Switch filtering and forwarding are done with a switch table
– MAC address to interface mapping
VLAN Basics
I n th i s Se g m e n t
• Forwarding in switches
• Issues with switch hierarchy
• Virtual LANs
Swi tc h – Mu l t i p l e S i m u l t a n e o u s
Tra n s m i s s i o n s
• Hosts have dedicated, direct connection
to switch
• Switches buffer packets
• Ethernet protocol used on each incoming
link, but no collisions; full duplex
• Each link is its own collision domain
• Switching: A-to-A’ and B-to-B’ can transmit
simultaneously, without collisions
F o rwa rd i n g i n S wi t c h e s
• Switch forwarding table
– Destination MAC address look up
– If found, forward incoming frame out of that interface
– If not, flood the incoming frame out of all interfaces except the one from it the frame was received
• Collision domain
– A section of a network connected by a shared medium or through repeaters where frames can collide with
one another when being sent
• Broadcast domain
– A logical division of a computer network, in which all nodes can reach each other by broadcast at the data
link layer. A broadcast domain can be within the same LAN segment or it can be bridged to other LAN
segments.
• Layer 2 switches provide for separate collision domains
– VLANs or routers provide for separate broadcast domains
Ex a m p l e - I n s t i t u t i o n a l Ne t wo r k
I s s u es wi t h S wi t c h Hi e ra rc h y
• Lack of traffic isolation for broadcast traffic
– Separate broadcast domains are provided by routers, but it is possible to do this with Layer 2 switches also
• Managing users
– Difficult to handle cases where an employee moves from one dept to another, or if an employee belongs to 2
different depts
Source: ciscopress.com
Sa m p l e Co n f i g u ra t i o n s – Tr u n k p o r t
! Sample config to configure access port
switch# configure terminal
switch(config)# interface ethernet 1/10
switch(config-if)# switchport mode access
switch(config-if)# switchport access vlan 5
• Potential solution
– Assign each customer a range of VLANs it may use
– Removes the customers' flexibility to choose their own VLAN numbers
– There may not be enough VLAN numbers (max no: of VLANs: < 4096)
• Effect on MTU
– 4 additional bytes are added
– MTU value on the trunk or access ports may need to be configured appropriately
8 0 2. 1 Q Tu n n e l i n g
• Tagged customer traffic
– Comes from an 802.1Q trunk port on a customer device
– Enters the service-provider edge switch through a tunnel
port
• The link between the 802.1Q trunk port on
a customer device and the tunnel port is
called an asymmetrical link
– One end is configured as an 802.1Q trunk port and the
other end is configured as a tunnel port
• Tunnel port is configured to an access
VLAN ID unique to each customer
8 0 2. 1 Q Tu n n e l i n g
• Tunnel traffic
– Tagged customer traffic comes from an 802.1Q trunk port on a customer device
– Enters the service-provider edge switch through a tunnel port
– The 802.1Q tag (C-VLAN tag) is not removed
– A new VLAN tag is added: 2-byte Ethertype field (0x8100), 2-byte field CoS field and the VLAN
– The received customer traffic is then put into the VLAN to which the tunnel port is assigned
– This Ethertype 0x8100 traffic, with the received 802.1Q tag intact, is called tunnel traffic
– A VLAN carrying tunnel traffic is an 802.1Q tunnel
– The tunnel ports in the VLAN are the tunnel’s ingress and egress points
– An egress tunnel port strips the 2-byte Ethertype field (0x8100) and the 2-byte length field and transmits the traffic with the
802.1Q tag still intact to an 802.1Q trunk port on a customer device
– The 802.1Q trunk port on the customer device strips the 802.1Q tag and puts the traffic into the appropriate customer VLAN
• Related commands
– switchport mode dot1q-tunnel
• An 802.1Q header, which is 4 bytes long, is added to an untagged Ethernet frame in the following
manner:
• The 4-byte tag is inserted between the MAC Source Address of the untagged frame and its ethertype field.
• This is the C-VLAN tag or the C-Tag
• The newly inserted VLAN header's ethertype is set to 0x8100 to identify the following data as a VLAN tag.
• After the insertion of a .1Q header to an untagged frame, the frame's original ethertype appears to
have been changed to 0x8100. The untagged frame's original ethertype in the single-tag frame is
now located adjacent to the payload. Its value is unchanged.
• A second 802.1Q header is added to a single-tagged frame in the following manner:
• The second tag is inserted in front of the first tag, meaning the second tag is closer to the Ethernet header than the first
(original) tag. This is the S-VLAN tag or the S-Tag.
• The second tag is inserted between the MAC SAMAC and the first (original) tag.
• The second tag is assigned an ethertype of 0x88A8 (instead of the .1Q standard 0x8100) by default. Source: Wikipedia
VL AN Tra n s l a t i o n
• Helps establish service provider VLANs
– Configures VLAN mapping (or VLAN ID translation) on trunk ports connected to a customer network
– Maps customer VLANs to service-provider VLANs based on the port number and the C-VLAN of the packet