Sunteți pe pagina 1din 6

Design and implementation of P2P protocol for mobile phones

Hiromitsu SUMINO, Norihiro ISHIKAWA, Takeshi KATO


NTT DoCoMo, Inc.
suminoh@nttdocomo.co.jp, ishikawanor@nttdocomo.co.jp, katoutake@nttdocomo.co.jp
Abstract
In most P2P communication services, mobile
phones can not access the P2P network without having
a proxy server due to their limited capabilities. The
implementation of a P2P protocol over mobile phones
which enables direct P2P communication between
mobile phones is discussed in this paper. We have
designed and implemented a P2P protocol in our
research group to provide seamless communication
across various networks such as the Internet, mobile
networks, and home networks. We have implemented
the P2P protocol over a mobile phone which had a
Bluetooth communication interface. We have also
implemented instant message application among
mobile phones.
1. Introduction
Peer-to-Peer (P2P) has entered the public limelight
over the last few years. Compared with traditional
Internet technologies, P2P has the potential to realize
highly scalable, extensible, and efficient distributed
applications. Then, P2P communication services such
as Skype [1] is widely used and various kinds of
applications are expected to appear in future. However,
there is no standard protocol for P2P networks and
current P2P applications are implemented with their
original protocols. Therefore, P2P application
developers demand for a general platform which
provides the functions common to various P2P
applications. In addition, most P2P applications are
developed on PCs, but currently mobile phone users
access the Internet and the needs for using P2P
applications over mobile phones are increasing.
However, in most P2P services, mobile phones can not
access the P2P network without having a proxy server
due to their limited capabilities.
The purpose of this study is to explore a P2P
protocol over mobile phones which enable direct P2P
communication between mobile phones. We have
designed a general-purpose P2P protocol and
implemented a P2P platform to provide seamless
communication across various networks such as the
Internet, mobile networks, and home networks. We
have implemented the P2P protocol over a mobile
phone which had a Bluetooth communication interface.
We have also implemented instant message application
over the P2P protocol.
2. P2P Platform
2.1. Architecture overview
We briefly describe the P2P platform that we have
been developing. This P2P platform aims to provide an
environment wherein various kinds of devices such as
PCs, mobile phones, and home appliances to
communicate with each other seamlessly over various
networks, such as home networks, mobile networks
and the Internet.
As shown in Figure 1, the P2P platform implements
the P2P Core protocol and the P2P system protocols
and provides a middleware Application Programming
Interfaces (APIs) for P2P applications. The P2P Core
protocol performs P2P routing on a variety of lower
transport networks such as IP network, IEEE1394[2],
or Bluetooth[3]. The P2P system protocols, which are
situated on the P2P Core protocol, consist of several
protocols that provide the various functions required
by P2P communication. Those protocols have
functions for constructing the neighboring relationship
between P2P nodes, constructing delivery trees for
P2P multicast and so on. Moreover, P2P application
protocols that are used for specific P2P applications
can be defined over the P2P Core protocol.
Middleware APIs are also provided for accessing the
P2P protocol stack, which enable the implementation
of various P2P applications on the P2P platform. The
ability of this platform to support a variety of transport
networks simplifies the implementation of various
kinds of P2P applications in a ubiquitous
communication environment.
Proceedings of the Fourth Annual IEEE International Conference on Pervasive Computing and Communications Workshops (PERCOMW06)
0-7695-2520-2/06 $20.00 2006 IEEE
The platform is developed in Java (J2SE 1.3.1) [4]
on Microsoft Windows 2000 and Red Hat Linux 7.2.
Figure1. P2P platform protocol stack
2.2. Network architecture
As shown in Figure 2, the P2P platform supports
Hybrid and Pure P2P networks. All of the peer nodes
in a hybrid P2P network are managed by a control
node. Each peer node reports its existence and its
adjacent nodes to the control node. The control node
thus can comprehend the topology of an entire hybrid
P2P network. It accepts a request from a P2P node and
provides related routing information, topology
optimization and security functions according to the
state of the desired P2P network. The hybrid P2P
network is suitable for a large well organized P2P
network such as Grid computing over the Internet.
On the other hand, the pure P2P network is well-
adapted to ad-hoc networks such as multi-hop wireless
LANs and sensor networks. In our architecture, Hybrid
and pure P2P networks can be integrated by several
gateway nodes. The gateway node collects topology
information of the pure P2P network and reports it to
the control node. The control node thus can
comprehend the topology of a pure P2P network as
well. The gateway node also accepts a request from a
P2P node in the pure P2P network and forwards it to
the control node. This allows the gateway node to
support seamless communication between a P2P node
in a pure P2P network and a P2P node in a hybrid P2P
network. All P2P nodes can thus efficiently
communicate with each other by using the routing
information provided by the control node.
Control
Node
Gateway
Node
Pure P2P Pure P2P
P2P Community
Pure P2P
P2P Node
Gateway
Node
Hybrid P2P
Gateway
Node
Figure2. P2P network architecture
3. Mobile phone support
This section describes how the P2P platform
supports mobile phones. In most P2P applications,
proxy servers are used to support mobile phones since
capabilities of mobile phones are limited. These proxy
servers act as P2P nodes on P2P networks and convert
P2P protocols used in the P2P networks into protocols
that mobile phones support. However, P2P
communication via proxy is not effective and not
suitable for communication on ad-hoc networking
environments. Therefore, we have designed a P2P
protocol for mobile phones, in order to realize P2P
communications between mobile phones without
having a proxy server.
3.1. Protocol for mobile phone
Since a protocol for mobile phones should be
defined as simple as possible for implementing on
mobile phones, we classified the functions provided by
the P2P platform into mandatory or option. A P2P
node whose processing performance is as low as the
mobile phones is also able to participate in the P2P
network by only supporting the mandatory functions.
As described in 2.2, the P2P platform supports both
hybrid and pure P2P networks. However, it is difficult
for a mobile phone to work on a hybrid network since
it is required to support the functions to communicate
with a control node. Moreover, the node which acts as
a gateway node needs much more performances since
it collects other nodes information and reports such
information to the control node. Accordingly, a mobile
phone cannot become a gateway node. For this reason,
the functions for participating on a hybrid network are
classified as optional.
P2P nodes that support the pure P2P network
functions can communicate with each other within the
pure P2P network. The node on a pure P2P network
can also communicate with a node on a hybrid P2P
hetwork
|P
TCP hon~|P
e,g, |EEE1394 / B|uetooth(L2CP)
P2P core protoco|
H|dd|eware P|s
P2P app||cat|on P2P app||cat|on
P2P system protoco|s
P2P
Bas|c
Commun
|cat|on
Protoco|
P2P
Hu|t|cast
Commun|
cat|on
Protoco|
P2P
Bas|c
$erv|ce
Protoco|
P2P
Hu|t|cast
$erv|ce
Protoco|
P2P
Contro|
Hessage
Protoco|
P2P
pp||cat|on
protoco|
P2P
pp||cat|on
protoco|

