—BitTorrent — A new kind swarming peer-to-peer filesharing solution

Download Report

Transcript —BitTorrent — A new kind swarming peer-to-peer filesharing solution

—BitTorrent —
A new kind swarming peer-to-peer
filesharing solution
NAME : Pang-Wei Liu
SUID : 520415912
Traditional P2P File-sharing method :
The tools we used to do filesharing work (like
ICQ/FTP/FlashGet/Net Transport), more people on the net
will cause slower download speed.
The structure of these software is one server machine owned
the files, the others download data from the serevr. Its concept
is either “one to one” or “one to many”.
Traditional P2P transference prototype
What is BitTorrent ?
BitTorrent is a swarming peer-to-peer filesharing
solution, written in Python (and thus available on nearly
every OS Python is). In more simple terms, BitTorrent
allows a single source to spread a single file to many
users by having each user share what they download. It
can be used to share any type of file of nearly any size
with a minimum of bandwidth required for the original
distributor(s).
How does BitTorrent work ?
BitTorrent needs a few things to run: a client, a torrent, and a
tracker. The client opens a .torrent file, chooses a location to
save the file, and connects to the tracker. The tracker keeps
track of how much each user is downloading and uploading,
and what parts they have, and gives information to the client
about where to get the next piece of the file.
How does BitTorrent work ?(cont.)
Note that BitTorrent downloads in a mostly random
order, although it prefers to get pieces that the fewest
people have, so even if the whole original file is
unavailable, chances are you'll be able to get a complete
file from people who all only have pieces. Also, the
tracker keeps track of your 'karma'; your download
speed is tied to your upload speed, so if you have a low
upload speed, you'll have a low download speed also.
What is (re) seeding ?
Seeding is sharing a complete file for everyone else to get. If
nobody seeds a torrent to start, it's dead, and nobody can get the
complete file. When you create a torrent, you should seed it (by
opening the .torrent file you created and choosing the file or
directory you used to create the torrent) for at least 3 days, and
possibly longer if what is being shared is very large.
What is (re) seeding ? (cont.)
If you've ever been stuck with a download where you're
uploading but your download is at 0kb/s, you've been on a
torrent that had no seeders. You hate it when it happens to you,
so don't let it happen to other people. Reseeding is when
enough people request for others to open up a .torrent for a file
they've already downloaded. If enough people reopen their
already downloaded files, the people who have incomplete
downloads can finish very quickly and seed for other people.
The BitTorrent Solution: customers help distribute content
The kernel axiom of BitTorrent
Compare with others P2P softwares, there’s one unique
property. A stable web server, provides integrated data
stream management. Not like unstable personal server. The
way machine knows the detail of the data we want to
download is File type as “*.torrent”. This document record
the site of web server and some message, file name,
directory name, data length…etc. otherwise, there’s some
thing about the length of data fragment and check code -
Sha1 code. (To make continue transfer and checksum, BT
divide data into several fragments.)
Format of torrent file
Suppose we want to download the data from web server. BT will
analysis the torrent file to get a web site as following :
http://btfans.3322.org:6969/announc...2&event=started
http://btfans.3322.org:6969/announce is the site of web server.
info_hash : is the Sha check code to find out the map to the files in
web server.
peer_id : a unique id composed of (12 “0” + present time) + the first 8
numbers of the Sha code of GUID on the web server. Totally are
20numbers.
port : the port you provide to upload.
IP : the ip address of cilent.
event : tell the server about the status of client.(start to download, stop
or finish).
Server will check these things per 5 mins.
Track
Server use this to control request. Server map it on info_hash to
check if the request is valid.
Then server will use “NatCheck” to confirm the ip address and
port of client. At last, it returns the record like this :
d8:intervali1800e5eersld2:ip14:xxx.xxx.xx.xxx7eer
id20:00180531904b7e3abdd74orti6881eeee
interval 1800 : tell BT the interval to check the status. In this
example, it ask 1800 secs.
If client has real ip : server will put the data about IP and Port
into info_hash table so that the other can see and use the
downloaded package.
Download the torrent file
Preload the destination file
(keep the disk space, load file name and size)
Start to download file
An short introduction to Python
Python is a portable, interpreted, object-oriented
programming language. Its development started in 1990 at
CWI in Amsterdam, and continues at CNRI in Reston, Va.
The language has an elegant (but not over-simplified) syntax;
a small number of powerful high-level data types are built in.
Python can be extended in a systematic fashion by adding
new modules implemented in a compiled language such as C
or C++. Such extension modules can define new functions and
variables as well as new object types.
Weakness of BT
1.For cross-plate, this software was wrote by using Python,
but it caused system loading heavy under MS Windows,
especially about server, maybe it will work better to
rewrite the track in C (it seems www.torrentse.cx has
already done that, because the returns are different than
original version), but I cannot sure if they rewrite it or just
modified.
2. The interval of track should be set smaller when it
happened to NAT Seed. Cause it will affect the speed.
Secret worry about BT
It is a fashion to use this kind of technique to transfer data
on internet recently. But there’s some problem come with it.
Since every client on the net use this software could be a
seed. What if someone use this to spread malicious code.
How can we trace the real offender if he just transfer
several packages from one point, we know we got the file,
but from where we got it, one seed or hundred seeds?
I'm Bram Cohen, the author of BitTorrent.
I started BitTorrent by spending over a year working
on it full-time, unpaid, and am very proud of how far
it's come.If you use BitTorrent and like it, please
make a donation.
The suggested amount is $10.