Author
Final revision Date
Hao Zhuang, Guojun Wang
1.5
Summary ... 3 1. C/C++ DTN2 Services Client ... 4 1.1 dtnhttpsqs ... 4 1.2 dtnmail ... 4 2. PHP Client Application ... 5 2.1 PHP Web Interface ... 5 2.1.1 WSN... 5 2.1.2 SSA ... 6 2.2 PHP Mail Server ... 7
3. Python Client for DTN Management Tool ... 8
4. Java Client WSN Core-Engine onVoyage ... 8
5. Java Code on Sun SPOT Motes ... 8
6. Database SQL Script... 9
Summary
1.
C/C++ DTN2 Services Client
1.1
dtnhttpsqs
dtnhttpsqs client provides basic services over DTN network including dtnsend, dtnrecv, dtncp and dtncpd.
File Name Function
dtnhttpcp.h dtnhttpcp.c
copy a bundle to a valid destination eid and return the filename to the middleware
dtnhttpcpd.h dtnhttpcpd.c
receive a bundle and return the file path to the middleware
dtnhttprecv.h dtnhttprecv.c
receive a bundle on a registration and return the received message to the middleware
dtnhttpsend.h dtnhttpsend.c
sends a bundle with payload of file, tmpfile, message, or date and return the status if the messages send successfully
dtnhttpsqs.h dtnhttpsqs.c
Main method
HandleRequest.h HandleRequest.cpp
analyze the request message and process the request
httpsqsclient.h httpsqsclient.c
C/C++ client for httpsqs which put and get the messages to middleware HttpsqsMessage.h HttpsqsMessage.cpp HttpsqsMessage class HttpsqsMessageHandler.h HttpsqsMessageHandler.cpp
Marshall and unmarshall the HttpsqsMessage to XML string
includes.h Contains all the include header file QueueManager.h
QueueManager.cpp
Queue manager to manage the different queues
util.h util.cpp
Utility class
make.sh Make script the compile the source code clean.sh Clean script to clean the file
1.2
dtnmail
DTN Mail is a C/C++ client application for both DTN2 and DSAM. It is responsible for receiving bundles and if the bundles are special for email, it will forward to Email Server in the city network. This application runs on the city gateway.
File Name Function
dtnmail.h dtnmail.c
receive the bundles and forward message to Email Server
httpsqsclient.h httpsqsclient.c
C/C++ client for httpsqs which put and get the messages to middleware
includes.h Contains all the include header file make.sh Make script the compile the source code clean.sh Clean script to clean the file
2.
PHP Client Application
2.1
PHP Web Interface
2.1.1
WSN
PHP web client runs in the gateway either in the remote or city area. It is designed to serve as web interfac to the user to control the WSN and DTN service.
File Name Function
amline
amline_example amline_original
Amline to graph the data
css css file
download The file is put in the download folder httpsqs Contains the httpsqs client for php
images Contains all the images
js Javascript
mail Mail message
addroute.php Add route information to DTN2 Collecthistory.php Show the collect history
collectionManage.php process the request from wsncontrol.php Datacontrol.php process the request from the datacontrol.php
Datamanage.php start to manage the data for distribute, download and graph data Dbmanage.php To init the database tables
Delroute.php delete a route
Dtncontrol.php start or stop the dtn; list bundles info and bundle stats Dtncpd.php start to receive the file
Dtncpdcontrol.php process the request of dtncpd.php Dtncpres.php Response page for dtncp.php Dtnheader.html Dtn header file
Dtnhome.html Dtn home page
Dtnmail.php Send email over DTN through web pages Dtnmailres.php Response to email service
Dtnstart.php action, deal with the request from dtncontrol.php Footer..html page footer
gatewayManager.php list all the gateway information Graph.php graph the data on the picture
Graphxml.php dynamic generate the xml file as a data source Header.html Header file
Index.html Index main page
routeInfo.php display the route information for DTN2
routeManage.php process the request from addroute.php and routeManage.php Sendemail.php Send mail which read mail from /var/www/wsn/mail folder Sunspot.php updte sunspot information
Sunspotlist.php list all the sunspot connected to a gateway. updateGatewayInfo.php update the gateway information
Wsncontrol.php start the wsn engine to collect environment data Wsnheader.php Wsn page header
Wsnhome.html Wsn home page
2.1.2
SSA
The goal of the SSA is to provide a facility to report medical related data such as the level of the stock of medical drugs or number of patients in a village to a healthcare authority located in another remote region such as a city by using the Bytewalla DTN network.
File Name Function
ssahome.html home page of the ssa
register1.php user registration code
insert.php patient registration code
login.php code for logging in of registered users
logout.php user session ends with this code
member.php small code for running the log in session
query.php search the patient info. in database
feedback.php Feedback to patient, stored in database
caseDetail.php display the searched cases
exportData.php export the searched cases to text file
dtncpres.php Response page for dtncp.php
dtncpd.php start to receive the file
dtncpdcontrol.php process the request of dtncpd.php
string.txt sql commands for creating tables
httpsqs floder Contains the httsqs client for php
css floder contains styling and layout files for website
images floder contains images used for the website
js floder javascript for animation for website
header.php header for the website
footer.php footer for the website
2.2
PHP Mail Server
PHP Mail Proxy runs on the Email Server to send the email to the Internet.
File Name Function
dtnemail.php get the message from the HTTPSQS middleware and send the message out with mailto function
3.
Python Client for DTN Management Tool
DTN Management Tool is to provide a user-friendly management tool for application users including start and stop DTN2, route and bundle information configuration.
File Name Function
dtnconctroller.py Analyze and process the requests for dtn2 management dtnmanagement.py Start, stop DTN2 and get bundle and route information httpsqs_client.py Python client API for put and get message
4.
Java Client WSN Core-Engine onVoyage
Java client on Voyage Gataeway are connected to base station which is used to receive the data that is broadcasted / multicasted by the WSN Mote(s).
File Name Function
build The folder contains the object class after compilation. jdbc-driver Contains the external jar library such as jdbc and jdom build.properties Properties file for a Sun Spot Host Application
main.class= “give the path of main class” main.args=” give the path of external library”
Src Contains all the Java source code
com.dtn.wsn.dao Contains Data Access Object(DAO) to access the database com.dtn.wsn.database ConnectionPool to manage the database connections com.dtn.wsn.demo WSNApplication and main method
com.dtn.wsn.entity entity classes
com.dtn.wsn.filemanager File operation like compress and uncompress the files com.dtn.wsn.httpsqs Java client for httpsqs to send and receive the messages
com.dtn.wsn.middleware Contains httpsqsmessage handler to marshal and unmarshal the XML message
com.dtn.wsn.sunspot Contains sunspot connection, data store and data analysis
5.
Java Code on Sun SPOT Motes
build The folder contains the object class after compilation. j2meclasses The class file created from the compilation
nbproject Containing project specific IDE settings and metadata of the project to be created
src Containing the source code of this application build.properties Properties file for a Sun Spot Host Application
main.class= “give the path of main class” main.args=” give the path of external library”
6.
Database SQL Script
The SQL script contains two parts: wsn and ssa. The scripts excute in mysql. In our project, all the database username is root and password is bytewalla5.
7.
Performance Test Shell Script
This contains two shell script when we conduct the power consumption analysis. It is used to send different size of bundles automatically.