Proceedings of the Fourth Annual IEEE International Conference on Pervasive Computing and Communications Workshops (PERCOMW06)
0-7695-2520-2/06 $20.00 2006 IEEE
network if the pure P2P network is connected with the
hybrid P2P network via a gateway node.
As described in 2.1, the P2P protocols consist of the
P2P Core protocol and P2P System protocols. Table 1
shows the functions provided by these protocols. We
classified the functions of each protocol as mandatory
or optional.
3.1. 1. P2P Core protocol
The P2P Core Protocol provides a function to
forward messages on P2P networks which realizes
reactive and proactive communication modes. Request
and response messages are defined for the reactive
communication mode while an advertise message is
defined for the proactive communication mode.
Additionally, this protocol defines three
communication types namely, unicast, multicast and
broadcast.
Since the most important function for the
communication on P2P networks is forwarding
messages between nodes, most of the functions defined
on the P2P Core protocol are classified as mandatory.
However, P2P multicast communication function is
classified as optional since P2P multicast
communication is not always necessary, and requires
complex processing.
3.1. 2. P2P Basic Communication protocol
The P2P Basic Communication Protocol establishes
and releases P2P sessions. In our P2P architecture, all
communications are based on a P2P session between a
pair of adjacent P2P nodes. This protocol also has the
function of exchanging node resource information
such as names of its adjacent nodes, joined multicast
groups, and supported P2P applications. This protocol
consists of a Hello method, a Bye method, and a
Resource Information Exchange method. A Hello
method is used to establish a P2P session. A Bye
method is used to release a P2P session. A Resource
Information Exchange method is used to exchange
node resource information between P2P nodes.
The Basic communication protocol is required by
every node on the P2P network, since it is used to
establish and release the connection between P2P
nodes.
3.1. 3. P2P Control Message protocol
The P2P Control Message Protocol provides
ancillary functions such as notification of message
forwarding error, keep-alive for P2P sessions, and first
peer node discovery in pure P2P network
environments. For example, an ErrorReport message is
used to notify the source node of the forwarding error
of a message. A Diagnose message is used to measure
RTT (Round Trip Time) between P2P nodes. A
Lookfor message is used to find the first peer node to
which a node should connect in pure P2P network
environments.
On the P2P network, P2P nodes join or leave
frequently, and the messages are transmitted hop by
hop. On such environment, the existence of a
destination node or the route to the destination node
can not be assured in advance when a source node
forwards a message to the destination node. When the
message can not be forwarded to the destination node,
the node which receives the message should send back
an error message to the source node.
Since the above functions of the P2P Control
Message protocol is required by every node on the P2P
network, those functions are classified as mandatory.
Discovery function for finding resources
autonomously on the P2P network is also very
important since there is no server to manage the
information of resources on the P2P network.
Therefore, the functions of resource discovery, such as
first peer discovery or node discovery are classified as
mandatory. Since P2P multicast communication is not
always necessary, the ancillary function for P2P
multicast is optional..
3.1. 4. P2P Basic Service protocol
In hybrid P2P network environments, the P2P Basic
Service Protocol is used between a P2P node and a
control node, to provide the functions for first peer
discovery, source route discovery toward a destination
node and network topology optimization. In this study,
the functions for participating on hybrid P2P network
are classified as optional. Therefore, the P2P Basic
Service protocol is classified into as optional protocol.
3.1. 5. P2P Multicast Communication protocol
The P2P Multicast Communication Protocol
constructs a multicast distribution tree for multicast
member nodes and forwards multicast messages along
it. A node finds a member node of a multicast group,
and sends a Join message to it, and a multicast routing
table is generated at each node along the path toward it
at the same time. When a node wants to send a
multicast message, it sends the message toward the
adjacent member nodes based on the multicast routing
table. The multicast messages are forwarded along the
multicast distribution tree using the bi-directional
shared tree mechanism. When the node leaves the
multicast group, it sends a Leave message to the
adjacent member nodes.
As described in 3.1.1., the P2P multicast
communication function is classified as optional.
Accordingly, the P2P Multicast Communication
Protocol is classified into an optional protocol.
3.1. 6. P2P Multicast Service protocol
The P2P Multicast Service Protocol is used between
a P2P node and a control node, and provides the
Proceedings of the Fourth Annual IEEE International Conference on Pervasive Computing and Communications Workshops (PERCOMW06)
0-7695-2520-2/06 $20.00 2006 IEEE
functions for member nodes discovery of a multicast
group and source route discovery toward member
nodes in hybrid P2P network environments. This
protocol is classified into an optional protocol since the
multicast communication function and communication
on a hybrid network are classified as optional.
Table1. Protocol functions
Protocols Function Support
Proactive Communication mode
(advertise message)
Must
Reactive Communication mode
(Request/Response message)
Must
Unicast Must
Broadcast Must
P2P Core
Protocol
Multicast Option
Establish the connection between
P2P nodes (Hello message)
Must
Release the connection between
P2P nodes.(Bye message)
Must
Resource information advertise Must
P2P Basic
Communication
Protocol
Resource information exchange Must
Notify the forwarding error (error
report)
Must
Diagnose connectivity between
nodes (diagnose)
Must
Node discovery (diagnose) Must
First peer discovery (Lookfor) Must
P2P Control
Message
Protocol
Multicast group member
discovery
Option
P2P Basic
Service Protocol
Used for the communication with
a control node (Ex. login,
exchange node information, node
discovery)
Option
P2P Multicast
Communication
Protocol
Establish Multicast group (Ex.
Join or leave multicast group)
Option
P2P Multicast
Service Protocol
Used for the communication with
a control node regarding multicast
communication ( management for
multicast group)
Option
3.2. Example of Protocol Sequence
Figure3 shows a basic sequence when a P2P node
participates in a P2P network and exchanges resource
information with another node in pure P2P network
environments. At first, Node A sends a Lookfor
message using network specific broadcast or multicast
mechanisms (e.g. IP multicast) and receives the
corresponding LookforResponse messages from
several nodes. Then, Node A sends a Hello message to
one of discovered nodes (Node B) to participate in a
P2P network. When a HelloResponse Message from
Node B is received, a P2P session is established
between Node A and Node B. Resource information
will be exchanged using Resource Information
Advertisement messages in the next step.
Node A Node B Node C
Look Por PlrcL
Peer Node
CoooecLlog
PlrcL Peer Node
LxcHaoglog
Pecource
|oformaLloo
Lookfor
Lookfor
Pecpooce
Hello
HelloPecpooce
Peer-Lo-Peer CoooecLloo LcLabllcHmeoL
Pecource
|oformaLloo
AdverLlcemeoL
Pecource
|oformaLloo
AdverLlcemeoL
Figure3. Ex. Message sequence
3.3. Example of P2P Protocol Message
All P2P protocols are defined in XML syntax.
Figure4 shows an example of a "hello" message sent
by a moble phone node. Information on the P2P Core
protocol such as message type, message ID, destination
node ID and source node ID is declared inside the
<Core> element. Information on the P2P Basic
Communication protocol is declared inside the
<MsgBody> element. For the compliance with XML
and independency among P2P protocols, each P2P
protocol has its own namespace.
Figure4. An example of message
4. Implementation
In this section, we describe the prototype
implementation of the P2P protocol and application on
a mobile phone which has a bluetooth interface. This
prototype software realizes P2P communication via
bluetooth.
<Core xmlns=http://www.mml.yrp.nttdocomo.
co.jp/ED/2004/03/p2p_core>
<ComType>Unicast</Comtype>
<MsgID>123456-200402021600-nd1</MsgID>
<MsgType>Request</MsgType>
<CommunityID>p2p</CommunityID>
<Source> source node ID </Source>
<Destination> <target>destination node ID </Target>
</Destination>
<MsgBody protocol="http://www.mml.yrp.nttdocomo.
co.jp/ED/2004/03/p2p_basic_com">
<Hello xmlns="http://www.mml.yrp.nttdocomo.
co.jp/ED/2004/03/p2p_basic_com"/>
</MsgBody>
</Core>
Proceedings of the Fourth Annual IEEE International Conference on Pervasive Computing and Communications Workshops (PERCOMW06)
0-7695-2520-2/06 $20.00 2006 IEEE
4.1. System components
Software architecture of the prototype is shown in
Figure5. The mobile phone supports JAVA API for
bluetooth communication in addition to DoJa2.0 which
is JAVA API for NTT DoCoMo's mobile phones. The
software is implemented as a JAVA application. The
Bluetooth Personal Area Network (PAN) profile,
which supports TCP or UDP, is used for underlying
networks. This prototype software is compiled as one
JAVA application and installed on the mobile phone.
The size of the prototype software which includes the
P2P platform and the P2P application is about 200KB.
In this study, we use 4 mobile phones and each mobile
phone is connected, as shown in Figure6. PAN User
(PANU) and Group ad-hoc Network (GN) are roles
defined in the Bluetooth PAN profile. A GN can only
connect with a PANU, and also a PANU can only
connect with a GN. Therefore, 3 PANU nodes connect
with a GN node in this case. Since a P2P network is
constructed over a Bluetooth network, the connections
between P2P nodes are independent of the Bluetooth
connections.
: Implemented software
KVM/CLDC
CLDC1.0+DoJa2.0 Bluetooth PAN module
i-Appli (JAVA Application)
P2P Application (Instant Message)
CLDC1.0+Doja2.0 API Java API for Bluetooth
P2P Node
manager
P2P Protocol
Adapter for Bluetooth PAN
KVM/CLDC
CLDC1.0+DoJa2.0 Bluetooth PAN module
i-Appli (JAVA Application)
P2P Application (Instant Message)
CLDC1.0+Doja2.0 API Java API for Bluetooth
P2P Node
manager
P2P Protocol
Adapter for Bluetooth PAN
Figure5. Prototype software architecture
P2P connection
P2P node
(PANU)
P2P node
(PANU)
P2P node
(PANU)
P2P node
(GN)
Bluetooth connection
Figure6. Communication with Prototype
4.2. Application
We have implemented an instant messaging
application over mobile phones. The instant messaging
application includes a messaging service and a
presence service. In the messaging service, users are
able to send their messages by broadcast or unicast.
The presence service is used to announce each user's
presence information when its presence information
changes. The user interface of this application is
shown in Figure7. When the node receives a message,
it is displayed sequentially on this screen.
Figure7. IM application user Interface
4.3. Operation
Figure8 shows the message sequence of the instant
messaging application. First, a mobile phone user starts
the P2P node manager software on the mobile phone,
and then it searches other mobile phones that can setup
the connection via bluetooth communication link. Next,
the user starts the P2P instant message application.
When the application starts, the mobile phone tries to
establish P2P connection with other mobile phone. The
mobile phone sends a Lookfor message by broadcast to
find mobile phones on which a P2P node is running,
and establish P2P connection with the node which
sends back a Lookfor response message. The P2P
connection is established by exchanging a Hello
message and a Hello response message. After
establishing the P2P connection, each node sends a
Resource information advertise message to exchange
its resource information. In our experiment, it takes
about 5 seconds to setup the Bluetooth link, 10
seconds to search nodes with Lookfor massages, and 5
seconds to establish a P2P connection by exchanging
Hello and Resource information messages.
Proceedings of the Fourth Annual IEEE International Conference on Pervasive Computing and Communications Workshops (PERCOMW06)
0-7695-2520-2/06 $20.00 2006 IEEE
After establishing a P2P connection, messages for the
instant message application on a mobile phone can be
exchanged. First, the application sends a presence
information message to notify its presence information.
Then, instant messages are exchanged among mobile
phones. It takes about 0.5 seconds to send a message to
the neighbor node. However, the time changes
according to the condition of the wireless channel.
When the distance between mobile phones was 10 m,
it took more than 10 seconds.
When the application ends, it sends a presence
information message which indicates "good bye" and
closes the P2P connection by sending a bye message of
the P2P Basic communication protocol.
Mobile Phone 2
(GN)
Establish
P2P
connection
Setup Bluetooth
Mobile Phone 3
(PANU)
Mobile Phone 1
(PANU)
Presence lnformation
bye
Hello
Hello Response
connected
Lookfor
Lookfor Response
Start lM
Application
Stop lM
Application
Presence lnformation (leaved)
close Bluetooth connection
Application
Messages
lnstant Message
Resource lnformation
Resource lnformation
Mobile Phone 2
(GN)
Establish
P2P
connection
Setup Bluetooth
Mobile Phone 3
(PANU)
Mobile Phone 1
(PANU)
Presence lnformation
bye
Hello
Hello Response
connected
Lookfor
Lookfor Response
Start lM
Application
Stop lM
Application
Presence lnformation (leaved)
close Bluetooth connection
Application
Messages
lnstant Message
Resource lnformation
Resource lnformation
Figure8. Message sequence
5. Conclusion
We have designed a P2P protocol for mobile
phones that provides P2P communication environment
for various mobile applications. Seamless
interconnection between various devices including
mobile phones across various networks such as the
Internet, home networks and wireless sensor networks
could be achieved using our P2P architecture and
protocols. We also described the prototype
implementation of the P2P protocol and its application
on a mobile phone via bluetooth.
P2P security and privacy are important topics that
we will investigate in the near future. Additionally, we
will continue to develop new P2P applications over
mobile phones and will evaluate scalability and
performance of our P2P architecture and protocols in
more depth.
6. References
[1] Skype, http://www.skype.com
[2] IEEE 1394 http://www.1394ta.org/
[3] Bluetooth http://www.bluetooth.com/
[4] Java J2SE 1.3.1 http://java.sun.com/j2se/1.3/
[5] Norihiro Ishikawa, at el, Jupiter: Peer-to-Peer
Networking Platform over Heterogeneous Networks, The
3rd International Conference on Computing,
Communications and Control Technologies (CCCT2005)
[6] Hiromitsu Sumino, at el, Design and Implementation of
a Multicast Instant Messaging System on the Mobile P2P
Network, First International Conference on Mobile
Computing and Ubiquitous Networking (ICMU), Yokosuka,
Japan. 8-9, January, 2004
[7] Hiromitsu Sumino, at el, A Mobile Multimedia Content
Search using RDF, MDM2003 4th International Conference
on Mobile Data Management, Melbourne, Australia. 21-24,
January, 2003.
Proceedings of the Fourth Annual IEEE International Conference on Pervasive Computing and Communications Workshops (PERCOMW06)
0-7695-2520-2/06 $20.00 2006 IEEE

S-ar putea să vă placă și