Magnet links

KarwanJacksi 2,260 views 24 slides Nov 18, 2014
Slide 1
Slide 1 of 24
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24

About This Presentation

Magnet Links technology and description


Slide Content

UOZ–FS-CS
Magnet Links Magnet Links
An Introduction..
Karwan Jacksi
An Introduction..
Karwan Jacksi
Faculty of Science
Computer Science Department
University of Zakho
22/04/2012
Faculty -Department Seminar

Outline: •
Background
•
Client
-
Server vs. Peer to Peer Model.
UOZ–FS-CS •
Client
-
Server vs. Peer to Peer Model.
•
BitTorrent Protocol.
•
DHT Networks.
•
Peer Exchange.
•
Magnet Links
•
History
•
Use of Content Hashes
•
Use of Content Hashes
•
Technical Description
•
The Pirate Bay
Karwan Jacksi
22/04/2012

Background •
Client Server Model
–
The server has to upload the file to all clients tha t are requesting.
UOZ–FS-CS –
The server has to upload the file to all clients tha t are requesting.
–
The server bandwidth is the bottleneckwhen many concurrent 
applicants request.
–
Would get congested and overload the server with too many 
requests.
–
Lacks the robustness. 
–
since it has a single point of failure.
•
Peer to Peer (P2P) Model
•
Peer to Peer (P2P) Model
–
Offers more than a single source for files to be do wnloaded.
–
Getting pieces from other peers increase while the  number of 
concurrent peers increase.
–
bandwidth is used efficiently.
Karwan Jacksi
22/04/2012

Background •
BitTorrent Protocol

One of many P2P file sharing prototypes in existence.
e.g. Napster, Kazaa… etc.
UOZ–FS-CS –
One of many P2P file sharing prototypes in existence.
e.g. Napster, Kazaa… etc.

One of few P2P protocols that has managed to attract millions of users.

One of the most common protocols for transferring large files.

Its power comes from splitting the file into several  smaller pieces.

once a piece is obtained by a peer, it can be share d with other peers in the swarm.

To download a file via BitTorrent, you need:
–
Torrent file: a small metadata file with . torrentextension. 
•
Contains: information about files e.g. names, size,  etc., and URL of a Tracker.
–Tracker: a navigation centre for the swarm and is responsi ble for helping clients to 
find each other in their swarm.
Karwan Jacksi
22/04/2012

Background •
Distributed hash table (DHT)

A class of a decentralized
distributed system
that provides a lookup 
UOZ–FS-CS –
A class of a decentralized
distributed system
that provides a lookup 
service similar to ahash table;

Usually most file sharing programs use a distributed  hash table.

The DHT Network is used to find IP addresses of peers present in a 
swarm, instead of those provided by a tracker.

DHT allows to search for peers using queries based  on
info hash
and 

DHT allows to search for peers using queries based  on
info hash
and 
requires no interaction whatsoever with the tracker( s) of that torrent.

Search engines use DHT networks to look up 

what search terms are the most popular, and 

what different parts of the search engine most people use most frequently.
Karwan Jacksi
22/04/2012

Background •
Peer Exchange (PEX)

A
communications protocol
that augments the
BitTorrent
protocol.
UOZ–FS-CS –
A
communications protocol
that augments the
BitTorrent
protocol.

It allows a group ofpeers that are collaborating to  share a given file.

The original design of the BitTorrent protocol, pee rs in a "swarm“ relied 
upon a central computer server “tracker”to find each other.

PEX greatly reduces the reliance of peers on a track er 
by allowing each 
peer to directly update others in the swarm as to wh ich peers are 
currently in the swarm. 

By reducing dependency on a centralized tracker, PEX  increases the 
speed, efficiency, and robustness of the BitTorrent  protocol.
Karwan Jacksi
22/04/2012

What is Magnet Link?

According to the original BitTorrent design, .torre nt files are 
downloaded from torrent web sites (usually index site s). 
UOZ–FS-CS –
Upon downloading the file, the BitTorrent client ca lculates a 20-byte 
SHA-1 hashof the info key from the .torrentfile which it uses in the 
query made to the tracker to uniquely identify the tor rent and find out 
IP addresses of other peers sharing that torrent

