Sysop:BandwithLinux

Aus immerda
Zur Navigation springen Zur Suche springen

Bandwidth

Queues

bandwidth

umrechnen beispiel:

  • 10Mbit = 10mbit
  • = 10485760 bit/s
  • = 1310720 bytes/s
  • = 1280 kbytes/s = 1280 kbps
  • = 1.25 mbytes/s (Megabytes) = 1.25 mbps

also tc schreibt b für byte und bit für bit ....

pfifo_fast qdisc (default)

simple, classless (also für ein ganzes interface)

je nach type kann mittels "priomap": minimize delay, maximize throughput, minimize monetary cost, maximize reliability,.... gewählt werden.

The Token Bucket Filter (TBF)

is a simple qdisc that only passes packets arriving at a rate which is not exceeding some administratively set rate, but with the possibility to allow short bursts in excess of this rate.

TBF is very precise, network- and processor friendly. It should be your first choice if you simply want to slow an interface down!

tc qdisc add dev ppp0 root tbf rate 220kbit latency 50ms burst 1540

Ok, why is this useful? If you have a networking device with a large queue, like a DSL modem or a cable modem, and you talk to it over a fast device, like over an ethernet interface, you will find that uploading absolutely destroys interactivity


Advice for when to use which queue

  • To purely slow down outgoing traffic, use the Token Bucket Filter. Works up to huge bandwidths, if you scale the bucket.
  • If your link is truly full and you want to make sure that no single session can dominate your outgoing bandwidth, use Stochastical Fairness Queueing.
  • If you have a big backbone and know what you are doing, consider Random Early Drop (see Advanced chapter).
  • To shape incoming traffic which you are not forwarding, use the Ingress Policer. Incoming shaping is called policing, by the way, not shaping.
  • If you *are* forwarding it, use a TBF on the interface you are forwarding the data to. Unless you want to shape traffic that may go out over several interfaces, in which case the only common factor is the incoming interface. In that case use the Ingress Policer.
  • If you dont want to shape, but only want to see if your interface is so loaded that it has to queue, use the pfifo queue (not pfifo_fast). It lacks internal bands but does account the size of its backlog.
  • Finally - you can also do social shaping. You may not always be able to use technology to achieve what you want. Users experience technical constraints as hostile. A kind word may also help with getting your bandwidth to be divided right!

beispiele

# tc qdisc add dev tap1 root tbf rate 10kbps latency 50ms burst 1540
# tc qdisc show

qdisc pfifo_fast 0: dev eth1 bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
qdisc pfifo_fast 0: dev eth2 bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
qdisc tbf 8001: dev tap1 rate 80000bit burst 1540b lat 48.8ms