IP Traffic Shaping on Linux

Recently I got interested in traffic shaping to simulate various bandwidth capacities. It was a headache to find a working software in that field until I realized that 1) it was easy 2) it was straighforward on Linux kernel since version (2.2.x?).

First of all, you need to modrobe a few kew kernel modules:  cls_u32, sch_cbq, ip_tables

Then all you have to do is to use the “tc” utility which is part of the iproute package.

For instance, let’s assume that you want  to limit incoming and outgoing traffic to 256kbits/s on your local host, and assuming that you have a 100Mbps capable network interface on eth0, what you have to do is:

#  tc qdisc add dev eth0 root handle 1: cbq avpkt 1000 bandwidth 100mbit
# tc class add dev eth0 parent 1: classid 1:1 cbq rate 256kbit allot 1500 prio 5 bounded isolated
# tc filter add dev eth0 parent 1: protocol ip prio 16 u32 match ip dst 0/0 flowid 1:1

Then if you want to change the limit, use “replace” instead of “add” in the second command. For instance:

# tc class replace dev eth0 parent 1: classid 1:1 cbq rate 64kbit allot 1500 prio 5 bounded isolated

You will notice easily that it’s doing the job very well.

Anyway,  I went into some troubles when I started to monitor the traffic: the bandwidth that I set with tc doesn’t fit at all with the actual limitation. For instance, when setting 50kbit in tc, I get a real limitation of around 24 *kBytes* per second, which is about 200kbps. At first, I thought it was a problem with “knetdockapp” that I’m using to monitor the traffic. So I used Bandwidthd which shew similar results, and finally, I transferred a big file during 60 seconds and calculated the real rate from the number of bytes that were received. The results were still the same.

So I’m still wondering why there is such a difference between the figure provided to tc and the real shaped bandwidth.

Ulteo unveils the first Open Source virtual desktop, providing businesses with quicker, cheaper deployment and easier applications management

Following its commitment to desktop virtualization solutions, Ulteo, an Open Virtual Desktop Infrastructure company, announced today that they were releasing the first version of their Open Virtual Desktop solution for enterprises. Delivering faster deployment times and ease of management for the IT department, this first release can be integrated easily into an existing professional Linux or Windows IT environment. The solution can be up and running in a few minutes, delivering rich desktop applications to corporate users.

Read more >>>

New Ulteo Application System coming soon

It’s slick, automatic, and have the latest software version inside (Firefox 3, OpenOffice 2.4…). We’re on track to release the first alpha of Ulteo “Polaris”, and guess what? Soon you may be able to play with the first Ulteo SBC/VDI solution for corporates.

Google Chrome is out

Google Chrome, a new web browser – based on Apple WebKit – aimed at surfing the world wide web, has been released by Google today. Only available for Windows for now, it should be available for other plateforms such as Linux later. What is funny, in my opinion, is that normally, releasing a new web browser should have made not even a news wavelet in the IT world. But Google is releasing it, so it makes a lot of noise. It’s clear that even if they were to release a toilet bowl, that would generate a lot of press. The good news is that they are releasing this product as Open Source, because (they)”owe a great debt to many open source projects, (…) We’ve used components from Apple’s WebKit and Mozilla’s Firefox” (which are open source projects). The question to Google now is: why don’t you improve Webkit and Firefox features and performance instead of releasing your own web browser? Other question: licensing. According to Wikipedia, Google Chrome is covered by BSD licensing but as far as I know, WebKit is covered by the LGPL. So, find the bug (if any). Regarding Mozilla, I don’t know enough about its licensing, so maybe it can be converted to BSD. I’ve tried to find information about source code licensing on the Chrome web site, but I couldn’t find any in 5 minutes. And by the way, why no antialiasing for text rendering? What else? Hmm… OK, we have a new web browser around there. Let’s dance.