to which it will subsequently connect and download the contents referred in the 
.torrent file. 

Magnet Linkstake that a step further, since they contain embedde d as  a parameter, not the link to a .torrent file but in stead, the info
-
hash 
a parameter, not the link to a .torrent file but in stead, the info
-
hash 
value already calculated for that specific torrent fi le. 

Therefore, by clicking on a Magnet Link your client g ets the info-hash of 
the torrent passed to it, which it further uses to  query the DHT Network 
and find other peers which share that torrent.
Karwan Jacksi
22/04/2012

Background •
‘.torrent‘ files

For years, BitTorrent clients, trackers and indexers have relied on .
torrent
files to
UOZ–FS-CS –
For years, BitTorrent clients, trackers and indexers have relied on .
torrent
files to
store information on the files shared with the popular p2p protocol.

These files are stored by indexing sites and are used by BitTorrent clients to
connect to the tracker sites. –
The files hold several types of data, a URL of the tracker site, names for the fi les
it shared, as well as hash codes of files.

All of this is used by the client to connect with p eers that have the files in the torrent, 
or portions of them, and also to ensure that the do wnloaded data is accurate. 

This system has several disadvantages, some technical,  but one of the 
biggest is that BitTorrent indexers have to store t he .torrent files on 
their servers, which leaves them vulnerable to legal threats if the 
content shared happens to be infringing despite containing no actual 
infringing data by themselves.
Karwan Jacksi
22/04/2012

Magnet Links

Magnet links though are just links, they have no file s associated with 
them just data. 
UOZ–FS-CS –
The links are an evolving URI standard developed prima rily to be used by 
P2P networks. 

They differ from URLs in that they don't hold informa tion on the 
locationof a resource but rather on the contentof the file or files to 
which they link. 

Technically, magnet links are made up of a series of  parameters  containing various data in no particular order.  containing various data in no particular order. 

In the case of BitTorrent :

they hold the hash value of the torrent which is th en used to locate copies of the files 
among the peers.  –
they may also hold file name data or links to track ers used by the torrent.
Karwan Jacksi
22/04/2012

Magnet Links

With magnet links, BitTorrent indexers don't have to  store any file at all, 
just a few snippets of data leaving the individual cl ient apps to do all the 
UOZ–FS-CS
heavy lifting. 

Magnet links can be copy-pasted as plain text by user s and shared via 
email, IM or any other medium. 

For the indexer sites, the allure is clear, using ma gnet links makes it 
harder for them to be accused of any wrong-doing in  court. 

Theoretically, magnet links should not have any disadva ntages for the  users over .torrent files either.  users over .torrent files either. 

It would also potentially make downloads faster as i t would enable the 
clients to download from peers which have identical  files but with 
different names.
Karwan Jacksi
22/04/2012

Magnet Links

In practice though, since the technology is still be ing actively developed, 
some kinks still creep up. 
UOZ–FS-CS

Up until very recently, many of the major BitTorrent clients didn't support
magnet links at all. –
After thePirate Bay introduced them, this is no longer a problem, but there
are still things to work out.

Indexer sites haven't agreed on a single link format,  so it’s up to the 
clients to support the various implementations. 
Karwan Jacksi
22/04/2012

Magnet Links

And for the users, the experience isn't on par with  using plain .torrent 
files yet. 
UOZ–FS-CS

For example, magnet links on the Pirate Bay don't have any additional data
on the torrent other than its content so when the link is opened in uTor rent,
for example, the torrent won't have a name or list the files in it.

This leads to a second problem, without knowing the contents of the
torrent, uTorrent starts downloading it directly in the default location,
preventingusers from selecting a custom location or selecting just some files
in a multiple-file torrent.

These are likely to be just temporary set
-
backs, the recently
-
launched

These are likely to be just temporary set
-
backs, the recently
-
launched
TorrIndex, the world's first magnet link-only BitTorrent indexer, is listin g
links which have additional information like tracker URLs and the torrent's
name.

