Page 1 of 1

VoIP/SIP help with QoS

Posted: Thu Jun 19, 2014 9:05 pm
by safiullahtariq
Hello All,

I need some advices and also some help.

I have 2 sites, remotely connected to each via ptp wireless link. I have also attached the screenshot of the network diagram. The IP of the SIP server is 192.168.0.150.

The Routers I am using are RB750GL

What I want is, I want to priorities the VoIP traffic so that the voice quality can increase. Can anyone please help me on how to do it? Any advice, anything will be helpful as I dont know how to do it.

Best Regards,

Safiullah

Re: VoIP/SIP help with QoS

Posted: Fri Jun 20, 2014 10:30 am
by awacenter
Yuo have to use firewall mangle rules and queues.
First of all, identify the type of traffic using magle. but import the SSL7 signs fromhttp://www.mikrotik.com/download/l7-protos.rsc

In this example, My output interface is WLAN and my LAN is in interface ether1.

ros code

/ip firewall mangle
add action=mark-connection chain=forward comment=DNS disabled=no dst-port=53 \
    new-connection-mark=dns passthrough=yes protocol=udp
add action=mark-connection chain=forward disabled=no layer7-protocol=dns \
    new-connection-mark=dns passthrough=yes
add action=mark-packet chain=forward connection-mark=dns disabled=no \
    new-packet-mark=dnsP passthrough=no
add action=mark-connection chain=forward comment="VoIP (SIP)" disabled=no \
    layer7-protocol=sip new-connection-mark=voip passthrough=yes
add action=mark-connection chain=forward comment="VoIP (Skype)" disabled=no \
    layer7-protocol=skypetoskype new-connection-mark=voip passthrough=yes
add action=mark-connection chain=forward disabled=no layer7-protocol=skypeout \
    new-connection-mark=voip passthrough=yes
add action=mark-connection chain=forward disabled=no layer7-protocol=h323 \
    new-connection-mark=voip passthrough=yes
add action=mark-connection chain=forward disabled=no dscp=46 new-connection-mark=voip passthrough=yes
add action=mark-packet chain=forward connection-mark=voip disabled=no \
    new-packet-mark=voipP passthrough=no
add action=mark-connection chain=forward comment="Other traffic" disabled=no \
    new-connection-mark=otros passthrough=yes
add action=mark-packet chain=forward connection-mark=otros disabled=no \
    new-packet-mark=otrosP passthrough=no
add action=mark-connection chain=forward disabled=yes new-connection-mark=\
    desconocido packet-mark=no-mark passthrough=yes
Basicaly, I differenciate three types of traffic:
  • Routing protocols
    VoIP
    Other Traffic

ros code

/queue type
add kind=pcq name=PCQ pcq-classifier=src-address pcq-limit=50 pcq-rate=0 \
    pcq-total-limit=2000
add kind=pcq name=DOWN pcq-classifier=dst-address pcq-limit=50 pcq-rate=0 \
    pcq-total-limit=2000
add kind=pcq name=UP pcq-classifier=src-address pcq-limit=50 pcq-rate=0 \
    pcq-total-limit=2000
Then I create two queue type: UP AND DOWN of type PCQ.

Finally, I create the queue tree for the traffic priorization:

ros code

/queue tree
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
max-limit=750k name=UPLOAD packet-mark="" parent=wlan1 priority=2
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=200k \
max-limit=500k name=VOIP-UP packet-mark=voipP parent=UPLOAD priority=5 \
queue=UP
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=100k \
max-limit=150k name=ROUTING-UP packet-mark=dnsP parent=UPLOAD priority=3 queue=\
UP
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
max-limit=0 name=OTRO-UP packet-mark=otrosP parent=UPLOAD priority=8 queue=\
UP
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
max-limit=0 name=DOWNLOAD packet-mark="" parent=ether1 priority=2
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=100k \
max-limit=150k name=ROUTING-DOWN packet-mark=dnsP parent=DOWNLOAD priority=3 \
queue=DOWN
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
max-limit=0 name=OTRO-DOWN packet-mark=otrosP parent=DOWNLOAD priority=8 \
queue=DOWN
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=200k \
max-limit=500k name=VOIP-DOWN packet-mark=voipP parent=DOWNLOAD priority=\
5 queue=DOWN
I hope this explanation is satisfactory for you and I increase my karma.

Re: VoIP/SIP help with QoS

Posted: Wed Apr 08, 2015 9:44 am
by amperex
Hello and sorry for answer in a old topic. I would like to apply this solution to my case.
I have a rb750 that have the ether3 as wan port to internet and have two ppoe servers in ether4 and ether5 where the computers are connected. I would like to priorize voip.

Re: VoIP/SIP help with QoS

Posted: Wed Apr 08, 2015 11:49 am
by safiullahtariq
I am on way to somewhere. As soon as im free ill help you.
Ive successfully prioritised my voip traffic. Ill write a detail answer later

Re: VoIP/SIP help with QoS

Posted: Wed Apr 08, 2015 2:52 pm
by amperex
Ok, thank you I will wait. :)

Re: VoIP/SIP help with QoS

Posted: Thu Apr 09, 2015 4:05 pm
by safiullahtariq
I apologize for the delay

I guess your VoIP is directly connected to one of the ethernet ports of RB750

Go to IP>>Firewall>>Mangle

Create a new mangle rule.

In General Tab:

Chain: prerouting
Src Address: YOUR VoIP IP ADDRESS

In Action Tab:
Action: Mark connection
New connection Mark: VOIP
Passthrough : Yes (check)


Create Another Rule:


In General Tab:

Chain: prerouting
destination Address: YOUR VoIP IP ADDRESS

In Action Tab:
Action: Mark connection
New connection Mark: VOIP
Passthrough : Yes (check)


Create Another Rule:

In General Tab:

Chain: prerouting
Connection Mark: VOIP

In Action Tab:
Action: Mark packet
New packet Mark: VOIP
Passthrough : No (uncheck)

Now Go to Queues



Create a new Simple Queue

In General Tab:
Name: VOIP Traffic
Target: 0.0.0.0/0
Target Upload
Max limit: I have given 1M - you can give more or less depending on the bandwidth you want for you VoIP.

Target Download
Max limit: I have given 1M - you can give more or less depending on the bandwidth you want for you VoIP
Advanced Tab
Packet Mark : VOIP
Target Upload: unlimited
Priority: 1
Target Download: unlimited
Priority: 1
Parent None.

Now create another Simple Queue.


In General Tab:
Name: All other Traffic
Target: 0.0.0.0/0
Target Upload
Max limit: I have given 5M - you can give more or less depending on the bandwidth you want for you VoIP.

Target Download
Max limit: I have given 5M - you can give more or less depending on the bandwidth you want for you VoIP
Advanced Tab
Packet Mark : no-mark
Target Upload: unlimited
Priority: 8
Target Download: unlimited
Priority: 8
Parent None.


This is all you got to do. Do reply if you need any more help. And do tell the results.