• Tidak ada hasil yang ditemukan

Peer-to-Peer Protocols

3.2 Overlay networks

3.2.3 Unstructured overlays

Unlike structured overlays, nodes in unstructured overlays are organised in a random graph where no constraints are enforced. The protocols used to locate resources in the overlay are less de- terministic than in structured overlays, where broadcast, flooding and random walks are usually employed [22]. There is greater variance in the characteristics of unstructured protocols than in structured ones. Three popular types are examined in the next three sections.

3.2.3.1 Gnutella

Gnutella [41] is a file sharing protocol which has evolved considerably throughout the years of its existence and has had many modifications to improve efficiency and lower bandwidth consumption [42, 43]. Initial bootstrap nodes on a Gnutella network are discovered via out-of- band mechanisms such as a manual search on the Internet, where recently live nodes are listed on public caches known as GWebCaches [44]. Once an existing node has assisted the new node to join the network, the new node broadcasts PING messages to the network to announce its presence. PONGmessages are re-sent to the node, so it can gain knowledge of other nodes in its vicinity.

A resource such as a file is published on the network with aPUT method. Searches for the re- sources stored by nodes in the network are facilitated byQUERYrequests, which are broadcasted throughout the network. The broadcast queries are limited to a certain number of hops before the query fails. A successful query match called aQUERY RESPONSEproceeds along the same path as the query through back propagation and contains details as to where the file can be found.

AGETrequest directed to the target node is used to download the desired resource.

Figure 3.6: Document location and retrieval in Gnutella. Adapted from [45].

3.2.3.2 KaZaA

KaZaA is a peer-to-peer protocol which is similar to Gnutella in that it does not use central servers [2]. However, unlike Gnutella, the KaZaA protocol defines two different types of nodes in the network: ordinary nodes and super nodes. This means that KaZaA is a distributed but hierarchical peer-to-peer system, exhibiting a tree topology (see Figure 3.1). The role of the central server is emulated across a set of super nodes, each with an associated set of ordinary nodes that communicate with it. Each super node keeps record of the locations of its ordinary client nodes, as well as those of its tier 1 peer neighbours.

When a client node wishes to share a file, it registers the details of the file (metadata) with its related super node. The file metadata contains keywords that will be matched against a search string during a query request. When a node wishes to download an indexed file, it forwards the request through its super node. The super node will in turn proxy the request to the rest of the network using broadcast mechanisms. A list of successful matches are sent back to the super node, which returns the results to the requesting node. That node can then use the location details contained in the set of results obtained on its behalf to download the file from the network.

Figure 3.7 shows ordinary nodes with their respective super nodes, and how a file is published and downloaded by peers.

Figure 3.7: Super nodes and ordinary nodes in a KaZaA network. Source: [45].

3.2.3.3 BitTorrent

BitTorrent is a file sharing system that has both centralised and peer-to-peer components [3].

Its hybrid design is similar to the star topology in Figure 3.1, where a central server is used to manage user downloads. A file that is to be shared is broken into data blocks and is stored on the network. A server called a tracker keeps record of a file that is shared and of the users that either have a complete copy or only blocks of the file [46, 47].

When a client wishes to share a file to the rest of the network, it divides the file into blocks of up to 256KB in size which can be distributed to other peers. It also creates a file known as a torrent which contains metadata that describes the file. The torrent is then made available to the public and registered with a tracker. Peers that have blocks of the file are called seeders, and the initial peer that introduces the file to the network is called the initial seeder. A client that wants to download the shared file, must first obtain the associated torrent for the file. The torrent directs the client as to the location of the tracker, which the client proceeds to contact, requesting the desired file. The tracker returns a list of seeders for this client to contact. The client can then start downloading blocks of the file from the indicated peers. BitTorrent is sophisticated in that it allows for nodes to choke, meaning a temporary disabling of uploading connections so as to maintain a consistent downloading rate, since uploading causes congestion on the node’s band- width allocation. Also, the network rewards nodes with high upload speeds with high download speeds. BitTorrent is unusual because it employs what are called tit-for-tat algorithms to discour-

age freeloaders (that is, people who seek to benefit from the system but do not wish to contribute resources) by providing quicker download times for those that share data for others [45]. Figure 3.8 shows the relationship between a tracker, a torrent and peers in a BitTorrent network.

Figure 3.8: BitTorrent architecture. Source: [45].