A Seminar report on Peer to peer Network



Similar documents
The Role and uses of Peer-to-Peer in file-sharing. Computer Communication & Distributed Systems EDA 390

Peer-to-Peer Networks for Content Sharing

Napster and Gnutella: a Comparison of two Popular Peer-to-Peer Protocols. Anthony J. Howe Supervisor: Dr. Mantis Cheng University of Victoria

Title: P2P Networks for Content Sharing

Interoperability of Peer-To-Peer File Sharing Protocols

Peer-to-Peer File Sharing

Peer-to-Peer Networks Organization and Introduction 1st Week

P2P: centralized directory (Napster s Approach)

Decentralized Peer-to-Peer Network Architecture: Gnutella and Freenet

Improving Gnutella Protocol: Protocol Analysis And Research Proposals

PEER-TO-PEER NETWORK

An Introduction to Peer-to-Peer Networks

Peer-to-Peer Networks 02: Napster & Gnutella. Christian Schindelhauer Technical Faculty Computer-Networks and Telematics University of Freiburg

Multicast vs. P2P for content distribution

Peer-to-peer filetransfer protocols and IPv6. János Mohácsi NIIF/HUNGARNET TF-NGN meeting, 1/Oct/2004

The Internet and Network Technologies

Department of Computer Science Institute for System Architecture, Chair for Computer Networks. File Sharing

Peer-to-Peer Systems: "A Shared Social Network"

The Gnutella Protocol Specification v0.4

Architectures and protocols in Peer-to-Peer networks

Three short case studies

From Centralization to Distribution: A Comparison of File Sharing Protocols

The Algorithm of Sharing Incomplete Data in Decentralized P2P

Professor Yashar Ganjali Department of Computer Science University of Toronto.

HollyShare: Peer-to-Peer File Sharing Application

Sync Security and Privacy Brief

Common P2P Examples. Peer to Peer Networks. Client-Server Architecture. Uses of P2P. Napster Morpheus Gnutella Freenet BitTorrent Skype

Peer to Peer Search Engine and Collaboration Platform Based on JXTA Protocol

CSCI-1680 CDN & P2P Chen Avin

Overlay Networks. Slides adopted from Prof. Böszörményi, Distributed Systems, Summer 2004.

Best Practices for Controlling Skype within the Enterprise > White Paper

A Study on the novel tool to retort P2P security issues

Wireless Links - Wireless communication relies on radio signals or infrared signals for transmitting data.

Detecting peer-to-peer botnets

Bit Chat: A Peer-to-Peer Instant Messenger

Masters of Science in Information Technology

Advanced Peer to Peer Discovery and Interaction Framework

HoneyBOT User Guide A Windows based honeypot solution

The Challenges of Stopping Illegal Peer-to-Peer File Sharing

Chapter 9A. Network Definition. The Uses of a Network. Network Basics

What really is a Service?

Frequently Asked Questions

How To Analyse The Edonkey 2000 File Sharing Network

Client/server and peer-to-peer models: basic concepts

Chakchai So-In, Ph.D.

ADSL or Asymmetric Digital Subscriber Line. Backbone. Bandwidth. Bit. Bits Per Second or bps

Guideline for setting up a functional VPN

Media Exchange really puts the power in the hands of our creative users, enabling them to collaborate globally regardless of location and file size.

PEER TO PEER FILE SHARING USING NETWORK CODING

Chapter 7: Computer Networks, the Internet, and the World Wide Web. Invitation to Computer Science, C++ Version, Third Edition

INSIDE. Malicious Threats of Peer-to-Peer Networking

Unit 3 - Advanced Internet Architectures

BlackBerry Enterprise Service 10. Secure Work Space for ios and Android Version: Security Note

Internet Services. Sadiq M. Sait, Ph.D

Product Brief. DC-Protect. Content based backup and recovery solution. By DATACENTERTECHNOLOGIES

CSIS CSIS 3230 Spring Networking, its all about the apps! Apps on the Edge. Application Architectures. Pure P2P Architecture

Computers Basic Training recruits are provided access to a computer lab for completion of work assignments. Recruits may choose to bring a laptop or

Net Protector Admin Console

Monitoring Traffic manager

CS 360 Internet Programming

DDoS Vulnerability Analysis of Bittorrent Protocol

Internet Firewall CSIS Packet Filtering. Internet Firewall. Examples. Spring 2011 CSIS net15 1. Routers can implement packet filtering

GoToMyPC Corporate Advanced Firewall Support Features

AN APPLICATION OF INFORMATION RETRIEVAL IN P2P NETWORKS USING SOCKETS AND METADATA

Bridgit Conferencing Software: Security, Firewalls, Bandwidth and Scalability

4. H.323 Components. VOIP, Version 1.6e T.O.P. BusinessInteractive GmbH Page 1 of 19

INTERNET SECURITY: THE ROLE OF FIREWALL SYSTEM

Comparison of Firewall, Intrusion Prevention and Antivirus Technologies

Technical Glossary from Frontier

Discovering Computers Chapter 9 Communications and Networks

GlobalSCAPE DMZ Gateway, v1. User Guide

NFS File Sharing. Peter Lo. CP582 Peter Lo

Dell Spotlight on Active Directory Deployment Guide

Ethernet. Ethernet. Network Devices

Computer Networks and the Internet

1 Introduction. Agenda Item: Work Item:

