Friday, September 28, 2012

Transferring files over the Internet using torrents

Recently I needed to copy several gigabytes of pictures and videos from a family member's computer.  My initial attempt was to run an FTP server (FileZilla) and transfer the files that way.  This failed because the Internet connection on the other end is kind of flaky.  Their DSL connection has a tendency to briefly drop-out, sometimes as often as every 5 minutes.  So I needed to find a reliable way to transfer these files, some method that is fault-tolerant of frequent connection losses.  I know I could use Dropbox, Google Drive, or some other form of online storage as an intermediary location, but I'd prefer to direct PC to PC transfer.  On the suggestion of someone else, I decided to give torrents a try.  This seemed like a great idea - below is how I got the transfer to work using torrents.

First let me say I'm by no means an expert when it comes to torrents.  This was my first real exposure to torrents, so much of the technology and terms is new to me.  But I do know enough about the torrent design to know that it should handle a flaky connection.

The first thing you need is a torrent client and server.  Far and away the most popular and used program for Windows is uTorrent (free).  I started to use this program and it would have worked, but this program has some really annoying ads, nagware, whatever you want to call it.  I then discovered qBitTorrent (also free) which in my opinion is a much better program.  It does pretty much everything of uTorrent but without the nags, and it's open-source which is nice.

After you start qBitTorrent, click Tools then Options.  On the "Behavior" page enable "Inhibit system sleep" at the bottom.  You don't want your computer going to sleep during the transfer.

On the "Connection" page take note of the port being used.  You may need to open holes in your firewall later on.  Also, UPnP is very convenient if your home router supports it.

On the "Speed" page uncheck the "Upload" field at the top.  We don't want to limit the transfer speed, we want it to go as fast as possible.

And finally, on the "Advanced" page scroll down and enable the embedded tracker.  Also take note of the tracker port.

You're now ready to create the torrent on the computer with the files to send.  Click on Tools then Torrent Creator.  At the top enter the path to the file or folder containing the files to be sent.  Under "Tracker URLs" you need to manually type the URL used to identify the new torrent.  The form is "http://<public_ip>:<port>/announce"  Public IP is your IP address on the Internet, which is likely different than the IP address of your computer.  To get your public IP address you can Google "what's my IP"  As for port number, that's the embedded tracker port from the Advanced page in the options.  Lastly, enable "private" and "start seeding" at the bottom.  When you click "Create and Save" it will ask for a location to save the torrent file, and it will begin "hosting" the files.  You need to email or otherwise transfer this torrent file to the receiving computer.

Receiving the files is much easier.  Just start any torrent client (again, I recommend qBitTorrent) and open the torrent file created by the sending machine.  If you did everything correctly it will begin to download the files.

If the torrent doesn't connect, then chances are the firewall(s) on the sending side are blocking things.  There are likely two firewalls on the sender-side, the Windows firewall and the router.  You need to open up exceptions in both, for both the connection port (connection page of the options) and tracker port (advanced page).  If your router doesn't support UPnP then you need to setup port forwarding for these two ports.

No comments:

Post a Comment