And with broader support from BitTorrent clients and indexers, magnet links
will eventually replace .torrentfiles sooner than you might expect.
Karwan Jacksi
22/04/2012

Magnet Links

Magnet links don't require a tracker (since it uses  DHT), nor does it 
require you to download a separate file before start ing the download, 
which is convenient.
UOZ–FS-CS
which is convenient.

The main reason torrent sites are moving toward magnet links—apart 
from convenience to the user—is that these links (pro bably) free torrent 
sites like The Pirate Bay from legal trouble. Since  The Pirate Bay won't 
be hosting files that link to copyrighted content—tha t is, the torrent 
files—it's more difficult to claim the site is direc tly enabling the 
downloading of copyrighted material. 
Karwan Jacksi
22/04/2012

Magnet Links •
History

The standard was developed in 2002, partly as a "vendor
-
and project
-
neutral
UOZ–FS-CS –
The standard was developed in 2002, partly as a "vendor
-
and project
-
neutral
generalization" of the ed2k:and freenet: URI schemes used
by eDonkey2000and Freenet, respectively, and attempts to follow
official(Internet Engineering Tast Force) IETFURI standards as closely as
possible.

Applications supporting magnet links include μTorrent
,
aMule
,
BitComet
,
BitSpirit
,
BitTorrent
,
DC++
,
Deluge
,
FrostWire
,
gtkg
nutella
,
I2P
,
KTorrent
,
MLDonkey
,
Morpheus
,
Qbittorrent
,
rTorrent
,Shareaza
,
Tra
nsmission
and
Vuze
.
nsmission
and
Vuze
.
Karwan Jacksi
22/04/2012

Magnet Links •
Use of content hashes

The most common use of magnet links is to link to a  particular file based 
UOZ–FS-CS –
The most common use of magnet links is to link to a  particular file based  on ahashof its contents, producing a unique identifier for  the file, 
similar to anISBNorcatalognumber. 

Unlike traditional identifiers, however, content-bas ed signatures can be 
generated by anyone who already has the file, and so d o not need a 
central authority to issue them. 

This makes them popular for use as "guaranteed"searchterms within  the
file sharing
community where anyone can distribute a magnet link to 
the
file sharing
community where anyone can distribute a magnet link to 
ensure that the resource retrieved by that link is th e one intended, 
regardless of how it is retrieved. 
Karwan Jacksi
22/04/2012

Magnet Links •
Use of content hashes

While it is theoretically possible that two files co uld have the same hash 
UOZ–FS-CS –
While it is theoretically possible that two files co uld have the same hash  value (known as a "hash collision"), cryptographic hash functionsare 
designed so that the probability of this event is a p ractical impossibility

even if an expert is intentionally looking to find  two files with the same hash value.

Another advantage of magnet links is their open nature and platform 
independence: 

the same magnet link can be used to download a resource from one of any number of  applications on almost any operating system.  applications on almost any operating system. 

Because magnets are concise and plain-text, it is po ssible for users to 
simplycopy-and-pastethe links into emails or instan t messages, a 
property not found in, for example,BitTorrentfiles.
Karwan Jacksi
22/04/2012

Magnet Links •
Technical description

Magnet links consist of a series of one or more par ameters, the order of 
UOZ–FS-CS –
Magnet links consist of a series of one or more par ameters, the order of  which is not significant, formatted in the same way  as thequery 
stringon the end of manyHTTPURLs. 

The most common parameter is "xt", meaning "exact topic", which is 
generally aURNformed from the content hash of a particular file,  e.g..
magnet:?xt=urn:sha1:YNCKHTQCWBTRNJIV4WNAE52SJUQCZO5C
referring to theBase32encodedSHA-1hash of the file in question. 

Note that although this refers to a particular file , a search must still be 
carried out by the client application to determine w here, if anywhere, it 
can obtain that file.
Karwan Jacksi
22/04/2012

Magnet Links •
Technical description

Other parameters defined by the draft standard are:
UOZ–FS-CS –
Other parameters defined by the draft standard are:

"dn" ("display name"): a filename to display to the u ser, for convenience

"kt" ("keyword topic"): a more general search, speci fying search terms 
rather than a particular file