20-CS X Network Security Spring, An Introduction To. Network Security. Week 1. January 7

A Survey of Peer-to-Peer Network Security Issues

(Refer Slide Time: 02:17)

So today we shall continue our discussion on the search engines and web crawlers. (Refer Slide Time: 01:02)

Software design (Cont.)

United Tribes Technical College Acceptable Use Policies for United Tribes Computer System

HE WAR AGAINST BEING AN INTERMEDIARY FOR ANOTHER ATTACK

Computers and Media: P2P and Business Models CSCI 1200 COMPUTERS & MEDIA, JAREK SZLICHTA

Introduction to computer networks and Cloud Computing

NETASQ SSO Agent Installation and deployment

How To Configure Voice Vlan On An Ip Phone

INTERNET CRIMES AGAINST CHILDREN: PEER-TO-PEER TECHNOLOGIES WEBCAST

Computer Network. Interconnected collection of autonomous computers that are able to exchange information

A Measurement Study of Peer-to-Peer File Sharing Systems

Transcription:

A Seminar report on Peer to peer Network ABSTRACT: This report presents information about the peer to peer network that discussed in the seminar conducted in IIT, Kharagpur on dated 24.09.2011. Here we have covered up basic idea, some of the application areas, generic architecture, advantage and limitations of peer to peer network. Out of several applications, here basically we have focused on file sharing applications. Our point of discussion was based on Napster, Gnutella and Torrent. Finally the comparison study of different P2P network we had done. By: Himadri B.G.S. Bhuyan M-tech,ICT,10IT61B11 24-Sep-11 Guided By: Prof. Indranil Sen Gupta Department of Computer Science & Engg. Indian Institute of Technology Kharagpur

TABLE OF CONTENTS 1. Introduction.3 2. What is P2P?...3 3. Peer to peer and client-server 5 4. History.6 5. Application area of P2P Network.7 6. Generic Architecture of P2P.8 7. Different types of P2P 10 A. Unstructured P2P B. Types of unstructured P2P C. Structured P2P 8. Working principle and protocol of Napster..11 9. Working principle and protocol of Gnutella.19 10. Architecture of windows P2P.24 11. Working principle of Bit torrent.24 12. Comparison study among the different Types of P2P.27 13. Advantages..27 14. Disadvantages..29 15. Conclusion..29 16. References..30 2

1. Introduction As the connection speed of the internet has increased, the demand for web related services has also increased. After the Web revolution, peer-to-peer networks evolved and currently have a number of different usages - instant messaging, file sharing, etc. Some other revolutionary ideas are still in research. People want to use peer-to-peer in many different applications including e-commerce, education, collaborative work, search, file storage, high performance computing.p2p networking has generated tremendous interest worldwide among both Internet surfers and computer networking professionals. P2P software systems like Kazaa, Gnutella and Napster rank amongst the most popular software applications ever. Numerous businesses and Web sites have promoted "peer to peer" technology as the future of Internet networking. Although they have actually existed for many years, P2P technologies promise to radically change the future of networking. P2P file sharing software has also created much controversy over legality and "fair use." In general, experts disagree on various details of P2P and precisely how it will evolve in the future. 2. What is P2P? In its simplest form, a peer-to-peer (P2P) network is created when two or more PCs are connected and share resources without going through a separate server computer. A P2P network can be an ad hoc connection a couple of computers connected via a Universal Serial Bus to transfer files. A P2P network also can be a permanent infrastructure that links a half-dozen computers in a small office over copper wires. Or a P2P network can be a network on a much grander scale in which special protocols and applications set up direct relationships among users over the Internet. Peer-to-peer networking is a distributed application architecture that partitions tasks or workloads between peers. Peers are equally privileged, equipotent participants in the application. They are said to form a peer-to-peer network of nodes. Peers make a portion of their resources, such as processing power, disk storage or network bandwidth, directly available to other network participants, without the need for central coordinator. Here each party has the same capabilities and either party can initiate a communication session. 3

On the Internet, peer-to-peer (referred to as P2P) is a type of transient Internet network that allows a group of computer users with the same networking program to connect with each other and directly access files from one another's hard drives. Napster and Gnutella are examples of this kind of peer-topeer software. Peer to Peer Network Functional Diagram In our discussion, With respect to file sharing specifically, P2P technology allows decentralized sharing. That is, rather than storing files in a central location to which individual computers must connect to retrieve the files, P2P technology enables individual computers to share directly among themselves files stored on the individual computers.some workshop participants emphasized that P2P file-sharing programs themselves do not perform the sharing or copying of files; rather, they employ a protocol that facilitates communication between the two peers who wish to share or copy a particular file.peers can share myriad types of files, including audio, video, software, word processing, and photographs. By eliminating the need for a central storage point for files, P2P file-sharing technology allows for faster file transfers and conservation of bandwidth, i.e., the capacity to transmit information to and from a computer.in addition, because P2P technology decreases the need for businesses and consumers to store files on their hard drives, it can lower costs by conserving on storage requirements and saving on maintenance and energy costs related to data retrieval, sharing, and processing. 4

