Subject: [alpine-devel] Quality of Service

From: Ilya Strelkin <[email-masked]>
Date: Mon, 9 Feb 2009 12:48:19 +0300

Hi !

I am posting the alpha version of startup script to run the QoS at Alpine
router.
   This script uses iproute2 tc (traffic control) tool and has the separate
configuration file.
   The detailed documentation that discusses Quality of Service mechanisms
will be posted soon to the Documentation section of wiki.alpinelinux.org.

Technical Details:

1. Installation:

   - The attached file init-d-qos is the startup script, should be placed as
/etc/init.d/qos.
   - The attached file conf-d-qos is the configuration file; should be
placed as /etc/conf.d/qos

2. Startup:

   - Check which traffic control actions will be taken with '/etc/init.d/qos
compile'
   - Start QoS with '/etc/init.d/qos start'
   - Check status with '/etc/init.d/qos status'
   - If ok then make startup link with 'rc_add qos' or add appropriate "up"
references into /etc/network/interfaces file

3. Main Idea:

   The iproute2 tc tool is used. Setting rate about 5-10% less than real we
try to control queue at the Router side.
   A data stream is being controlled by means EGRESS shaping or/and INGRESS
policing

4. Supported Queuing Disciplines:

   At root level HTB, HFSC, PRIO queuing disciplines are supported,
      for leafs PFIFO, SFQ, RED queuing disciplines are supported

5. Supported QoS Schemes:

   EGRESS - HFSC or HTB # HFSC is good with latency control, HTB is good
with bursts control
      |
       \ Interactive (guarantee: 20%) PFIFO   # no packet reordering due to
VoIP RTP
      |
       \ Privileged  (guarantee: 50%, sharing up to 100%) PFIFO   # no
packet reordering due to RTP and IPSEC
      |
       \ Best-Effort (guarantee: 30%, sharing up to 100% if not used by
Privileged) SFQ or RED # Fair Queuing or Random Early Detection (>10mbit/sec
links)

   EGRESS - PRIO   # for variable or unknown rates
      |
       \ Interactive (guarantee: 20%) TBF # ultimate priority for
interactive traffic
      |
       \ HTB
           |
            \ Privileged  (guarantee: 50%, sharing up to 100%) PFIFO # no
packet reordering due to VoIP RTP and IPSEC
           |
            \ Best-Effort (guarantee: 30%, sharing up to 100% if not used by
Privileged) SFQ or RED # Fair Queuing or Random Early Detection (>10mbit/sec
links)

   INGRESS
      |
       \ Interactive traffic policing (20%) then CONTINUE action
      |
       \ Privileged traffic policing (50%) then CONTINUE action
      |
       \ Best-Effort traffic policing (30%) then DROP action

6. Default Schema and Traffic Classification (may be changed according to
custom needs):

   up-link - HFSC, down-link - HTB,

   Interactive (PFIFO): ACK, payload <64 bytes; ICMP, UDP, TOS: 0x10, 0x18,
0xb8
   Privileged (PFIFO): SSH, BGP, RDP, AH, ESP, TOS: 0x88
   Best-Effort (SFQ): Any other unclassified traffic

7. To do list:

   1. multiple WAN interface support
   2. code optimizations/refinements, bug fixes
   3. monitoring tools
   4. ...Any suggestions are very welcome...

Ilya S.

---

From: Natanael Copa <[email-masked]>
Date: Mon, 09 Feb 2009 11:26:11 +0100

On Mon, 2009-02-09 at 12:48 +0300, Ilya Strelkin wrote:
> Hi !
> 
> I am posting the alpha version of startup script to run the QoS at
> Alpine router.

way cool!

>    This script uses iproute2 tc (traffic control) tool and has the
> separate configuration file.
>    The detailed documentation that discusses Quality of Service
> mechanisms will be posted soon to the Documentation section of
> wiki.alpinelinux.org.
> 
> Technical Details:
> 
> 1. Installation:
> 
>    - The attached file init-d-qos is the startup script, should be
> placed as /etc/init.d/qos.
>    - Check which traffic control actions will be taken with
> '/etc/init.d/qos compile'
>    - If ok then make startup link with 'rc_add qos' or add appropriate
> "up" references into /etc/network/interfaces file
>    
> 3. Main Idea: 
> 
>    The iproute2 tc tool is used. Setting rate about 5-10% less than
> real we try to control queue at the Router side.
>    A data stream is being controlled by means EGRESS shaping or/and
> INGRESS policing
> 
>    EGRESS - HFSC or HTB # HFSC is good with latency control, HTB is
> good with bursts control
>       |
>        \ Interactive (guarantee: 20%) PFIFO   # no packet reordering
> due to VoIP RTP 
>       |
>        \ Best-Effort (guarantee: 30%, sharing up to 100% if not used
> by Privileged) SFQ or RED # Fair Queuing or Random Early Detection
> (>10mbit/sec links)
> 
>             \ Privileged  (guarantee: 50%, sharing up to 100%) PFIFO #
> no packet reordering due to VoIP RTP and IPSEC 
>            |
>             \ Best-Effort (guarantee: 30%, sharing up to 100% if not
> used by Privileged) SFQ or RED # Fair Queuing or Random Early
> Detection (>10mbit/sec links)
> 
>    INGRESS
>       | 
> 6. Default Schema and Traffic Classification (may be changed according
> to custom needs):
> 
>    Interactive (PFIFO): ACK, payload <64 bytes; ICMP, UDP, TOS: 0x10,
> 0x18, 0xb8

the config looks very complicated (and even includes functions)
Would it be possible to simplify so its posible to be used by deadly
people too? ;)

I think I will add them as is to the iproute2 package for now.

> Ilya S.

Thanks alot!

-nc

---
Unsubscribe:  [email-masked]
Help:         [email-masked]
---

---

From: Ilya Strelkin <[email-masked]>
Date: Mon, 9 Feb 2009 16:56:28 +0300

Thank you!

Having in mind a simplicity i divided configuration file onto two sections:
MAIN and ADVANCED.

Actually MAIN section has 3 parameters: up-link rate, down-link rate and
sub_percent (amount of percent of traffic to sacrifice in order to control a
queue). So in general that's all that should be adjusted before running the
script.

Thanks again for your close attention to this subject.

-is

On Mon, Feb 9, 2009 at 1:26 PM, Natanael Copa <[email-masked]>wrote:

> ...