Top Banner
QoS on RouterOS with Token Bucket RouterOS v6.35 Valens Riyadi (Citraweb) @valensriyadi MUM-KH-2017 Phnom Penh
34

QoS on RouterOS with Token Bucket - MikroTik · This license lets others remix, tweak, and build upon your work even for commercial purposes, as long as they credit you and license

May 31, 2020

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: QoS on RouterOS with Token Bucket - MikroTik · This license lets others remix, tweak, and build upon your work even for commercial purposes, as long as they credit you and license

QoS onRouterOS withTokenBucket

RouterOS v6.35

ValensRiyadi(Citraweb)@valensriyadi

MUM-KH-2017PhnomPenh

Page 2: QoS on RouterOS with Token Bucket - MikroTik · This license lets others remix, tweak, and build upon your work even for commercial purposes, as long as they credit you and license

ValensRiyadi• MikroTik CertifiedEngineer

(MTCNA,MTCWE,MTCRE,MTCTCE,MTCUME,MTCINE)

• MikroTik CertifiedTrainersince2004,CertifiedConsultant,andAcademyCoordinator

• CEOforCitranet (WISP)andCitraweb (Mikrotik DistributorandSystemDeveloper)

• ManagerforIDNIC(IndonesiaNationalInternetRegistry)2009-2015

• ExpertonCyberCrime,DigitalForensic,ITforDisasterRelief,LiveStreaming

• Proudmemberof“RoutedWorld”community

2QoS onMulticore – Mikrotik Indonesia

Page 3: QoS on RouterOS with Token Bucket - MikroTik · This license lets others remix, tweak, and build upon your work even for commercial purposes, as long as they credit you and license

QospadaRouterOSv6 3

Page 4: QoS on RouterOS with Token Bucket - MikroTik · This license lets others remix, tweak, and build upon your work even for commercial purposes, as long as they credit you and license

MikroTik TrainingCenter• ThefirstMikroTik TrainingCenterinAsiaPasific since2004,morethen5500participants(237classes).

• Mikrotik AcademyCoordinator.

QospadaRouterOSv6 4

Page 5: QoS on RouterOS with Token Bucket - MikroTik · This license lets others remix, tweak, and build upon your work even for commercial purposes, as long as they credit you and license

QoSonMulticore– MikrotikIndonesia 5

Mikrotik TrainingforIndonesiaSpecialForces

Page 6: QoS on RouterOS with Token Bucket - MikroTik · This license lets others remix, tweak, and build upon your work even for commercial purposes, as long as they credit you and license

QoS concept

6Token Bucket– Mikrotik Indonesia

Whydoweneedtomanagebandwidth?

Page 7: QoS on RouterOS with Token Bucket - MikroTik · This license lets others remix, tweak, and build upon your work even for commercial purposes, as long as they credit you and license

QoS onRouterOS

• MikroTik RouterOS isoneofthemostadvancedbandwidthmanagement,comparedtoanyotherbrand.

• Why?– AdvancedHTBconfiguration– Doublelimitation+Burst– Alotofoptionandparameterà packet-mark• Grouping,protocol,layer7,connectionsize,trafficdetection,etc

Token Bucket– Mikrotik Indonesia 7

Page 8: QoS on RouterOS with Token Bucket - MikroTik · This license lets others remix, tweak, and build upon your work even for commercial purposes, as long as they credit you and license

Burst

Amechanismtobeabletoprovideadditionalbandwidthtoaparticularclientif:• Clientnotalwaysonmax-limit• Additionalbandwidthstillavailableonrelatedparentandinterface

Token Bucket– Mikrotik Indonesia 8

Page 9: QoS on RouterOS with Token Bucket - MikroTik · This license lets others remix, tweak, and build upon your work even for commercial purposes, as long as they credit you and license

Happycustomer

TokenBucket– MikrotikIndonesia 9

Burstwillsignificantlyimprovecustomerexperience

astheyfeeltheconnectionisfast

Page 10: QoS on RouterOS with Token Bucket - MikroTik · This license lets others remix, tweak, and build upon your work even for commercial purposes, as long as they credit you and license

TokenBucket

• SinceRouterOS v6.35,MikroTik introduceTokenBucket.

• It’sbeenontheRouterOS engineforlongtime,butit’shiddenandstaticallysetto0.1.

• ConceptofTokenBucketalsoimplementedonLinux.

• Itworkslikeburstfeature,butmuchsimpler.

TokenBucket– MikrotikIndonesia 10

Page 11: QoS on RouterOS with Token Bucket - MikroTik · This license lets others remix, tweak, and build upon your work even for commercial purposes, as long as they credit you and license

