You are on page 1of 5

Content Sharing using P2PSIP protocol in Wi-Fi Direct Networks

Tuan Nguyen Duong, Ngoc-Thanh Dinh, YoungHan Kim


School of Electronic Engineering, Soongsil University Dongjak-ku, Seoul, 156-743, Korea {tuannd, ngocthanhdinh, younghak}@dcn.ssu.ac.kr
Abstract Efficient sharing of content, between several users in a close area, is a challenging problem remaining in smart devices. This paper presents an architecture which allows users in a group to experience the ubiquitous and real-time sharing service of resource like image, video and website address. Our approach is motivated by taking advantage of the novel industrial standard Wi-Fi Direct which allows Wi-Fi terminals to establish a Wi-Fi network without a real Access Point (AP) and P2PSIP protocol which enables real-time communication using Session Initiation Protocol (SIP) in a Peer-to-Peer (P2P) fashion. Accordingly, with instant ad-hoc peer-to-peer connectivity, content sharing between users is conducted more easily and quickly. We describe a prototype application and discuss major practical requirements of the proposed system.

without the requirement of an underlying infrastructure (e.g. hotspot) but also promises regular Wi-Fi speeds of up to 250 Mbps in comparison with the traditional ad-hoc mode with transfer speeds around 11 Mbps. Furthermore, due to the ubiquity of a group, we come up with a system based on Peerto-Peer SIP which enables users to share their content quickly and easily without invoking any server. The next section provides the Wi-Fi Direct technology and background of P2PSIP. Section III discusses some related works. Then, the architecture overview of our system and its message flow are discussed in Section IV. Section V presents the implementation and functionalities and the last one draws a comprehensive conclusion and outlines some future works. II. BACKGROUND

I.

INTRODUCTION

The rapid growth of technology in the area of mobile phone has changed the way people use their phones. Mobile devices have come a long way in just about three short years, and now support a wide range of useful features like web browsing, video camera or even the possibility of Wireless Network beyond making or receiving phone calls. The functions performed by these embedded features have become a habit of users in daily life. This, in turn, raises the fact that people come up with the need for sharing their mobile content (e.g. photos, videos or website address) with their friends. The instant sharing of multimedia content in device is provided in a variety of ways and all of them remain troublesome. It requires several user actions, such as registration, uploading to central servers which have a number of disadvantages including scalability issues, a single point of failure, administration overhead and hosting expenses. Although traditional ad-hoc method reduces a users burden based on the peer-to-peer paradigm and enable spontaneously content sharing, it cannot overweight some drawbacks, namely the need of alternative infrastructure (Access Point - AP) or the limitation of range, exchanging rate. One way to alleviate a users burden is to rely on an ad hoc method of peer-to-peer content sharing, especially when contents are suddenly discovered and shared. Regarding to the requirement of time and convenience for that kind of sharing and in an attempt to remove the challenges of regular ad-hoc model, our approach uses Wi-Fi Direct (formally known as Wi-Fi peer-to-peer) [1] technology which is developed by the Wi-Fi Alliance to make often temporary WLAN connections easier to establish in device-to-device fashion since it not only allows devices connect directly

A. Wi-Fi Direct The specification of Wi-Fi Direct is defined by Wi-Fi Alliance, an international association that promotes Wireless LAN technology and certifies products if they conform to certain standards of interoperability. The main goal of Wi-Fi Direct is to create a P2P-style network based on traditional WiFi signal when a Wi-Fi access point isnt available [1]. Wi-Fi Direct technology brings the ubiquity which allows users to connect anytime and anywhere without a hotspot. This simplicity of network model helps real-time property in sharing achieved easily and takes less time for configuration. In addition, the embedded software AP enables interoperability between Wi-Fi Direct and conventional devices. Moreover, many existing conventional Wi-Fi devices might be upgraded to Wi-Fi Direct ones with the support of manufacturers. Wi-Fi Direct devices might connect to one another by forming Groups similar to an infrastructure BSS [2]. A single Wi-Fi Direct device is in charge of the Group called Group Owner (GO). This terminal decides which devices are allowed to join and when the Group is started and terminated. This device appears as a virtual AP to support the conventional Wi-Fi terminals while keep the association with real AP if it is connected. B. P2PSIP SIP [3] is an application-layer signaling protocol developed by the IETF to establish, modify and terminate multimedia session. Anyhow, the centralized architecture not just makes demands on administration and maintenance but also is vulnerable for the failure of single point. A conventional SIP

