b o o h

m o

c .i

HTB Network Packet Scheduler implementation: experimenting with the new bucket size feature

a s

©2017 Alfredo Giordano, Matthew Ciantar Titania Networks Limited

Alfredo Giordano

m o

• MikroTik Certified Trainer. • Certified consultant for MikroTik and other Brands. • Specialized in ISP, WISP and corporate Network development. • Working with MikroTik solutions since 2006. • In Telecommunications since 2001. • Active Member of RIPE and administrator for several AS • Master degree in Electronic Engineering at Polytechnic of Turin, IT and university of Illinois of Chicago, USA.

a s

b o o h

c .i

© TITANIA NETWORKS LTD

2

Matthew Ciantar

m o

• MikroTik Certified Trainer. • Certified consultant for MikroTik – (MTCNA, MTCTCE, MTCWE, MTCRE, MTCINE, MTCIPv6E) • Certified consultant for Cisco – (CCNA, CCNP) • Microsoft Certified Professional - Enterprise Administrator (MCITP) • Experience with Service Provider, and Betting Industry for providing robust and highly available infrastructures. • Over 15 years experience with Mikrotik RouterOS and RouterBoards

a s

b o o h

c .i

© TITANIA NETWORKS LTD

3

Titania Networks

m o

• Started in 2014, by providing IT Training and Consultancy under the brand tiktrain.com • Incorporated in 2015 as a company in Ireland started operations in Europe. • Most requested services:

b o o h

c .i

– Mission critical Networking consulting – ISP Design – Network Training

a s

• Operation area:

– Europe (Ireland, Malta, Italy, the Netherlands, Spain) – Latin America © TITANIA NETWORKS LTD

4

Operations

m o

Qualified European Carriers

b o o h Custom Design

Top market Brand integrations

a s

Creative Networking Team

TITANIA NETWORKS

Consulting

c .i

Support in English, Italian, Spanish, Maltese

Connectivity

Global Partners Network

Infrastructure

• With a single point of contact.

SDN Advanced control planes

Customers

m o

Titania HQ

SDC

b o o h

Skynet

Nexus

a s

c .i

Warian Link Tec. HH

Consulting Customer

Partner with Infrastructure facility © TITANIA NETWORKS LTD

6

Goals

m o

• With this presentation we seek to explain: – Concepts involving HTB – New features introduced – What you can achieve

b o o h

c .i

• Trying to get a holistic picture from the available documentation

a s

© TITANIA NETWORKS LTD

7

Topics • Concepts • The linux kernel queue_run() • Queuing

b o o h

– Queue type / kind / size

• The HTB Algorithm

– Token / Buckets – Classes – Putting everything together

a s

m o

c .i

• Configuration basics • Real-time Lab demonstration

© TITANIA NETWORKS LTD

8

Concepts • Scheduling • Shaping • Queue

a s

b o o h

m o

c .i

© TITANIA NETWORKS LTD

9

The truth about Queues

m o

• Queues are located between the system and the interface and determine how data is SENT from the interface itself. • Queues can be used to buffer the excess of output bandwidth to prevent packet loss in case of bursts – and this is generally GOOD • TCP/IP, because of the way it works, will try to fill any queue you offer it. Queues create latency that affects interactivity for example when your keystroke must traverse a long queue – and this is generally BAD

a s

b o o h

c .i

© TITANIA NETWORKS LTD

10

Proof of Concept

a s

b o o h

m o

c .i

© TITANIA NETWORKS LTD

11

The Linux Kernel

a s

b o o h

m o

c .i

© TITANIA NETWORKS LTD

12

The Linux Kernel

m o

• The forwarding stack or the local process sends data to the kernel. • Kernel enqueues data to the queue-type selected for the queue and immediately tries to run the queue to the hardware using queue_run() • The function will call dequeue() according to the queue-kind algorithm to send to hardware (provided hardware can take as much).

a s

b o o h

c .i

© TITANIA NETWORKS LTD

13

PFIFO

m o

c .i

• Simple Buffer • Defined by queue-size • Can be bytes or packets

a s

b o o h

dequeue()

© TITANIA NETWORKS LTD

14

SFQ

a s

b o o h

dequeue()

m o

c .i

© TITANIA NETWORKS LTD

• Attempt to distribute opportunity to transmit fairly • Hash function to fit traffic in separate FIFOs • dequeue() with round robin

15

Tokens

m o

• Control the rate of dequeuing counting the number of packets/bytes dequeued is complex and timers dependent. • Instead of calculating the current usage, one method, used widely in traffic control, is to generate tokens at a desired rate, and only dequeue packets or bytes if a token is available.

a s

b o o h

c .i

© TITANIA NETWORKS LTD

16

Simple TBF

a s

b o o h

dequeue()

m o

• Built on tokens and buckets • Packets are only transmitted if there are sufficient tokens available. • Otherwise, packets are deferred. • It will introduce an artificial latency

c .i

© TITANIA NETWORKS LTD

17

Buckets

m o