Winbox Configuration

TokenBucket– MikrotikIndonesia 11

Page 12: QoS on RouterOS with Token Bucket - MikroTik · This license lets others remix, tweak, and build upon your work even for commercial purposes, as long as they credit you and license

TokenBucketAlgoritm

TokenBucket– MikrotikIndonesia 12http://wiki.mikrotik.com/wiki/Manual:HTB-Token_Bucket_Algorithm

Page 13: QoS on RouterOS with Token Bucket - MikroTik · This license lets others remix, tweak, and build upon your work even for commercial purposes, as long as they credit you and license

Bucket

• Bucketcapacity isbucketsizeratio comparedtomax-limit.

• Example:–Max-limit=5Mbps– Bucketsizeration=3(max10)– Bucketcapacity=5*3=15Mbit

• Whenthecalculationstart,bucketisalwaysconsideredfulloftoken.

TokenBucket– MikrotikIndonesia 13

Page 14: QoS on RouterOS with Token Bucket - MikroTik · This license lets others remix, tweak, and build upon your work even for commercial purposes, as long as they credit you and license

Tokenrate

TokenBucket– MikrotikIndonesia 14

token-rate=max-limit

iflimit-atonchild>max-limitonparent

token-rate=limit-at

ifburstisactiveandallowed

token-rate=burst-limit

Page 15: QoS on RouterOS with Token Bucket - MikroTik · This license lets others remix, tweak, and build upon your work even for commercial purposes, as long as they credit you and license

TokenBucketAlgoritmIftraffic=token-rate AlltrafficwillbedeliveredIftraffic<token-rate Alltrafficwillbedelivered,and

tokenwillbeaddedtothebucket,asmuchasthedifferences

Iftraffic>token-rate Trafficwillbedelivered,andtokenwillbetakenfromthebucket,asmuchasthedifferences.Iftokenisnotenough/bucketisempty,trafficwillbedeliveredastoken-rate.

TokenBucket– MikrotikIndonesia 15

Page 16: QoS on RouterOS with Token Bucket - MikroTik · This license lets others remix, tweak, and build upon your work even for commercial purposes, as long as they credit you and license

TokenBucketExample

• Max-limit=20M,Bucket-size=10àBucket-capacity=20*10=200Mbit

• Routerwilldeliveredadditional(aftertoken-rate)200Mbittrafficwithoutanylimitation.

• 30Mbpswillbedeliveredin…….seconds:

200/(30– 20)=200/10=20secondsTokenBucket– MikrotikIndonesia 16

BucketCapacity /(- )Actual

SpeedTokenRate

Page 17: QoS on RouterOS with Token Bucket - MikroTik · This license lets others remix, tweak, and build upon your work even for commercial purposes, as long as they credit you and license

40Mbpswillbedeliveredin…….seconds:Second(s) Traffic TokenDeducted/

SpeedExceedTokenleftat

bucketSpeed

Delivered

0 0 200Mbit

1 40Mbps 20Mbit 180Mbit 40Mbps

2 40Mbps 20Mbit 160Mbit 40Mbps

3 40Mbps 20Mbit 140Mbit 40Mbps

4 40Mbps 20Mbit 120Mbit 40Mbps

5 40Mbps 20Mbit 100Mbit 40Mbps

6 40Mbps 20Mbit 80Mbit 40Mbps

7 40Mbps 20Mbit 60Mbit 40Mbps

8 40Mbps 20Mbit 40Mbit 40Mbps

9 40Mbps 20Mbit 20Mbit 40Mbps

10 40Mbps 20Mbit 0 40Mbps

11 40Mbps 0 0 20MbpsTokenBucket– MikrotikIndonesia 17

Page 18: QoS on RouterOS with Token Bucket - MikroTik · This license lets others remix, tweak, and build upon your work even for commercial purposes, as long as they credit you and license

TokenBucketExample

• Afterthebucketempty,trafficwillbelimitedtotoken-rate(20M)

• Andifclientutilizelowerthentoken-rate,forexampleonly15Mbps,bucketwillbefulloftokensafter…..seconds:

200/(20– 15)=200/5=40secondsTokenBucket– MikrotikIndonesia 18

BucketCapacity /(- )Token

RateActualSpeed

Page 19: QoS on RouterOS with Token Bucket - MikroTik · This license lets others remix, tweak, and build upon your work even for commercial purposes, as long as they credit you and license

Howaboutburst?

• Inburstcalculation,routerhavetorememberspeedperqueueinthelast(burst-time)seconds.

• Intoken-bucket,onlytoken-rateandnumberoftokensinbucketwillbeconsidered.

• Inhighloadapplication,tokenbucketmightbemoreefficent thenburst.Really?

TokenBucket– MikrotikIndonesia 19

Page 20: QoS on RouterOS with Token Bucket - MikroTik · This license lets others remix, tweak, and build upon your work even for commercial purposes, as long as they credit you and license

Comparation

• Istokenbucketreallymoreefficientthenburstsystem?

• It’sreallydifficulttotest:– CPUloadisnotonlyrelatedwithqueueconfiguration,butthesizeoftrafficdeliveredbyrouter

– Queueisveryefficient.500+simplequeuewith500mbpsonlymake1%CPUload.

TokenBucket– MikrotikIndonesia 20

Page 21: QoS on RouterOS with Token Bucket - MikroTik · This license lets others remix, tweak, and build upon your work even for commercial purposes, as long as they credit you and license

WithSimpleQueue

It’sonly1%ofCPULoadwithSimpleQueue

QoS onMulticore – Mikrotik Indonesia 21

Page 22: QoS on RouterOS with Token Bucket - MikroTik · This license lets others remix, tweak, and build upon your work even for commercial purposes, as long as they credit you and license

Letsuse(not)sofastrouterboard!

TokenBucket– MikrotikIndonesia 22

Page 23: QoS on RouterOS with Token Bucket - MikroTik · This license lets others remix, tweak, and build upon your work even for commercial purposes, as long as they credit you and license

RB230Token Bucket– Mikrotik Indonesia 23

Page 24: QoS on RouterOS with Token Bucket - MikroTik · This license lets others remix, tweak, and build upon your work even for commercial purposes, as long as they credit you and license

TokenBucket– MikrotikIndonesia 24

RB44GV

Page 25: QoS on RouterOS with Token Bucket - MikroTik · This license lets others remix, tweak, and build upon your work even for commercial purposes, as long as they credit you and license

TokenBucket– MikrotikIndonesia 25

Forbandwidthtest

Page 26: QoS on RouterOS with Token Bucket - MikroTik · This license lets others remix, tweak, and build upon your work even for commercial purposes, as long as they credit you and license

TokenBucket– MikrotikIndonesia 26

bridge

UseIPfirewall

Bridgeports

Page 27: QoS on RouterOS with Token Bucket - MikroTik · This license lets others remix, tweak, and build upon your work even for commercial purposes, as long as they credit you and license

BandwidthtestonCCRTokenBucket– MikrotikIndonesia 27

Page 28: QoS on RouterOS with Token Bucket - MikroTik · This license lets others remix, tweak, and build upon your work even for commercial purposes, as long as they credit you and license

WithoutqueueTokenBucket– MikrotikIndonesia 28

Page 29: QoS on RouterOS with Token Bucket - MikroTik · This license lets others remix, tweak, and build upon your work even for commercial purposes, as long as they credit you and license

TokenBucket– MikrotikIndonesia 29

Page 30: QoS on RouterOS with Token Bucket - MikroTik · This license lets others remix, tweak, and build upon your work even for commercial purposes, as long as they credit you and license

TokenBucket– MikrotikIndonesia 30

Withqueue

Page 31: QoS on RouterOS with Token Bucket - MikroTik · This license lets others remix, tweak, and build upon your work even for commercial purposes, as long as they credit you and license

TokenBucket– MikrotikIndonesia 31

Burst

TokenBucket

Page 32: QoS on RouterOS with Token Bucket - MikroTik · This license lets others remix, tweak, and build upon your work even for commercial purposes, as long as they credit you and license

Withburst

withtokenbucket

TokenBucket– MikrotikIndonesia 32

Page 33: QoS on RouterOS with Token Bucket - MikroTik · This license lets others remix, tweak, and build upon your work even for commercial purposes, as long as they credit you and license

Conclusions

• TokenBucketisalternativestoburstsystem• Differenceofefficiencybetweenbothsystemisstillverysmall.

Token Bucket– Mikrotik Indonesia 33

Page 34: QoS on RouterOS with Token Bucket - MikroTik · This license lets others remix, tweak, and build upon your work even for commercial purposes, as long as they credit you and license

ThankyouCommentsandsuggestions:

Token Bucket– Mikrotik Indonesia 34

Thislicenseletsothersremix,tweak,andbuilduponyourworkevenforcommercialpurposes,aslongastheycredityouandlicensetheirnewcreationsundertheidenticalterms.Thislicenseisoftencomparedto“copyleft”freeandopensourcesoftwarelicenses.Allnewworksbasedonyourswillcarrythesamelicense,soanyderivativeswillalsoallowcommercialuse.