Community discussions

MikroTik App
 
Mashal
just joined
Topic Author
Posts: 10
Joined: Mon Jul 20, 2015 8:03 am

VOIP QOS HELP !!!

Mon Jul 20, 2015 8:11 am

I'm having some trouble on setting a QOS on the company Voip, I've set up the mangle to mark the voip packets and a simple queue for both voip marked and unmarked (only voip packets are marked) packets with limitations on upload and downloads and the voip has plenty of bandwidth left to use but still i get jitter when using voip for calling the other branch over internet, and only when no one is using the internet does the sound get clear. any help?
 
purana
newbie
Posts: 48
Joined: Sun Jun 21, 2015 1:57 pm

Re: VOIP QOS HELP !!!

Mon Jul 20, 2015 11:42 am

I'm having some trouble on setting a QOS on the company Voip, I've set up the mangle to mark the voip packets and a simple queue for both voip marked and unmarked (only voip packets are marked) packets with limitations on upload and downloads and the voip has plenty of bandwidth left to use but still i get jitter when using voip for calling the other branch over internet, and only when no one is using the internet does the sound get clear. any help?
I setup some simple mark of packets and traffic, and give them priority in a queue tree. It works, but I am sure I could improve it. Here is the items to recreate it below;
/ip firewall address-list
add address=208.117.224.0/24 list=Youtube
add address=208.117.225.0/24 list=Youtube
add address=208.117.228.0/24 list=Youtube
add address=208.117.229.0/24 list=Youtube
add address=208.117.232.0/24 list=Youtube
add address=208.117.233.0/24 list=Youtube
add address=208.117.234.0/24 list=Youtube
add address=208.117.238.0/24 list=Youtube
add address=208.65.152.0/24 list=Youtube
add address=208.65.153.0/24 list=Youtube
add address=208.65.154.0/24 list=Youtube
add address=64.15.112.0/20 list=Youtube
add address=208.117.236.0/24 list=Youtube
add address=74.125.96.0/19 list=Youtube
add address=72.14.221.0/24 list=Youtube
add address=84.53.128.0/18 comment=Redtube list=Youtube
add address=87.248.192.0/19 comment=Youporn list=Youtube
add address=216.155.128.0/19 comment=Redtube list=Youtube
add address=208.73.208.0/21 comment=Redtube list=Youtube
add address=66.55.140.0/23 comment=Redtube list=Youtube
add address=74.125.208.0/24 list=Youtube
add address=216.58.220.0/24 list=Youtube

/ip firewall mangle
add action=mark-packet chain=forward connection-type=sip new-packet-mark=\
    tcp_sip protocol=tcp
add action=mark-packet chain=forward new-packet-mark=icmp passthrough=no \
    protocol=icmp
add action=mark-packet chain=forward dst-port=443 new-packet-mark=ssl \
    passthrough=no protocol=tcp
add action=mark-packet chain=forward new-packet-mark=p2p p2p=all-p2p \
    passthrough=no
add action=mark-packet chain=forward new-packet-mark=udp-100 packet-size=\
    0-100 passthrough=no protocol=udp
add action=mark-packet chain=forward new-packet-mark=udp-500 packet-size=\
    100-500 passthrough=no protocol=udp
add action=mark-packet chain=forward new-packet-mark=udp-other passthrough=no \
    protocol=udp
add action=mark-packet chain=forward dst-port=1863 new-packet-mark=\
    msn-messenger passthrough=no protocol=tcp
add action=mark-packet chain=forward dst-port=110 new-packet-mark=pop3 \
    passthrough=no protocol=tcp
add action=mark-packet chain=forward dst-port=25 new-packet-mark=smtp \
    passthrough=no protocol=tcp
add action=mark-packet chain=forward dst-port=143 new-packet-mark=imap \
    passthrough=no protocol=tcp
add action=mark-packet chain=forward new-packet-mark=gre passthrough=no \
    protocol=gre
add action=mark-packet chain=forward new-packet-mark=ipsec-esp passthrough=no \
    protocol=ipsec-esp
add action=mark-packet chain=forward new-packet-mark=ipsec-ah passthrough=no \
    protocol=ipsec-ah
add action=mark-packet chain=forward new-packet-mark=ipencap passthrough=no \
    protocol=ipencap
add action=mark-packet chain=forward new-packet-mark=ipip passthrough=no \
    protocol=ipip
add action=mark-packet chain=forward new-packet-mark=Youtube passthrough=no \
    src-address-list=Youtube
add action=mark-packet chain=forward dst-port=80 new-packet-mark=http \
    passthrough=no protocol=tcp
add action=mark-packet chain=forward new-packet-mark=wfh-out passthrough=no \
    src-address=192.168.3.120
add action=mark-packet chain=forward dst-address=192.168.3.120 \
    new-packet-mark=wfh-in passthrough=no