Corresponding Author This research was supported by the MKE (The Ministry of Knowledge Economy), Korea, under the program for CITG support program supervised by the NIPA (National IT Industry Promotion Agency) (NIPA-2012- C61501200-0004)

communication system is not easily and quickly set up in spontaneous or emergency scenarios [4]. Notably, in Wi-Fi Direct environment, therere some certain cases, where Internet connection or pre-deployed server is not available, in which users are desperate to create an ad-hoc network just for sharing resource. P2PSIP [5] developed by the IETF P2PSIP working group addressed those weaknesses by distributing the binding information over P2P overlay. The P2PSIP network consist of a number of nodes which play different roles like a SIP UA peer, a bootstrap peer, an adapter peer or an admitting peer. In detail, this decentralization approach can be achieved by using some distributed data mechanism. Distributed Hash Tables (DHTs), like Chord [6], Kademlia [7] and Content Addressable Network (CAN) [8], provided one option for distributed data mechanisms. III. RELATED WORKS The wide variety of mobile content sharing applications has been developed on research or commercial systems. For example, multimedia messaging (MMS) which is a standard based on text messaging (SMS) enable users to send messages including text, image, sound, video to one or several recipients from his phone. However, some drawbacks such as charging, simplicity and inconvenient user interface make it unable for advanced sharing application. Another one is Bluetooth technology [9]. Using this, Subbusundaram et al. [10] develop a system which pushes data between supported devices for the advertisement purpose. Nevertheless, without an IP-based infrastructure, Bluetooth environment is not the right place to deploy P2P Overlay network on as well as for a group communication application which is launched in a coincidence manner to fulfill users need. Many commercial softwares such as Skype [11], Yahoo Messenger [12], WhatsApp [13] provide user with the ability to share mobile content and have been successful with a thousands of subscribers, especially Skype with the proprietary standard and P2P overlay model. There is still a number of Achilles heels one of them is that there is no single set of standardization that all agree should be made available for communication. In addition, most of them not only need the availability of Internet but also lack a consideration of real-time property. It, obviously, calls the use of these applications for sharing between a few devices in a small area into question. Besides those most popular commercial solutions for mobile group communication, there has been academic research in this area. Hyunjeong et al. [14] presented a solution of content sharing for multiple devices in instant multimedia service environment. They focused on building a converting server to help a variety of devices to be able to communicate each other. Obviously, this approach turned up several shortcomings which generally stemmed from the situation in which some users immediately have sharing need at a certain time especially now there are several types of media supported by most of smartphones by default. In [15] is also a study on content sharing and Wi-Fi Direct area. The authors addressed some weaknesses of Wi-Fi Direct and propose DOMS (Decentralized cOllaborative Media

content Streaming) architecture with the concept of centralized controls with decentralized data distribution for collaborative streaming amongst Wi-Fi devices in the home network. However, some modifications are required to source device driver, which is hard to entirely deploy in reality. Since none of any methods are suitable for mobile environments, we will propose a model to cover the needs for spontaneously sharing group formation. Our system follows the standardized P2PSIP, and ensures that any other ones implementing it faithfully are able to interoperate with ours. IV. ARCHITECTURE

A. Architecture of P2PSIP over Wi-Fi Direct network This section presents a sharing-service P2P overlay architecture that allows for establishing SIP sessions between members without centralized servers in Wi-Fi Direct environment. The architecture is illustrated in Fig. 1.
Internet
J/P J/P

B/P/P P

P2PSIP Wi-Fi Direct Network

P PTT/P

Data Transfer

B/P/P = Bootstrap & Presence Peer

Publish/Subscribe Message J/P = Joining Peer P2P Control Protocol PTT/P = Push-to-Talk Peer MBCP Message P = Peer

Figure 1. A sharing-service P2P overlay in Wi-Fi Direct

In this architecture, there are two types of entities (excluding the normal peer and the joining peer): Bootstrap/Presence Peer (B/P/P) provides initial configuration information to newly joining nodes and is able to receive the SUBSCRIBE and PUBLISH message from peers and notifies others the change of presence status by sending NOTIFY message. The reason for combining the bootstrap and presence function within one node is the small group created by Wi-Fi Direct. Push-to-Talk Peer (PTT/P) is the first peer initializing the conference. Its IP address is registered on overlay and can be retrieved by others. The function of this peer is to control the Media Burst Control Protocol (MBCP) message from participant in conference. We apply the client-server based model for signaling plane and the P2P one for data. In our architecture, both B/P/P and PTT/P are the main entities maintaining two kinds of signaling message, one presented by the continuous green line for presence information-related message and the remaining presented by the dotted blue line for media handling-related

