cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2494
Views
3
Helpful
24
Replies

Applying QoS based on ToS on a switchport

jlixfeld
Level 1
Level 1

I'm trying to wrap my head around QoS and I guess I have to start at the beginning - classification. I have a TDM to IP device that sets a ToS value of 0x08 to packets before it forwards the frame out towards the LAN.

Now as I understand it, ToS is an IP tag so I'm having a hard time understanding whether or not a L2 switch can read the ToS bit, map it to CoS to send about the LAN to the router, at which point CoS is mapped to DSCP, shipped out the WAN to the far end router where DSCP is mapped back to CoS to it's destination port.

I understand that the next steps are Policing, Marking and Queuing, and I'll cross those bridges when I come to them, but at this point, I think I just need to understand how the classification works on an L2 switch. The switch in question is a 2970 running 12.2(25)SEB4.

Thanks in advance.

24 Replies 24

Collin Clark
VIP Alumni
VIP Alumni

If your device marks ToS only, have your switch map it DSCP. CoS/ToS are older and are generally only used by legacy equipment. Once you remark ToS to DSCP there is no reason to remap back unless of legacy equipment. Here's an example-

http://www.cisco.com/en/US/tech/tk652/tk698/technologies_configuration_example09186a00800a954d.shtml

Hope that helps.

Hi Collin,

Thanks for the link. I had seen this previously, but within it I couldn't understand how to actually match a ToS value of 0x08. The only option that seems relevant is match ip precedence, and all that looks reasonable there is to match ip precedence 7, which would be 0x08 in decimal.

Am I way off base?

Collin Clark
VIP Alumni
VIP Alumni

If your device marks ToS only, have your switch map it DSCP. CoS/ToS are older and are generally only used by legacy equipment. Once you remark ToS to DSCP there is no reason to remap back unless of legacy equipment. Here's an example-

http://www.cisco.com/en/US/tech/tk652/tk698/technologies_configuration_example09186a00800a954d.shtml

Hope that helps.

Hi Collin,

In order to be able to map ToS to DSCP as you suggest, I believe I need to first match the ToS value of 0x08 and I'm not sure how to match that. As I said in my previous post, all I could find to match that looked relevant is ip precedence, and I don't know if precedence is the right thing to match on.

If the ToS byte is set to 0x08, then match against the DSCP value 0x04.

If it's a voice bearer packet, remark to DSCP EF. For CoS, if supported, mark as priority 5.

Addendum (correction):

Believe I slipped a (binary) decimal point. If the ToS byte is set to 0x08, then match against the DSCP value 0x02. (DSCP is the first 6 bits of the ToS byte, so you need to divide by 4 to convert a ToS value to a DSCP value.)

From what I'm seeing, there's no DSCP value of 0x02 (2) to match against. What am I missing?

You'll have to further explain what you're "seeing". DSCP values, being six bits, can be between 0..63 (decimal), although less than half are used when using CS(0..7)/AF(1..3)(1..3))/EF tags. Depending on the device, some old platforms don't recognize DSCP at all but may recognize the lower bits by "name" of their prior ToS functions DTR (delay/throughput/reliability).

Well, the device in question (Engage IPTube) applies ToS value 0x08 to packets. I'm trying to configure a class-map to match that traffic so I can do stuff with it in a policy-map.

Looking at the IP Tube manual for QoS configuration, it simply says: "The TUBE TOS command is used to set the Type of Service byte in the IP packets encapsulated in T1/E1 frames. The setting of the TOS byte can be used to ensure that the real time TDM data from the IP Tube is ensured high priority. The Quality of Service support is required within each router or switch within the interconnect between the IP Tubes. A TOS setting of 0x08 "maximizes throughput".

Please correct me if I'm way off base with my bin/hex conversion and how that relates to various ToS/DSCP values -

So if it sets ToS and doesn't make any use of DSCP natively, then I can figure it's looking through the entire ToS field; all 8 bits of it. Unless I'm mistaken, a ToS value 0x08 in an 8 bit field converts to 00001000. Looking through RFC795, that seems translates to the following: Routine Precedence (000), Normal Delay (0), High Throughput (1), Normal Reliability (0), Reserved (00).

In Cisco land, I can't find the proper knobs in the class-map configuration to match that bit four. I tried match ip dscp 2, as that's what 0x08 converts to in DSCP value but that didn't match anything, and the interface is doing a ton of traffic right now - all voice.

2970#sh policy-map int g0/16

GigabitEthernet0/16

Service-policy input: IPTube

Class-map: IPTube (match-all)

0 packets, 0 bytes

5 minute offered rate 0 bps, drop rate 0 bps

Match: ip dscp 2

Class-map: class-default (match-any)

0 packets, 0 bytes

5 minute offered rate 0 bps, drop rate 0 bps

Match: any

0 packets, 0 bytes

5 minute rate 0 bps

2970#sh int g0/16

GigabitEthernet0/16 is up, line protocol is up (connected)

Hardware is Gigabit Ethernet, address is 0017.5a76.ca10 (bia 0017.5a76.ca10)

Description: Engage IPTube

MTU 1500 bytes, BW 100000 Kbit, DLY 100 usec,

reliability 255/255, txload 4/255, rxload 4/255

Encapsulation ARPA, loopback not set

Keepalive set (10 sec)

Full-duplex, 100Mb/s, media type is 10/100/1000BaseTX

input flow-control is off, output flow-control is unsupported

ARP type: ARPA, ARP Timeout 04:00:00

Last input never, output 00:00:01, output hang never

Last clearing of "show interface" counters never

Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0

Queueing strategy: fifo

Output queue: 0/40 (size/max)

5 minute input rate 1669000 bits/sec, 335 packets/sec

5 minute output rate 1670000 bits/sec, 336 packets/sec

946229337 packets input, 310385943 bytes, 0 no buffer

Received 568480 broadcasts (0 multicast)

0 runts, 0 giants, 0 throttles

245 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored

0 watchdog, 0 multicast, 0 pause input

0 input packets with dribble condition detected

2970#

You can configure the class-map to use tos with the keyword ip-precendence.

This can be mapped to a cos value wich in turn can be converted into dscp on any other port.

regards

Leo

How?

2970(config-cmap)#match ip precedence ?

<0-7> Enter up to 4 precedence values separated by white-spaces

critical Match packets with critical precedence (5)

flash Match packets with flash precedence (3)

flash-override Match packets with flash override precedence (4)

immediate Match packets with immediate precedence (2)

internet Match packets with internetwork control precedence (6)

network Match packets with network control precedence (7)

priority Match packets with priority precedence (1)

routine Match packets with routine precedence (0)

2970(config-cmap)#

This seems to match only 3 bits (0-2) in the precedence portion of the ToS octet. I need to match on bit 4.

Please clarify for me.

I think we're in agreement on your analysis of the ToS byte.

In principle, your class-map and policy-map appear reasonable, although not only are there no matches against "IP Tube", but there appear to be none against class-default. So, there's a good chance we're missing a config statement.

Unable to find documentation for the 2970, but from release notes, appears similar to 3560/3750.

Without 2970 documetation, unsure whether any of these are needed, but do you have QoS enabled (mls qos); and/or within the policy class, not the class map, do you trust dscp (mls qos trust dscp); and/or trust dscp on the interface (mls qos trust dscp); and/or enabled dscp Transparency Mode (no mls qos rewrite ip dscp)?

Good point that we're not matching against anything, even class-default.

mls qos is enabled, but I've configured nothing else, with the exception of the policy-map, class-map and service-policy on the interface:

!

mls qos

!

class-map match-any IPTube

match ip dscp 2

!

policy-map IPTube

class IPTube

!

interface GigabitEthernet0/16

description IPTUBE01

switchport access vlan 31

service-policy input IPTube

!

Keep in mind that it's not my intention to *do* anything with what's matched - yet. Like I said in my first post, I want to just start with classifying the traffic. I'll mark with set statements in the policy-map once I can verify that I'm matching what I want to match.

Understood about you just wanting to match. You might need one of options (noted in my prior post) allowing dscp trust or insuring the dscp value isn't reset upon receipt.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: