Thursday, September 6, 2012

Non-IP Header Marking Fields


·         When IP packet passing through an internetwork, the packet is encapsulated in a variety of other headers.
·         In these other headers have QoS fields that can be used for Classification & Marketing.
·         Ethernet LAN Class of Service
o   Ethernet supports a 3-bit QoS  marking field
§  This field only exist when the Ethernet header includes either an 802.1Q or ISL trunking header.
o   IEEE802.1Q defines its QoS field as the 3 most significant bits of the 2-byte Tag Control field, calling the field the Class of Service (CoS).
o   Regardless  of the type of trunking most people & most ios commands refer to these fields as CoS.
o   Bellow figure shows the general location of the CoS field inside ISl and 802.1P headers.



·         WAN Marking Fields
o   Frame Relay & ATM supports a single bit that can be set for QoS purpose,
§  But these single bits are intended for a very strict use related to drop probability.
o   Frames or cells with these bits sets to 1 are considered to be better candidates to be dropped than frames or cells without the bit set to 1.
o   These single bits are named as Frame Relay Discard eligibility (DE) bit and the ATM Cell Loss Priority (CLP) bit.
o   These bits can be sent by a router, or by an ATM or Frame Relay Switch.
o   Routers & Switches drop features can be configured more aggressively drop frames & cells that having the DE or CLP bit.
o   MPLS defines a 3-bit field called the MPLS Experimental (EXP) bit
§  It is used for general QoS marking.
§  Often, C&M tools are used on the edge of MPLS networks
·         to remap DSCP or IPP values to MPLS Experimental bit values
·         to provide QoS inside the MPLS network

DSCP Setting & Terminology:



·         Several DiffServ RFCs suggest a set of values to use in the DSCP field.
·         RFC 2598 defines a DSCP of decimal 46, with a name Expedited Forwarding (EF).
o   According to this RFC,
o   during periods When thigh-priority traffic reaches or exceeds the interface bandwidth,
o   packet marked as EF should be given queuing preference
o    so that they experience minimal latency,
o   But the packets should be policed to prevent them from taking over a link
o   & preventing any other types of traffic from exiting an interface
·         These suggested settings, and the associated QoS behaviour recommended when using each setting, are called Per-Hop Behaviours (PHBs) by DiffServ.
·         Above example is called  Expedited Forwarding PHB
·         Class Selector PHB and DSCP values
o   IPP overlaps with the 1st 3bits of the DSCP field
§  Because the DS field is simply a redefinition of the original ToS byte in the IP header.
o   Because of this overlap, RFC 2475 defines a set of DSCP values and PHBs, called Class Selector(CS) PHBs,
§  That provides backward compatibility with IPP.
o   A C&M feature can set a CS DSCP value, and if another router or switch just looks at the IPP field,
§  The value will make sense from an IPP perspective.
o   Below table lists the CS DSCP names & values, and the corresponding IPP values and names.
DSCP Class Selector Name
Binary DSCP Values
IPP Binary Values
IPP Names
Default/CS0
000000
000
Routine
CS1
001000
001
Priority
CS2
010000
010
Immediate
CS3
011000
011
Flash
CS4
100000
100
Flash Override
CS5
101000
101
Critic/Critical
CS6
110000
110
Internetwork Control
CS7
111000
111
Network Control
o   CS PHB define above eight DSCP values their text names ,
o   It also suggests a simple set of QoS action that should be taken based on the CS values.
o   The CS PHB simply states that packets with larger CS DSCPs should be given better queuing preference than packets with lower CS DSCPs.
·         Assured Forwarding PHB & DSCP Values
o   The Assured Forwarding (AF) PHB (RFC 2597) defines four classes for queuing purposes,
o   Along with three levels of drop probability inside each queue.
o   To mark packets and distinguish into which of four queues a packet should be placed,
o   along with one of three drop priorities inside each queue,
o   the AF PHB defines 12 DSCP values their meanings.
o   The name of the AF DSCPs confirm to the following format:
o    AFxy
§  Where x implies one of four queues(values 1 through 4),
§  y implies one of three drop priorities(values 1 through 3)
·         The AF PHB suggested that
o   The higher the value of x in the DSCP name AFxy,
§  The better the queuing treatment a packet should get.
o   The higher the value of y in the DSCP name AFxy,
§  The worse the drop treatment for those packets.
§  (treating a packet worse for drop purposes means that the packet has a higher probability of being dropped)
·         Assured Forwarding DSCP values-Names, Binary Values, and Decimal Values
Queue Class
Low Drop Probability
Medium Drop Probability
High Drop Probability

Name/Decimal/Binary
Name/Decimal/Binary
Name/Decimal/Binary
1
AF11/10/001010
AF12/12/0011001
AF13/14/001110
2
AF21/18/010010
AF22/20/010100
AF23/22/010110
3
AF31/26/011010
AF32/28/011100
AF33/30/011110
4
AF41/34/100010
AF42/36/100100
AF43/38/100110