3. Peer to peer and client-server Peer to peer is an approach to computer networking where all computers share equivalent responsibility for processing data. Peer-to-peer networking (also known simply as peer networking) differs from client-server networking, where certain devices have responsibility for providing or "serving" data and other devices consume or otherwise act as "clients" of those servers. When several computers are interconnected, but no computer occupies a privileged position, the network is usually referred to as a peer-to-peer network. In this type of network, every computer can communicate with all the other machines on the network, but in general each one stores its own files and runs its own applications. With a client-server network, one or more servers will perform critical functions on behalf of the other machines (the clients) on the network. These functions might include user authentication, data storage, and the running of large, shared, resource-intensive applications such as databases and client relationship management (CRM) software. Typically, both peer-to-peer and client-server networks rely on a shared Internet connection for access to external resources of these basic network structures. 5

Peers are both suppliers and consumers of resources, in contrast to the traditional client server model where only servers supply (send), and clients consume (receive). Client/Server Limitations: Scalability is hard to achieve Presents a single point of failure Requires administration Unused resources at the network edge P2P systems try to address these limitations 4. History Files were first exchanged on removable media. Computers were able to access remote files using file system mounting, bulletin board systems (1978), Usenet (1979), and FTP servers (1985). Internet Relay Chat (1988) and Hotline (1997) enabled users to communicate remotely through chat and to exchange files. The mp3 encoding, which was standardized in 1991 and which substantially reduced the size of audio files, grew to widespread use in the late 1990s. In 1998, MP3.com and Audiogalaxy were established, the Digital Millennium Copyright Act was unanimously passed, and the first mp3 player devices were launched. MP3.com offered music by unsigned artists, and grew to serve 4 million audio downloads daily. In June 1999, Napster was released as a centralized unstructured peer-to-peer system, requiring a central server for indexing and peer discovery. It is generally credited as being the first peer-to-peer file sharing system. In the case of Napster, an online service provider could not use the "transitory network transmission" safe harbor in the DMCA if they had control of the network with a server. Many P2P products will, by their very nature, flunk this requirement, just as Napster did. Napster provided a service where they indexed and stored file information that users of Napster made available on their computers for others to download, and the files were transferred directly between the host and client users after authorization by Napster. Gnutella, edonkey2000, and Freenet were released in 2000, as MP3.com and Napster were facing litigation. Gnutella, released in March, was the first decentralized file sharing network. In the gnutella 6

network, all connecting software was considered equal, and therefore the network had no central point of failure. In July, Freenet was released and became the first anonymity network. In September the edonkey2000 client and server software was released. In 2001, Kazaa and Poisoned for the Mac was released. Its FastTrack network was distributed, though unlike gnutella, it assigned more traffic to 'supernodes' to increase routing efficiency. The network was proprietary and encrypted, and the Kazaa team made substantial efforts to keep other clients such as Morpheus off of the FastTrack network.from 2002 through 2003, a number of Bit Torrent services were established, including Suprnova.org, isohunt, Torrent Spy, and The Pirate Bay. 5. Basic Application area of P2P Network P2P File sharing application Files are distributed in several P2P network nodes. If any peer require any file then it search that file in its peers. Once file is found in any one of the peer the required file start downloaded provided this file has been shared. Millions of people use free P2P file sharing programs - software to swap music, video and other files over the Internet. Many free P2P file sharing programs exist. Some P2P software offers a larger user base and greater numbers of files to choose from. Some software better utilizes network resources and may be easier to use. E.g., Napster, Gnutella, Freenet, KaZaA (FastTrack), BitTorent your DFS project. P2P Process sharing application For large-scale computations, Data analysis, data mining and scientific computing process sharing is required. A large process where a huge amount of data is to be processed is divided into several sub processes and distributed among peers in a P2P network. By help of this a huge data can be computed in a shorter period of time. E.g., SETI@Home, Folding@Home, distributed.net, World-Wide Computer. P2P Collaborative Application In a collaborative application, many users frequently need to access and update information even if they are disconnected from the network, e.g. in a train or another environment that does not provide good network connection. This requires that users hold local replicas of shared documents. However, a collaborative application requires optimistic multi-master replication to 7

assure data availability at anytime. It is required for remote real-time human collaboration. It is used in Instant messaging, virtual meetings, shared whiteboards, tele-conferencing, telepresence. E.g., talk, IRC, ICQ, AOL Messenger, Yahoo! Messenger, Jabber, MS Netmeeting, NCSA Habanero, Games 6. Generic Architecture of P2P The peer-to-peer architecture is a way to structure a distributed application so that it consists of many identical software modules, each module running on a different computer. The different software modules communicate with each other to complete the processing required for the completion of the distributed application. One could view the peer-to-peer as 3 tier architecture. Base Overly Layer Middleware Layer Application Layer Base Overlay Layer As mentioned above, the base overlay formation is a feature that must be provided by all peer-topeer systems. The functions included in this layer include the following: Discovery: Before communicating with each other, a node in a peer-to-peer system must discover a minimum set of other nodes so that it could communicate with them. The discovery mechanism may include discovering all the other nodes in the system or just one other node that could be used as an intermediary to communicate with the other nodes. Overlay Formation: This provides a mechanism by which all the peer-to-peer nodes are connected into some type of common network. The network is used by each of the nodes to communicate with the other nodes. Application-Level Multicast: This functionality permits a node to send a message out to all of the other nodes in the network. In some peer-to-peer infrastructures, the only communication supported is the ability of a node to send a message to all of the other nodes. Some other peer-to-peer architectures would allow formation of subgroups within the system so that the message is sent only to a restricted subset of nodes. 8

