peer to peer system

24
PEER TO PEER SYSTEM Author : Jahanzaib Niazi

Upload: sam-niazi

Post on 15-Jul-2015

285 views

Category:

Education


2 download

TRANSCRIPT

PEER TO PEER

SYSTEM

Author : Jahanzaib Niazi

What is Peer to Peer Architecture?

Peer to peer is a type of architecture in which nodes are interconnected with each other and share resources with each other without the central controlling server.

P2P system allows us to construct such a distributed system or a application in which all resources and data is contributed by the hosts over the network.

P2P system allows us to sharing of data at very large scale without the use of any server whose job is to manage the scaling it means that scaling of data can be done without a server.

P2P are used in Filesharing,webcaching and providing information to user , Bittorrent and etc are examples of P2P applications which use P2P architecture.

Difference b/w P2P and Client

Server Architecture

Server is a basically a point of difference

between the P2P and client server

architecture.In c/s architecture there is a

central server which is managing all the

resources across the network but in p2p there

is no server which is completely handling the

complete network all nodes can connect and

share resources with each other.

Advantages of Peer to Peer

It is easy to install.

All resources are shared by all nodes with

each other without a server.

Central dependency is eliminated.

It is more reliable.

Cost of building and maintaining this p2p

network is less as compared to other network.

Disadvantages of Peer to Peer

As we no there is not central server so that network cannot be administrated for example we cannot filter the files being shared by the nodes with each other.

Security is an other issue in this network as malware can easily be transmitted across the network.

Because of no centralized server we cannot make a backup of system every node has to make backup of its own data in his system.

Transferring of sensitive data through the p2p is not recommended.

Distributed Nodes location and

Routing

Distributed nodes are the nodes which are

connected in the p2p network.

Efficiency of the a peer to system depends

upon the location of nodes and there

interconnection.

Peer to Peer Models

Purely Decentralized System

Centralized System

Hybird System

Purely Decentralized Model:

It is a type of model in which there is not central sever all nodes are acting as both client and server all are getting and sending data to each other no server is managing them.

Advantages:

i.) High Performance

ii.) Failure of single node doesn’t fails whole network.

iii.) Easily scalable and robustness.

Disadvantages:

i.) We cannot administrate the network.

ii.) Cannot filter the network traffic that what files are being shared.

iii.) Locating peers and offering services is a challenging tasks.

Example:

Gnutella 0.4

Centralized P2P Model:

In this model which there is a central server whose job is that it is maintaining all the records of files which each node have.

When a node needs a file its requests to the server makes the lookup in its database and redirects the requesting node to that node which has file.

So then this requesting node makes the direct connection with that node which has file.

Note Server only searches file it doesnot transfer files.

For transfering of files nodes make direct connection

With each other.

Continued….

Continued….

Advantages:

i.) Quick searches.

ii.) Low bandwidth required.

iii.) Searches can be filtered to some extent.

iv.) Main advantage of this system is faster resource sharing.

Disadvantages:

i.) Failure of server fails down whole network.

ii.) This model is more easily be attacked.

iii.) There limitation is that scalabilty of network is affected by use of server.

Example:

Napster, BitTorent.

Hybird P2P Model:

Main advantage of Centralized model is faster and reliable resource sharing.But there limitation is that scalabiilty of system is affected by use of servers.

Main advantage of Decentralized model is that they take less time in locating the resource as compared to the Centralized Model.

Hybird Model is a type of Model which is introduced to take advantage of both centralized and decentralized system this model doesn’t uses the server hence scalability issue got resolved.

This model introduced the new concept of SUPERNODES.Hybirdmodel uses Super nodes,they are the more powerful nodes then the other nodes they are dynamically choosen.By use of super nodes Resource locating become faster. By using supernodes we can take advantage of both decentralized search techniques and centralized search techniques.

Continued….

Continued….

Advantages of Hybird Model:

I.) Issue of scalability in centralized model resolved.

ii.) We can fastly locate the resource by use of supernodes.

Disadvantages:

i.) Searching is still based upon the flooding.

ii.) Loss of Distribution , more centralized control.

Example:

Gnutella v0.6

Skype Case Study:

Skype has basically a hybird peer to peer architecture such as Kazza or Gnutella v0.6.

There are three types of nodes in Skype Network.

i.) Ordinary peers

ii.) Super Nodes

iii.) Central Login Server

The login server stores all the usernames and

All passwords and ensures that usernames are

Unique across the skype namespace this node

Authenticates the users.

Continued…

Continued….

Skype used TCP for signalling and both UDP

and TCP for data transferring.

All users communication are encrypted using

AES 256-bit.

Normal Login:

i.) Skype client connects with the supernode.

ii.) Skype client is authenticated using skype

login server.

Some important terminologies:

Seeder: Seeder is a one whose file is completely downloaded but its uploading.

Leecher: Some one who is downloading file.

Peer: Collective term for seeder and leecher.

Swarm : A group of peers sending or receiving simultaneously the same file.

Torrent file: A file contains information(Address/hostname) about Tracker.

Tracker : A server that manages the bit torrent transfer process. tracker is computer which acts as a server, and maintains a list of nodes which are participating in the system (ie. computers that are currently downloading or uploading file data). For a new node to join a Bittorrent network, it sends a message to the tracker requesting the IPs of some of the other participating nodes, so that it can connect to them and begin downloading. No actual file data is downloaded from the tracker; its job is simply to facilitate node discovery.

Bit Torrent Architecture

Bit torrent is a centralized peer to peer

Application.

Bit torrent uses a central server to maintain the records of all shared files of all nodes.

Below are four steps in Bit torrent.

Join (Torrent is created)

Publish (Torrent is published over internet)

Search (File is searched across the nodes)

Fetch (File is download)

Overall Architecture

A

B

C

Peer

[Leech]

Downloader

“US”

Peer

[Seed]

Peer

[Leech]

TrackerWeb Server

Overall Architecture

A

B

C

Peer

[Leech]

Downloader

“US”

Peer

[Seed]

Peer

[Leech]

TrackerWeb Server

Overall Architecture

A

B

C

Peer

[Leech]

Downloader

“US”

Peer

[Seed]

Peer

[Leech]

TrackerWeb Server

Overall Architecture

A

B

C

Peer

[Leech]

Downloader

“US”

Peer

[Seed]

Peer

[Leech]

TrackerWeb Server

Overall Architecture

A

B

C

Peer

[Leech]

Downloader

“US”

Peer

[Seed]

Peer

[Leech]

TrackerWeb Server

Overall Architecture

A

B

C

Peer

[Leech]

Downloader

“US”

Peer

[Seed]

Peer

[Leech]

TrackerWeb Server

Overall Architecture

A

B

C

Peer

[Leech]

Downloader

“US”

Peer

[Seed]

Peer

[Leech]

TrackerWeb Server

Query Flooding:

Query flooding is an old technique of file searching across the P2P network.

Gnutella v0.4 used that technique.

In this technique file is searched across the neighbours , if they don’t have file these neighbours search file around there neighbours hence whole network is searched.

In this technique we can limit the range of search.

Query flooding use is very poor it is not easily scalable hence now a days it is not used.

Now a days it is replaced by Query Routing such as Gnutella v6.0 is using Query Routing.

Distributed hashtables are also an alternative.

Thanks for learning:

For Queries and Feedback email me at :

[email protected]

Also you can download lecture notes from:

http://www.bscsf11b.blogspot.com