message. As shown in Fig. 1, all signaling messages must go through a central point and then be broadcast to others in the overlay whereas the data, presented by the red line, is exchanged among participants in direct style. In addition, a WiFi Direct device can connect to two different networks at the same time with the hardware support as mentioned earlier. With the support of dual mode networking, Internet user might communicate and send data with other participants in Wi-Fi Direct network or he is able to download resource from outside before deciding to share. Firstly, a client must contact with the pre-configuration B/P/P to be able to join the overlay. Using a DHT based on Kademlia algorithm, the resource URI of virtual presence server is registered in overlay. After joining and successfully registering its resource URI with overlay, a peer can retrieve the IP address of presence peer to subscribe or public to and receive notification from that peer. To reduce the latency as much as possible, we set the GO to B/P/P peer. So the message from one certain peer will be broadcast immediately after it arrives at GO. B. Layered Peer Architecture In principle, our P2PSIP UA architecture is designed based on the layered architecture; it can initiate a standard SIP session and also supports P2P resource transmission. It consists of four layers. They are Wi-Fi Direct layer, Access layer, Functional Layer and Graphic User Interface (GUI) layer. The object of this layered design is to easily adding more functionality and maintenance. The Fig. 2 describes the detailed architecture of a P2PSIP UA.
Application (GUI) GUI Layer Functional Layer

totally implemented as a firmware by device manufacturer or third parties. 2) Access Layer The Access layer provides the means to determine a nodes IP address by retrieving its URI on overlay. This is achieved by using a P2P overlay to distribute the mapping information between a nodes URI and its address. In our system, we customized Kademlia algorithm to adapt with the simple, small characteristic and the need of high data transmitting speed in a Wi-Fi Direct Group on Android platform. This layer contains two components performing basic functions: one relates to P2P algorithm to distribute the information effectively and one is P2P protocol to manage and maintain the overlay in the case theres joining or leaving peers. 3) Functional Layer The functional layer consists of Session Controller, Pushto-Talk handler, Shared Resource handler and User Management. Session Controller contains a SIP stack block implemented completely basing on Java, takes charge in establishing and handling sessions between different situations. This block is involved in Presence service, Conference service as well as controlling the resource sharing or the transmitting process of media data (MBCP Handler block). About media part, transmission between users in all scenarios is done by Push-to-Talk Handler. The Audio launcher initializes several parameters like port, codec and encodes media data into RTP packet for real-time requirement before sending to others. Received resource is manipulated by different components in Shared Resource Handler block on account of dissimilar ways of display. The UserManagement block has responsibility for managing users including the presence information and the participants taking part in conference as well. 4) Graphic UI Layer The User Interface in this layer is a set of Activity objects. The main screen (called Activity in Android) of a P2PSIP UA is a contact list, could accepts users invitation and invokes the below layer to start a sessions that allow users to share content, is shown in Fig. 3.

Shared Resource Handler


Image Processing Notification Message Formatter

User Management

Session Control
Resource Sharing Handler

Push-to-Talk Handler
Audio Handler Audio Launcher

Presence Agent

Conference Handler

Audio Sender SIP Stack MBCP Handler Media API

Audio Receiver

RTP/RTCP

DHT

P2P Protocol

P2P Algorithm

Access Layer

Device Discovery Protocol

Service Discovery Protocol

WiFi Direct Layer

Data Link Layer (P2P Interface Address & P2P Device Address)

Figure 2. Layered architecture inside P2PSIP UA

1) Wi-Fi Direct Layer The Wi-Fi Direct Layer is responsible for creating a P2P group and establishing as well as maintaining the network connections between devices. This layer is the place for protocol involved in processes like device and service discovery, negotiation and addressing mechanism, which is

Figure 3. The user interface of UA

C. Use Case and Sequence Diagram In our system, we use the Push-To-Talk method to communicate between users. As represented by the one-way orange line, at a certain time only one user (in this case Alice) has right to talk whereas the others are only able to receive.

