ON THIS PAGE
Example: Configuring DiffServ for IPv6
Configuration
The example assigns expedited forwarding to Q1 and a subset of the assured forwarding classes (af1x) to Q2, and distributes resources among all four forwarding classes.
Figure 1 shows the topology of the three routers and links that are used as a case study in this chapter.
In this case study, the service provider has agreed to provide high-priority delivery of packets for two applications between the customer’s servers at two sites. The first application generates streams of high-definition audiovisual (television) packet flows and the second generates large quantities of time-sensitive financial information. In all cases, the packet flow is from server to server. The service provider marks the packets appropriately as they enter the network from either site, configures special queues and forwarding classes for this traffic on the three routers, and uses DiffServ for IPv6 for this purpose.
Routers 1 and 3 use multifield (MF) classifiers on the customer-facing interfaces to detect high-priority packets and rewrite the Differentiated Services code points (DSCPs) appropriately. Best-effort data and network control packets are not affected. All three routers are configured with consistent schedulers and resources to handle high-priority packets properly.
Figure 2 shows the complete topology for IPv6 DiffServ, complete with interfaces and IPv6 addresses. The IPv4-mapped IPv6 address format described in RFC 5952 is used.
Begin your configuration on Router 2, the core router. This ensures that when DiffServ is enabled on the edge routers, class of service (CoS) is enabled end to end through the network. The core router configuration is a little simpler because no MF classification is configured in the core.
Router 2
[edit] class-of-service { classifiers { # Router 2 classifiers. dscp-ipv6 IPv6-classifier { import default; # Uses the DSCP default map. forwarding-class be-DATA-class { loss-priority high code-points 000001; } forwarding-class ef-FIN-class { loss-priority high code-points 101111; } forwarding-class af-AV-class { loss-priority high code-points 001100; } forwarding-class nc-CONTROL-class { loss-priority high code-points 110001; } } } drop-profiles { # Router 2 drop profiles. af-AV-normal { interpolate { fill-level [95 100]; drop-probability [0 100]; } } af-AV-with-PLP { interpolate { fill-level [60 70 80 90 95]; drop-probability [80 90 95 97 100]; } } } forwarding-classes { # Router 2 forwarding classes. queue 0 be-DATA-class; queue 1 ef-FIN-class; queue 2 af-AV-class; queue 3 nc-CONTROL-class; } interfaces { # Router 2 class-of-service interfaces. so-1/0/1 { # Connected to R1. scheduler-map diffserv-cos-map; unit 0 { classifiers { dscp-ipv6 IPv6-classifier; } rewrite-rules { dscp-ipv6 rewrite-IPv6-dscp; } } } so-1/0/2 { # Connected to R3. scheduler-map diffserv-cos-map; unit 0 { classifiers { dscp-ipv6 IPv6-classifier; } rewrite-rules { dscp-ipv6 rewrite-IPv6-dscp; } } } } rewrite-rules rewrite-IPv6-dscps { # Router 2 rewrite rules. forwarding-class be-DATA-class { loss-priority low code points 000000; loss-priority high code points 000001; } forwarding-class ef-FIN-class { loss-priority low code points 101110; loss-priority high code points 101111; } forwarding-class af-AV-class { loss-priority low code points 001010; loss-priority high code points 001100; } forwarding-class nc-CONTROL-class { loss-priority low code points 110000; loss-priority high code points 110001; } } scheduler-maps { # Router 2 scheduler maps. diffserv-cos-map { forwarding-class be-DATA-class scheduler be-DATA-scheduler; forwarding-class ef-FIN-class scheduler ef-FIN-scheduler; forwarding-class af-AV-class scheduler af-AV-scheduler; forwarding-class nc-CONTROL-class scheduler nc-CONTROL-scheduler; } } schedulers { # Router 2 schedulers. be-DATA-scheduler { transmit-rate percent 40; buffer-size percent 40; priority low; } ef-FIN-scheduler { transmit-rate percent 10; buffer-size percent 10; priority high; } af-AV-scheduler { transmit-rate percent 45; buffer-size percent 45; priority high; drop-profile-map loss-priority low protocol any drop-profile af-AV-normal; drop-profile-map loss-priority high protocol any drop-profile af-AV-with-PLP; } nc-CONTROL-scheduler { transmit-rate percent 5; buffer-size percent 5; priority low; } } } interfaces { # R2 interfaces. so-1/0/1 { # Connected to R1. unit 0 { family inet { address 10.0.0.1/24; } family inet6 { address 0:0:FFFF:10.0.0.1/120; } } } so-1/0/2 { # Connected to R3. unit 0 { family inet { address 10.0.1.1/24; } family inet6 { address 0:0:FFFF:10.0.1.1/120; } } } }
Continue your configuration on Router 1 and Router 3, the edge routers. These routers get firewall-filter-based MF classifiers and rewrite rules for markers as well as schedulers and drop profiles on the core-facing interfaces.
Router 1
[edit] class-of-service { classifiers { # Router 1 classifiers. dscp-ipv6 IPv6-classifier { import default; # Uses the DSCP default map. forwarding-class be-DATA-class { loss-priority high code-points 000001; } forwarding-class ef-FIN-class { loss-priority high code-points 101111; } forwarding-class af-AV-class { loss-priority high code-points 001100; } forwarding-class nc-CONTROL-class { loss-priority high code-points 110001; } } } drop-profiles { # Router 1 drop profiles. af-AV-normal { interpolate { fill-level [95 100]; drop-probability [0 100]; } } af-AV-with-PLP { interpolate { fill-level [60 70 80 90 95]; drop-probability [80 90 95 97 100]; } } } forwarding-classes { # Router 1 forwarding classes. queue 0 be-DATA-class; queue 1 ef-FIN-class; queue 2 af-AV-class; queue 3 nc-CONTROL-class; } interfaces { # Router 1 class-of-service interfaces. so-0/1/1 { # To servers. scheduler-map diffserv-cos-map; unit 0 { classifiers { dscp-ipv6 IPv6-classifier; } rewrite-rules { dscp-ipv6 rewrite-IPv6-dscp; } } } rewrite-rules rewrite-IPv6-dscps { # Router 1 rewrite rules. forwarding-class be-DATA-class { loss-priority low code points 000000; loss-priority high code points 000001; } forwarding-class ef-FIN-class { loss-priority low code points 101110; loss-priority high code points 101111; } forwarding-class af-AV-class { loss-priority low code points 001010; loss-priority high code points 001100; } forwarding-class nc-CONTROL-class { loss-priority low code points 110000; loss-priority high code points 110001; } } scheduler-maps { # Router 1 scheduler map. diffserv-cos-map { forwarding-class be-DATA-class scheduler be-DATA-scheduler; forwarding-class ef-FIN-class scheduler ef-FIN-scheduler; forwarding-class af-AV-class scheduler af-AV-scheduler; forwarding-class nc-CONTROL-class scheduler nc-CONTROL-scheduler; } } schedulers { # Router 1 schedulers. be-DATA-scheduler { transmit-rate percent 40; buffer-size percent 40; priority low; } ef-FIN-scheduler { transmit-rate percent 10; buffer-size percent 10; priority high; } af-AV-scheduler { transmit-rate percent 45; buffer-size percent 45; priority high; drop-profile-map loss-priority low protocol any drop-profile af-AV-normal; drop-profile-map loss-priority high protocol any drop-profile af-AV-with-PLP; } nc-CONTROL-scheduler { transmit-rate percent 5; buffer-size percent 5; priority low; } } } firewall { # Router 1 firewall policer and filter. policer ef-FIN-Policer-Profile { if-exceeding { bandwidth-percent 10; burst-size-limit 2k; } then loss-priority high; } family inet6 { filter mf-classifier { filter-specific; term AV { from { destination-address { 0:0:FFFF:172.16.79.11; } } then { loss-priority low; forwarding-class af-AV-class; } } term Finance { from { destination-address { O:0:FFFF:172.16.79.63; } } then { policer ef-FIN-Policer-Profile; forwarding-class ef-FIN-class; } } term Network-Control { from { traffic-class 192; # 192 is the 110000 traffic class. } then { forwarding-class nc-CONTROL-class; # This is network control traffic. } } term Data { then forwarding-class be-DATA-class; # The rest is data. } } } } interfaces { # Router 1 interfaces. so-0/0/1 { # To servers. unit 0 { family inet { address 192.168.54.1/24; } family inet6 { filter { input mf-classifier; } address 0:0:FFFF:192.168.54.1/120; } } } so-0/1/1 { # Connected to R2. unit 0 { family inet { address 10.0.0.2/24; } family inet6 { address 0:0:FFFF:10.0.0.2/120; } } } } }
Router 3
[edit] class-of-service { classifiers { # Router 3 classifiers. dscp-ipv6 IPv6-classifier { import default; # Uses the DSCP default map. forwarding-class be-DATA-class { loss-priority high code-points 000001; } forwarding-class ef-FIN-class { loss-priority high code-points 101111; } forwarding-class af-AV-class { loss-priority high code-points 001100; } forwarding-class nc-CONTROL-class { loss-priority high code-points 110001; } } } drop-profiles { # Router 3 drop profiles. af-AV-normal { interpolate { fill-level [95 100]; drop-probability [0 100]; } } af-AV-with-PLP { interpolate { fill-level [60 70 80 90 95]; drop-probability [80 90 95 97 100]; } } } forwarding-classes { # Router 3 forwarding classes. queue 0 be-DATA-class; queue 1 ef-FIN-class; queue 2 af-AV-class; queue 3 nc-CONTROL-class; } interfaces { # Router 3 class-of-service interfaces. so-2/0/1 { # To servers. scheduler-map diffserv-cos-map; unit 0 { classifiers { dscp-ipv6 IPv6-classifier; } rewrite-rules { dscp-ipv6 rewrite-IPv6-dscp; } } } rewrite-rules rewrite-IPv6-dscps { # Router 3 rewrite rules. forwarding-class be-DATA-class { loss-priority low code points 000000; loss-priority high code points 000001; } forwarding-class ef-FIN-class { loss-priority low code points 101110; loss-priority high code points 101111; } forwarding-class af-AV-class { loss-priority low code points 001010; loss-priority high code points 001100; } forwarding-class nc-CONTROL-class { loss-priority low code points 110000; loss-priority high code points 110001; } } scheduler-maps { # Router 3 scheduler map. diffserv-cos-map { forwarding-class be-DATA-class scheduler be-DATA-scheduler; forwarding-class ef-FIN-class scheduler ef-FIN-scheduler; forwarding-class af-AV-class scheduler af-AV-scheduler; forwarding-class nc-CONTROL-class scheduler nc-CONTROL-scheduler; } } schedulers { # Router 3 schedulers. be-DATA-scheduler { transmit-rate percent 40; buffer-size percent 40; priority low; } ef-FIN-scheduler { transmit-rate percent 10; buffer-size percent 10; priority high; } af-AV-scheduler { transmit-rate percent 45; buffer-size percent 45; priority high; drop-profile-map loss-priority low protocol any drop-profile af-AV-normal; drop-profile-map loss-priority high protocol any drop-profile af-AV-with-PLP; } nc-CONTROL-scheduler { transmit-rate percent 5; buffer-size percent 5; priority low; } } firewall { # Router 3 firewall policer and filter. policer ef-FIN-Policer-Profile { if-exceeding { bandwidth-percent 10; burst-size-limit 2k; } then loss-priority high; } family inet6 { filter mf-classifier { filter-specific; term AV { from { destination-address { 0:0:FFFF:172.16.79.11; } } then { loss-priority low; forwarding-class af-AV-class; } } term Finance { from { destination-address { O:0:FFFF:172.16.79.63; } } then { policer ef-FIN-Policer-Profile; forwarding-class ef-FIN-class; } } term Network-Control { from { traffic-class 192; # 192 is the 110000 traffic class. } then { forwarding-class nc-CONTROL-class; # This is network control traffic. } } term Data { then forwarding-class be-DATA-class; # The rest is data. } } } } interfaces { # Router 3 interfaces. so-2/0/0 { # To servers. unit 0 { family inet { address 1172.16.79.1/24; } family inet6 { filter { input mf-classifier; } address 0:0:FFFF:172.16.79.1/120; } } } so-2/0/1 { # to R2 unit 0 { family inet { address 10.0.1.2/24; } family inet6 { address 0:0:FFFF:10.0.1.2/120; } } } } } }
Verification
To verify that your CoS using IPv6 DiffServ configuration is correct, use the following commands:
show class-of-service classifier type dscp-ipv6
show class-of-service rewrite-rule type dscp-ipv6
show class-of-service interface
show class-of-service forwarding-table classifier mapping
show class-of-service forwarding-table rewrite-rule mapping
show class-of-service scheduler-map
scheduler-map-nameshow class-of-service forwarding-table scheduler-map
The following section shows the output of these commands used with the configuration example.
DiffServ Classifiers
user@R1> show class-of-service classifier type dscp-ipv6 Classifier: dscp-ipv6-default, Code point type: dscp-ipv6, Index: 4 Code point Forwarding class Loss priority 000000 be-DATA-class low 000001 be-DATA-class low 000010 be-DATA-class low 000011 be-DATA-class low 000100 be-DATA-class low 000101 be-DATA-class low 000110 be-DATA-class low 000111 be-DATA-class low 001000 be-DATA-class low 001001 be-DATA-class low 001010 af-AV-class low 001011 be-DATA-class low 001100 af-AV-class high 001101 be-DATA-class low 001110 af-AV-class high 001111 be-DATA-class low 010000 be-DATA-class low 010001 be-DATA-class low 010010 be-DATA-class low 010011 be-DATA-class low 010100 be-DATA-class low 010101 be-DATA-class low 010110 be-DATA-class low 010111 be-DATA-class low 011000 be-DATA-class low 011001 be-DATA-class low 011010 be-DATA-class low 011011 be-DATA-class low 011100 be-DATA-class low 011101 be-DATA-class low 011110 be-DATA-class low 011111 be-DATA-class low 100000 be-DATA-class low 100001 be-DATA-class low 100010 be-DATA-class low 100011 be-DATA-class low 100100 be-DATA-class low 100101 be-DATA-class low 100110 be-DATA-class low 100111 be-DATA-class low 101000 be-DATA-class low 101001 be-DATA-class low 101010 be-DATA-class low 101011 be-DATA-class low 101100 be-DATA-class low 101101 be-DATA-class low 101110 ef-FIN-class low 101111 be-DATA-class low 110000 nc-CONTROL-class low 110001 be-DATA-class low 110010 be-DATA-class low 110011 be-DATA-class low 110100 be-DATA-class low 110101 be-DATA-class low 110110 be-DATA-class low 110111 be-DATA-class low 111000 nc-CONTROL-class low 111001 be-DATA-class low 111010 be-DATA-class low 111011 be-DATA-class low 111100 be-DATA-class low 111101 be-DATA-class low 111110 be-DATA-class low 111111 be-DATA-class low Classifier: IPv6-classifier, Code point type: dscp-ipv6, Index: 18301 Code point Forwarding class Loss priority 000000 be-DATA-class low 000001 be-DATA-class high 000010 be-DATA-class low 000011 be-DATA-class low 000100 be-DATA-class low 000101 be-DATA-class low 000110 be-DATA-class low 000111 be-DATA-class low 001000 be-DATA-class low 001001 be-DATA-class low 001010 af-AV-class low 001011 be-DATA-class low 001100 af-AV-class high 001101 be-DATA-class low 001110 af-AV-class high 001111 be-DATA-class low 010000 be-DATA-class low 010001 be-DATA-class low 010010 be-DATA-class low 010011 be-DATA-class low 010100 be-DATA-class low 010101 be-DATA-class low 010110 be-DATA-class low 010111 be-DATA-class low 011000 be-DATA-class low 011001 be-DATA-class low 011010 be-DATA-class low 011011 be-DATA-class low 011100 be-DATA-class low 011101 be-DATA-class low 011110 be-DATA-class low 011111 be-DATA-class low 100000 be-DATA-class low 100001 be-DATA-class low 100010 be-DATA-class low 100011 be-DATA-class low 100100 be-DATA-class low 100101 be-DATA-class low 100110 be-DATA-class low 100111 be-DATA-class low 101000 be-DATA-class low 101001 be-DATA-class low 101010 be-DATA-class low 101011 be-DATA-class low 101100 be-DATA-class low 101101 be-DATA-class low 101110 ef-FIN-class low 101111 ef-FIN-class high 110000 nc-CONTROL-class low 110001 nc-CONTROL-class high 110010 be-DATA-class low 110011 be-DATA-class low 110100 be-DATA-class low 110101 be-DATA-class low 110110 be-DATA-class low 110111 be-DATA-class low 111000 nc-CONTROL-class low 111001 be-DATA-class low 111010 be-DATA-class low 111011 be-DATA-class low 111100 be-DATA-class low 111101 be-DATA-class low 111110 be-DATA-class low 111111 be-DATA-class low
Rewrite Rules
user@R1> show class-of-service rewrite-rule type dscp-ipv6 Rewrite rule: dscp-ipv6-default, Code point type: dscp-ipv6, Index: 20 Forwarding class Loss priority Code point be-DATA-class low 000000 be-DATA-class high 000000 ef-FIN-class low 101110 ef-FIN-class high 101110 af-AV-class low 001010 af-AV-class high 001100 nc-CONTROL-class low 110000 nc-CONTROL-class high 111000 Rewrite rule: rewrite-IPv6-dscp, Code point type: dscp-ipv6, Index: 58077 Forwarding class Loss priority Code point be-DATA-class low 000000 be-DATA-class high 000001 ef-FIN-class low 101110 ef-FIN-class high 101111 af-AV-class low 001010 af-AV-class high 001100 nc-CONTROL-class low 110000 nc-CONTROL-class high 110001
Class-of-Service Interfaces
user@R1> show class-of-service interface ... Physical interface: so-0/0/1, Index: 141 Queues supported: 4, Queues in use: 4 Scheduler map: diffserv-cos-map, Index: -543019056 Logical interface: so-0/0/1.0, Index: 68 Object Name Type Index Rewrite rewrite-IPv6-dscp dscp-ipv6 58077 Rewrite exp-default exp 21 Classifier IPv6-classifier dscp-ipv6 18301 Classifier exp-default exp 5 ... Physical interface: so-0/1/1, Index: 144 Queues supported: 4, Queues in use: 4 Scheduler map: <default>, Index: -113795564 Logical interface: so-0/1/1.0, Index: 69 Object Name Type Index Rewrite exp-default exp 21 Classifier exp-default exp 5 Classifier ipprec-compatibility ip 8
Classifier Mapping
user@R1> show class-of-service forwarding-table classifier mapping Table Index/ Interface Index Q num Table type so-0/0/1.0 68 18301 IPv6 DSCP so-0/1/1.0 69 8 IPv4 precedence
Rewrite Rule Mapping
user@R1> show class-of-service forwarding-table rewrite-rule mapping Interface Index Table index Type so-0/1/1.0 68 58077 IPv6 DSCP
Scheduler Map
user@R1> show class-of-service scheduler-map diffserv-cos-map Scheduler map: diffserv-cos-map, Index: 1094596010 Scheduler: be-DATA-scheduler, Forwarding class: be-DATA-class, Index: 14343 Transmit rate: 40 percent, Rate Limit: none, Buffer size: 40 percent, Priority: low Drop profiles: Loss priority Protocol Index Name Low non-TCP 1 <default-drop-profile> Low TCP 1 <default-drop-profile> High non-TCP 1 <default-drop-profile> High TCP 1 <default-drop-profile> Scheduler: ef-FIN-scheduler, Forwarding class: ef-FIN-class, Index: 21707 Transmit rate: 10 percent, Rate Limit: none, Buffer size: 10 percent, Priority: high Drop profiles: Loss priority Protocol Index Name Low non-TCP 1 <default-drop-profile> Low TCP 1 <default-drop-profile> High non-TCP 1 <default-drop-profile> High TCP 1 <default-drop-profile> Scheduler: af-AV-scheduler, Forwarding class: af-AV-class, Index: 51704 Transmit rate: 45 percent, Rate Limit: none, Buffer size: 45 percent, Priority: high Drop profiles: Loss priority Protocol Index Name Low non-TCP 61474 af-AV-normal Low TCP 61474 af-AV-normal High non-TCP 65199 af-AV-with-PLP High TCP 65199 af-AV-with-PLP Scheduler: nc-CONTROL-scheduler, Forwarding class: nc-CONTROL-class, Index: 50404 Transmit rate: 5 percent, Rate Limit: none, Buffer size: 5 percent, Priority: low Drop profiles: Loss priority Protocol Index Name Low non-TCP 1 <default-drop-profile> Low TCP 1 <default-drop-profile> High non-TCP 1 <default-drop-profile> High TCP 1 <default-drop-profile> user@R1> show class-of-service forwarding-table scheduler-map ... Interface: so-0/0/1 (Index: 141, Map index: -543019056, Map type: FINAL, Num of queues: 4): Entry 0 (Scheduler index: 14343, Queue #: 0): Tx rate: 0 Kb (40%), Buffer size: 40 percent Priority low PLP high: 1, PLP low: 1, TCP PLP high: 1, TCP PLP low: 1 Entry 1 (Scheduler index: 21707, Queue #: 1): Tx rate: 0 Kb (10%), Buffer size: 10 percent Priority high PLP high: 1, PLP low: 1, TCP PLP high: 1, TCP PLP low: 1 Entry 2 (Scheduler index: 51704, Queue #: 2): Tx rate: 0 Kb (45%), Buffer size: 45 percent Priority high PLP high: 65199, PLP low: 61474, TCP PLP high: 65199, TCP PLP low: 61474 Entry 3 (Scheduler index: 50404, Queue #: 3): Tx rate: 0 Kb (5%), Buffer size: 5 percent Priority low PLP high: 1, PLP low: 1, TCP PLP high: 1, TCP PLP low: 1 ...