• In the case that a queue does not need tokens immediately, the tokens are collected until they are needed. • The number of unused tokens that can be stored depends on the size of the bucket. • A queue that has tokens available can initially dequeue a larger number of packets or bytes before tokens are depleted.

a s

b o o h

c .i

© TITANIA NETWORKS LTD

18

HTB - Classes

m o

c .i

Hierarchical class structure

b o o h

a s

Note: HTB will not delay packets at inner level only leaf

dequeue() © TITANIA NETWORKS LTD

19

HTB - Classes

m o

• Children classes borrow tokens from their parents once they have exceeded limit-at. • A child class will continue to attempt to borrow until it reaches max-limit • It will then begin to queue packets for transmission until more tokens are available. rate

child

< limit-at

child

a s

b o o h

type

child parent parent parent

c .i

kernel action

dequeue() based on all available tokens

limit-at < rate max-limit < limit-at

delay packets

lend tokens to children

limit-at < rate < max-limit try to borrow from parent if any, lend to children > max-limit

no borrow, no lend © TITANIA NETWORKS LTD

20

HTB - Burst

m o

• Burst is a feature that allows to satisfy queue requirement for additional bandwidth even if required rate is bigger that max-limit for a limited period of time. • Burst can occur only if average-rate of the queue for the last burst-time seconds is smaller that burst-threshold. • Burst mechanism is simple - if burst is allowed queue will receive tokens at burst-limit rate. When burst is disallowed queue will receive tokens at max-limit rate.

a s

b o o h

c .i

© TITANIA NETWORKS LTD

21

HTB – Wrap up

m o

• At the end of the day the amount of readily available tokens in the child class will define its behavior. • We can set how fast the token replenish with the max-limit or burst-limit. • Until RouterOS version 6.35 bucket size was hardcoded to max-limit/10. This is why default value is set to 0.1. • Now it will accept values from 0 to 10

a s

b o o h

c .i

© TITANIA NETWORKS LTD

22

The New HTB Diagram

a s

b o o h

m o

c .i

© TITANIA NETWORKS LTD

23

How much traffic will pass Unrestricted?

m o

c .i

This is calculated as follows: Bucket Capacity = bucket-size * max-limit (or burstlimit, if burst-limit is being used)

b o o h

Default Bucket with 10M max-limit 0.1 * 10M = 1M This will allow 1M of Data (Not bandwidth!) to go at unrestricted speed!

a s

© TITANIA NETWORKS LTD

24

Default Bucket Size

a s

b o o h

m o

c .i

© TITANIA NETWORKS LTD

25

How much traffic will pass Unrestricted?

a s

b o o h

m o

c .i

Large Bucket with 10M max-limit 10 * 10M = 100M This will allow 100M of data to go at unrestricted speed!!!

© TITANIA NETWORKS LTD

26

Large Bucket Size

a s

b o o h

m o

c .i

© TITANIA NETWORKS LTD

27

What if one wants a ceiling for the burst?

m o

c .i

Bucket size work like burst but without a burstlimit. To be able to force a ceiling, we can set a max-limit on the parent queue.

b o o h

Small Bucket with 20M max-limit on the parent with a child having a Large Bucket with 10M max-limit.

a s

© TITANIA NETWORKS LTD

28

Burst with Ceiling

a s

b o o h

m o

c .i

© TITANIA NETWORKS LTD

29

Burst with Ceiling

m o

c .i

Large Bucket at the child with 10M max-limit will still allow 10 * 10M = 100M of traffic.

b o o h

But the Parent is replenishing the bucket at 20Mbit rate. So it will take ~5seconds to be able to empty the 100M bucket, before the queue settles at the actual Token Rate of 10M.

a s

© TITANIA NETWORKS LTD

30

HTB

m o

c .i

• Very predictable regular traffic can be handled by small buckets. Larger buckets may be required for burstier traffic, unless one of the desired goals is to reduce the burstiness of the flows.

a s

b o o h

© TITANIA NETWORKS LTD

31

Credits • • • •

m o

https://wiki.mikrotik.com/wiki/Manual:HTB-Token_Bucket_Algorithm https://wiki.mikrotik.com/index.php?title=Manual:Queues_-_Burst http://linux-ip.net/articles/Traffic-Control-HOWTO http://www.docum.org/

a s

b o o h

c .i

© TITANIA NETWORKS LTD

32

Grazie! Thank You! Grazzi! ¡Gracias!

m o

c .i

Time for questions, answers and suggestions

b o o h

[email protected] [email protected]

a s

© TITANIA NETWORKS LTD

33

35. HTB_Network_Packet_Scheduler_Implementation-Alfredo.pdf ...

Polytechnic of Turin, IT and university of. Illinois of Chicago, USA. ... Page 4 of 33. 35. HTB_Network_Packet_Scheduler_Implementation-Alfredo.pdf. 35.

2MB Sizes 2 Downloads 221 Views

Recommend Documents

