classofservice _junos

Upload: alanvg29

Post on 02-Jun-2018

221 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/10/2019 ClassOfService _junos

    1/71

    CLASS OF SERVICE

  • 8/10/2019 ClassOfService _junos

    2/71

    2Copyright 2009 Juniper Networks, Inc. www.juniper.net

    WHAT IS CLASS OF SERVICE?

    CoS is designed to:Provide mechanisms for categorizing traffic Allow the router to use those categorizations to meet performancerequirements

    CoS is not designed to:Make a network fasterReduce congestion

  • 8/10/2019 ClassOfService _junos

    3/71

    3Copyright 2009 Juniper Networks, Inc. www.juniper.net

    TYPICAL USES OF COS

    PrioritizationVoIPLatency-sensitive trafficPriority users

    Congestion managementCongestion avoidance using REDCongestion control to ensure SLA maintenance

    Bandwidth controlEnsure that different classes of traffic receive allocated bandwidth

  • 8/10/2019 ClassOfService _junos

    4/71

    4Copyright 2009 Juniper Networks, Inc. www.juniper.net

    COS TERMINOLOGY

    Forwarding classesIdentifies traffic that should receive common treatmentUsed to assign traffic to output queues

    Loss priorityIdentifies the priority the router should give to dropping a packetUsed to select the drop profile used in the RED process

  • 8/10/2019 ClassOfService _junos

    5/71

    5 Copyright 2009 Juniper Networks, Inc. www.juniper.net

    Scheduler/Shaper/REDAdaptive Shaper/Virtual

    Channels

    COS PROCESSING

    Forwarding Class/Loss Priority

    BAClassifier

    Policing(Ingress)

    RewriteMarker

    MultifieldClassifier

    Fabric

    Ingress

    Egress

    ForwardingPolicy

    Policing(Egress)

    MultifieldClassifier

  • 8/10/2019 ClassOfService _junos

    6/71

    6 Copyright 2009 Juniper Networks, Inc. www.juniper.net

    FORWARDING CLASSES All traffic transiting the router is associated with a forwarding class

    Called ordered aggregates in DiffServ terminology Affects forwarding, scheduling, and marking

    The forwarding class and loss priority serve to define the nodesPHB for a particular packet

    Four categories

    Best effort, assured forwarding, expedited forwarding, and networkcontrolM-series platforms support four forwarding classesT-series platforms support up to eight forwarding classes for finergranularity, that is, EF, EF1, and EF2 instead of just EFForwarding classes are roughly analogous to queues

    Classifiers map traffic to a forwarding class at ingressMultifield and behavior aggregate classification is supported

  • 8/10/2019 ClassOfService _junos

    7/71

    7 Copyright 2009 Juniper Networks, Inc. www.juniper.net

    TRAFFIC CLASSIFICATION

    Classifiers map traffic to a forwarding class at ingressMultifield classifiers (firewall filters) are normally used at thenetworks edge

    Able to match on protocol, port, addresses, and so forthBehavior aggregate typically used in networks core

    Computationally efficient when compared to multifield classificationOptions include:

    DiffServ code pointsIPv4 precedence bits

    Classifier

    Bronze(BE)

    Silver(EF)

    Control(NC)

    Packet Aacket Backet C

    IEEE 802.1p bits MPLS EXP bits

  • 8/10/2019 ClassOfService _junos

    8/71

    8 Copyright 2009 Juniper Networks, Inc. www.juniper.net

    LOSS PRIORITYEach packet is associated with a loss priority during classificationor policing

    Action modifier in a multifield classifier or the interpretation of abehavior aggregate pattern

    A policer action for data in excess of the profile

    Loss priority is used to influence probability of RED drops within a

    given forwarding classSimilar in function to ATMs CLP or Frames DE

    Marker rewrite often required to convey loss-priority status betweenrouters

    Classifier

    Bronze(LP = 0)

    Packet A

    Bronze(LP = 1)

    Packet B

    Aggressive RED

    In PolicerProfile

    Out ofPolicerProfile

    Low Loss Priority

    High Loss

    Priority

    Mild RED

  • 8/10/2019 ClassOfService _junos

    9/71

    9 Copyright 2009 Juniper Networks, Inc. www.juniper.net

    Policy can be used to select the forwarding next hopfor traffic associated with a particular forwarding class

    Facilitates CoS-based forwarding (CBF) In this example, BE traffic is directed over the D E links

    using policy at R2:

    COS AND FORWARDING POLICY

    A B C F

    D EBE Packet EF Packet

    R1 R2

    R3

    R4

    CBF in place at R2 for the BE FC

  • 8/10/2019 ClassOfService _junos

    10/71

    10 Copyright 2009 Juniper Networks, Inc. www.juniper.net

    CLASSIFICATION OVERVIEW

    In-the-box applicationsMultifield classifierNo BA rewrite

    Across-the-network applicationsMultifield classifier at edgeBA in core

    Data (NoBA)

    Data (NoBA) Data (NoBA)

    Data BA Data (NoBA)

    fe-0/0/0 fe-0/0/0

    se-1/0/0

  • 8/10/2019 ClassOfService _junos

    11/71

    11 Copyright 2009 Juniper Networks, Inc. www.juniper.net

    MULTIFIELD CLASSIFIERS

    Data (NoBA) Data (NoBA)

    se-1/0/0

    firewall {family inet {

    filter apply-cos-markings {term admin {

    from {source-address {

    192.168.200.0/25;}

    }then {

    forwarding-class expedited-forwarding;accept;

    }}term all-other-traffic {

    then accept;}

    }}

    }

    interfaces {se-1/0/0 {

    unit 0 {family inet {

    filter {input apply-cos-markings;

    }}

    }}

    }

  • 8/10/2019 ClassOfService _junos

    12/71

    12 Copyright 2009 Juniper Networks, Inc. www.juniper.net

    BEHAVIOR AGGREGATES

    class-of-service {interfaces {

    fe-0/0/0 {unit 0 {

    rewrite-rules {inet-precedence default;

    }}

    }

    }}

    Data (NoBA) Data BA Data(NoBA)

    fe-0/0/0 fe-0/0/0

    class-of-service {interfaces {

    fe-0/0/0 {unit 0 {

    classifiers {inet-precedence default;

    }}

    }

    }}

  • 8/10/2019 ClassOfService _junos

    13/71

    13 Copyright 2009 Juniper Networks, Inc. www.juniper.net

    REWRITE MARKERS

    Marker rewrite alters packet fields to accommodate BA classification indownstream nodes

    Support for IP precedence, DSCP, MPLS EXP, and IEEE 802.1P rewrite tables

    One rewrite operation per logical unit per egress; simultaneous rewrite of multipleheaders is possible in some releases

    Able to perform Layer 2-to-Layer 3 (and vice versa) mappings for end-to-end CoS

    R1(Edge)

    Packet

    DSCP = 0001001

    Multifield ClassifierAssigns Traffic to the BE

    class

    Packet

    DSCP = 000000

    DSCP Rewrite Table AltersDSCP Coding for BE Class

    DSCP BA Classifier forBE Traffic

    R2(Core)

  • 8/10/2019 ClassOfService _junos

    14/71

    14 Copyright 2009 Juniper Networks, Inc. www.juniper.net

    JUNOS SOFTWARE COS DEFAULTS

    The lack of an explicit CoS configuration yields the following

    behavior:

    Default association of the BE, EF, AF, and NC forwarding classeswith queues 0 3 respectively

    Default scheduler for BE and NC traffic95% BE, 5% NC, both linked to default WRED profile regardless ofTCP and loss-priority flags

    Buffer depth set to equal WRR weight (95% and 5% respectively)

  • 8/10/2019 ClassOfService _junos

    15/71

    15 Copyright 2009 Juniper Networks, Inc. www.juniper.net

    POLICERSfirewall {

    policer admin-traffic-policer {if-exceeding {

    bandwidth-limit 1m;burst-size-limit 3k;

    }then forwarding-class best-effort;

    }

    family inet {filter apply-cos-markings {

    term admin {from {

    source-address {192.168.200.0/25;

    }}then {

    policer admin-traffic-policer;forwarding-class expedited-forwarding;accept;

    }}term all-other-traffic {

    then accept;}

    }}

    }

    Policer

    Expedited Forwarding

    Conforming Traffic Best Effort

    Out-of-Profile Traffic

  • 8/10/2019 ClassOfService _junos

    16/71

    16 Copyright 2009 Juniper Networks, Inc. www.juniper.net

    QUEUEING

    Overview:Default of 4 queues (0 3)Forwarding classes map toqueues

    Default queue/forwarding classassociations: 0: best-effort 1: expedited-forwarding 2: assured-forwarding

    3: network-control

    Queue0

    Queue1

    Queue2

    Queue3

    Scheduler Map

  • 8/10/2019 ClassOfService _junos

    17/71

    17 Copyright 2009 Juniper Networks, Inc. www.juniper.net

    FORWARDING CLASS DEFINITION

    To associate a forwarding class with a queue:set class-of-service forwarding-classes queue number forwarding-class-name

    Examples:[edit]lab@London# set class-of-service forwarding-classes queue 4 very-important-data

    [edit]lab@London# set class-of-service forwarding-classes queue 0 unimportant-data

    [edit]lab@London# commit commit complete

    [edit]

    lab@London# run show class-of-service forwarding-class Forwarding class Queueunimportant-data 0expedited-forwarding 1assured-forwarding 2network-control 3very-important-data 4

  • 8/10/2019 ClassOfService _junos

    18/71

    18 Copyright 2009 Juniper Networks, Inc. www.juniper.net

    SCHEDULING OVERVIEW

    Several components toscheduling:

    Priority Transmission rate Buffer size RED configuration

    Priority and transmissionrate define the orderBuffer size and REDconfiguration define howpackets are stored anddropped

    Queue0

    Queue1

    Queue2

    Queue3

    Scheduler Map

  • 8/10/2019 ClassOfService _junos

    19/71

  • 8/10/2019 ClassOfService _junos

    20/71

    20 Copyright 2009 Juniper Networks, Inc. www.juniper.net

    QUEUE PRIORITY ON J-SERIES ROUTERS

    Queues are serviced in priorityorder:

    HighMedium high

    Medium lowLowL M-L M-H H

    Scheduler Map

    15

    3 2 46

    462315

    *

    * - exceedingtransmission rate

  • 8/10/2019 ClassOfService _junos

    21/71

    21 Copyright 2009 Juniper Networks, Inc. www.juniper.net

    SCHEDULER DEFINITION

    Configure schedulers under [edit class-of-serviceschedulers]

    Example:[edit class-of-service schedulers]lab@HongKong# set sched-best-effort transmit-rate percent 40

    [edit class-of-service schedulers]lab@HongKong# set sched-best-effort buffer-size percent 40

    [edit class-of-service schedulers]lab@HongKong# set sched-best-effort priority low

    [edit class-of-service schedulers]lab@HongKong# showsched-best-effort {

    transmit-rate percent 40;buffer-size percent 40;priority low;

    }

  • 8/10/2019 ClassOfService _junos

    22/71

    22 Copyright 2009 Juniper Networks, Inc. www.juniper.net

    SCHEDULER MAP DEFINITION

    Scheduler maps associate schedulers with queues Configured under [edit class-of-service scheduler-

    maps]

    Example:[edit class-of-service scheduler-maps]lab@HongKong# set class-example forwarding-class best-effort scheduler sched-best-effort

    [edit class-of-service scheduler-maps]lab@HongKong# set class-example forwarding-class network-control scheduler sched-network-control

    [edit class-of-service scheduler-maps]lab@HongKong# set class-example forwarding-class admin scheduler sched-admin

    [edit class-of-service scheduler-maps]lab@HongKong# show class-example {

    forwarding-class best-effort scheduler sched-best-effort;forwarding-class network-control scheduler sched-network-control;forwarding-class admin scheduler sched-admin;

    }

  • 8/10/2019 ClassOfService _junos

    23/71

    23 Copyright 2009 Juniper Networks, Inc. www.juniper.net

    APPLYING A SCHEDULER MAP TO AN INTERFACE

    Scheduler maps must be associated with outbound interfacesunder [edit class-of-service interfaces]

    Wildcards are allowed for interface names and unitsPer-unit scheduling requires per-unit-scheduler in the interfaceconfiguration under [edit interfaces]

    Example:[edit class-of-service interfaces]lab@HongKong# set se-1/0/0 scheduler-map class-example

    [edit class-of-service interfaces]lab@HongKong# set fe-* scheduler-map class-example

    [edit class-of-service interfaces]lab@HongKong# show se-1/0/0 {

    scheduler-map class-example;}fe-* {

    scheduler-map class-example;}

  • 8/10/2019 ClassOfService _junos

    24/71

  • 8/10/2019 ClassOfService _junos

    25/71

    25 Copyright 2009 Juniper Networks, Inc. www.juniper.net

    EXAMPLE: TOPOLOGY AND GOALS

    fe-2/0/1 fe-2/0/1se-1/0/0 se-1/0/0

    r1 r2Classification Rules:Traffic to/from professors(192.168.25.64/26) should be placedin the professor forwarding class.Traffic to/from students

    (192.168.25.128/25) should be placedin the student forwarding class, providedthe traffic from the students doesnt

    exceed 1Mb/s.Traffic from students in excess of 1Mb/sshould be placed in the best-effortforwarding class.

    Queues:0: best-effort1: students2: professors3: network-control

    Scheduling Rules:network-control traffic should be giventhe highest priority and 5% of theavailable bandwidth.Traffic from professors should be giventhe next-highest priority (medium-high)and be allocated 50% of the bandwidth.They should be allowed to use leftoverbandwidth.Traffic from students should be given thenext-highest priority and allocated 40%of the bandwidth. They should beallowed to use leftover bandwidth.best-effort traffic should be given thelowest priority and allocated 5% of thebandwidth. They should not be allowedto use extra bandwidth.

  • 8/10/2019 ClassOfService _junos

    26/71

    26 Copyright 2009 Juniper Networks, Inc. www.juniper.net

    EXAMPLE: R1 INGRESS MULTIFIELD CLASSIFIER

    then {

    forwarding-class professors;accept;}

    }term from-students {

    from {source-address {

    192.168.25.128/26;}

    }then {

    policer student-policer;forwarding-class students;accept;

    }}term default {

    then accept;}

    }}}

    interfaces {se-1/0/0 {

    unit 0 {family inet {

    filter {input apply-cos-markings;

    }}

    }}

    }

    firewall {policer student-policer {if-exceeding {

    bandwidth-limit 1m;burst-size-limit 28125;

    }then forwarding-class best-effort;

    }family inet {

    filter apply-cos-markings {term from-professors {

    from {source-address {

    192.168.25.64/26;}

    }

  • 8/10/2019 ClassOfService _junos

    27/71

    27 Copyright 2009 Juniper Networks, Inc. www.juniper.net

    EXAMPLE: R2 INGRESS MULTIFIELD CLASSIFIER

    term to-students {

    from {destination-address {192.168.25.128/26;

    }}then {

    forwarding-class students;accept;

    }}term default {

    then accept;}

    }}

    }

    interfaces {se-1/0/0 {

    unit 0 {family inet {

    filter {input apply-cos-markings;

    }}

    }}

    }firewall {family inet {

    filter apply-cos-markings {term to-professors {

    from {destination-address {

    192.168.25.64/26;}

    }then {forwarding-class professors;accept;

    }}

  • 8/10/2019 ClassOfService _junos

    28/71

    28 Copyright 2009 Juniper Networks, Inc. www.juniper.net

    EXAMPLE: FORWARDING CLASS, BA,AND SCHEDULER

    schedulers {sched-network-control {

    transmit-rate percent 5;buffer-size percent 5;priority high;

    }sched-professors {

    transmit-rate percent 50;buffer-size percent 50;priority medium-high;

    }sched-students {

    transmit-rate percent 40;buffer-size percent 40;priority medium-low;

    }sched-best-effort {

    transmit-rate percent 5 exact;buffer-size percent 5;priority low;

    }}

    }

    class-of-service {forwarding-classes {

    queue 1 students;queue 2 professors;

    }interfaces {

    fe-2/0/1 {scheduler-map professor-student-scheduler;unit 0 {

    classifiers {inet-precedence default;

    }

    rewrite-rules {inet-precedence default;}

    }}se-1/0/0 {

    scheduler-map professor-student-scheduler;}

    }scheduler-maps {

    professor-student-scheduler {

    forwarding-class network-control scheduler sched-network-control;forwarding-class professors scheduler sched-professors;forwarding-class students scheduler sched-students;forwarding-class best-effort scheduler sched-best-effort;

    }}

  • 8/10/2019 ClassOfService _junos

    29/71

    29 Copyright 2009 Juniper Networks, Inc. www.juniper.net

    USEFUL COMMANDS (1 OF 2)

    show class-of-service interfaceinterface

    show interfaces interface detaillab@London> show interfaces fe-2/0/1 detail [...]Egress queues: 8 supported, 8 in use

    Queue counters: Queued packets Transmitted packets Dropped packets0 best-effort 1 1 01 students 0 0 02 professors 0 0 03 network-cont 0 0 0

    lab@London> show class-of-service interface fe-2/0/1 Physical interface: fe-2/0/1, Index: 142Queues supported: 8, Queues in use: 4

    Scheduler map: professor-student-scheduler, Index: 15041Input scheduler map: , Index: 3

    Logical interface: fe-2/0/1.0, Index: 68Object Name Type IndexRewrite ipprec-default ip 29Classifier ipprec-default ip 11

  • 8/10/2019 ClassOfService _junos

    30/71

    30 Copyright 2009 Juniper Networks, Inc. www.juniper.net

    USEFUL COMMANDS (2 OF 2)

    show interfaces queue interfacelab@London> show interfaces queue fe-2/0/1 Physical interface: fe-2/0/1, Enabled, Physical link is Up

    Interface index: 142, SNMP ifIndex: 62Forwarding classes: 8 supported, 8 in useEgress queues: 8 supported, 8 in useQueue: 0, Forwarding classes: best-effort

    Queued:Packets : 1 0 ppsBytes : 42 0 bps

    Transmitted:Packets : 1 0 ppsBytes : 42 0 bpsTail-dropped packets : 0 0 ppsRED-dropped packets : 0 0 pps

    Low : 0 0 ppsMedium-low : 0 0 ppsMedium-high : 0 0 ppsHigh : 0 0 pps

    RED-dropped bytes : 0 0 bpsLow : 0 0 bpsMedium-low : 0 0 bpsMedium-high : 0 0 bpsHigh : 0 0 bps

    Queue: 1, Forwarding classes: studentsQueued:

    Packets : 0 0 ppsBytes : 0 0 bps

    [...]

  • 8/10/2019 ClassOfService _junos

    31/71

    31 Copyright 2009 Juniper Networks, Inc. www.juniper.net

    TROUBLESHOOTING HINTS

    Hints: Add a counter to an existing multifield classifierUse monitor traffic to look for behavioraggregate markings in the headers of traffic destined

    to the router Add an input firewall filter that counts traffic assignedto each forwarding class, matches on BA fields, orboth

    Look for drops in show interfaces queue outputUse show interfaces queue to see if a queue isexceeding its transmission rate

  • 8/10/2019 ClassOfService _junos

    32/71

    32 Copyright 2009 Juniper Networks, Inc. www.juniper.net

    COS-BASED FORWARDING. EJEMPLORouter A has two routes to destination 10.255.71.208 on Router D. Oneroute goes through Router B, and the other goes through Router C.

    Configure Router A with CBF to select Router B for queue 0 and queue 2,and Router C for queue 1 and queue 3.

    [edit class-of-service]forwarding-policy {

    next-hop-map my_cbf {forwarding-class be {

    next-hop ge-2/0/0.0;}forwarding-class ef {

    next-hop so-0/3/0.0;

    }forwarding-class af {

    next-hop ge-2/0/0.0;}forwarding-class nc {

    next-hop so-0/3/0.0;}

    }}

    classifiers {inet-precedence inet {

    forwarding-class be {loss-priority low code-points [ 000 100 ];

    }forwarding-class ef {

    loss-priority low code-points [ 001 101 ];}forwarding-class af {

    loss-priority low code-points [ 010 110 ];}forwarding-class nc {

    loss-priority low code-points [ 011 111 ];}

    }}

    [edit policy-options]policy-statement cbf {

    from {route-filter 10.255.71.208/32 exact;

    }then cos-next-hop-map my_cbf;

    }

  • 8/10/2019 ClassOfService _junos

    33/71

    33 Copyright 2009 Juniper Networks, Inc. www.juniper.net

    VOIP CASE STUDY TOPOLOGY

    General notes: Adapted from the example used in the JNCIE certification preparationguideConfiguration and operational analysis is unidirectional (fromsubscriber to PABX)

    Simplifies and reduces the size of configuration examplesYields one-way CoS! A similar set of configuration statements needed toprovide CoS in the return direction

    San Jose Montreal

    Denver

    AmsterdamHong Konglo0: 192.168.16.1

    lo0: 192.168.20.1 lo0: 192.168.40.1

    lo0: 192.168.56.1

    lo0: 192.168.32.1

    Service Provider

    PABX Dataandset Data

    10.222.x/24

    CoS configured in this direction only

    Ingress

    Transit

    Egress

  • 8/10/2019 ClassOfService _junos

    34/71

    34 Copyright 2009 Juniper Networks, Inc. www.juniper.net

    VOIP CASE STUDY CRITERIA: INGRESS

    Use CoS to support VoIP, conventional Internet, and control traffic received

    from a customerClassification and policingVoIP SIP signaling uses TCP/UDP port 5060RTP media channels use UDP with ports in the range of 16,000 16,500Classify all VoIP traffic as expedited forwardingClassify IP precedence 6 or 7 as network control

    Classify all remaining IP precedence 0 traffic as best effortPolice BE traffic to 1 Mbps with a 3000-byte burst; mark excess traffic as highloss priority

    Scheduling and congestion controlSchedule VoIP traffic as high priority with at least 20 Mbps of capacity; limitmaximum delay to 200 millisecondsSchedule BE traffic with low priority and limit to 1 MbpsConfigure WRED for the BE class so that a greater percentage of high losspriority traffic is discarded; only TCP traffic is subjected to WRED

    Marker rewriteRewrite the DSCP marker to accommodate BA classification; ensure that losspriority for the EF forwarding class is coupled between chassis

  • 8/10/2019 ClassOfService _junos

    35/71

  • 8/10/2019 ClassOfService _junos

    36/71

    36 Copyright 2009 Juniper Networks, Inc. www.juniper.net

    INGRESS NODE MULTIFIELD CLASSIFIER[edit firewall family inet filter mf-classify]lab@San_Jose-3# show term 1 {

    from {protocol [ udp tcp ];port 5060;

    }then forwarding-class expedited-forwarding;

    }term 2 {

    from {

    protocol udp;port 16000-16500;}then forwarding-class expedited-forwarding;

    }term 3 {

    from {precedence routine;

    }then {

    policer police-be;forwarding-class best-effort;

    }}term 4 {

    then accept;}

    Precedence 0 traffic directed topolicer and classified as BE

    Traffic associated with VoIP isclassified as EF and accepted

    Network control accepted and classified byipprec-compatibility

  • 8/10/2019 ClassOfService _junos

    37/71

  • 8/10/2019 ClassOfService _junos

    38/71

    38 Copyright 2009 Juniper Networks, Inc. www.juniper.net

    INGRESS NODE SCHEDULING/WRED

    Code PointClassifier

    MultifieldClassifier

    Policing(Ingress)

    ForwardingPolicy

    Rewrite/

    Marker

    Scheduler/

    WRED

    Policing

    (Egress)

    Forwarding Class/

    Loss Priority

  • 8/10/2019 ClassOfService _junos

    39/71

    39 Copyright 2009 Juniper Networks, Inc. www.juniper.net

    CONFIGURING SCHEDULERSDefine a scheduler for all forwarding classes that are in effect

    A network control scheduler should always be in effect to ensure thatcontrol protocols are not starved

    [edit class-of-service]lab@San_Jose# show schedulers be-scheduler {

    transmit-rate 1m exact;priority low;drop-profile-map loss-priority low protocol tcp drop-profile low-red;drop-profile-map loss-priority high protocol tcp drop-profile high-red;

    }ef-scheduler {

    transmit-rate 20m;buffer-size temporal 200000;priority high;

    }nc-scheduler {

    transmit-rate percent 5;priority low;

    }

    In this case study, buffer depth isset for the EF class only. Delay ismeasured in microseconds.

  • 8/10/2019 ClassOfService _junos

    40/71

    40 Copyright 2009 Juniper Networks, Inc. www.juniper.net

    DEFINING WRED DROP PROFILES

    Two drop profiles are required for the BE class in this example:The low-red profile affects TCP traffic with low loss priority10% drop probability at 80% queue fill

    The high-red profile affects TCP traffic with high loss priority10% drop probability at 50% queue fill

    Drop profiles are referenced within a scheduler stanza on aforwarding class, TCP status, and loss-priority basis

    [edit class-of-service]lab@San_Jose# show drop-profiles low-red {

    fill-level 80 drop-probability 10;}high-red {

    fill-level 50 drop-probability 10;}

  • 8/10/2019 ClassOfService _junos

    41/71

    41 Copyright 2009 Juniper Networks, Inc. www.juniper.net

    LINK SCHEDULERS TO CLASSES/INTERFACES

    [edit class-of-service]lab@San_Jose# show scheduler-maps voip-case {

    forwarding-class best-effort scheduler be-scheduler;forwarding-class expedited-forwarding scheduler ef-scheduler;forwarding-class network-control scheduler nc-scheduler;

    }

    [edit class-of-service]lab@San_Jose# show interfaces fe-0/0/1 {

    scheduler-ma p voip-case;}

    Define a scheduler map to link forwarding classes to

    schedulers

    Place schedulers into effect on egress interfaces bylinking them to a scheduler map

    Schedulers are applied at the physical device level

  • 8/10/2019 ClassOfService _junos

    42/71

    42 Copyright 2009 Juniper Networks, Inc. www.juniper.net

    INGRESS NODE REWRITE TABLE

    Code PointClassifier

    MultifieldClassifier

    Policing(Ingress)

    ForwardingPolicy

    Rewrite/

    Marker

    Scheduler/

    WREDPolicing

    (Egress)

    Forwarding Class/

    Loss Priority

  • 8/10/2019 ClassOfService _junos

    43/71

    43 Copyright 2009 Juniper Networks, Inc. www.juniper.net

    CONFIGURING DSCP REWRITE TABLEDefault DSCP rewrite table does not communicate loss priority forBE traffic

    The voip-dscp-rewrite table imports default settings and definesa code point for BE traffic with high loss priority:

    The voip-dscp-rewrite table is linked to the egress interface atthe ingress node:

    [edit class-of-service rewrite-rules dscp voip-dscp-rewrite]lab@San_Jose# show import default;

    forwarding-class best-effort {loss-priority high code-point 000001;

    }

    [edit class-of-service]lab@San_Jose# show interfaces fe-0/0/1 scheduler-map voip-case;unit 0 {

    rewrite-rules {dscp voip-dscp-rewrite;

    }

    }

    Prepopulates new table with values fromthe default DSCP rewrite table

  • 8/10/2019 ClassOfService _junos

    44/71

    44 Copyright 2009 Juniper Networks, Inc. www.juniper.net

    INGRESS COS CONFIGURATION UNIDIRECTIONAL (1OF 2)

    [edit class-of-service]lab@San_Jose# show drop-profiles {

    low-red {fill-level 80 drop-probability 10;}high-red {

    fill-level 50 drop-probability 10;}

    }interfaces {

    fe-0/0/1 {scheduler-map voip-case;unit 0 {

    rewrite-rules {dscp voip-dscp-rewrite;

    }}

    }}rewrite-rules {

    dscp voip-dscp-rewrite {import default;forwarding-class best-effort {

    loss-priority high code-point 000001;}

    }}. . .

  • 8/10/2019 ClassOfService _junos

    45/71

    45 Copyright 2009 Juniper Networks, Inc. www.juniper.net

    INGRESS COS CONFIGURATION UNIDIRECTIONAL (2OF 2)

    The ingress nodes multifield classifier and policer configuration isshown on a previous slide

    . . .scheduler-maps {

    voip-case {forwarding-class best-effort scheduler be-scheduler;forwarding-class expedited-forwarding scheduler ef-scheduler;forwarding-class network-control scheduler nc-scheduler;

    }}schedulers {

    be-scheduler {transmit-rate 1m exact;priority low;

    drop-profile-map loss-priority low protocol tcp drop-profile low-red;drop-profile-map loss-priority high protocol tcp drop-profile high-red;}ef-scheduler {

    transmit-rate 20m;buffer-size temporal 200;priority high;

    }nc-scheduler {

    transmit-rate percent 5;priority low;

    }}

  • 8/10/2019 ClassOfService _junos

    46/71

    46 Copyright 2009 Juniper Networks, Inc. www.juniper.net

    VOIP CASE STUDY CRITERIA: TRANSIT/EGRESS

    Use CoS to support VoIP, conventional Internet, and control traffic

    received from an upstream nodeBA classification

    Configure DSCP-based BA classification compatible with ingress nodeclassification

    Scheduling and congestion controlSchedule VoIP traffic as high priority with at least 20 Mbps of capacitySchedule BE traffic with low priority, and limit this traffic to 1 MbpsConfigure RED profiles for BE traffic that discriminate on loss priority andTCP status flags

    Marker rewriteRewrite the DSCP marker to accommodate BA classification indownstream nodes; ensure that loss priority for the EF forwarding class iscoupled between chassis

  • 8/10/2019 ClassOfService _junos

    47/71

    47 Copyright 2009 Juniper Networks, Inc. www.juniper.net

    TRANSIT/EGRESS NODE BA CLASSIFICATION

    Code PointClassifier

    MultifieldClassifier

    Policing(Ingress)

    ForwardingPolicy

    Rewrite/

    Marker

    Scheduler/

    WRED

    Policing

    (Egress)

    Forwarding Class/

    Loss Priority

  • 8/10/2019 ClassOfService _junos

    48/71

    48 Copyright 2009 Juniper Networks, Inc. www.juniper.net

    CONFIGURING DSCP CLASSIFICATION TABLE

    The voip-dscp-classify table defines code points for BE

    traffic with high/low loss priorityThe DSCP classifiers must match the DSCP rewrite values in effectat the upstream node

    Link the voip-dscp-classify table to the i ng ress interface attransit/egress nodes:

    [edit class-of-service classifiers dscp voip-dscp-classifier]lab@Denver# show

    import default;forwarding-class best-effort {

    loss-priority high code-points 000001;}

    [edit class-of-service]lab@Denver# show interfaces fe-0/0/1 unit 0 {

    classifiers {dscp voip-dscp-classifier;

    }}

    Prepopulates new table with values fromthe default DSCP classifier table

  • 8/10/2019 ClassOfService _junos

    49/71

    49 Copyright 2009 Juniper Networks, Inc. www.juniper.net

    TRANSIT/EGRESS NODE SCHEDULERS/WRED

    Code PointClassifier

    MultifieldClassifier

    Policing(Ingress)

    ForwardingPolicy

    Rewrite/

    MarkerScheduler /

    WRED

    Policing

    (Egress)

    Forwarding Class/

    Loss Priority

  • 8/10/2019 ClassOfService _junos

    50/71

    50 Copyright 2009 Juniper Networks, Inc. www.juniper.net

    CONFIGURING SCHEDULERSTransit and egress nodes use the same scheduler configuration asthe ingress node

    CoS designs must ensure consistent traffic handling among all nodesin the path

    [edit class-of-service]lab@Denver# show schedulers be-scheduler {

    transmit-rate 1m exact;priority low;drop-profile-map loss-priority low protocol tcp drop-profile low-red;drop-profile-map loss-priority high protocol tcp drop-profile high-red;

    }ef-scheduler {

    transmit-rate 20m;buffer-size temporal 200;priority high;

    }nc-scheduler {

    transmit-rate percent 5;priority low;

    }

  • 8/10/2019 ClassOfService _junos

    51/71

    51 Copyright 2009 Juniper Networks, Inc. www.juniper.net

    DEFINING WRED DROP PROFILES

    [edit class-of-service]

    lab@Denver# show drop-profiles low-red {

    fill-level 80 drop-probability 10;}high-red {

    fill-level 50 drop-probability 10;

    }

    Transit and egress nodes use the same drop profilesconfigured at the ingress node

    CoS designs are contingent on consistent and predictable traffic handling among all nodes in the path

  • 8/10/2019 ClassOfService _junos

    52/71

    52 Copyright 2009 Juniper Networks, Inc. www.juniper.net

    [edit class-of-service]lab@Denver# show scheduler-maps voip-case {

    forwarding-class best-effort scheduler be-scheduler;forwarding-class expedited-forwarding scheduler ef-scheduler;forwarding-class network-control scheduler nc-scheduler;

    }[edit class-of-service]lab@Denver-3# show interfaces fe-0/0/1 {

    unit 0 {classifiers {

    dscp voip-dscp-classifier;}

    }}so-0/1/1 {

    scheduler-map voip-case;}

    LINK SCHEDULERS TO CLASSES AND INTERFACES A scheduler map links forwarding classes to schedulers and toegress interfaces

  • 8/10/2019 ClassOfService _junos

    53/71

    53 Copyright 2009 Juniper Networks, Inc. www.juniper.net

    TRANSIT NODE MARKING

    Code PointClassifier

    MultifieldClassifier

    Policing(Ingress)

    ForwardingPolicy

    Rewrite/

    Marker

    Scheduler/

    WREDPolicing

    (Egress)

    Forwarding Class/

    Loss Priority

  • 8/10/2019 ClassOfService _junos

    54/71

    54 Copyright 2009 Juniper Networks, Inc. www.juniper.net

    CONFIGURING TRANSIT NODE MARKINGTransit nodes have the same DSCP rewrite table as the ingressnode

    Applied to transit nodes egress interface

    No egress conditioning is required in this case study

    [edit class-of-service]lab@Denver# show rewrite-rules dscp voip-dscp-rewrite {

    import default;forwarding-class best-effort {

    loss-priority high code-point 000001;}

    }

    [edit class-of-service]

    lab@Denver# show interfaces so-0/1/1 scheduler-map voip-case;unit 0 {

    rewrite-rules {dscp voip-dscp-rewrite;

    }}

    TRANSIT/EGRESS NODE COS CONFIGURATION

  • 8/10/2019 ClassOfService _junos

    55/71

    55 Copyright 2009 Juniper Networks, Inc. www.juniper.net

    TRANSIT/EGRESS NODE COS CONFIGURATION(1 OF 2)

    [edit class-of-service]lab@Denver# show classifiers {

    dscp voip-dscp-classifier {import default;forwarding-class best-effort {

    loss-priority high code-points 000001;}

    }}drop-profiles {

    low-red {fill-level 80 drop-probability 10;

    }high-red {

    fill-level 50 drop-probability 10;}

    }interfaces {

    fe-0/0/1 {unit 0 {classifiers {

    dscp voip-dscp-classifier;}

    }}

    . . .

    . . .so-0/1/1 {

    scheduler-map voip-case;unit 0 {

    rewrite-rules {dscp voip-dscp-rewrite;

    }}

    }}. . .

  • 8/10/2019 ClassOfService _junos

    56/71

  • 8/10/2019 ClassOfService _junos

    57/71

    57 Copyright 2009 Juniper Networks, Inc. www.juniper.net

    GENERATING TEST DATATraffic is generate from the Hong-Kong station to confirm properclassification

    Pings generate traffic to confirm BE classificationTelnet to port 5060 confirms EF (VoIP) classification

    lab@Hong_Kong> ping 192.168.32.1 count 5 PING 192.168.32.1 (192.168.32.1): 56 data bytes

    64 bytes from 192.168.32.1: icmp_seq=0 ttl=252 time=0.642 ms64 bytes from 192.168.32.1: icmp_seq=1 ttl=252 time=0.541 ms64 bytes from 192.168.32.1: icmp_seq=2 ttl=252 time=0.526 ms64 bytes from 192.168.32.1: icmp_seq=3 ttl=252 time=0.519 ms64 bytes from 192.168.32.1: icmp_seq=4 ttl=252 time=0.525 ms

    --- 192.168.32.1 ping statistics ---5 packets transmitted, 5 packets received, 0% packet lossround-trip min/avg/max/stddev = 0.519/0.551/0.642/0.046 ms

    lab@Hong_Kong> telnet 192.168.32.1 port 5060 Trying 192.168.32.1...telnet: connect to address 192.168.32.1: Connection refusedtelnet: Unable to connect to remote host

    Connection failure is expected

  • 8/10/2019 ClassOfService _junos

    58/71

    58 Copyright 2009 Juniper Networks, Inc. www.juniper.net

    CONFIRMING INGRESS CLASSIFICATION Adding a count or log action modifier to a multifield classifier canassist in troubleshooting

    In this example, the MF classifier at San_Jose works as intended:

    lab@San_Jose> show interfaces fe-0/0/1 detail | find Queue CoS queues : 4 supportedHold-times : Up 0 ms, Down 0 msCurrent address: 00:90:69:6d:98:01, Hardware address: 00:90:69:6d:98:01Last flapped : 2003-11-22 19:49:35 UTC (00:00:14 ago)Statistics last cleared: 2003-11-22 19:49:23 UTC (00:00:26 ago)Traffic statistics:

    Input bytes : 556 0 bpsOutput bytes : 644 0 bpsInput packets: 7 0 ppsOutput packets: 8 0 pps

    Queue counters: Queued packets Transmitted packets Dropped packets0 best-effort 5 5 01 expedited-fo 1 1 02 assured-forw 0 0 03 network-cont 2 2 0

    Active alarms : LINKActive defects : LINK

    . . .

  • 8/10/2019 ClassOfService _junos

    59/71

    59 Copyright 2009 Juniper Networks, Inc. www.juniper.net

    CONFIRMING INGRESS POLICING

    Rapid pings with large packet sizes exceed the BE policer profile

    Excess traffic is marked, not discarded in this example

    lab@Hong_Kong> ping 192.168.32.1 rapid size 40000 count 20 PING 192.168.32.1 (192.168.32.1): 40000 data bytes....................--- 192.168.32.1 ping statistics ---20 packets transmitted, 0 packets received, 100% packet loss

    lab@SanJose> show firewall Filter: __default_bpdu_filter__

    Filter: mf-classifyPolicers:Name Packetspolice-be-3 480

  • 8/10/2019 ClassOfService _junos

    60/71

    60 Copyright 2009 Juniper Networks, Inc. www.juniper.net

    lab@San_Jose> show interfaces queue fe-0/0/1 Physical interface: fe-0/0/1, Enabled, Physical link is Up

    Interface index: 129, SNMP ifIndex: 32Forwarding classes: 4 supported, 4 in useQueues: 4 supported, 4 in useQueue: 0, Forwarding classes: best-effort

    Queued:Packets : 560 0 pps

    Bytes : 811360 0 bpsTransmitted:Packets : 340 0 ppsBytes : 486120 0 bpsTail-dropped packets : 0 0 ppsRED-dropped packets : 220 0 pps

    Low, non-TCP : 40 0 ppsLow, TCP : 0 0 ppsHigh, non-TCP : 180 0 ppsHigh, TCP : 0 0 pps

    RED-dropped bytes : 330000 0 bpsLow, non-TCP : 60000 0 bpsLow, TCP : 0 0 bpsHigh, non-TCP : 270000 0 bpsHigh, TCP : 0 0 bps

    . . .

    CONFIRMING INGRESS SCHEDULERRapid pings exceed 1-Mbps limit of BE scheduler

  • 8/10/2019 ClassOfService _junos

    61/71

    61 Copyright 2009 Juniper Networks, Inc. www.juniper.net

    DISPLAYING FC-TO-QUEUE MAPPINGS

    This display shows the default FC-to-queue mappings Additional mappings possible to support T-series systems using morethan four queues

    lab@Denver> show class-of-service forwarding-class

    Forwarding class Queuebest-effort 0expedited-forwarding 1assured-forwarding 2network-control 3

  • 8/10/2019 ClassOfService _junos

    62/71

    62 Copyright 2009 Juniper Networks, Inc. www.juniper.net

    CONFIRMING TRANSIT CLASSIFICATION

    Displaying queue statistics for a transit nodes egress interface

    confirms BA classificationThe counters match the results of ingress classification

    lab@Denver> show interfaces so-0/1/1 detail | find Queue CoS queues : 4 supportedLast flapped : 2003-11-20 16:29:27 UTC (00:32:40 ago)

    Statistics last cleared: 2003-11-20 17:00:16 UTC (00:01:51 ago)Traffic statistics:

    Input bytes : 1788 40 bpsOutput bytes : 2156 48 bpsInput packets: 44 0 ppsOutput packets: 46 0 pps

    Queue counters: Queued packets Transmitted packets Dropped packets

    0 best-effort 5 5 01 expedited-fo 1 1 02 assured-forw 0 0 03 network-cont 39 39 0

    SONET alarms : NoneSONET defects : None. . .

  • 8/10/2019 ClassOfService _junos

    63/71

    63 Copyright 2009 Juniper Networks, Inc. www.juniper.net

    DISPLAYING THE DSCP CLASSIFIERlab@Denver> show class-of-service classifier ? Possible completions:

    Execute this command

    name Name of classifiertype Type of classifier| Pipe through a command

    lab@Denver> show class-of-service classifier name voip-dscp-classifier Classifier: voip-dscp-classifier, Code point type: dscp, Index: 62709

    Code point Forwarding class Loss priority000000 best-effort low

    000001 best-effort high000010 best-effort low000011 best-effort low000100 best-effort low000101 best-effort low000110 best-effort low000111 best-effort low001000 best-effort low

    001001 best-effort low001010 assured-forwarding low001011 best-effort low001100 assured-forwarding high001101 best-effort low001110 assured-forwarding high001111 best-effort low

    . . .

  • 8/10/2019 ClassOfService _junos

    64/71

    64 Copyright 2009 Juniper Networks, Inc. www.juniper.net

    DISPLAYING THE DSCP REWRITE TABLE

    lab@Denver> show class-of-service rewrite-rule ?

    Possible completions: Execute this commandname Name of rewrite ruletype Type of rewrite rule| Pipe through a command

    lab@Denver> show class-of-service rewrite-rule name voip-dscp-rewrite

    Rewrite rule: voip-dscp-rewrite, Code point type: dscp, Index: 62398Forwarding class Loss priority Code pointbest-effort low 000000best-effort high 000001expedited-forwarding low 101110expedited-forwarding high 101110assured-forwarding low 001010assured-forwarding high 001100network-control low 110000network-control high 111000

  • 8/10/2019 ClassOfService _junos

    65/71

    65 Copyright 2009 Juniper Networks, Inc. www.juniper.net

    DISPLAYING THE SCHEDULER MAPlab@Denver> show class-of-service scheduler-map ? Possible completions:

    Execute this command Name of scheduler map| Pipe through a command

    lab@Denver> show class-of-service scheduler-map voip-case Scheduler map: voip-case, Index: 56711

    Scheduler: be-scheduler, Forwarding class: best-effort, Index: 4154Transmit rate: 1000000 bps, Rate Limit: exact, Buffer size: remainder, Priority: low

    Drop profiles:Loss priority Protocol Index NameLow non-TCP 1 Low TCP 40376 low-redHigh non-TCP 1 High TCP 53001 high-red

    Scheduler: ef-scheduler, Forwarding class: expedited-forwarding, Index: 5046

    Transmit rate: 20000000 bps, Rate Limit: none, Buffer size: 200 us, Priority: highDrop profiles:

    Loss priority Protocol Index NameLow non-TCP 1 Low TCP 1 High non-TCP 1 High TCP 1

    . . .

  • 8/10/2019 ClassOfService _junos

    66/71

    66 Copyright 2009 Juniper Networks, Inc. www.juniper.net

    DISPLAYING INTERFACE COS SETTINGSlab@San_Jose> show class-of-service interface fe-0/0/1 Physical interface: fe-0/0/1, Index: 129

    Queues supported: 4, Queues in use: 4Scheduler map: voip-case, Index: 56711

    Logical interface: fe-0/0/1.0, Index: 68Object Name Type IndexRewrite voip-dscp-rewrite dscp 62398Rewrite exp-default exp 2

    Classifier ipprec-compatibility ip 5

    lab@Denver> show class-of-service interface fe-0/0/1 Physical interface: fe-0/0/1, Index: 129Queues supported: 4, Queues in use: 4

    Scheduler map: , Index: 1

    Logical interface: fe-0/0/1.0, Index: 67Object Name Type IndexRewrite exp-default exp 2Classifier voip-dscp-classifier dscp 62709

    Egress interface CoS settings

    Ingress interface CoS settings

  • 8/10/2019 ClassOfService _junos

    67/71

    67 Copyright 2009 Juniper Networks, Inc. www.juniper.net

    DISPLAYING DROP PROFILES

    lab@San_Jose> show class-of-service drop-profile ?Possible completions:

    Execute this command Name of drop profile| Pipe through a command

    lab@San_Jose> show class-of-service drop-profile Drop profile: , Type: discrete, Index: 1

    Fill level Drop probability100 100

    Drop profile: high-red, Type: discrete, Index: 53001Fill level Drop probability

    50 10Drop profile: low-red, Type: discrete, Index: 40376

    Fill level Drop probability

    80 10

  • 8/10/2019 ClassOfService _junos

    68/71

    68 Copyright 2009 Juniper Networks, Inc. www.juniper.net

    DISPLAYING FORWARDING TABLE COS SETTINGSlab@Denver> show class-of-service forwarding-table ? Possible completions:

    Execute this commandclassifier Show classifier informationdrop-profile Show RED drop profilepolicer Show policerrewrite-rule Show rewrite informationscheduler-map Show scheduler mapshaper Show shaper| Pipe through a command

    lab@Denver> show class-of-service forwarding-table classifier mapping Table Index/Interface Index Q num Table typefe-0/0/1.0 69 62709 DSCPso-0/1/1.0 70 5 IPv4 precedence

    lab@Denver> show class-of-service forwarding-table scheduler-map Interface: fe-0/0/0 (Index: 128, Map index: 1, Num of queues: 2):

    Entry 0 (Scheduler index: 2, Queue #: 0):Tx rate: 0 Kb (95%), Buffer size: 95 percentPLP high: 1, PLP low: 1, TCP PLP high: 1, TCP PLP low: 1

    Entry 1 (Scheduler index: 4, Queue #: 3):Tx rate: 0 Kb (5%), Buffer size: 5 percentPLP high: 1, PLP low: 1, TCP PLP high: 1, TCP PLP low: 1

    . . .

  • 8/10/2019 ClassOfService _junos

    69/71

    69 Copyright 2009 Juniper Networks, Inc. www.juniper.net

    DISPLAYING COS QUEUING INFORMATION

    lab@Denver> show interfaces queue so-0/1/1 Physical interface: so-0/1/1, Enabled, Physical link is Up

    Interface index: 133, SNMP ifIndex: 27Forwarding classes: 4 supported, 4 in useQueues: 4 supported, 4 in useQueue: 0, Forwarding classes: best-effort

    Queued:Packets : 5 0 ppsBytes : 420 0 bps

    Transmitted:Packets : 5 0 ppsBytes : 445 0 bpsTail-dropped packets : 0 0 ppsRED-dropped packets : 0 0 pps

    Low, non-TCP : 0 0 ppsLow, TCP : 0 0 ppsHigh, non-TCP : 0 0 pps

    High, TCP : 0 0 ppsRED-dropped bytes : 0 0 bpsLow, non-TCP : 0 0 bpsLow, TCP : 0 0 bpsHigh, non-TCP : 0 0 bpsHigh, TCP : 0 0 bps

    . . .

    DISPLAYING COS RELATED INTERFACE COUNTERS

  • 8/10/2019 ClassOfService _junos

    70/71

    70 Copyright 2009 Juniper Networks, Inc. www.juniper.net

    DISPLAYING COS-RELATED INTERFACE COUNTERS

    lab@Denver> show interfaces so-0/1/1 extensive Physical interface: so-0/1/1, Enabled, Physical link is Up

    . . .CoS queues : 4 supported

    Last flapped : 2003-11-20 16:29:27 UTC (02:33:14 ago)Statistics last cleared: 2003-11-20 17:00:16 UTC (02:02:25 ago)Traffic statistics:

    Input bytes : 79992 264 bpsOutput bytes : 831808 288 bpsInput packets: 2372 0 ppsOutput packets: 2890 0 pps

    . . .Queue counters: Queued packets Transmitted packets Dropped packets

    0 best-effort 544 544 01 expedited-fo 2 2 02 assured-forw 0 0 03 network-cont 2343 2343 0

    . . .Packet Forwarding Engine configuration:

    Destination slot: 0, PLP byte: 1 (0x00)CoS transmit queue Bandwidth Buffer Priority Limit

    % bps % bytes0 best-effort 0 1000000 50 0 low exact1 expedited-forwarding 12 20000000 0 200 high none3 network-control 5 7776000 50 0 low none

    . . .

  • 8/10/2019 ClassOfService _junos

    71/71