31
Multi-level Hashing for Peer-to-Peer System in Wireless Ad Hoc Environment Dewan Tanvir Ahmed and Shervin Shirmohammadi Distributed & Collaborative Virtual Environments Re search Laboratory School of Information Technology and Engineering University of Ottawa, Ottawa, Ontario, Canada {dahmed, shervin}@discover.uottawa.ca Pervasive Computing and Communications Workshops(PerComW'0 7) 報報 : 報報報

Multi-level Hashing for Peer-to-Peer System in Wireless Ad Hoc Environment Dewan Tanvir Ahmed and Shervin Shirmohammadi Distributed & Collaborative Virtual

Embed Size (px)

Citation preview

Page 1: Multi-level Hashing for Peer-to-Peer System in Wireless Ad Hoc Environment Dewan Tanvir Ahmed and Shervin Shirmohammadi Distributed & Collaborative Virtual

Multi-level Hashing for Peer-to-Peer System in

Wireless Ad Hoc Environment

Dewan Tanvir Ahmed and Shervin ShirmohammadiDistributed & Collaborative Virtual Environments Research Laboratory

School of Information Technology and EngineeringUniversity of Ottawa, Ottawa, Ontario, Canada

{dahmed, shervin}@discover.uottawa.caPervasive Computing and Communications Workshops(PerComW'07)

報告 :羅世豪

Page 2: Multi-level Hashing for Peer-to-Peer System in Wireless Ad Hoc Environment Dewan Tanvir Ahmed and Shervin Shirmohammadi Distributed & Collaborative Virtual

Outline

.壹 Introduction

.貳 Multi-level hashing in wireless ad hocpeer-to-peer systems

.參 Wireless ad hoc p2p system – node join

.肆 Wireless ad hoc p2p system – content publishing

.伍 Wireless ad hoc p2p system – content discovery

.陸 Simulation

.柒 Conclusion

Page 3: Multi-level Hashing for Peer-to-Peer System in Wireless Ad Hoc Environment Dewan Tanvir Ahmed and Shervin Shirmohammadi Distributed & Collaborative Virtual

Introduction (1/2)

Mobile peer-to-peer (MP2P) system faces more constraints as compared to wired peer-to-peer system. Some problems in this network are

Scarcity of bandwidth Short lifetime of the nodes due to power constraint Dynamic topology caused by the mobility of nodes.

These constraints give hard challenges to the researchers in the various aspects of the peer-to-peer system in ad hoc environments such as

Routing Content discovering Data retrieval Caching

Page 4: Multi-level Hashing for Peer-to-Peer System in Wireless Ad Hoc Environment Dewan Tanvir Ahmed and Shervin Shirmohammadi Distributed & Collaborative Virtual

Introduction (2/2)

Smart content discovery is the heart of peer-to- peer system. In ad hoc network, routing is expensive so it requires more effective content discovery process.

We apply chord directly on top of wireless ad hoc peer-to-peer system.

We use two-level distributed hashing scheme. First level hash maps a content request to a region

that greatly reduces routing overhead. Second level hash discovers content location after

redirecting the request to that region.

Page 5: Multi-level Hashing for Peer-to-Peer System in Wireless Ad Hoc Environment Dewan Tanvir Ahmed and Shervin Shirmohammadi Distributed & Collaborative Virtual

Multi-level hashing in wireless ad hocpeer-to-peer systems (1/2)

The entire system consists of a set of home regions where peers in close proximity form home region.

Each home region has a representative that plays a supporting role to make the system operational.

Page 6: Multi-level Hashing for Peer-to-Peer System in Wireless Ad Hoc Environment Dewan Tanvir Ahmed and Shervin Shirmohammadi Distributed & Collaborative Virtual

Multi-level hashing in wireless ad hocpeer-to-peer systems (2/2)

These representatives may change over the time considering the ad hoc issues of the system.

Home region is identified by the Home-Region-ID.

The representative functions as a rendezvous point for incoming requests and also provides useful information to its local peers.

Page 7: Multi-level Hashing for Peer-to-Peer System in Wireless Ad Hoc Environment Dewan Tanvir Ahmed and Shervin Shirmohammadi Distributed & Collaborative Virtual

Wireless ad hoc p2p system – node join (1/3)

We use a pair, <Home-Region-ID, Node-ID>, to identify a node.

Hash function generates Node-ID; Node-ID = Hl(Node-Address)

Home-Region-ID depends on its location that may change over time.

Page 8: Multi-level Hashing for Peer-to-Peer System in Wireless Ad Hoc Environment Dewan Tanvir Ahmed and Shervin Shirmohammadi Distributed & Collaborative Virtual

Wireless ad hoc p2p system – node join (2/3)

Two ways to learn about home region representative.

The home region representative periodically broadcasts its own identity (address) and Home-Region-ID.

Joining node explicitly floods Home-Region-Search-Request.

Home-Region-Search-Request is a controlled flood – not flooded to the entire system.

An intermediate node does not forward the request when it already has the answer of the request.

Page 9: Multi-level Hashing for Peer-to-Peer System in Wireless Ad Hoc Environment Dewan Tanvir Ahmed and Shervin Shirmohammadi Distributed & Collaborative Virtual

Wireless ad hoc p2p system – node join (3/3)

The requester may get multiple responses based on its location.

It marks minimum hops away response.

The joining node confirms the representative for its inclusion to the system.

It gets the identity of its successor and predecessor from this representative.

The joining node determines its Node-ID using the hash function Hl.

Page 10: Multi-level Hashing for Peer-to-Peer System in Wireless Ad Hoc Environment Dewan Tanvir Ahmed and Shervin Shirmohammadi Distributed & Collaborative Virtual

Wireless ad hoc p2p system – contentpublishing (1/5)

keyr= Hr(Content-Name ) Map the content name to a home region.

keys=Hl(Content-Name) Determine the successor in a particular region, i.e. the

actual node where content information has to be stored.

Page 11: Multi-level Hashing for Peer-to-Peer System in Wireless Ad Hoc Environment Dewan Tanvir Ahmed and Shervin Shirmohammadi Distributed & Collaborative Virtual

Wireless ad hoc p2p system – contentpublishing (2/5)

keyr, is used to determine the home region where content has to be published.

The content publisher first builds a tuple consisting of <Content-Name, Own-Address> and then asks local representative to store the tuple.

Page 12: Multi-level Hashing for Peer-to-Peer System in Wireless Ad Hoc Environment Dewan Tanvir Ahmed and Shervin Shirmohammadi Distributed & Collaborative Virtual

Wireless ad hoc p2p system – contentpublishing (3/5)

Local representative transport the tuple to the foreign region. But it may happen that content has to be stored in the local region based on the keyr.

Page 13: Multi-level Hashing for Peer-to-Peer System in Wireless Ad Hoc Environment Dewan Tanvir Ahmed and Shervin Shirmohammadi Distributed & Collaborative Virtual

Wireless ad hoc p2p system – contentpublishing (4/5)

successor(keys) the node identifier of the first actual node following k

eys around the circle clockwise.

At a particular region, the successor of the content is determined using keys and the representative initiates tuple storing process.

Page 14: Multi-level Hashing for Peer-to-Peer System in Wireless Ad Hoc Environment Dewan Tanvir Ahmed and Shervin Shirmohammadi Distributed & Collaborative Virtual

Wireless ad hoc p2p system – contentpublishing (5/5)

The index is distributed over the nodes at random. One of the shortcomings in this environment is node’s ad hoc nature.

To recover from such unwanted events protocol deploys multiple hash functions to store tuple in multiple nodes.

Page 15: Multi-level Hashing for Peer-to-Peer System in Wireless Ad Hoc Environment Dewan Tanvir Ahmed and Shervin Shirmohammadi Distributed & Collaborative Virtual

Wireless ad hoc p2p system – contentdiscovery (1/8)

Hashes to get keyr using Hr(Content-Name). This key represents the home region where the conten

t information is stored.

If the content is not in local region, the request is delegated to the foreign representative.

Node gets the address of foreign representative with the help of local representative.

The protocol allows local representative to broadcast home regions’ addresses in its periodic keep-alive messages.

Page 16: Multi-level Hashing for Peer-to-Peer System in Wireless Ad Hoc Environment Dewan Tanvir Ahmed and Shervin Shirmohammadi Distributed & Collaborative Virtual

Wireless ad hoc p2p system – contentdiscovery (2/8)

We applied chord like content searching process with modified finger table in local region.

Lookup can proceed as follows. Based on keyr, either the initiating node or the foreign

representative sends a packet to its successor containing requester’s physical address and the key, keys.

The packet is circulated around the logical circle until it locates the successor or it fails.

Page 17: Multi-level Hashing for Peer-to-Peer System in Wireless Ad Hoc Environment Dewan Tanvir Ahmed and Shervin Shirmohammadi Distributed & Collaborative Virtual

Wireless ad hoc p2p system – contentdiscovery (3/8)

Chord uses finger table to speed up searching process. If the hash address space is too large as compared to the number of peers in the system

The most of the entries in finger table point to the same node, and search continues in linear way.

Let hash key is 128-bit long. Most entries of the finger table point to the same successor.

We propose two approaches to construct finger table for wireless ad hoc environments.

Page 18: Multi-level Hashing for Peer-to-Peer System in Wireless Ad Hoc Environment Dewan Tanvir Ahmed and Shervin Shirmohammadi Distributed & Collaborative Virtual

Wireless ad hoc p2p system – contentdiscovery – first approach (4/8)

In the first design, the finger table is slightly different from chord.

The finger table has m entries, indexed by 0 through m-1. It is divided into two halves:

0 to m/2 m/2 to (m-1).

Page 19: Multi-level Hashing for Peer-to-Peer System in Wireless Ad Hoc Environment Dewan Tanvir Ahmed and Shervin Shirmohammadi Distributed & Collaborative Virtual

Wireless ad hoc p2p system – contentdiscovery – first approach (5/8)

The values of the fields for entry i at node k for the first half of the table are:

First half table covers k to k + 2m / 2−1 address space.

start the physical address of successor(start)

k + 2i mod 2m, where 0 ≤ i < m/2 Physical address of successor(start[i])

Page 20: Multi-level Hashing for Peer-to-Peer System in Wireless Ad Hoc Environment Dewan Tanvir Ahmed and Shervin Shirmohammadi Distributed & Collaborative Virtual

Wireless ad hoc p2p system – contentdiscovery – first approach (6/8)

step-size a big number to jump more rapidly.

The entries of the second half of the table are incremented by the step size starting from k + 2m / 2−1 .

Similarly we have corresponding physical addresses of the successors.

Page 21: Multi-level Hashing for Peer-to-Peer System in Wireless Ad Hoc Environment Dewan Tanvir Ahmed and Shervin Shirmohammadi Distributed & Collaborative Virtual

Wireless ad hoc p2p system – contentdiscovery – first approach (7/8)

Page 22: Multi-level Hashing for Peer-to-Peer System in Wireless Ad Hoc Environment Dewan Tanvir Ahmed and Shervin Shirmohammadi Distributed & Collaborative Virtual

Wireless ad hoc p2p system – contentdiscovery – second approach (8/8)

The values of the fields for entry i at table of node k are:

a is a constant One possible choice for the value of ‘a’ is the index of finger table. i.e. it increase at a rate of ii [11, 22, 33…].

n is n-bit hash value. These approaches perform well when the number of peers is too

small as compared to the address space; otherwise we prefer the usual one.

Start the physical address of successor(start)

(k + ai) mod 2n ,where m/2 ≤ i < m Physical address of successor(start[i])

Page 23: Multi-level Hashing for Peer-to-Peer System in Wireless Ad Hoc Environment Dewan Tanvir Ahmed and Shervin Shirmohammadi Distributed & Collaborative Virtual

Simulation (1/8)

8000 – 10000 peers are randomly deployed in the environment

Each peer has 0.2 movement probability. Nodes are allowed to move at any direction.

16 fixed adjacent regions. Not all nodes are involved in peer-to-peer system.

If we have 8000 peers, system has more than 8000 nodes.

Peers are considered alive during the simulations but helping nodes (intermediate ad hoc nodes that provide routing service) are not all time.

The request may not end with a success.

Page 24: Multi-level Hashing for Peer-to-Peer System in Wireless Ad Hoc Environment Dewan Tanvir Ahmed and Shervin Shirmohammadi Distributed & Collaborative Virtual

Simulation (2/8)

Page 25: Multi-level Hashing for Peer-to-Peer System in Wireless Ad Hoc Environment Dewan Tanvir Ahmed and Shervin Shirmohammadi Distributed & Collaborative Virtual

Simulation (3/8)

Applied chord directly on top of wireless ad hoc network (Setup 1) .

Estimated search cost and routing cost of chord for peer-to-peer system in wireless ad hoc network.

Search cost How many peers are involved in a particular content

discovering process

Routing cost All ad hoc nodes that are involved in content discovering

process including the forwarding nodes.

Page 26: Multi-level Hashing for Peer-to-Peer System in Wireless Ad Hoc Environment Dewan Tanvir Ahmed and Shervin Shirmohammadi Distributed & Collaborative Virtual

Simulation (4/8)

Chord in wireless ad hoc network is not suitable as a peer-to-peer system because of its high routing cost.

If the number of peers is too small as compared to the hash address space, finger table has little contribution in content discovering process.

Page 27: Multi-level Hashing for Peer-to-Peer System in Wireless Ad Hoc Environment Dewan Tanvir Ahmed and Shervin Shirmohammadi Distributed & Collaborative Virtual

Simulation (5/8)

Two-level hashing presented in this paper is tested and compared with chord for wireless ad hoc p2p system.

Simulation environment: (Setup 2) For the sake of fair experiment, we ignored finge

r table in both approaches. This is because we can deploy any variant of finger table in both approaches.

Page 28: Multi-level Hashing for Peer-to-Peer System in Wireless Ad Hoc Environment Dewan Tanvir Ahmed and Shervin Shirmohammadi Distributed & Collaborative Virtual

Simulation (6/8)

On an average, chord requires 10 to 12 times more searching cost than our two-level hashing approach.

Content searching cost is reduced as we divide the entire topology into multiple small regions and first level hash makes it possible to explore the content into that small region.

Page 29: Multi-level Hashing for Peer-to-Peer System in Wireless Ad Hoc Environment Dewan Tanvir Ahmed and Shervin Shirmohammadi Distributed & Collaborative Virtual

Simulation (7/8)

Chord requires 50 times more routing cost than two level hashing scheme on an average.

Chord is a logical topology. It has no knowledge of the physical structure.

Request is redirected to a node that is logically close but physically far away.

Page 30: Multi-level Hashing for Peer-to-Peer System in Wireless Ad Hoc Environment Dewan Tanvir Ahmed and Shervin Shirmohammadi Distributed & Collaborative Virtual

Simulation (8/8)

It is also true in two-level hashing approach when it enters in a local region.

But its logical ring is composed of close proximity nodes as compared to one level hashing in chord.

Reduces routing cost to a large extent. Proves the requirement of multi-level hashing.

Page 31: Multi-level Hashing for Peer-to-Peer System in Wireless Ad Hoc Environment Dewan Tanvir Ahmed and Shervin Shirmohammadi Distributed & Collaborative Virtual

Conclusion(1/1)

We present a two-level hashing scheme for wireless ad hoc peer-to-peer system.

It shows that the performance of the system will be increased once we have multi-level hashing in terms of searching cost and routing overhead.

Modified finger tables works well when the number of peers is too small as compared to the hash address space.