add action=mark-packet chain=forward connection-bytes=1-512000 \
    new-packet-mark=0bytes
add action=mark-packet chain=forward connection-bytes=512000-1000000 \
    new-packet-mark=1Mbyte
add action=mark-packet chain=forward connection-bytes=1000000-3000000 \
    new-packet-mark=3Mbyte
add action=mark-packet chain=forward connection-bytes=3000000-6000000 \
    new-packet-mark=6Mbyte
add action=mark-packet chain=forward connection-bytes=6000000-30000000 \
    new-packet-mark=30Mbyte
add action=mark-packet chain=forward connection-bytes=30000000-60000000 \
    new-packet-mark=60Mbytes
add action=mark-packet chain=forward connection-bytes=60000000-0 \
    new-packet-mark=Infinite
    
/queue tree
add name=OVERALL parent=global priority=5
add name=PRIO3 parent=OVERALL priority=3
add name=1Mbyte packet-mark=1Mbyte parent=PRIO3 priority=3
add name=PRIO4 parent=OVERALL priority=4
add name=3Mbyte packet-mark=3Mbyte parent=PRIO4 priority=4
add name=PRIO5 parent=OVERALL priority=5
add name=6Mbyte packet-mark=6Mbyte parent=PRIO5 priority=5
add name=PRIO6 parent=OVERALL priority=6
add name=30Mbyte packet-mark=30Mbyte parent=PRIO6 priority=6
add name=PRIO7 parent=OVERALL priority=7
add name=Youtube packet-mark=Youtube parent=PRIO7 priority=7
add name=60Mbyte packet-mark=60Mbytes parent=PRIO7 priority=7
add name=PRIO1 parent=OVERALL priority=1
add name=0-512 packet-mark=0bytes parent=PRIO1 priority=1
add name=ICMP packet-mark=icmp parent=PRIO1 priority=1
add name=PRIO2 parent=OVERALL priority=2
add name=POP3 packet-mark=pop3 parent=PRIO2 priority=2
add name=SMTP packet-mark=smtp parent=PRIO2 priority=2
add name=IMAP packet-mark=imap parent=PRIO2 priority=2
add name=HTTP packet-mark=http parent=PRIO2 priority=2
add name=SSL packet-mark=ssl parent=PRIO2 priority=2
add name=MSN-MESSENGER packet-mark=msn-messenger parent=PRIO2 priority=2
add name=PRIO8 parent=OVERALL
add name=Infinite packet-mark=Infinite parent=PRIO8
add name=GRE packet-mark=gre parent=PRIO8
add name=IPSEC-ESP packet-mark=ipsec-esp parent=PRIO8
add name=IPSEC-AH packet-mark=ipsec-ah parent=PRIO8
add name=P2P packet-mark=p2p parent=PRIO8
add name=IPENCAP packet-mark=ipencap parent=PRIO8
add name=IPIP packet-mark=ipip parent=PRIO8
add name=UDP parent=OVERALL priority=1
add name=UDP-100 packet-mark=udp-100 parent=UDP priority=1
add name=UDP-500 packet-mark=udp-500 parent=UDP priority=3
add name=UDP-Other packet-mark=udp-other parent=UDP

/queue type
add kind=pcq name=Youtube_down pcq-classifier=src-port,dst-port pcq-rate=400k
If you improve it, please let me know. I'd like to setup a queue tree for uploads, since I am not really doing that yet. You can add your SIP traffic into the priority you want above, based on the sample commands.
 
Mashal
just joined
Topic Author
Posts: 10
Joined: Mon Jul 20, 2015 8:03 am

Re: VOIP QOS HELP !!!

Tue Jul 21, 2015 3:40 pm

Hey after hours and hours of reading vague texts i finally figured it out and put it to work, and guess what? it works like a charm!!!!

before saying anything i refer u to this link for a very vague and short explanation on marking and queuing

http://wiki.mikrotik.com/wiki/Manual:HTB

theres a couple of things u need to pay attention to

first thing in the mangle section is, in order to reduce cpu usage first mark connections in the prerouting chain, then mark all packets in the forward chain that fall in that marked connection u just marked using another mangle and be sure to remove the pass through tick this time.
after that all done its time for queuing and there isnt anything quite like tree queues.
the link above is kind of clear on tree queuing, u need two trees one for upload(choose the interface connected to the public ip or internet as parent) and one for download(choose the interface connected to the private ip or LAN as parent), the devide the traffic using other branch and leafs and choosing the correct parent to form ur tree having his in mind that "limit at" is first given and guaranteed for all leafs after that extra traffic is handed out to leafs first based on their "priority" and then "max-limit", if bandwidth is finished before every leaf has received its "max-limit" then i guess its bad luck for them but at least they have their "limit at" bandwidth which suffices. :D

Who is online

Users browsing this forum: Bing [Bot], Google [Bot], qatar2022, zabloc and 62 guests