Archives For µTorrent

A Note on the DDoS Attacks

Adam Kelly —  January 29, 2015 — 3 Comments

Recently, several sites have noticed DDoS attacks from torrent clients in China. These attacks are not originating in the torrent ecosystem, but are caused by DNS servers returning incorrect IP addresses for well-known BitTorrent trackers.

While the identity of the perpetrators and the motivation remain unclear, we here at BitTorrent would like to share some of our expertise that may help website operators mitigate these attacks.

Torrent Trackers work similarly to a normal HTTP server, but in a more limited fashion. Torrent clients contact the server, and ask it information about the torrent and the swarm.

Because of this, the misdirected torrent clients will contact the victim HTTP server, and see what looks like a valid HTTP response (although not a valid “scrape reply”).

If you follow the link to Jamie’s blog, you will notice that that he suggests a configuration change for Apache similar to the one below:

[Credit Jamie Zawinski]

In our example above, we’ve changed the response code from 404 to 410. uTorrent, Bittorrent, and torrent clients based on the excellent libtorrent library will interpret this HTTP response code as “do not attempt to contact this tracker again”. That will cause the request traffic to fall off much faster.

References:
http://furbo.org/2015/01/28/grass-mud-horse/
http://www.jwz.org/blog/2015/01/chinese-bittorrent-the-gift-that-keeps-on-giving/
http://blog.devops.co.il/post/108740168304/torrent-ddos-attack
http://www.bittorrent.org/beps/bep_0031.html

uTorrent

Our flagship torrent clients, uTorrent and BitTorrent, do many different things in the course of downloading content onto your computer faster than what’s physically possible with other protocols. There is a lot of functionality going on under the hood in the course of a download, which fall into three broad categories: networking, disk IO and user interface. We have written before about enhancements in the first two categories (uTP, DHT and multithreaded disk IO, for instance) and are now pleased to announce new improvements in how the user interface interacts with the rest of the system.

In addition to requesting and sharing pieces of files on the network and assembling them on disk, the client needs to convey these activities to the user by showing them on the screen. The logic which displays this information often interacted with the rest of the program in a coarse and intrusive way, requiring networking and/or disk IO to briefly halt while the information was gathered. For example, while viewing the list of files contained in a torrent and their relative download progress, the networking subsystem would be halted several times a second. However brief these pauses were, when multiplied by several UI elements and possibly large lists of torrents and their files, it was enough to slow overall performance.

As an analogy, consider a car’s speedometer as the user interface and the engine, transmission and wheels as the core subsystem doing the work. If the engine had to pause several times a second to update the state of the speedometer, performance would suffer.

To avoid these pauses, the layer between the UI and the rest of the system was made richer and less synchronous. Instead of pausing the subsystem to interrogate values, the UI first conveys broadly what it is interested in (which tab is visible, which torrent is selected), and the subsystem then asynchronously presents only the updated information relative to that state. The user interface layer is then free to present this information without holding up the other layers.

This is an exciting update for us to issue, as the entire engineering team is constantly refining products to try and provide the best user experience.

There’s always more to come on this front, so do stay tuned!

client-hero-torrents

3.4 is an exciting release for the uTorrent team.

3.4 is the first version to include a major change in the way that uTorrent chooses peers in a swarm. Designed by our own Arvid Norberg, Canonical Peer Priority is a way to help peers connect to the swarm faster, as well as reduce the average hop length from you to any other peer in the swarm.

When a bittorrent client joins a swarm, it needs a way to select which peers it connects to. If it chooses poorly, or if there are malicious actors in the swarm, the connections between clients are not well distributed through the swarm, leading to a large number of hops from node to node. That slows down the ability to each client to pass data on to the next.

You can read a more detailed technical discussion of the issues here, along with graphs and figures that drive home how bad the worst case can be. You can read more about graph connectivity here.

Perhaps one of the biggest changes, though, is one you cannot see. Our engineering team has been growing rapidly, and we have been busy changing our development and release processes. uTorrent 3.4 will mark the first release using improved processes that should allow us to release much more often, while keeping stability at the levels you have come to expect from the world’s fastest and lightest torrent client.

Our previous release cycle was slow. We followed the traditional alpha -> beta -> stable model that a lot of software development follows, for example large video games or operating systems. One of the problems with this style of development is as stabilization work continues on the features you just developed, new features are requested, or requirements change, and now you have to balance two lines of development in the same tree.

Also, with more developers, more changes can be made simultaneously … in theory. In reality, changes in unrelated modules (e.g. the installer) would impact when we could ship new code in other areas (e.g. the disk code), and of course, vice versa. This creates a vicious cycle, where each small problem creates a knock-on effect that impacts other features.

In a situation like this, instead of asking the business to “pick one thing and stick with it” the correct response is for the engineering team to change how they operate.

* On a small scale, picking one thing and sticking with it.
* On a larger scale Multiplexing the work into separate branches.

We needed a way to release changes fast and reliably. This implied quite a few things:
* Don’t mix changes
* Release fast, review results fast

This required us to build a few systems. Some of the larger ones:
* Our release system (code-named “Cherry”)
* Or automatic update system (code-named “The automatic update system”)

It also required programming policies into the smaller parts of the system that already existed
* The build server
* The version control system
* New test servers

These systems, working together, can now answer the question: Is this feature ready for release?
Will deploying this feature likely increase or decrease the crash rate?

We now build individual features in separate branches, which are automatically tested for stability before being integrated into the mainline. That gives us confidence that we won’t slow other engineers down, and that we won’t release a low-quality build to customers.

This effort would not have been possible without the support of the excellent engineering team at Bittorrent.

I look forward to covering these in detail in later posts.

From the uTorrent engineering team, and the rest of Bittorrent as a whole, Happy torrenting!

uT Linux Server
Good news!

We’ve just updated the µTorrent Server for Linux. It’s a pretty major refresh from the last version. What’s new? Here’s the rundown.

New features:

Touch based input option for Web UI: use your tablet or mobile phone to control your torrent client in the home network
Remote.utorrent.com integration: use your tablet, mobile phone or computer to control your torrent client from anywhere on the Internet. Either visit remote.utorrent.com or use the Android µTorrent Remote application.

Big improvements:

Performance enhancements to the Torrent engine: the faster just got faster.
Improved web UI: a modern rewrite of the UI for controlling the torrent client in the home network
□ Support for signed torrents
□ Updated RSS feed parser
□ Multiple bug fixes and enhancements

Give the new version a shot, and let us know what you think. Our forums are open. All questions, ideas, and feedback are welcome.

button-free-download

–Team BitTorrent