Middleware Layer The middleware layer is responsible for providing some common functions that will be used by applications at the higher layer. The middleware consists of those software functions that are intended to be used primarily by other software components, rather than by a human user. The middleware function in itself cannot be used to build a complete application, but the common functions can be used to build peer-to-peer applications rapidly. Some of the functions included in this layer are: Security: This middleware function provides the support needed for managing secure communication among the different nodes, providing support such as encryption, access control, and authentication. The issues involved in the security aspects of peer-to-peer communication are similar to those involved in traditional client-server computing systems. However, the distributed nature of the system makes Security issues much harder in peer-to-peer systems. Distributed Indexing: Many peer-to-peer applications need a fast way to index and find information that is distributed along the different nodes of a peer-to-peer infrastructure. A distributed indexing system could be used by applications such as a distributed storage application or a distributed file system. A special type of an index is a hash table, which maps keywords of arbitrary length into a fixedlength hash and uses the hash to locate the entries corresponding to the keywords. Distributed indexing and hash tables have been an active area of research in peer-to-peer computing systems. Directory Services: A directory service provides a name lookup service, whereby one could look up the properties of an entity by specifying its name. In many respects, a directory service is like a index or hashing service, with one difference. It is common in conventional directory services to impose a hierarchical naming structure on the elements stored in the directory. The most widespread directory servers use the LDAP protocol to allow clients to access the information stored in the directory service. A peer-to-peer implementation of the directory service can offer some unique advantages over the traditional server-based implementation. Publish-Subscribe Systems: A publish-subscribe system allows for the sharing of information in a system in a controlled manner. Publishers of information send the information to the publish-subscribe system, and the subscribers of information inform the system about what types of information they wish to receive. The publish-subscribe system manages the published information sources and the preferences of the different subscribers and provides an efficient delivery mechanism. Most middleware functions can be implemented with a client-server approach as well as a peer-to-peer approach. In the 9

subsequent chapters of the book, we look at the different middleware functions that can be provided with a peer-to-peer infrastructure and compare the alternative implementations of the middleware functions. Application Layer We define this layer as consisting of the software components that are designed to be used primarily by a human user. The file sharing application is the most ubiquitous peer-to-peer application, with multiple implementations available from a large number of providers. The file-sharing application allows users of a peer-to-peer network to find files of interest from other computers on the network and to download them locally. A peer-to-peer infrastructure can be used to support self-managing websites, assist users to surf the network in an anonymous manner, and provide highly scalable instant messaging services and a host of other common applications. There are some old applications which were built and developed with the peer-to-peer model long before the file-sharing application grew in prominence. These applications include some routing protocols used within the Internet infrastructure as well as the programs used to provide discussion and distributed news groups on the Internet. 7. Different types of P2P Depending upon the different architecture P2P network is divided into 2 basic types: Unstructured and Structured. Unstructured peer-to-peer networks do not provide any algorithm for organization or optimization of network connections. In particular, three models of unstructured architecture can be distinguished as follows: In Centralized peer-to-peer systems, a central server is used for indexing functions and to boot strap the entire system. Although this has similarities with a structured architecture, the connections between peers are not determined by any algorithm. E.g. Napster Decentralized systems allow such infrastructure nodes to exist, often called super nodes. No centralized server exists in this case. E.g. Gnutella In pure peer-to-peer systems the entire network consists solely of equipotent peers. There is only one routing layer, as there are no preferred nodes with any special infrastructure function. E.g. Windows P2P 10

In structured peer-to-peer networks, peers ers (and, sometimes, resources) are organized following specific criteria and algorithms, which lead to overlays with specific topologies and properties. They typically use distributed hash table-based based (DHT) indexing. E.g. Bit torrent. 8. Working principle and protocol of Napster Napster is a file-sharing P2P application that allows people to search for and share MP3 music files through the vast Internet. It was single handedly written by a teenager named Shawn Fanning (Tyson, 2000 and Shirky, 2001). Not only did he develop the application, but he also pioneered the design of a protocol that would allow peer computers to communicate directly with each other. This paved a way for more efficient and complex P2P protocols by other organizations and groups. It is one of the examples of Centralized P2P network. There exist a central server. 8.1. Working principle Napster operated using a centralized directory or index of files available for sharing.the directory was located on a centralized server (or set of servers), to which various individual user computers or peers could connect via an Internet connection.an individual user could download the Napster software, connect to the server, and then send a query for a particular file she wanted to obtain such as a song title.the server would respond with information indicating which other peers had the file.the user who made the query could then request that file directly from the other peer, which would respond by providing the file itself. It works on Application-level, level, client-server protocol over point-to-point TCP. It work through the following steps. Step-1: Connect to Napster server 11

Step-2: Upload your list of files (push) to server or User requests search at server. Give server keywords to search the full list with. Step-3: User pings hosts that apparently have data. Looks for best transfer rate. Step-4: Select best of correct answers. (pings) and User retrieves file 12

8.2. The Napster Protocol Due to the fact that Napster is not an open source application, it was only possible to build up a similar application to reveal the Napster protocol through reverse-engineering. In other words, no one will ever be totally sure how the Napster protocol specification is like, except for the creator of Napster himself. Project OpenNap has made it possible to run a Napster server on many platforms without using the original Napster application and the index server. The following are the protocol specification for Napster. Napster works with a central server which maintains an index of all the MP3 files of the peers. To get a file you have to send a query to this server which sends you the port and IP address of a client sharing the requested file. With the Napster application it is now possible to establish a direct connection with the host and to download a file. The Napster protocol also uses a whole lot of different types of messages. Every state of the hosts, acting like clients towards the server, is related to the central Napster server. Thus the Napster protocol makes anonymity impossible. At first, one may think that this is a drawback, but this complex protocol actually makes a lot of services possible. Some examples are: Creating Hotlists: notifying when users of your own hotlist sign on or off the server List of ignored User Instant Messaging: sending public or private messages to other users; creating and joining channels of shared interests 13

