Concurrently Streaming Media Files Over P2P Dhts
Concurrently Streaming Media Files Over P2P Dhts
Concurrently Streaming Media Files Over P2P Dhts
potentially large audience by turning passive clients into continuous portion of a video in their local buffer. Peers
peers. Peers can self-organize to distribute content to each perform a registration of the first video block in the buffer
other, increasing the scalability of the system and decreasing instead of all video blocks in the buffer. This reduces the
the publishers’ costs, compared to a publisher distributing overhead of holding keys and makes peers available to other
the data himself using a content delivery network (CDN) or peers earlier.
his own servers. We dramatically improve peer discovery
performance in Bit-Torrent Mainline DHT, the largest 3. Existing Algorithm
distributed hash table (DHT) overlay on the open Internet. A) Pseudo DHT
A DHT is a distributed data structure that associates keys P2P streaming systems can be classified into the fol- lowing
with values, just like traditional hash tables or hash maps types: (1) server-dependent type, (2) hybrid type [4], and (3)
and is generally built as a self-organizing overlay network fully distributed type. In Type (1) systems, peers provide
of nodes. DHTs are mainly used in large scale applications their resources to the system with the construction and
by providing services to add, delete and look-up hash keys maintenance of data delivery overlays controlled by central
with very good scalability and performance on distributed servers. In Type (2) systems, peers actively participate in
environments consisting of many thousands of nodes. constructing and maintaining data delivery overlays. How-
Raul Jimenez [1] in his thesis illustrated the scalability issues ever, there may be a central server that assists peers in some
occuring on P2P networks including that connectivity aspects, such as locating peers with contents in their inter-
artifacts are common on the underlying network (i.e., the est. In Type (3) systems, peers are fully in charge of the
Internet) used by the Mainline DHT overlay. Furthermore, distribution of media data among themselves as well as
these connectivity artifacts have the potential to pollute rout- seeking supplier peers. We are proposing a Type (3) system
ing tables and degrade lookup performance. Usage of DHTs which uses a Pseudo DHT [1] algorithm. Pseudo-DHT [1], a
such as Kademlia has increased performance lookup of the descent distributed search algorithm to locate contents in a
DHTs and nodes associated. Sergio Bessa [2] in his thesis P2P time- streaming system. This search algorithm provides
illustrated the development, implementation and simulation a server- free content discovery, which allows Type (1) or
of a simple Distributed Hash Table (DHT) protocol for a (2) systems to become more distributed, thus avoiding a
Peer to peer (P2P) overlay network inspired by small world single point of failure in the system. In our approach, a
[3, 2]
concepts. Chord DHT was used in the implementation distributed lookup overlay is constructed on top of the peers.
for the P2P network with access and retrieval of data from This lookup overlay provides a foundation for pseudo- DHT
the peers on the same. Mike Freedman [3] in his course on services. Pseudo-DHT services include registration,
Com- puter Networks illustrated several algorithms used for retrieval, and deletion; With registration, peers register their
P2P networks along with the design goals and the problems cache information (key) and their network address (value).
faced in system design of each. Issues such as Registered information is retrieved later for other peers
Heterogeneity, False Nodes and Underlay network issues seeking a random video block (retrieval). When peers leave
were illustrated. a system, their registration information is discarded
Jeonghun Noh and Sachin Deshpande [4] proposed a pseudo- (deletion). Pseudo-DHT is a variant of DHT, a distributed
DHT, a descent distributed search algorithm to lo- cate version of a hash table.
contents in a P2P time streaming system. The search
algorithm provides a server free content discovery, which B) Registration
allows systems to become more distributed, thus avoiding a Peers register the index of the first video block they store in
single point of failure in the system. In our approach, a the buffer. Let block index i denote a key. i is hashed using
distributed lookup overlay is constructed on top of the peers. SHA-1, a base hash function. Like the node ID, the hashed
This lookup overlay provides a foundation for pseudo- DHT value of the key ranges from 0 to 2m1 (and mapped into [0,
services. Pseudo-DHT services include registration, 1) with normalization). The space of (normalized) keys and
retrieval, and deletion; With registration, peers register their node IDs is referred to as a key/node space. After
cache information (key) and their network address (value). registration.
Registered information is retrieved later for other peers We choose to use hashed block indexes over block indexes
seeking a random video block (retrieval). When peers leave themselves as a key for the following reasons. First, it is
a system, their registration information is discarded difficult to spread out keys over a key/node space with- out
(deletion). Pseudo-DHT is a variant of DHT, a distributed knowing the length of a media stream a priority. For in-
version of a hash table. Pseudo-DHT is different from stance, when a program is broadcast live, its time length is
classical DHTs in the following aspects: not known beforehand. Second, continuous video blocks are
Register (key, value) may perform the alteration of a spread out over peers that are not adjacent to each other the
given key when a key collision occurs. video chunks from being permanently lost due to node
Retrieve(key) may return a value associated with a given failure. This enhances resource availability in the system.
key or a key closest to the given key, referred to as best Once a peer computes a hash value, it executes register (key,
effort search. value), where value is its network address. When multiple
peers attempt to register with the same key, keys may
They suggested a system to apply pseudo-DHT to P2T- SS become associated with multiple values. This is called key
[5]
. P2T-SS is a novel P2P streaming system which can colli-sion. To prevent a key from being registered with
provide live and time-shifted streams. Time-shifting allows multiple values, successive key modifications are performed
viewers to watch a live stream with an arbitrary offset at a by the registering peer until no key collision occurs.
later time. It also allows viewers to pause and resume video Registration with successive key modification. Key is a
playback. In P2T-SS, a live video stream is segmented into hashed index of a video block. value represents the network
blocks. Peers store video blocks that correspond to a address of the peer associated with the key. Off set is added
~ 129 ~
International Journal of Applied Research
to a key when a key collision occurs. If the offset is of to buffer video after the video block with the modified key
positive value, a subsequent attempt is made forward in the becomes available. If a backward key modification or no
key/node space. If the offset is negative, the attempt is made key modification is made, a peer can start to buffer video
backward in the key/node space immediately after it finds a supplier peer. Fig. 1 depicts the
When a registration is successful, a peer can start to fill their two different approaches of successive key modification for
buffer. If a forward key modification is made, the peer starts registration: forward and backward. Once a supplier with
to buffer video after the video block with the modified key available bandwidth is found, the supplier starts to deliver
becomes available. If a backward key modification or no video from video block.
key modification is made, a peer can start to buffer video If no appropriate supplier is found the peer connects to the
immediately after it finds a supplier peer. Fig. 1 depicts the server to receive the video. Forward successive look up
two different approaches of successive key modification for
registration: forward and backward.
Registration with successive key modification
N Attempt = 0
if Register(key, value) fails then
key = key + offset nAttempt = nAttempt + 1
if key ¡ 0 then Register With Force (0, value)
else if n Attempt = Thres then
Register With Force(key, value)
end if
end if
C) Retrieval
Peers register the index of the first video block they store in
the buffer. Let block index i denote a key. i is hashed using
SHA-1, a base hash function. Like the node ID, the hashed
value of the key ranges from 0 to 2m1 (and mapped into [0,
1) with normalization). The space of (normalized) keys and Fig 1: Key Modification
node IDs is referred to as a key/node space. After
registration.
We choose to use hashed block indexes over block indexes
themselves as a key for the following reasons. First, it is
difficult to spread out keys over a key/node space with- out
knowing the length of a media stream a priority. For in-
stance, when a program is broadcast live, its time length is
not known beforehand. Second, continuous video blocks are
spread out over peers that are not adjacent to each other the
video chunks from being permanently lost due to node Fig 2: Back Key Modification
failure. This enhances resource availability in the system.
Once a peer computes a hash value, it executes register (key, Is not appropriate because the cache contents of a supplier
value), where value is its network address. When multiple needs to span the requested video block i. Figure 2 depicts
peers attempt to register with the same key, keys may the retrieval with backward successive key modification. As
become associated with multiple values. This is called key we view the value in (key, value) pair as a pointer to a peer,
colli- sion. To prevent a key from being registered with the lookup overlay is independent of a data delivery overlay.
multiple values, successive key modifications are performed In other words, pseudo-DHT provides a basic functionality
by the registering peer until no key collision occurs. to store and seek random video blocks. There are a number
Registration with successive key modification. Key is a of approaches to enhance retrieval performance. One
hashed index of a video block. value represents the network approach is to send simultaneous retrieval requests. In
address of the peer associated with the key. Off set is added simultaneous retrieval, n retrieval attempts are made in
to a key when a key collision occurs. If the offset is of parallel with key i,i+1, ..., and i(n-1), respectively. When
positive value, a subsequent attempt is made forward in the more than one reply is received, the earliest reply may be
key/node space. If the offset is negative, the attempt is made used to reduce the retrieval latency.
backward in the key/node space.
Retrieval with successive key modification 4. Proposed Methodology
nAttempt = 0 if Retrieval(key) fails then The web based architecture supports multiple DHTs which
key = key + offset nAttempt = nAttempt + 1 stores the users file hash. The hash is stored in the DHT
if key ¡ 0 or nAttempt = Thres then which is generated using the SHA-1 over the network. This
Return NULL hash is used to reference the file based in the users system.
end if The secure 128 bit hash contains the offset for the file to be
end if streamed by the other users. Distributed topology such as
Chord [2] is used for connecting multiple users over the
When a registration is successful, a peer can start to fill their network. Chord is a scalable, distributed peer-to-peer system
buffer. If a forward key modification is made, the peer starts that uses a flexible key naming scheme, prepared to support
applications as diverse as a Domain Name System (DNS) or
~ 130 ~
International Journal of Applied Research
6. Conclusion
This paper presents use of P2P in video streaming with
importance to issues of scalability and reliability on the
server based architecture which creates a bottleneck in the
current system. Millions of users streaming a file over a
network counts to increase of availability of the server. Our
system proposed a method to accommodate and increase the
reliability of the streaming experience with increase in the
users. Video streaming is concern of all major technology
firms along with applications such as Video Chat, Video
Transfer and Video streaming has created a potential market
which can be utilized by using P2P as a service to end user.
7. References
1. Raul Jimenez. Distributed Peer Discovery in Large-
Scale P2P Streaming Systems, Doctoral Thesis in
Communication Systems Stock- holm, Sweden KTH
School of Information and Communication
Technology, 2013.
2. Sergio Bessa. Storage and retrieval on P2P networks: A
DHT based protocol, IEEE, 2007.
3. Mike Freedman. Peer-to-peer systems and Distributed
Hash Ta- bles (DHTs), COS 461: Computer Networks
Spring 2009 (MW 1:30- 2:50) in COS 105, University
of Princeton.
4. Jeonghun Noh and Sachin Deshpande. Pseudo-DHT:
Distributed Search Algorithm For P2P Video
Streaming, Tenth IEEE International Symposium on
Multimedia, 2008.
~ 132 ~