05-22-2008 07:41 PM
05-23-2008 02:13 AM
[edit class-of-service]
user@graz-re0# show
interfaces {
ge-0/0/0 {
unit 0 {
rewrite-rules {
inet-precedence test1;
}
}
}
}
rewrite-rules {
inet-precedence test1 {
forwarding-class expedited-forwarding {
loss-priority high code-point 010;
}
}
}
[edit class-of-service]
user@graz-re0#
05-23-2008 07:01 AM
05-23-2008 07:24 AM
To be clear, there are several things that need to be taken into account when developing a Class of Service design and configuration. I would really suggest that you spend some more time reading throught the documentation to be clear what it is that you want to achieve. For a quick start here is some suggestions.
You will need to classify the incoming packets and assign them to a forwarding class which will match your re-write rule. As you know that all traffic coming in on a particular interface is voice traffic, you can use a configuration similar to the one below.
user@graz-re0# show
interfaces {
ge-0/0/0 {
unit 0 {
forwarding-class expedited-forwarding;
}
}
t3-1/0/0 {
unit 0 {
rewrite-rules {
dscp level3-voice;
}
}
}
}
rewrite-rules {
dscp level3-voice {
forwarding-class expedited-forwarding {
loss-priority high code-point 101110;
}
}
}
You might therefore have to use loss-priority low instead of high. Keep in mind if you don't assign all the values for the re-write rule, the default values will apply. I also don't know what the incoming DCSP value is for your voice traffic.
user@graz-re0# run show class-of-service rewrite-rule type dscp
Rewrite rule: dscp-default, Code point type: dscp, Index: 26
Forwarding class Loss priority Code point
best-effort low 000000
best-effort high 000000
expedited-forwarding low 101110
expedited-forwarding high 101110
assured-forwarding low 001010
assured-forwarding high 001100
network-control low 110000
network-control high 111000
user@graz-re0# ...ensive so-0/0/0 | find "CoS transmit"
CoS transmit queue Bandwidth Buffer Priority Limit
% bps % usec
0 best-effort 95 147744000 95 0 low none
3 network-control 5 7776000 5 0 low none
05-23-2008 09:14 AM - edited 05-23-2008 09:17 AM
05-24-2008 11:35 PM
You've configured a Behavior Aggregate (BA) classifier for your voice and data traffic. BA classifiers only work if the incoming traffic has inet-precedence bits and loss priority (PLP bit) already set on ingress. If that is the case then rewrite rules are not really needed as the JUNOS router will preserve whatever TOS bits are set on egress.
However, if your voice traffic is all ingressing without TOS bits set, then you will need to use a Multifield Classifier instead of a BA classifier. The multifield classifier uses firewall rules to identify traffic based on perhaps source IP, source or destination ports, or whatever is the best way to be sure that you can target only the voice traffic. Then for the action statement you would specify the loss-priority and forwarding class. That will send the traffic to the proper out-queue on the egress interface. Then you can configure the rewrite rules on the egress interface to set the TOS bits as needed.
-Richard
05-27-2008 12:59 PM
05-27-2008 02:13 PM
Hi DAK
Within your filter I would aslo specify the loss-priority. That will make sure that your rewrite rules will take effect.
set firewall family inet filter ef-class term match-voice then loss-priority high
I noticed that you have assigned the queues with a schedule ratio of 40/60. There is now nothing assigned to queue 3 which is the default queue for a lot of control plain traffic.I would suggest that you assign 5% to it as well.
07-06-2008 01:28 AM
Hi ,
Just I want to elaborate more as you look a bit confused, first of all you should classify the packets at your ingress interface and then assign a forwarding class, you classify the packets using either Multifield Aggreagte (MA) or Behaviour Aggregate. MA is used when the packets arriving the interface don't have the TOS value set in the IP header and in this casde you need to define a firewall filter based on IP source/destination or port number whatever and assign a forwarding class and a loss priority high or low, for voice traffic you can use protocol UDP and ports rang of RTP
firewall {
filter x{
term x {
from {
protocol x;
port x;
}
then {
loss-priority x;
forwarding-class x;
accept;
}
}
}
Now you just assigned the traffic to specific class "queue", you now need to define the rewrite rule as the TOS field of the IP header is still not changed and apply this rule to the outgoing interface, you have to change it before the packet leave the router.
class-of-service {
interfaces {
x {
unit * {
rewrite-rules {
dscp x;
}
}
}
The other type of classifiers is the BA which is used if the packets arriving at the interface are already assigned TOS value, in this case you just need to create the classifier and assign it to the interface without the need to apply a rewrite rule as the TOS field is aready marked
class-of-service {
interfaces {
x {
unit * {
classifier {
dscp x;
}
}
}
you can use copy/paste for configuring classifiers and rewrite rules as they use the same parameters and should be the same value in the network
I just want to add for the best practice with voice traffic, it is better to make the marking at the voice node itself, this should make the marking very accurate and there will be less overhead in the routers as the firewall filter is very CPU consuming
Hope it helps
Osama
03-12-2010 03:27 AM
Thanks for sharing this post. This is a very helpful and informative material. Good post and keep it up. Websites are always helpful in one way or the other, that’s cool stuff, anyways, a good way to get started to renovate your dreams into the world of reality.