01-08-2009 01:17 PM - edited 03-06-2019 03:20 AM
If i want to say change all packets coming in at cos 4 to be set to a dscp value of 16, do i need to put the mls trust cos command on there.
IE:
mls qos (enables qos)
mls qos map cos-dscp 0 8 16 24 16 50 48 56 (this maps cos 4 to to dscp 16)
now when packets come in will they be mapped to dscp 16 or are they rewritten to 0 cos and 0 dscp becuase they are not trusted?
Solved! Go to Solution.
01-08-2009 03:00 PM
01-08-2009 01:26 PM
Mike
You need the "mls qos trust cos" on your interface and then that cos value will be mapped to whatever is in your DSCP-to-Cos map.
Jon
01-08-2009 01:37 PM
And iassume this is the same if i wnat my dscp to cos map to work? I would have to trust dscp..
and i did trust dscp and trust cos no maps would be used..
Are the above statements correct?
Also i would have to trust dscp to use a dscp mutation?
01-08-2009 01:42 PM
"And i assume this is the same if i want my dscp to cos map to work? I would have to trust dscp"
Depends. Don't forget that the switch derives an internal DSCP value to use from either the CoS or DSCP value received on the port.
Your DSCP-to-Cos map is used for egress queueing. So you could trust CoS which would then be mapped according to the Cos-to-DSCP map and then mapped back to a Cos value in the DSCP-to-Cos map if you see what i mean. Or you could just trust DSCP which would then be the same DSCP as the internal value.
Yes you would need to trust DSCP if you wanted to then remap that DSCP value to another with the DSCP mutation map.
Jon
01-08-2009 01:57 PM
Still confused..
so if you trust cos then the packet will come in, trust the cos.. the dscp will then be mapped from the cos to dsp map
if you trust dscp then the packet will come in, trust the dscp, rewrite the cos depending on the dscp to cos map?
01-08-2009 02:10 PM
Sorry Mike, i'm not explaining this very well.
Key thing to understand is that L2 and L3 switches always use an internal DSCP value to prioritise the packet within the switch. This value is not written into the packet but it is used derive the value in the packet when sent to the egress queue.
A switch supports
Cos-to-DSCP map - used to derive the internal DSCP value when the packets contain Cos values on ingress
IPP-to-DSCP map - used to derive the internal DSCP value when the packets contain IP Precedence values.
DSCP-to-Cos map - used to derive a Cos value from the internal DSCP value before sending to egress queue.
Note DSCP-to-DSCP maps are not needed normally as the DSCP value received is the internal DSCP value which is also the DSCP value used to map to a queue, if you are using DSCP values to map to egress queues which some switches support.
However there is a DSCP-to-DSCP mutation map which allows you to change the received DSCP value.
So if you trust Cos the procedure is
1) map Cos to internal DSCP based on Cos-to-DSCP map
2) When placing the packet in an egress queue if
i) the queues are mapped based on the Cos value then use the DSCP-to-Cos map to derive the Cos value
ii) the queues are mapped based on DSCP just use the internal value
If you trust DSCP then no need to derive internal DSCP as it will be the received DSCP (providing no DSCP-to-DSPC mutation map) but you still need step 2 from above.
IP predence is prety much same as Cos except in step 1 you use IP Precedence-to-DSCP map.
If you don't trust the port then default Cos value of 0 is used which will map to DSCP 0 , still using Cos-to-DSCP map. This is assuming you haven't modified the Cos-to-DSCP map.
Hope this makes it clearer.
Jon
01-08-2009 02:24 PM
i think im almost there/
so an example.
1.) packet comes in with cos 5
2.) its trusted
3.) its mapped to dscp 40 (only internally to the switch) based on cos-dscp map
4.) if the dscp-cos map says dscp 40 to cos 5 then it will go into he egress queue assigned for cos 5
01-08-2009 02:31 PM
Mike
You've got it. The only slight difference would be if you were using DSCP values to map packets to egress queues then you wouldn't need to consult the DSCP-to-Cos map.
By modifying these maps you can influence which value is written into the packet before being sent to the egress queue.
Jon
01-08-2009 02:43 PM
Excellent!
Final question:
Say # 4 said this:
4.) if the dscp-cos map says dscp 40 to cos 4 then it will go into he egress queue assigned for cos 4
Now does it overwright cos 5 to cos 4 when it leaves the port or just use this table for lookups.
01-08-2009 03:00 PM
The Cos value of 4 will be written into the packet.
Jon
01-08-2009 03:05 PM
And if you trusted the dscp value only. the output packet would contain that dscp value and whatever cos value is in the dscp-cos map?
pending the queses are mapped off cos
bottom line is the packet will leave the switch with a cos and dscp value
Youve been a super big help. Where do i write the check to for tonights training haha.
Thank You
01-08-2009 03:13 PM
Mike
"Youve been a super big help"
Glad to have helped. One last point. The packet may or may not leave the switch with a CoS value because the Cos values are contained within an 802.1q/ISL tag so the egress port would need to be a trunk for the packet to have CoS values.
But if it came in with a DSCP mark then it is safe to say it will leave with a DSCP mark.
Jon
01-08-2009 03:18 PM
makes sence. So if cos is trusted would the packet always leave with a dscp value or is that dscp strickly for internal use.
01-08-2009 03:21 PM
If the packet came in with a DSCP value then it will leave with a DSCP value whether or not that value is the same is down to your maps and the trust state on the port.
So if you trust CoS and the packet has no DSCP value, then an internal DSCP value will be used by the switch but it won't write a DSCP value into the outgoing packet.
If you trust Cos and the packet has a DSCP value then the packet will leave with the same DSCP value ie. it remains untouched.
Jon
01-08-2009 03:25 PM
clever. Again thank you very much.
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: