07.06.2014 Views

2 - Raspberry PI Community Projects

2 - Raspberry PI Community Projects

2 - Raspberry PI Community Projects

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

GOING FURTHER<br />

Optimal configuration<br />

The /usr/share/doc/wondershaper/README.Debian.gz file describes, in some<br />

detail, the configuration method recommended by the package maintainer. In<br />

particular, it advises measuring the download and upload speeds so as to best<br />

evaluate real limits.<br />

10.3.2.2. Standard Configuration<br />

Barring a specific QoS configuration, the Linux kernel uses the pfifo_fast queue scheduler,<br />

which provides a few interesting features by itself. The priority of each processed IP packet<br />

is based on the ToS field (Type of Service) of this packet; modifying this field is enough to take<br />

advantage of the scheduling features. There are five possible values:<br />

• Normal-Service (0);<br />

• Minimize-Cost (2);<br />

• Maximize-Reliability (4);<br />

• Maximize-Throughput (8);<br />

• Minimize-Delay (16).<br />

The ToS field can be set by applications that generate IP packets, or modified on the fly by<br />

netfilter. The following rules are sufficient to increase responsiveness for a server's SSH service:<br />

iptables -t mangle -A PREROUTING -p tcp --sport ssh -j TOS --set-tos Minimize-Delay<br />

iptables -t mangle -A PREROUTING -p tcp --dport ssh -j TOS --set-tos Minimize-Delay<br />

10.4. Dynamic Routing<br />

The reference tool for dynamic routing is currently quagga, from the similarly-named package;<br />

it used to be zebra until development of the latter stopped. However, quagga kept the names<br />

of the programs for compatibility reasons which explains the zebra commands below.<br />

BACK TO BASICS<br />

Dynamic routing<br />

Dynamic routing allows routers to adjust, in real time, the paths used for<br />

transmiing IP packets. Each protocol involves its own method of defining<br />

routes (shortest path, use routes advertised by peers, and so on).<br />

In the Linux kernel, a route links a network device to a set of machines that<br />

can be reached through this device. The route command defines new routes<br />

and displays existing ones.<br />

Quagga is a set of daemons cooperating to define the routing tables to be used by the Linux<br />

kernel; each routing protocol (most notably BGP, OSPF and RIP) provides its own daemon. The<br />

Chapter 10 — Network Infrastructure<br />

237

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!