Вы находитесь на странице: 1из 19

Dr : Hatem

File Sharing
 Peer to Peer File Sharing : -

Peer to peer file sharing is the practice of


downloading files from another “ peer ”
workstation. This is in contrast to a typical
server/client relationship where servers supply
and clients consume.
P2P File Sharing
In P2P, the people/computers you are
downloading from are anonymous (‫ )مجهول‬and
can be from anywhere on the Internet.
BecauseP2P spans the Internet, there are
likely a number of computers that will “share”
the file you want.
What is Peer to Peer file
?sharing
Peer to peer (P2P) file sharing is a protocol
used by various programs such as Kazaa
,Bearshare , Morphus , Gnutella, Limewire ,
and others to both ……….
( 1 ) download media files
( 2 ) and make them available for upload.

Thus there is no single, explicit server - all


clients are potential servers.
Why is my computer
sharing files if I didn't
?set it up to do so
Most P2P programs set themselves up as
servers when they are installed and run for
the first time. Every time that you run the
program (typically to look for files to
download), it acts as a server, sharing the files
in the Shared folder that it downloads into. It
is your responsibility to know what the
programs that you install on your machine are
doing. If you do not want the program to
share files, configure it to not do so.
Disable File Sharing
Windows XP

Follow these steps to disable File Sharing on Windows


XP:
1. Select Start > My Computer.
2. Select Tools > Folder Options .
3. Click on the View tab and scroll down to find the
Use Simple File Sharing .
To disable Simple File Sharing, ensure this
checkbox is NOT CHECKED.
4. Click OK to close the Folder Options window.
?P2P: Why so attractive
Low cost and high availability of large
numbers of computing and storage
resources .

Increased network connectivity


 As long as these issues keep their
importance, peer-to-peer applications will
continue to gain importance
?What is the problem
A large number of users Want to download
content that is available from a limited source
as fast as possible ……..
limited
source

users
Let us see how did it
all start
Users storing data items on their machines
Other users are interested in this data .

Problem: How does a user know which


other user(s) in the world have the data
item(s) that he desires?
Where
?
is
foo.mp3 ?
?

? ?

Hello.mp3
Britney.mp3
foo.mp3
bye.mp3
Hello.mp3
1st Generation of P2P
systems
britney.mp3 {x.imit.kth.se}
bye.mp3 {hope.sics.se}
Central Directory
hello.mp3{hope.sics.se, x.imit.kth.se
britney.mp3 {hope.sics.se}
foo.mp3
Solution: (build a {x.imit.kth.se}
central directory)
Napster….

Hope.sics.se
x.imit
.kth.s
e foo.mp3
Hello.mp3 bye.mp3 .…
Britney.mp Hello.mp .…
Basic Operations in
Napster
Join
Leave/Fail
Share (Publish/Insert)
Search (Query)
Download
The End of Napster
Since users of Napster stored copy righted
material , the service was stopped for legal
reasons .
But…. a second generation appeared…
Discussion
- Scalability
- Failure
2nd Generation Random Overlay Networks)
Distributed Directory + Distributed
(Storage
Storage + Storage +
Directory Directory

Storage +
Storage +
Directory
Main Directory
:representatives
Gnutella
Free net
Gnutella Protocol
Messages
Broadcast Messages
-Ping: initiating message (“I’m here”)
-Query: search pattern and TTL (time-to-live)
Back-Propagated Messages
- Pong: reply to a ping, contains information about the peer
-Query response: contains information about the
computer that has the needed file
Node-to-Node Messages
-GET: return the requested file
-PUSH: push the file to me
Gnutella Search
Mechanism
Steps:
• Node 2 initiates search for file A
• Sends message to all neighbors
• Neighbors forward message
• Nodes that have file A initiate a reply message
• Query reply message is backpropagated
• File download

Key idea in DHTs


1st,2ndGeneration: Each data item is stored in the
machine of its creator/downloader
Third Generation
):(DHTs
The id of a data item determines the machine on
which it is going to be stored

Simplest Example: Consistent Hashing using a Ring

(1) Each machine will have an id based on the hash of its IP


address
(2) SHA-1 or MD5sum could be used for this hashing
(3) Naturally all of them are using the same hashing
function
(4) Data will also have ids using the same function
Applications
 File Sharing:
*Emule and bittorrent are one of many popular file sharing applications which
are currently using DHTs
 Decentralized directories of all kinds, work has been done on
using DHTs to replace
* DNS, MIT
* SIP discovery, Cisco
* Trackers in Bittorrent
 Decentralized file systems
* Past & Farsite, Microsoft
* Oceanstore, Berkeley
* Keso, KTH
 SICS, KTH
* Distributed backup
* Decentralized command & control for military apps

Вам также может понравиться