In this page, we describe how to use
our generic
communication structure using peer-to-peer (P2P) technology. It allows
users to
discover and access widely distributed Particles from various types of
client entities in remote networks, such as PC, PDA, cellular and even
other
Particles. The following describes system components and
functionalities of the system.
System Components:
- P2PBridge:
It connects to
the same IP subnetwork with
XBridges and organizes the P2P substrate with other P2PBridges. We
implemented a prototype of P2PBridge on JXTA
as a P2P
application platform.
- JXME
Application (ParticleBrowser): It is
an application using JXME, which is an
implementation of JXTA on J2ME (Java 2 Micro Edition). We implemented
an
application called ParticleBrowser that can discover and access desired
Particle on PDA.
JXTA Related Components:
- Proxy: It is a proxy
for JXME applications to participate
with JXTA P2P substrate, because J2ME
can only use HTTP for its communication. It should be specified when a
JXME application is firstly executed.
- Rendezvous: It works as
a rendezvous point for JXTA P2P
peers located in
different networks. It should be specified when a P2PBridge is firstly
executed.
- Relay: It is required
for JXTA P2P peers behind a firewall
to
traverse NAT (Network Address Translation) or packet filtering. It
should be specified when a P2PBridge located behind a firewall.
System Functionalities:
- Detect & Publish: A
P2PBridge detects a Particle by
receiving packets from XBridge and publishes an advertisement that
contains attributes (sender Id, location Id,
artifact type, etc.) of it to JXTA P2P
substrate.
- Node Discovery: P2P
Peer (P2PBridges, JXTA/JXME applications) can send query to
discover the
advertisement of the desired Particle by using an attribute as a query
key.
- Remote
Access: Once the
desired Particle is discovered, it is possible to establish a
connection to
the corresponding
P2PBridge that published the
advertisement. After establishing the connection, the P2PBridge
forwards data from the Particle to the connected P2P peer.
- Inter
Sensor Network
Communication: If a P2PBridge finds that a received data from a
Particle has a ACL tuple that represents the
destination of the data, the P2PBridge tries to discover destined
Particles and forwards the data to them by establishing connections to
the corresponding P2PBridges.