8.3. Napster Message Data Structures The format of each message that flow to/from the Napster central server is shown below Basic message format: Where: Length specifies the length of the payload. Function defines the message type of the packet. Payload defines the different parameters necessary for different messages 8.3.1. Initialization A registered Napster host, acting like a client, sends to the server a LOGIN message with the following payload format: 14

Where: Nick & Password identifies the user Port is the port which the client is listening on for data transfer. Client_Info is a string containing the client version info. Link_Type is an integer indicating the client s bandwidth. The details of what the integers in Link_type represent are given in the table-1 bellow Representation Bandwidth Representation Bandwidth 0 Unknown 1 14.4kbps 2 28.8 kbps 3 33.6 kbps 4 56.7 kbps 5 64k ISDN 6 128k ISDN 7 Cable 8 DSL 9 T1 10 T3 or greater The host s IP address need not be added to the message. However, the server can extract it automatically from the TCP packet in which the message is packed for the transmission. An unregistered host sends a New User Login which is similar to the format of Login, with the addition of the email address on the end. The server sends a Login Acknowledgement to the client after a successful login. If the nick is registered, the email address given at registration time is returned, else, a dummy value will be returned. 8.3.2. Client Notification of Shared File With the Client Notification of Shared File message the client sends successively all the files it wants to share. It uses the following message notification payload format: Where: Filename is the name of the file to be shared. MD5 (Message Digest 5) is the hash value of the shared file. The MD5 algorithm produces a 128-bit "fingerprint" of any file. It is nearly computationally infeasible to produce two messages having the same hash value. The MD5 algorithm is intended to 15

provide any user the possibility to secure the origin of his shared file, even if the file is laying on drives of other Napster users. Size is the file size in bytes Bit-rate is the bit rate of the MP3 in kbps (kilobits per second) Frequency is the sample rate of the mp3 in Hz (Hertz) Time is the duration of the music file in seconds 8.3.3. File Request The downloading client will first issue either a Search or Browse. The first search message has the following format: Where: Artist Name is the name of the artist of the MP3 song. Title is the title of the MP3 song. Bit-rate is the range of bit-rates to be used. Max Results is the maximum number of results. Link-Type is the range of link-types. Frequency Range is the range of sample frequencies in Hz. The artist name and the song title are checked from the file name only. Napster does not make use of the ID3 in MP3 files in its search criteria. The payload of the Browse message does only contains the <nick> of the host. It requests a list of the host s shared files. 8.3.4. Response and Browse Response The server answers respectively with a Search Response or a Browse Response with the formats given below: 16

Where: Filename is the name of the file that is found. MD5 is the hash value of the requested file Size is the file size in bytes Bit-rate is the bit rate of the MP3 in kbps Frequency is the sample rate of the MP3 in Hz Time specifies the length of the file Nick is to identify the user who shares the file IP is a 4 Byte integer representing the IP address of the user with the file. Link-Type refers to the Login Message. 8.3.5. Download Request In order to request a download, a DOWNLOAD REQUEST message is sent to the server. This message will have the following payload format: <Nick> <FileName> Where: Nick is to identify the user who shares the file. Filename is the name of the file to be downloaded. 8.3.6. Download ACK The server will answer with a DOWNLOAD ACK containing more information about the file (Line speed, Port Number, etc). This message has the following payload format: <Nick> <IP> <Port> <FileName> <MD5> <Link_type> Where: Nick is to identify the user who shares the file. IP is a 4 Byte integer representing the IP address of the user with the file. Port is the port which the client is listening on for data transfer. Filename is the name of the file to be downloaded. MD5 is the hash value of the requested file. Link-Type is the range of link-types. 17

8.3.7. Alternate Download Request It is like the normal "Download Request". The only difference is that this request is used only when the person sharing the file can only make outgoing TCP connection because of the firewall that is blocking the incoming messages. The ALTERNATE DOWNLOAD REQUEST message should be used to request files from users who have specified their data port as 0 in their login message. Alternate Download Ack ALTERNATE DOWNLOAD ACK message is sent to the up loader when its data port is set to 0 to indicate they are behind a firewall and need to push all data. The up loader is responsible for connecting to the downloader to transfer the file. File Transfer From this point onwards, the hosts don t send messages to the central server anymore. The host requesting the file makes a TCP connection to the data port specified in the 0xCC message from the server. To request for the file that the client wish to download, it sends the following HTTP - messages: a string "GET" in a single packet and a message with format <Nick> <FileName> <Offset> Where: Nick is the client s nick. Filename is the name of the file to be downloaded. Offset is the byte offset in the file to begin the transfer at. It is needed to resume prior transfer. The remote host will then return the file size and, immediately following, the data stream. The direct file transfer between Napster s hosts uses a P2P architecture. Once the data transfer is initiated, the downloader should notify the server that they are downloading a file by sending the DOWNLOADING FILE message. Once the transfer is completed, the client sends a DOWNLOAD COMPLETE message. 8.3.8. Firewalled Downloading Napster also has a method to allow clients behind firewalls to share their contents. As described above, when the file needs to be pushed from a client behind a firewall, the downloader sends a message ALTERNATE DOWNLOAD REQUEST message to the server. This causes an ALTERNATE DOWNLOAD ACK 18