This could be achieved by using Media Burst Control Protocol. Accordingly, when a user requests a floor from PTT Handler peer, this peer would check floors availability. If other users are using it, the system will send a DENY response back to requester. Otherwise, it will send a GRANTED response to indicate the success of floor request. Fig. 4 outlines the components involved in the user case as well as their interactions. The first step (including three substeps) for a client to share content is registering itself with overlay. In this case, Alice is the first one who is creating the overlay and playing a role as a bootstrap for the next clients. This peer is also registered the URI of presenceuri@p2p.dcn.ssu.ac.kr to overlay to be a virtual presence server. Subsequently, since Bob has something to share, he would be the first to start the conference. Now, he needs to register the URI of PTT handler to overlay. This URI can be used by the invited peers to retrieved the IP address of PTT Handler and has the form of conf-uri@p2p.dcn.ssu.ac.kr.Then, Bob initiates the newly conference by sending INVITE request to PTT handler (itself) and sends a notification message to his selected buddies. Invited user, if accept to receive shared resource, will also send INVITE message to PTT handler. After receiving the response 200 OK message, each participant opens a connection to MBCP handler which is considered as a part of PTT peer at sub-step 3.1 and 3.2. From this time, participants are able to transmit RTP packet in Pushto-Talk manner with the involvement of MBCP message to get right.
P2P Overlay Bob (PTT Handler)

V.

IMPLEMENTATION AND EVALUATION

We leveraged IDE Eclipse, Java Virtual Machine 1.6 and Android Platform 2.3 to develop an application of our Group Sharing architecture which allows user to share image, video, or website address each other. The tests were performed with one P2P GO which plays a role as B/P/P peer and three clients connected in Wi-Fi Direct network as illustrated in Fig. 5.

Alice 1.1 Registration

Mary

1.2 Registration 1.3 Registration 2.1 INVITE (conf-uri@p2p) 2.2 Notification 2.3 Notification 2.4 INVITE (conf-uri@p2p) 2.5 200 OK 3.1 MBCP Connect (Floor Control) 2.6 INVITE (conf-uri@p2p) 2.7 200 OK 3.2 MBCP Connect (Floor Control) 4.1 MBCP Floor Control Request 4.2 MBCP Floor Control Granted 4.3 MBCP Floor Control Request 4.4 MBCP Floor Control Deny 5.1 RTP 5.2 RTP 6.1 Image/Web Page Sending Req 6.2 Image/Web Page Sending Req 6.3 Accept 6.4 Sending 6.5 Accept 6.6 Sending

Figure 5. Test environment

All the devices in our setup, including Wi-Fi Directenabled and conventional Wi-Fi ones are run on Android platform. The detailed steps are listed as following: 1. Two devices enable Wi-Fi Direct function and create a Wi-Fi Direct network after negotiation process. This step ends with a GO device and the others have been clients in its network. The application is launched at GO device firstly and takes responsibility of a B/P/P peer. After that, each client in turn joins the overlay created by B/P/P peer and notifies its presence status to the others. At any time, any client can Home, chooses resource (image, video, website address) and shares with ones he wants. At this time, the conference is established and all participants are able to begin sharing desired content with each other, including voice.

2.

3.

Figure 4. Sequence Diagram for content sharing process

Step 6 is the offer/answer process between sender and receiver about the shared resource. Mary sends an offer to everyone about her wish of sharing, and in turn the others might accept or deny by sending the corresponding message. Then the transmission is started from Mary to Bob and Alice.

Some experimental results obtained from our system in different distance between users have shown that the average

delay from the time when a GO invites others to when conference is ready is not so much different. This value is around 0.875s in low-inference network and 1.604s in highinference one, it remains acceptable with the real-time property from the end-user point-of-view. However, we also consider the load problem due to that fact that GO provides a data distribution service between all connected clients in P2P Group. It means that the stability of Wi-Fi Direct network is adversely affected when the number of clients increases. We define dX,Y as the time for a packet from two terminals X, Y (one of them is GO), with a s-byte packet, f(s) as the function of time for GO to relay, g(s) as the function of time for processing, C as the padding time for switching between multiple packets. So the worst waiting time for a packet from i to j in a conference of n participants is: = ( , + () + ) + () + ,

