My Countingdown

Friday, December 16, 2011

Lab 1. QOS - Match IP Precedence


QOS is my weakness I guess :( Maybe because I never do all labs. So let’s study QoS…
For more summary about QoS please refer to http://pursuingmydestiny.blogspot.com/2011/12/qos-summary.html.

What is IP Precedence??? Please have a look again my QoS summary that may help you.
Now let’s do lab to match IP Precedence…

R1#
interface Loopback0
 ip address 1.1.1.1 255.255.255.255
!
interface FastEthernet0/0
 ip address 12.12.12.1 255.255.255.0

R2#
interface Loopback0
 ip address 2.2.2.2 255.255.255.255
!
interface FastEthernet0/0
 ip address 12.12.12.2 255.255.255.0

As you know, there are 3 step in creating QoS using MQC:
  1. Configure class-map
  2. Configure policy-map
  3. Then assign the QoS in interface by using service-policy
Let’s create class-map for classification:

R1#
class-map match-all QOS7
 match ip precedence 7

class-map match-all QOS6
 match ip precedence 6

class-map match-all QOS5
 match ip precedence 5

class-map match-all QOS4
 match ip precedence 4

class-map match-all QOS3
 match ip precedence 3

class-map match-all QOS2
 match ip precedence 2

class-map match-all QOS1
 match ip precedence 1

class-map match-all QOS0
 match ip precedence 0

Then let’s make policy

R1#
policy-map EXCERCISE
 class QOS0
 class QOS1
 class QOS2
 class QOS3
 class QOS4
 class QOS5
 class QOS6
 class QOS7

After that let’s assign the policy to the interface

R1#
interface FastEthernet0/0
service-policy input EXCERCISE

IP Precedence use 8 bit but we use only the first 3 bits of IP TOS field

?
?
?





Note -> IP Precedence begin from 5th bit

Here the mapping from binary to decimal:

Level
Precedence
Binary
Decimal
TOS Level
0
Routine
20
0
0-31
1
Priority
25
32
32-63
2
Immediate
26
64
64-95
3
Flash
26+25
96
96-127
4
Flash override
27
128
128-159
5
Critical
27+25
160
160-191
6
Internetwork control
27+26
192
192-223
7
Network control
27+26+26
224
224-255

Now let’s do test the QoS using ping extended by setting Type of service (TOS).

R2#ping
Protocol [ip]:
Target IP address: 12.12.12.1
Repeat count [5]:
Datagram size [100]:
Timeout in seconds [2]:
Extended commands [n]: y
Source address or interface:
Type of service [0]: 165
Set DF bit in IP header? [no]:
Validate reply data? [no]:
Data pattern [0xABCD]:
Loose, Strict, Record, Timestamp, Verbose[none]:
Sweep range of sizes [n]:
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 12.12.12.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 16/30/48 ms

Based on diagram it should be in IP Precedence critical (QOS5). Let’s verify the policy-map in interface fa0/0.

R1(config)#do sh policy-map int f0/0
 FastEthernet0/0

  Service-policy input: EXCERCISE

    Class-map: QOS0 (match-all)
      0 packets, 0 bytes
      5 minute offered rate 0 bps
      Match: ip precedence 0

    Class-map: QOS1 (match-all)
      0 packets, 0 bytes
      5 minute offered rate 0 bps
      Match: ip precedence 1

    Class-map: QOS2 (match-all)
      0 packets, 0 bytes
      5 minute offered rate 0 bps
      Match: ip precedence 2

    Class-map: QOS3 (match-all)
      0 packets, 0 bytes
      5 minute offered rate 0 bps
      Match: ip precedence 3

    Class-map: QOS4 (match-all)
      0 packets, 0 bytes
      5 minute offered rate 0 bps
      Match: ip precedence 4

    Class-map: QOS5 (match-all)
      5 packets, 570 bytes
      5 minute offered rate 0 bps
      Match: ip precedence 5

    Class-map: QOS6 (match-all)
      829 packets, 61362 bytes
      5 minute offered rate 0 bps
      Match: ip precedence 6

    Class-map: QOS7 (match-all)
      0 packets, 0 bytes
      5 minute offered rate 0 bps
      Match: ip precedence 7

    Class-map: class-default (match-any)
      0 packets, 0 bytes
      5 minute offered rate 0 bps, drop rate 0 bps
      Match: any

No comments:

Post a Comment