to be sent to the uploader, which is similar to the DOWNLOAD REQUEST message for a normal download. Once the up loader receives the message from the server, it should make a TCP connection to the downloader's data port (given in the message). Upon connection, the downloader's client will send one byte, which is the ASCII character `1`. The up loader should then send the string "SEND" in a single packet, and then the message (format was shown before). Upon receipt, the downloading client will either send the byte offset at which the transfer should start, or an error message such as "INVALID REQUEST". The byte offset should be sent as a single packet in plain ASCII digits. A 0 byte offset indicates the transfer should begin at the start of the file. 9. Working principle and protocol of Gnutella Currently, the most popular system for sharing files is another peer-to-peer network called Gnutella, or the Gnutella network. In the early of March 2000, Gnutella was created by Justin Frankel and Tom Pepper, who were both working under the Gnull soft, which is one of AOL s subsidiaries. Gnutella's development was later halted by AOL shortly after it was published, but the short duration where Gnutella was made online was enough to allow curious programmers to download and later reverseengineer Gnutella s communication protocol. As a result, a number of Gnutella clones with improvements were introduced. (e.g., LimeWire, BearShear, Gnucleus, XoloX, and Shareaza).It is one of the examples of decentralized P2P network. Here no central server does exist. 9.1 Working principle Given that there is no central server to store the names and locations of all the available files, how does the Gnutella software on your machine find a song on someone else's machine? The process goes something like this: You type in the name of the song or file you want to find. Your machine knows of at least one other Gnutella machine somewhere on the network. It knows this because you've told it the location of the machine by typing in the IP address, or because the software has an IP address for a Gnutella host pre-programmed in. Your machine sends the song name you typed in to the Gnutella machine(s) it knows about. 19

These machines search to see if the requested file is on the local hard disk. If so, they send back the file name (and machine IP address) to the requester. At the same time, all of these machines send out the same request to the machines they are connected to, and the process repeats. A request has a TTL (time to live) limit placed on it. A request might go out six or seven levels deep before it stops propagating. If each machine on the Gnutella network knows of just four others, which means that your request might reach 8,000 or so other machines on the Gnutella network if it propagates seven levels deep. It is an extremely simple and clever way of distributing a query to thousands of machines very quickly. This approach has one big advantage -- Gnutella works all the time. As long as you can get to at least one other machine running Gnutella software, you are able to query the network. No court order is going to shut this system down, because there is no one machine that controls everything. 9.2. Protocol In Gnutella protocol, the messages used to communicate between the peers(servent) is called Gnutella descriptors. Gnutella descriptors consist of the Descriptor Header and the Descriptor Payload. There are five types of Gnutella Descriptors and they are: Ping, Pong, Query, queryhit, and Push. The Descriptor Header consists of five parts: Descriptor ID, Payload Descriptor, TTL,Hops, and Payload Length. 20

Table 2: Five descriptors used in the Gnutella protocol. Descriptor Ping Pong Query QueryHit Push Description Used to actively discover hosts on the network. A servant receiving a Ping descriptor is expected to respond with one or more Pong descriptors. The response to a Ping. Includes the address of a connected Gnutella servant and information regarding the amount of data it is making available to the network. The primary mechanism for searching the distributed network. A servant receiving a Query descriptor will respond with a QueryHit if a match is found against its local data set. The response to a Query. This descriptor provides the recipient with enough information to acquire the data matching the corresponding Query. A mechanism that allows a firewalled servant to contribute file-based data to the network. 9.3. Message structure 21

Where Pong Port provides the port address where Gnutella application runs in responding host Pong IP shows the IP address of the responding host Number of shared files shows total no of file a peer has been shared for the outsiders Size of shared file is total file size of shared file Minimum speed shows what is the minimum download permissible speed in Kbyte/sec Search Criteria contains the search criteria of the requesting servant. The maximum length of the search criteria is bounded by the Payload_Length field of the descriptor header. Number of Hit provides the total no of peer that contain our requested file Result Set is a set of responses to the corresponding Query. This set contains the Number_of_Hits elements, each of which has the structure comprising file index, file size, and file name. In query_hit Number of Hits is the number of query hits in the result set. Port is the port number on which the responding host can accept incoming connections. IP Address is the IP address of the responding host. Speed is the speed in KBytes/sec of the responding host. Result Set is a set of responses to the corresponding Query. This set contains the Number_of_Hits elements, each of which has the structure comprising file index, file size, and file name. 22