provide suitable support for a sharing service in spontaneous or emergency situations. REFERENCES
[1] [2] [3] Wi-Fi Alliance, Wi-Fi CERTIFIED Wi-Fi DirectTM: Personal, portable Wi-Fi technology, Oct. 2010. Wi-Fi Alliance, Wi-Fi Peer-to-Peer (P2P) Technical Specification version 1.1, Oct. 2010. J. Rosenberg, H. Schulzrine, G.Camarillo, A. Johnston, J. Peterson, R. Spark, M. Handley, E. Schooler, SIP: Session Initiation Protocol, Internet Engineering Task Force, RFC 3261, June 2002. R. Klauck, M. Kirsche, Integrate P2PSIP into Collaboration P2P Applications: A Case Study with the P2P Videoconferencing System BRAVIS, in Proceedings of CollaborateCom 2009, Crystal, Washington, pp.1-10. Peer-to-Peer Session Initiation Protocol (P2PSIP), Working Group Charter. [Online]. Available: http://datatracker.ietf.org/wg/p2psip/charter I. Stoice, R. Morris, D. Karger, M. F. Kaashoek, and H. Balakrishnan, Chord: A Scalable Peer-to-peer Lookup Service for Internet Applications, in Proceedings of the ACM SIGCSMM 01 Conference, San Diego, California, pp. 149-160, Aug. 2001. P. Maymounkov and D. Mazieres, Kademlia: A Peer-to-peer Information System Based on the XOR Metric, in Proceeding of the 1st International Workshop on Peer-to-Peer Systems (IPTPS02), pp. 53-65, Mar. 2002. S. Ratnasamy, P. Francis, M. Handley, R. Karp, and S. Shenkeo, A Scalable Content-Addressable Network, in Proceedings of ACM SIGCOMM 01 Conference, San Diego, California, Aug. 2001. C. M. Corderio, S. Abhyankar, D. P. Agrawal, An enhanced and energy efficient communication architecture for Bluetooth wireless PANs, Ad Hoc Networks, vol. 3, pp. 119-140, Mar. 2005. B. Subbusundaram, P. Jawaharlal, System Implementation of Pushing DATA to Handheld Devices via Bluetooth high speed specification, Version 3.0 + HS, in Proceedings of the 6th Wireless Communication Networking and Mobile Computing (WiCOM), pp.1-4, Sept. 2010. Skype Web Site, [Online]. Available: http://www.skype.com Yahoo Web Site, [Online]. Available: http://www.yahoo.com WhatsApp Web Site, [Online]. Available: http://www.whatsapp.com H. Lee, Y. Chung, J. Huh, S. H. Lee, Content sharing mechanism with multiple devices in real-time multimedia service environment, in Proceedings of the 1st IEEE International Conference on Consumer Electronics (ICCE), Berline, Germany, pp.137-139, Sept. 2011. H. Yoon, J. Kim, Collaborative Streaming-based Media Content Sharing in WiFi-enabled Home Networks, IEEE Trans. Consum. Electron., vol.56, no.4, pp.2193-2200, Nov. 2010.

[4]

[5]

[6]

We improve by reducing this value. In detail, instead of sending n packets, the sender notifies GO by a list of its recipients at the beginning of conference and then delegates GO a task of broadcast one only received packet. Thus, the extra time C is surely removed and (1) can be optimized to be (2): = , + () + () + ,

[7]

[8]

[9]

The average maximum duration between two packets from a client to GO and a client to another client in a conference involving 6 participants (n = 6) before and after applying the improving model are measured in 15 experiments and shown in TABLE I. Each RTP packet which length is the size of 1036 in bytes, originate at a client and is sent to GO as well as other participant. Note that we skip C value due to its very small value.
TABLE I. Parameters GO throughput Wireless link delay (dclient, GO) Forwarding duration (f(s)) Processing duration (g(s)) Maximum Delay at GO (TGO) Maximum Delay at Client (Treceiver) EXPERIMENTAL RESULTS Original Method Improved Method

[10]

[11] [12] [13] [14]

[15]

6216 bytes 12 ms 4 ms 7 ms 97 ms 85 ms CONCLUSION

1036 bytes 12 ms 4 ms 5 ms 61 ms 49 ms

VI.

In the years to come, resource sharing in real-time style is likely to become an integral part of most users. This results in the fact that Wi-Fi Direct technology has already been developed and truly plays a relevant role in different application domains. This paper discussed the main design to consider in system development and also stressed the necessity of using Wi-Fi Direct relying on standard P2PSIP protocol to