However, it is very likely that the wireless link is
disconnected due to various reasons and message
loss occurs. SMS sends messages asynchronously,
and therefore it cannot guarantee our requirement
entirely. So we develop another component above
these three methods to guarantee the synchronous
exactly-once semantic. We name this component
Communication Manager as shown in Figure 1. In
fact, Communication Manager performs a simplified
TCP’s sliding window algorithm (Tanenbaum, 2002)
by piggybacking the next expected message id to the
messages sent so that the other side can determine
whether to need to retransmit some messages. Pig-
gybacking is achieved with the Decorator pattern
(Gamma, 1995) by embedding the original message
in a decorator class which defines a new NextEx-
pected field and some relevant methods.
Communication Manager maintains three
queues: Sending Queue, Receiving Queue and Ex-
ception Queue. Sending Queue is further divided
into three sub-queues for the three communication
methods. Communication Manager determines the
proper sub-queue for each new message and transfer
messages from one sub-queue to another if the cor-
responding communication method does not work.
In our implementation, if Communication Manager
finds HTTP/HTTPS communication fail for twice, it
will transfer the messages in the HTTP/HTTPS sub-
queue to the SMS sub-queue. If a message sending
fails for the predefined maximum retries, it will be
reported to Exception Queue to be handled by the
upper layer program.
Since wireless communication is either charged
by time or data, we provide two different communi-
cation modes for HTTP/HTTPS. The user will be
prompted a window to select the mode for the first
time and the selection will be stored in the persistent
Record Management System (RMS) supported by
MIDP2.0. If the communication is charged by time,
the client side HTTP/HTTPS will periodically poll
its sub-queue and establish the connection when it
has some messages to send. Notice that the
HTTP/HTTPS connection can only be established
from the client side, so the client side has the re-
sponsibility to establish the connection even when it
has no messages to send but the proxy side may
have some invocation return values to deliver. How-
ever, if the connection is charged by data, the client
side HTTP/HTTPS will simply maintain a long term
connection. In this case, both sides can immediately
transfer whatever messages in the sub-queue. If the
connection fails, the client side will wait a few sec-
onds before trying to establish another connection.
5 SECURITY
In mobile computing, security is a very important
topic because data is transmitted over the unpro-
tected air media. Basically, there are three issues to
consider for security: encryption, authentication and
authorization, which are discussed in the next three
paragraphs in detail.
Encryption can prevent attackers from eaves-
dropping the transmitted data. Of course, it is great
to encrypt every transmitted data. However, this will
cost a substantial amount of system resources be-
cause encryption is a computationally expensive
process. It would be much reasonable to only en-
crypt those critical data such as credit card informa-
tion and leave the rest in plaintext. Therefore, we
provide two sets of interfaces to the developer, one
for unencrypted and the other for encrypted. If the
developer chooses the unencrypted interface, Com-
munication Manager will select HTTP as the default
communication method. If the developer chooses the
encrypted interface, Communication Manager will
select HTTPS as the default method since HTTPS in
MIDP2.0 is carried over any of the following secu-
rity protocols: Transport Layer Security (TLS), Se-
cure Sockets Layer (SSL), Wireless Transport Layer
Security (WTLS), and WAP TLS Profile and Tun-
neling Specification (Jonathan, 2002). SMS is also a
secure communication method, and therefore Com-
munication Manager can use SMS as the alternative
path for both HTTP and HTTPS in case they do not
work.
Authentication is a method to prove the identity
of the other side of the communication. With both
encryption and authentication, the communication
two parties are confident that not a third person can
involve the communication. In our system, HTTPS
can be used for the client authenticating the proxy.
But there is not a ready vehicle for the proxy authen-
ticating the client. Although SMS can support two-
way authentication, it cannot guarantee the client is
not a stolen device from a legitimate user. There are
two methods available for the client authentication.
One is password authentication and the other is cer-
tificate authentication. In our system, we does not
use certificate authentication because it involves the
complicated task of distributing the private secret,
i.e., for each copy of the client program, it should be
packaged with a unique client key and certificate.
Also, it cannot prevent a stolen device from access-
ing the application. We adopt password authentica-
tion and implement ACL Manager to authenticate
the client with the provided user name and pass-
word.
ICEIS 2007 - International Conference on Enterprise Information Systems
176