35.pdf
(i) This question paper contains two parts—A and B. (ii) Part—A and Part—B are compulsory for all. candidates. (iii) All parts of the questions should be attempted at one. place. PART—A. ( Accounting for Not-for-Profit Organisations,. Partner

35.pdf
Sign in. Page. 1. /. 4. Loading… Page 1 of 4. Page 1 of 4. Page 2 of 4. Page 2 of 4. Page 3 of 4. Page 3 of 4. Page 4 of 4. Page 4 of 4. Main menu. Displaying 35.pdf. Page 1 of 4.

35.pdf
In today's connective global environment, it is impossible to isolate change by borders ... For this paper, we looked at transformational leadership and ... Entrepreneurial Orientation (EO) Questionnaire and Sashkin's (1995) ... Displaying 35.pdf.

34/? 35/? Du
The down link 26 can comprise different channels D1, . . . , DN. Each .... data from a telephone 1 are A/D-conver'ted 2, voice coded 3 and then supplied to a ...

35.pdf
El autor contesta desde cinco postulados que mere- cen ser analizados uno a uno. .... 35.pdf. 35.pdf. Open. Extract. Open with. Sign In. Main menu. Displaying ...

35.pdf
manager to plan the meetings, usually someone with no experience in this field. Hotels are. discovering that with small business meetings, they get lots of repeat business if they do a. good job catering to their needs. This is ... "dominate" the sma

[LibroGame].Scegli.la.tua.Avventura.-.35.-.La.Coppa.del.Vampiro.
[LibroGame].Scegli.la.tua.Avventura.-.35.-.La.Coppa.del.Vampiro.(giocabile).[by.Dirk06].pdf. [LibroGame].Scegli.la.tua.Avventura.-.35.-.La.Coppa.del.Vampiro.(giocabile).[by.Dirk06].pdf. Open. Extract. Open with. Sign In. Main menu. Displaying [LibroG

35.pdf
Confirmatory factor analysis was used to confirm a three factor solution for social ... financial performance of the firm. In spite of a growing. Page 3 of 26. 35.pdf.

35.pdf
utilized in constructing two predictive models reported here. Limited information about entrepreneurial activity as well as. entrepreneurs themselves are ...

Map 35.pdf
Sign in. Page. 1. /. 1. Loading… Page 1 of 1. Page 1 of 1. Map 35.pdf. Map 35.pdf. Open. Extract. Open with. Sign In. Main menu. Displaying Map 35.pdf. Page 1 ...

WCCADF-35.pdf
Alouette III, Contributo para a divulgação da História em Portugal – 1. Desde o .... de 7 helicópteros Alouette II na BA 6, no Montijo, em ... WCCADF-35.pdf.

WMR 35.pdf
Page 1 of 4. Prev. W/Close Last Close W. Chg (%) YTD (%) Index Prev. W/Close Last Close W. Chg (%) YTD (%). 21,750.73 21,783.40 0.15% 9.61% Gold (USD/ ...

35. Currican Costero.pdf
Page 1 of 1. 35. Currican Costero.pdf. 35. Currican Costero.pdf. Open. Extract. Open with. Sign In. Main menu. Displaying 35. Currican Costero.pdf.

MANA_Summer2015_#35.pdf
and went toward the park through the winding PATH. The. winning runner ran the hilly course in a blazing 23minutes,. 31seconds. Stay tuned for more 5K runs ...

REGOLAMENTO VIDEOSORVEGLIANZA_DEL.CC.N.35-14.pdf ...
Page 4 of 18. REGOLAMENTO VIDEOSORVEGLIANZA_DEL.CC.N.35-14.pdf. REGOLAMENTO VIDEOSORVEGLIANZA_DEL.CC.N.35-14.pdf. Open. Extract.

Depliant_Fresa_Per_Roccia_FPRD_25-35.pdf
[email protected] ... transmission par chaîne à bain d'huile. et d'un rotor denté. ... Main menu. Displaying Depliant_Fresa_Per_Roccia_FPRD_25-35.pdf.

Math 35.pdf
Sign in. Page. 1. /. 10. Loading… Page 1 of 10. Page 1 of 10. Page 2 of 10. Page 2 of 10. Page 3 of 10. Math 35.pdf. Math 35.pdf. Open. Extract. Open with.

35 Slide 1 -
Page 1. 1. 2. 3. 5. 6. 7. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 23. 19. 21. 22. 24. 25. 26. 2. 7. 28. 29. 30. 32. 33. 34. 35. 36. 37. 38. 40. 41. 42. 43. 44. 45. 46. 47. 4. 8.

10 € 35 -
1. 2. 3. 4. 5. 6. 7. 8. Mean. A. B. C. D. Mean. 10 €. 35 €. 300. 350. 400. 450. 500. 550. 600. - €. 5 €. 10 €. 15 €. 20 €. 25 €. 30 €. 35 €. 40 €. 1. 2. 3. 4. 5. 6. 7. 8. 9.

35 Web Programming.pdf
Sign in. Loading… Whoops! There was a problem loading more pages. Retrying... Whoops! There was a problem previewing this document. Retrying.

Fasc 35.pdf
Y cada paso Os eleva hacia numerosas. Fuentes de Información en paralelo a la Consciencia Universal. En estas Dimensiones, quiere decir,. en las secciones ...