vides the simple message queue service based on HTTP
for the applications. Messages are stored by Tokyo Cab-
inet [4], as a simple data file containing records, each of
which is a pair of a key and a value. Records are orga-
nized in hash table, B+ tree, or fixed-length array. It only
takes 0.7 seconds to store 1 million records in the regular
hash table and 1.6 seconds for the B-Tree engine [2].
Client APIs enable applications to send and receive
HTTPSQS messages. It is implemented in different lan-
guages according to various applications. At present, we
provide PHP, JAVA, Python and C/C++ cross language
client APIs for HTTPSQS. It supports two different for-
mats of HTTPSQS Message: text and XML message.
(1)Text message is an ordinary sequential file as tex-
tual material without much processing, which is appro-
priate to run on the ALIX board. The text message
is fully compatible with all the commands used in the
DTN2 TCL console. For example, the text message
to get the DTN bundle statistical information is bundle
stats.
(2)XML message is stored in plain text format which
provides a software- and hardware-independent way of
storing data. This makes it much easier to exchange data
that can be shared by different applications. However,
it is a costly way to analyze the XML string which con-
sumes more CPU time as well as power. In DSAM, XML
message is designed to improve the quality of service
(QoS). The detailed elements in XML based message are
listed in the table 1.
Table 1: XML Elements
Elements Description
messageId identity number for message
destqueue the queue which the message will send
expiration in seconds, which indicates the expira-
tion time, default 60s
priority range from 1-9, default 4, which indi-
cates the priority of message
timestamp the timestamp of creating the message
redelivered the number of message is expected to
redelivered
deliveryMode persistent or non-persistent, which in-
dicates whether the message is stored
in the database or not
type text request reply request-without-
relpy. It indicates the type of message
body
correlationID provides provider specific or applica-
tion specific string help identify filter
classify the message
replyTo The queue which message will reply to
mesg body the content of message
HTTPSQS Message Processor (HMP) is main dae-
mon to process HTTPSQS Message asynchronously. All
the messages are stored in queues maintained by HTTP-
SQS. HTTPSQS Message is an object which indicates a
specific task. HPM analyzes the messages and dispatches
the messages to different applications with different pro-
cess logic. There are two main components in the HMP.
(1)HTTPSQS Message Serialize/Deserialize HTTP
Message is a local representation within a specific ap-
plication. When it is transferred among different kinds
of applications implemented on different platforms, it
should be converted from local representation to exter-
nal representation which is called serialize. The reverse
process of converting from external presentation to the
local is called deserialize. In our middleware, we sup-
port two kinds of external presentation, namely text and
XML, while local representation of HTTPSQS Message
uses class in an object-oriented design.
(2) Request-Reply Processor Our middleware pro-
vides a communication layer for different applications.
There are four different kinds of queues created, namely
request, reply, retry and dead queue. Under normal con-
ditions, one client application sends a request to request
queue and awaits a reply getting from reply queue. If the
reply is not sent before expiration of a timeout period,
the request will be put in a retry queue and the number of
redelivered time is decreased by 1. In other words, un-
der abnormal conditions, the request is not fully finished.
If redelivered time decreases to zero, the request will be
put in a dead queue for manual process. Meanwhile, a
status reply message will automatically generate and be
put into the reply queue.
4 Supporting Applications
4.1 DTN2 Network Management Tool
DTN2 starts the DTN daemon service with dtnd com-
mand on the ALIX boards, which acts as DTN nodes.
After startup, dtnd creates and initializes a TCL inter-
preter, listening on the port 5050, which provides a com-
mand line interface and an event loop for configuring the
DTN2. Through interacting with TCL interpreter, users
can monitor the status of DTN2 and also change the set-
ting in a DTN configuration file. For example, bundle
stats gives the statistical information of bundles while
route dump lists all of the static routes. For developers,
the command line based console is useful for debugging
and testing. However, for application users, it is difficult
for them to understand all the commands to obtain the
status and configuration information of DTN2.
The goal of DTN2 network management tool (DNMT)
is to provide a user-friendly management tool for the ap-
plication end-users, which helps them configure the route
3