·         A text AF PHB names do not follow the “bigger-is-better” logic in all cases
o   AF11 is better than  AF13 if both are in same queuing class,
§  AF11 has lower probability of being dropped than AF13
·         The binary version of the AF DSCP values shows the patterns of values.
o   1st 3 bits of Binary DSCP values designate queue class(bits 0-2, left to right)
o   Next two bits (bits 3 & 4) designate the drop preference
o   As a result, queuing tools that operate only on IPP can still react to the AF DSCP values,
§  Essentially making the AF DSCPs backward compatible with non-DiffServ nodes for queuing process.
o   Convert from the AF name to the decimal equivalent use simple following formulae
§  AF31
§  8x + 2y = decimal value
§  8*3 + 2*1 = 26
·         Expedited (speed & efficient)Forwarding PHB & DSCP Values
§  RFC 2598 defines the Expedited Forwarding (EF) PHB,
§  This RFC defines a very simple pair of PHB actions
o   Queue EF packets so that they get scheduled quickly, to give them low latency
o   Police (regularly watch & guard) the EF packets so that they do not consume all bandwidth on the link or starve other queues.
§  The DSCP value defined for EF is named EF, with decimal value 46, binary value 101110.

Headers in QoS


·         One header in all types of Packets
·         The IP header, LAN trunking header, Frame Relay header, and ATM cell header all have at least one field that can be used to perform some form of QoS marketing.
·         Main topics covered are IP header IP Precedence (IPP) and Differentiated Services Code Point (DSCP) fields.
·         IPP Precedence & DSCP Compared
·         IP header is defined in RFC 791
·         It includes 1-byte field called the Type of Service (ToS) byte
·         ToS byte used as field to mark a packet for treatment with QoS tools
·         ToS byte further subdivided, with the high-order 3bits defined as the IP Precedence (IPP) field.
·         The complete list of values from the ToS byte’s original IPP 3-bit field, and the corresponding names
Name
Decimal Value
Binary Value
Routine
Precedence 0
000
Priority
Precedence 1
001
Immediate
Precedence 2
010
Flash
Precedence 3
011
Flash Override
Precedence 4
100
Critic/Critical
Precedence 5
101
Internetwork Control
Precedence 6
110
Network Control
Precedence 7
111
·         ToS byte include the flag fields (from bits 3 to 6)
o   They are toggled on or off to imply a particular QoS service.
o   Flags were not used very often,
o   So the ToS byte’s main purpose was to hold the 3-bit IPP field
·         A series of RFCs collectively called Differentiated Services (DiffServ) came along later.
o   Diffserv needed more than 3bits to mark packets,
o   So DiffServ standardized a redefinition of the ToS byte
o   The ToS byte itself was renamed the Differentiated Services (DS) field.
o   And IPP was replaced with a 6-bit field (high-order bits 0-5) called Differentiated Services Code Point(DSCP) field.
o   Later, RFC 3168 defined the lower-order 2 bits of the DS field for use with the QoS Explicit Congestion Notification (ECN) feature.
·       
·         Above figure shows ToS byte’s format with the pre-DiffServ and Post-DiffServ definition of the field.
·         C&M tools often mark DSCP or IPP because the IP packet remains intact as it is forwarded throughout an ip network.

QoS Models


o   Define how we deal with Contention in network
o   Two Types
§  Integrated Services
§  Differentiated Services
o   Both are defined by different RFCs
o   Integrated Services( IntServ)
§  Every application flow has an explicit reservation end-to-end network
§  It is connection oriented type-2 ios model
·         Application has awareness about QoS of end-to-end network
§   Does not scale well
·         Network must maintain too much state
·         Generally routers want to maintain in less state
§    It is a legacy IOS QoS model
§  Still used in real world applications
·         Mainly in MPLS traffic engineering(129th video, 7th minute)
o   Differentiated Services (DiffServ)
§  They are well known PHBs (Per Hop Basis)

QoS


Theoretical Need for QoS:
·         Root Cause: Resource Contention
o   Multiple traffic flows sharing same logical or physical interface
§  Same or multiple applications
§  Each application has its own requirements(delay, packet loss, bandwidth, etc)
·         Resource Contention results
o   Due to this queuing of traffic occurred at layer-2 devices
o   It results,
§  Packets may be delayed or dropped
§  Effective flow through decreases
§  Delay or Jitter(differences in delay) exceed thresholds
·         Possible Solutions:
o   Best solution: Avoid Contention
§  Don’t over-provision network, so maintain enough bandwidth all applications.
§  Add new physical links and/or new physical devices
o   Next best solution: QoS
§  Network congestion is controlled on the links
§  Delay/loss/jitter/Throughput are controlled on per-hop-basis
§  QoS is band-aid for network but not a permanent solution
§  Longterm solution is add better and required hardware
There is too much contention, QoS also not helped