Servant Identifier is a 16-byte string uniquely identifying the responding servant on the network. 9.4. Rules There are generally 5 rules in the Gnutella protocol for servants to follow in order to maintain desirable network traffics. Rule 1: All Servants must memorize the unique 128-bit Descriptor ID every time a message is delivered or originated. If these memorized messages are received again, it will not be forwarded. This helps eliminating looping in the network thereby reducing the unnecessary traffic. Rule 2: Pong, QueryHit, and Push descriptors may only be sent along the same path that carried the incoming Ping, Query, and QueryHit descriptors, respectively. This ensures that only those servants that routed the Ping (Query, and QueryHit) descriptor will see the Pong (QueryHit, and Push) descriptor in response. A servant that receives a Pong (QueryHit, and Push) descriptor with Descriptor ID = n, but has not seen a Ping (Query, and QueryHit) descriptor with Descriptor ID = n should discard the Pong (QueryHit, and Push) descriptor from the network. Rule 3: A servant will forward incoming Ping and Query descriptor to all of its directly connected servants, except for the one that sent the incoming Ping or Query. Rule 4: A servant will decrement a descriptor header s TTL field, and increment the Hops field, before it forwards the descriptor to any directly connected servant. If after decrementing the header s TTL field, the TTL field is found to be zero, the descriptor is discarded. Rule 5: If a servant receives a descriptor with the same Payload Descriptor and Descriptor ID as the one it has received before (check by comparing with the ones the servant stores in the table), a servant should discard this descriptor. 9.5. Comparison between Napster and Gnutella Napster and Gnutella are similar services for two reasons: Users of both services store files on their own hard drives and share the files directly among themselves. Users of both services run software that connects them to the services' networks. There are, however, two significant differences between Napster and Gnutella: Gnutella's servers do not maintain a central database of available files. Computers connected to the network instead communicate their contents directly to each other. 23

There is not a single Gnutella application used to access the Gnutella network. 10. Architecture of windows P2P Windows P2P is one of the examples of pure P2P network. In pure peer-to-peer systems the entire network consists solely of equipotent peers. There is only one routing layer, as there are no preferred nodes with any special infrastructure function. It requires a Network component to create connectivity among the peers. And Each peer should have a client OS. The OSs may be similar or different. i.e. each client may have window-98 or window-xp or they have the different OS. In security aspect Window-9X is not suitable one. Here no central server is required like Napster system. Windows NetMeeting is one of the examples of this type. By using this application directly we can access another client in the same network by providing the IP address and password of the requested client. 11. Working principle of Bit torrent It is one of the examples of structured P2P network. Here peers (and, sometimes, resources) are organized following specific criteria and algorithms, which lead to overlays with specific topologies and properties. They typically use distributed hash table-based (DHT) indexing. BitTorrent is a protocol that enables fast downloading of large files using minimum Internet bandwidth. It costs nothing to use and includes no spyware or pop-up advertising. Unlike other download methods, BitTorrent maximizes transfer speed by gathering pieces of the file you want and downloading these pieces simultaneously from people who already have them. This process makes popular and very large 24

files, such as videos and television programs, download much faster than is possible with other protocols. Unlike some other peer-to-peer downloading methods, Bit Torrent is a protocol that offloads some of the file tracking work to a central server (called a tracker).another difference is that it uses a principle called tit-for-tat. This means that in order to receive files, you have to give them. With Bit Torrent, the more files you share with others, the faster your downloads are. Finally, to make better use of available Internet bandwidth (the pipeline for data transmission), Bit Torrent downloads different pieces of the file you want simultaneously from multiple computers. WORKING STEPS You open a Web page and click on a link for the file you want. Bit Torrent client software communicates with a tracker(which uses DHT) to find other computers running Bit Torrent that have the complete file (seed computers) and those with a portion of the file (peers that are usually in the process of downloading the file). The tracker identifies the swarms, which is the connected computers that have all of or a portion of the file and are in the process of sending or receiving it. The tracker helps the client software trade pieces of the file you want with other computers in the swarm. Your computer receives multiple pieces of the file simultaneously. If you continue to run the Bit Torrent client software after your download is complete, others can receive.torrent files from your computer; your future download rates improve because you are ranked higher in the "tit-for-tat" system. Downloading pieces of the file at the same time helps solve a common problem with other peer-to-peer download methods: Peers upload at a much slower rate than they download. By downloading multiple pieces at the same time, the overall speed is greatly improved. The more computers involved in the swarm, the faster the file transfer occurs because there are more sources of each piece of the file. For this reason, Bit Torrent is especially useful for large, popular files. A Bit Torrent tracker is a server that assists in the communication between peers using the Bit Torrent protocol. It is also, in the absence of extensions to the original protocol, the only major critical point, as clients are required to communicate with the tracker to initiate downloads. Clients that have already begun downloading also communicate with the tracker periodically to negotiate with newer peers and 25

provide statistics; however, after the initial reception of peer data, peer communication can continue without a tracker. BitTorrent's peer-to-peer download process A tracker should be differentiated from a Bit Torrent index by the fact that it does not necessarily list files that are being tracked. A Bit Torrent index is a list of.torrent files, usually including descriptions and other information. Trackers merely coordinate communication between peers attempting to download the payload of the torrents. 26

12. Comparison Studies Type of P2p Addressing Purpose Central Scalability Anonymity Security server Centralized(Napster) Efficient Mp3 file sharing Yes Hard to achieve No Moderate Pure P2P (Windows p2p) Not efficient Decentralized (Gnutella) Partially efficient All type of files No Partially No High All type of files No Yes Yes low Structured Most All type of files Yes but Yes Yes Very low (BitTorrent) efficient not as Napster 13. Advantages Ease of Development When building an application, you need to consider how easy or difficult it will be to build and test the software for the application. The task of developing the software is eased by the existence of development and debugging tools that can be used to hasten the task of developing the application. Some programming environment packages are available for peer-to-peer computing, such as Sun s JXTA package or Windows XP P2P SDK. Manageability Manageability refers to the ease of managing the final software when it is finally deployed. After software application is up and ready, it still needs ongoing maintenance while in operation. Maintenance includes tasks such as ensuring that the application has not stopped working (and restarting it in case it stops working), making backup copies of the data generated by the application, Applying software upgrades, fixing any bugs that are discovered, educating users about the application, and a variety of other functions. In case of P2P all those things can be achieved. 27

