# Shorewall QoS confusion (tcstart)

## Liviu

I set up my shorewall on my home router.. everything works so far (I used 3 different HOWTOs to get it working :/ )

Then i wanted to do some QoS and set it up like it`s said in this guide 

http://www.shorewall.net/traffic_shaping.htm

Ok i got my tcrules set up (and of course tcdevices etc etc)

but for what do i need the tcstart file ? I thought i defined everything in my tcrules ?

There are some sample-tcstart files around but i just don`t get it for what they are for nor what they exactly do.

Any help apreciated  :Smile: 

----------

## Liviu

ok i did some "research"  :Wink: 

i used the "standard" wondershaper "wshaper.tqb" file  and copied it to /etc/shorewall/tcstart

I did this before i posted here, but got some error messages like here -> https://forums.gentoo.org/viewtopic-t-379567-highlight-rtnetlink.html

i changed some kernel options and compiled the kernel and then it works.. (just got 2 error messages  :Wink:  )

But actually i don`t know what the wondershaper exactly does.. i`m just glad it works now and i really don`t know exactly HOW it works but web browsing under full torrent and emule upload works very fluently.. although its slow when uploading AND Downloading under full load (110 kb/sec up and 800kb/sec down)

*edit*

checked it again and it doesn`t matter if i download with 200kb/sec or 800kb/sec ... the latency gets more than 8 times longer than without download (still full upload). Ping times are decent even when upload is at full! But somehow it gets really slow when downloading

----------

## madhat

Shorewall in version 3 uses TOS for their Q0S if you read the /etc/shorewall/tos file it will hep in setting what needs to be up graded to get better responce times. 

#SOURCE---------DEST-----------PROTOCOL-------SOURCE-----DEST----TOS

#----------------------------------------------------------PORTS-------PORTS

You can use numbers under TOS such as:

Minimize-Delay (16)

Maximize-Throughput (8/)

Maximize-Reliability (4)

Minimize-Cost (2)

Normal-Service (0)

The reasoning is if you are using VoIP and need reliablity you would need to set TOS to 16 on ports of VoIP.

----------

## VStrider

madhat, there's no TOS 16. From lartc :

```

   0     1     2     3     4     5     6     7

+-----+-----+-----+-----+-----+-----+-----+-----+

|                 |                       |     |

|   PRECEDENCE    |          TOS          | MBZ |

|                 |                       |     |

+-----+-----+-----+-----+-----+-----+-----+-----+

TOS     Bits Means                     Linux Priority    Band

------------------------------------------------------------

0x0     0     Normal Service           0 Best Effort     1

0x2     1     Minimize Monetary Cost   1 Filler          2

0x4     2     Maximize Reliability     0 Best Effort     1

0x6     3     mmc+mr                   0 Best Effort     1

0x8     4     Maximize Throughput      2 Bulk            2

0xa     5     mmc+mt                   2 Bulk            2

0xc     6     mr+mt                    2 Bulk            2

0xe     7     mmc+mr+mt                2 Bulk            2

0x10    8     Minimize Delay           6 Interactive     0

0x12    9     mmc+md                   6 Interactive     0

0x14    10    mr+md                    6 Interactive     0

0x16    11    mmc+mr+md                6 Interactive     0

0x18    12    mt+md                    4 Int. Bulk       1

0x1a    13    mmc+mt+md                4 Int. Bulk       1

0x1c    14    mr+mt+md                 4 Int. Bulk       1

0x1e    15    mmc+mr+mt+md             4 Int. Bulk       1

```

Liviu, traffic shaping is very complicated. I've been reading about it on the last few days. I think I've figured it out, but I feel like my head is gonna explode.  :Very Happy: 

I wish I could just throw a couple of lines and solve your problem, but unfortunatelly that's not possible. Just like you cann't take someone else's iptables script and use it for your setup(cause it won't just work, it has to be tailor-made to work for your setup), the same goes for your tc setup.

It's really worth it though if you take the route of doing everything yourself instead of using a tool like shorewall. Here's everything I've been reading on tc:

Guide to IP Layer Network Administration with Linux *****

Very good book, though not fully tc related. Start with this one. Skip what you already know or jump straight to tc if you like.

Linux Advanced Routing & Traffic Control HOWTO *****

Good explanations of terminology and tc components but with some needlessly complicated bad examples. Some of the examples will confuse you. You will understand the terminology though as well as about how things work. If you cann't understand something, skip that part and continue reading. 

Traffic Control HOWTO*****

Very good for reference or for looking up terms, qdisc specs etc etc. With diagrams and all. Do not start with this one. If you do, it's certain you'll quit.

Differentiated Service on Linux HOWTO *****

Good for reference, with diagrams which might give you ideas for setups.

A Practical Guide to Linux Traffic Control *****

I think that's the best guide, though it gets you in deep waters fast.

Good luck!  :Smile: 

----------