"mt" ("manifest topic"): a URI pointing to a "manif est", e.g. a list of 
further items

The standard also suggests that multiple parameters of the same type 

The standard also suggests that multiple parameters of the same type  can be used by appending ".1", ".2", etc. to the par ameter name, e.g.:
magnet:?xt.1=urn:sha1:YNCKHTQCWBTRNJIV4WNAE52SJUQCZO5C&xt.2=urn:sha1:T
XGCZQTH26NL6OUQAJJPFALHG2LTGBC7
Karwan Jacksi
22/04/2012

Magnet Links •
The Pirate Bay

The world's largest BitTorrent tracker
is shutting down!.
UOZ–FS-CS –
The world's largest BitTorrent tracker
is shutting down!.

As of January 2012,The Pirate Bay has switched to magnet links as the 
defaultoption and may use magnet links exclusively eventually. 

On February 28, 2012, The Pirate Bay startedusing magnet links 
entirely.

It has decided that there is no need to run a track er anymore, so it will 
remain down! It's the end of an era, but the era is  no longer up to date. 

We have put a server in a museum already, and now the tracking can be 
put there as well,” the Pirate Bay announced.
Karwan Jacksi
22/04/2012

Magnet Links •
The Pirate Bay

Recently though, technologies like Distributed Hash  Table (DHT) and 
UOZ–FS-CS –
Recently though, technologies like Distributed Hash  Table (DHT) and  Peer Exchange (PEX) have rendered trackers useless as they are able to 
find peers without the need for a tracker server. Th is makes the whole 
system a lot more stable and resilient to technical  problems, but 
perhaps even more important, it makes it a lot harde r to be attacked by 
anti-piracy organizations.

Instead, the Pirate Bay, now feature a magnet link,  allowing users to get  access to a torrent without the need to download any file making the  access to a torrent without the need to download any file making the  sites even less susceptible to legal threats.
Karwan Jacksi
22/04/2012

Magnet Links •
Advantages

They do not need a central authority to issue.
UOZ–FS-CS –
They do not need a central authority to issue.

They has open nature and platform independence, the same magnet link can be
used as long as the system has the appropriate application. –
They are more user based, easy to use.

All the system need is an application that support magnet links.

Since it is user based, it is so easy to share resources.

Most Magnet links application has a search function.
Disadvantages:
•
Disadvantages:

Slower speed.

Less control on speed and on the contend that is being downloaded
Karwan Jacksi
22/04/2012

Torrents •
Advantages
•
Faster connection.
UOZ–FS-CS •
Faster connection.
•
Easier to search through the web.
•
Disadvantages:

Trackers are needed when downloading a contend. If the tracker is 
down and there are no existing connections, the download may never be 
finished.

Most torrent client do not have search function. Tor rents usually would 

Most torrent client do not have search function. Tor rents usually would  be find from the internet.

If a torrent was stored on web for long time, the t racker may be expired 
already. It is almost impossible to find existing see d or leechers.
Karwan Jacksi
22/04/2012

References •
Further Development of BitTorrent Simulator in Erlang(Karwan Jacksi)
•
Is P2P dying or just hiding? 
(Thomas Karagiannis UC Riverside 
[email protected]
)
UOZ–FS-CS
•
Is P2P dying or just hiding? 
(Thomas Karagiannis UC Riverside 
[email protected]
)
•
Distributed algorithms for improving BitTorrent perf ormance (ANIL CAN AKAY)
•
Incentives Build Robustness in BitTorrent  (Bram Cohen)
•
http://lifehacker.com/5411311/bittorrents-future-dht-pex-and-magnet-
links-explained
•
http://en.wikipedia.org/wiki/Distributed_hash_table
•
http://en.wikipedia.org/wiki/Peer_exchange
•
http://en.wikipedia.org/wiki/Peer_exchange
•
http://en.wikipedia.org/wiki/The_Pirate_Bay
•
http://en.wikipedia.org/wiki/Secure_Hash_Algorithm
Karwan Jacksi
22/04/2012

Questions? •
Thanks for coming ☺
UOZ–FS-CS
Karwan Jacksi
22/04/2012
Tags