Scalability The scalability of an application is measured in terms of the highest rate or size of user-level interactions that the application can support with a reasonable performance. Since there exist no central server which dealing with all the services, we can add more peer to the network without bothering about over load. Peer-to-peer applications use many computers to solve a problem and thus are likely to provide a more scalable solution than a server-centric solution, which relies on a single computer to perform the equivalent task. In general, using multiple computers would tend to improve the scalability of the application compared with using only a single computer. Administrative Domains One of the key factors determining how to structure the application would depend on the usage pattern of the application and how the different computers that are used to deploy the application software are going to be administered. A peer-to-peer system, however, can often be created by using computers from many different administrative domains. Thus, if usage of the software requires that computers from many different administrative domains be used, the peer-to-peer approach would be the natural choice for that application. Security Once an application has been deployed, one of the administrative tasks associated with it is to manage its security. Security management entails the tasks of making sure that the system is only accessed by authorized users, that user credentials are authenticated, and that malicious users of the system do not plant viruses or Trojan horses on the system. In P2P each machine or host is capable of providing security to its own machine and file by help of a secure pass word and a antivirus software. Reliability The reliability of a system is measured by its ability to continue working when one or more of its components fail. In the context of computer systems, reliability is often measured in terms of the ability of the system to run when one or more computers hosting the system are brought down. In peer-topeer systems, for most applications, use multiple computers to do identical tasks, and thus the system continues to be operational and available, even when a single computer fails or goes off-line. The most popular peer-to-peer networks are made up of thousands of computers. Although each computer in itself is a simple desktop and goes out of service frequently (when users switch off their machines), the entire system keeps on functioning without interruption. 28

Other than these advantages some other notable advantages are as follows Less initial expense - No need for a dedicated server. Peer-to-peer is, by far the easiest type of network to build for either home or office use. Reduced cost (the costs involved in such a network are hardware, cabling and maintenance. Applications only need to be installed on one computer. Can be built with both 10BaseT cabling and a hub or with a thin coax backbone. Drives can be easily shared between peer-to-peer PCs. Well tested simplicity. 14. Disadvantages There exist some advantages which are also could be considered as a disadvantages of P2P because of some pit falls. Lack of security - They are less secure, especially so because the files can be shared and no password is required. No computer in the network is reliable because any peer can act as a vulnerable agent. This system is not centralized, making administration difficult. It is more time consuming to maintain the software on individual computers Possibility of not discovering all peers 15. Conclusion It should be relatively clear by now that P2P technology is still in its infant stage of its development. There is still great potential for growth and improvements that can be done. From this chapter alone, we can see how P2P has evolved from a more centralized architecture like Napster into a fully distributed architecture like Bit Torrent. This evolution in technology is spurred mainly by the need to achieve better efficiency and speed in content sharing as well as for the need to survive law suits against these architectures. Much more innovative architectures will surface as the race toward network efficiency and survival continues. 29

References: 1. Peter, B., Tim, W., Bart, D., & Piet, D. (2002), A Comparison of Peer-to-Peer Architectures, Broadband Communication Networks Group (IBCN), Department of Information Technology (INTEC), Ghent University, Belgium, 1-2 2. http://www.howstuffworks.com/file-sharing.htm 3. Minar, N. (2001), Distributed Systems Topologies: Part 1, Oreilly Network, http://www.openp2p.com/pub/a/p2p/2001/12/14/topologies_one.html 4. www.howstuffswork.com 5. Barkai, D., (2001), An Introduction to Peer-to-Peer Computing http://www.intel.com/update/departments/initech/it02012.pdf 6. Dimitri, D. & Antonio, G. & Bill, K. (2002), Analysis of Peer-to-Peer Network Security using Gnutella, http://www.cs.berkeley.edu/~daw/teaching/cs261-f02/reports/defig.pdf 7. Shirky, C. (2001), Listening to Napster, Peer-to-Peer: Harnessing the Power of Disruptive Technologies, A. Oram (ed.), O Reilly Press, USA. 8. http://nbjl.nankai.edu.cn/lab_papers/2010/a%20new%20structured%20peer-to- Peer%20Architecture%20Based%20On%20Physical%20Distance.pdf 9. http://compnetworking.about.com/od/basicnetworkingfaqs/a/peer-to-peer.htm 10. http://compnetworking.about.com/od/p2ppeertopeer/tp/p2pfilesharing.htm 11. Tyson, J. (2000), Marshall Brain's HowStuffWorks, How Napster Worked 12. http://www.howstuffworks.com/napster1.htm 13. http://www.ines.zhaw.ch/fileadmin/user_upload/engineering/_institute_und_zentren/ines/iee E1588/Dokumente/IEEE_1588_Tutorial_engl_250705.pdf 14. http://asaha.com/ebook/znjy2mziw/peer-to-peer-network-architecture-peer-to-peer- Network.pdf 15. www.employees.org/~alokem/thesis/thesis-outline.doc 16. www.buyya.com/papers/p2pbasedcontentsharing.pdf 30