P2PBridge
for Particle
You can download the source code
with/without compiled classes. If you want to start quickly, it is
recommended to download with the compiled classes. The source code
consists
of source code for P2PBridge,
JXTA
JAVA J2SE 2.3.2
libraries and
Equip4j
Components for Particles.
Latest Release (17 Oct. 2005): We
newly add a wrapper program (P2PBridgeWrapper) to skip Equiator framework in the package.
Second Release (26 Aug. 2005):
- Source
code
with compiled classes (It is compiled by Java2 SDK
1.4.2 06)
- Source
code only
(Build tool "ANT" is necessary to compile)
First Release (17 Jun. 2005): Expired
- Source code
with compiled classes (It is compiled by Java2 SDK
1.4.2 06)
- Source code only
(Build tool "ANT" is necessary to compile)
-
Quick Start (without compile)
- You need following environment to get start.
- At least 2 PCs with Java2 JRE
1.4.2. Each PC should be connected to a different IP subnetwork
with others.
- Particles
- XBridges
- Download "Source code with compiled classes".
- Extract the archive wherever you want.
- Go to "[Installed
Directory]/Equator/equip4j/infrastructure/install".
- Execute "runEquipDataSpace.bat" to run Equip server.
- Execute "runExporterGUI.bat" to export all components to the
server (A warning message for Bluetooth related component might be
shown, but
you can ignore it).
- Execute "runComponentBrowser.bat" to run component browser.
- Create one instance of
P2PBridge component and two instance of ParticleFactory component as
the following screen shot. Please refer this
page to know how to use EQUIP Component Browser.
- After creating the ParticleP2PBridge,
the following window is
appeared to configure JXTA related parameters (only at first time). In
basic settings, input
proper peer name and its password as you like (ex. "P2PBridge").
- In advanced settings, select trace level. "fatal" shows only
critical errors (Recommended). Other settings should be as default.
- In Rendezvous/Relay settings, select
"Use a relay" if your PC is
connected behind a firewall (Recommended).
- Press "OK" to start ParticleP2PBridge.
- One ParticleFactory (upper) is used
for listening/sending UDP broadcast packet from/to XBridges. Therefore,
confirm that the listenport is configured as "5555" and sendport is
configured as "5556" as default. Another ParticleFactory (lower)
is used for listening/sending UDP broadcast packet from/to Particle
dedicated applications, such as Particle
Analyzer. Therefore, set the listenport as "5556" and the sendport
as "5555". If you do not need to receive/send UDP broadcast packet for
the
Particle dedicated applications, the latter configuration can be
ignored.
- Create link between ParticleP2PBridge and two ParticleFactories
as
follows.
- connect "recievedclpacket"
of ParticleFactory for Particle (upper) to "clpacketFromXBridge" of
ParticleP2PBridge.
- connect "recievedclpacket"
of ParticleFactory for Particle application (lower) to "clpacketFromApplication" of
ParticleP2PBridge.
- connect "clpacketToApplication"
of ParticleP2PBridge to "transmitclpacket"
of ParticleFactory for
Particle application.
- connect "clpacketToXBridge"
of ParticleP2PBridge to "clpacketFromXBridge" of
ParticleFactory for Particle .
- Start both ParticleFactories by setting "true" in startflag.
Status becomes "OK", when ParticleFactory becomes to work.
-
How to Compile/Rebuild from the Source Code
- Confirm that "Java2
JDK 1.4.2"
is properly installed to your PC.
- Confirm that "ANT"
is properly installed to your PC.
- Download source file with/without compiled classes.
- Extract files to wherever you want.
- Go to " [extract directory]/Equator/equip4j/infrastructure".
- If you download with compiled classes, perform "ant clean"
beforehand.
- Perform "ant" to build.
- "install" directory is created and it holds all runtime batch
files and classes.
- Add particleP2Pbridge component in
Equator/equip4j/infrastructure/src/equip/ect/components/
- Extend particleFactory component in
Equator/equip4j/infrastructure/src/equip/ect/components/
- Add build rules for particleP2Pbridge in
Equator/equip4j/infrastructure/build.xml
- Add JXTA libraries to
Equator/equip4j/infrastructure/resource/common
- Add classpath for JXTA libraries to runExporterGUI.bat in
Equator/equip4j/infrastructure/script
ParticleBrowser
for J2ME
You
can download the source code
with/without compiled classes. If you want to start quickly, it is
recommended to download with the compiled classes. The source code
consists
of source code of ParticleBrowser and modified me4se.
- Please confirm that "Java2 JDK 1.4.2"
is properly installed to your PC.
- Please confirm that "Wireless
Toolkit 2.2" is properly installed to your PC.
- Please confirm that "ProGuard" is properly
installed to your PC.
- Please confirm that "ANT"
is properly installed to your PC.
- Download source file with/without
compiled classes.
- Extract files to wherever you want.
- Go to " [extract
directory]/particle-jxme/".
- Modify "ecliseme-build.properties"
according to your environment. Use \\ as a separator of directory.
- wtk.proguard.home=<Installed directory of ProGuard. (ex.
D\:\\j2sdk1.4.2_06\\proguard3.2)>
- wtk.home=<Installed directory of Wireless Toolkit.
(ex. D\:\\j2sdk1.4.2_06\\WTK22)>
- Perform "ant" to build.
- "deployed" directory is created and it holds compiled jar file. A
jad file for ParticleBrowser is copied to the directory.
-
How to Configure PDA
- Prepare PDA with Windows PocketPC 2003.
- Connect PDA to a network (ex. use "Configuration" "System"
"WLAN Manager").
- Install following utility applications.
- Install IBM
J9VM as Java Virtual Machine for PDA. It is required to execute the
downloaded file on your PC to
extract CAB files for PDA.
- In order to
emulate J2ME environment on PDA, install me4se.jar in <extract
directory of ParticleBrowser>/particle-jxme/lib/ to /My
Documents/Java/lib/ of PDA . ME4SE is a wrapper
class to run MIDlet
applications and this jar file is little modified from original me4se
to incorporate the screen height of Window PocketPC.
- Copy particle-jxme.jar, particle-jxme.jad in <extract
directory of ParticleBrowser>/particle-jxme/deployed/ to /My
Documents/Java/lib/ of PDA.
- Create shortcut of /Program/J9/PPRO10/j9.exe on PDA.
- Open the shortcut and edit it as follows. In the shortcut
on
Windows PocketPC, directory of the execution file should be separated
by backslash, otherwise use slash. And, absolute path should be used.
| 33#"\Programme\J9\PPRO10\bin\j9.exe"
"-jcl:ppro10" "-cp" "/My
Documents/Java/lib/me4se.jar;/My Documents/Java/particle-jxme.jar"
org.me4se.MIDletRunner -jad "My Documents/Java/particle-jxme.jad" |
-
How to run ParticleBrowser on PC
It is possible to run ParticleBrowser
on PC by executing runParticleBrowser.bat in <extract directory of
ParticleBrowser>/particle-jxme/
Proxy for JXME is necessary for
ParcileBrowser to participate with JXTA P2P substrate. It is
originally included in JXTA
source code repository (See
JXME
page in
detail). For easy set up, we include minimal set of compiled
classes and batch files in ParticleBrowser archive.
- On your PC (It is
recommended using another PC to run Proxy than using same PC on which
ParticleP2PBridge is running), execute <extract directory of
ParticleBrowser>/particle-jxme/rendezvous/runRundezvous.bat to start
Proxy.
- After executing the batch file, JXTA configuration screen is
appeared as described above (only at first
time).
- In Basic setting, input
proper a peer name and password as you like (ex. "Proxy") as mentioned above.
- In advanced settings, it requires to check "Act as a JXME proxy"
and "Enable Incoming Connections" for HTTP settings. Trace level is
recommended to choose as "fatal" to reduce unnecessary logging
messages.
- In Rendezvous/Relays setting, it is recommended to choose "use
Relay" as mentioned above.
- Press "OK" to start Proxy.
-
How to Use Particle Browser
JXME applications has several limitation compared with normal
JXTA application. In particularly, it can only use "Name" attribute to
discover advertisement of Particles. To cope with this limitation,
ParticleP2PBridge makes several peerGroup to categorize advertisements
according to their attributes. Therefore, JXME application can discover
desired advertisement by joining corresponding group. For instance, if
a JXME application wants to discover Particles with LocationID=A, the
application discovers a group that represents LocationID of A and then
joins the group and performs discovery in the group. In current
implementation, ParticleP2PBrige makes following groups.
- XBridgeGroup: All advertisements of XBridge are published in
this group.
- ParticleGroup: All advertisements of Particle are published in
this group.
- LocationGroup X: All advertisements of XBridge and Particle
that have Location ID of "X" are published in this group.
- ArtifactTypeGroup Y: All
advertisements of XBridge and Particle that have ArtifactType of "Y"
are published in this group.
- Press "OK" to perform group discovery, now.
- If "ParticleLocationGroup" is discovered, it appears on the
screen. Press "Join" button to join with the group.
- This screen represents that the application now joins with
"ParticleLocationGroup". Press "Menu" to perform further group
discovery.
- Select "Group List".
- Press "Menu".
- Select "Search".
- When subsidiary groups are discovered, they appear on the screen.
Select "ParticleGroup" for example and
press "Join" to join the group.
- This screen shows that the application now joins with
"ParticleGroup" that holds advertisements of all Particles in
JXTA P2P substrate. Press "Menu" to discover Particles in this group.
- Select "ParticleList".
- This screen will show discovered Particle list in
"ParticleGroup". Press "Menu".
- Select "Search".
- Press "OK" to perform discovery.
- Discovered Particles are listed on the screen. Choose
appropriate Particle and press "Select".
- Press "Connect" to perform Remote Access
to the selected Particle.
- When the connection is establishmed, all data from the
selected Particle are forwarded from the corresponding
ParticleP2PBridge to this application via Proxy. If you want to stop
receiving
the data, press "Menu".
- Select "Disconnect" to stop receiving data. In addition, you
can try to access other Particles by selecting "Partice List" in this
menu.
-
Changes from original ME4SE
We
modified me4se/src/javax/microedition/midlet/
ApplicationManager.java to adjust
the screen height of Windows PocketPC.@
In line 482:
//screenHeight = dim.height - 25;
screenHeight = dim.height - 51;
|
-
Defects of JXME Application
Some defects still exist as follows.
- IMPORTANT: Each discovery
(group/particle) should be performed more than once, when it is a first time to access Proxy
since it has launched, because current Proxy can not inform
discovered
advertisements to the application at first time (it only stores them in
its cache). It becomes possible to inform the advertisements after they
are cached in Proxy.
- The connection between ParticleBrowser and ParticleP2PBridge
via Proxy may remain after the disconnection.
- In this system, advertisements are managed by lifetime basis.
However, some old advertisements may remain in the cache of Proxy or
ParticleP2PBridge. You can delete the
cache deleting <extract
directory of ParticleBrowser>/rendezvous/.jxta/cf directory. It also
requires restarting Proxy or ParticleP2PBridge.
P2PBridgeWrapper
It is a
wrapper program binds ParticleP2PBridge and ParticleFactory
components directly to perform P2PBridge without Equip framework.
Currently, Inter Sensor
Network Communication is disabled, which means it does not transmit
packets arrived from other P2PBridges to the local network.
The program is contained in the package
of
P2PBridge.
If you download the source code only
package, you need to complie it. Go to "[Installed
Directory]/P2PBridgeWrapper" and execute "compileP2PBridge.bat". It
requires compiled binaries of Equiator to build.
Go to "[Installed
Directory]/P2PBridgeWrapper" and execute "runP2PBridge.bat".
Appendix
If a ClPacket is sent from Particle
dedicated applications, ParticleP2PBridge try to discover XBridge that
has the Location ID of the ClPacket and forward the ClPacket to it.
In particularly, if Location ID has all zero value, it means broadcast
to all XBrige, ParticleP2PBrige forwards the ClPacket to all XBridge
that has been discovered in P2P substrate.
On the other hand, Location ID of a ClPacket
sent from Particle represents source XBrige of the ClPacket, not
destination.
-
ACL tuples that specifies destinations
In addition to the Location ID,
we apply following existing ACL tuples as
destination identifier. ParticleP2PBridge try to discover Particles and
Particle dedicated applicatins of the Particle ID that the ACL tuple
holds. If the Paritcle ID has all one
value (255.255.255.255.255.255.255.255), it means broadcast to all
Particles, not to Particle dedicated applications.
- C HE HELLO : 8byte=Particle
ID
- C EH OLLEH : 8byte=Particle ID
- C TR Triangulation : 8byte=Particle ID
- C SR Set Sync Rate : 8byte=Particle ID, 1byte= data
- C RT Remote Control : 8byte=Particle ID, 1byte= data
- C RR Remote Shutdown : 8byte=Particle ID, 1byte= data
- C FS Field Strength Regulation : 8byte=Particle ID, 1byte= data
- C AD Address Control Field : 8byte=Particle ID
For more generic purpose, following ACL
tuples should be newly defined.
- C RI : 8 byte=Receiver Particle ID
- C RL : 44 byte=Receiver Location ID
- C RA : 2 byte=Receiver Artifact Type (3in2)
- C RS : N byte=Receiver
Semantic Location Description
- C RS : ? byte=Receiver
Geographical Location