1 Introduction - University of Khartoum Repository

55
2 1 Introduction 1.1 Overview Mobile manufacture do great effort to make it smaller, integrate more service, so day by day mobile phone and PDA “Personal Digital Assistance” became more popular. On the other hand the World Wide Web (WWW) is also gaining high popularity as a media of mailing, trading, news, and so on. But it is desk-bound on PCs, and will restrict people by time and location. Here comes the WAP which combines the Web and wireless communications. The Wireless Application Protocol, WAP, was introduced and developed to address all of the handset limitations; small display, limited input facilities, limited memory & CPU, and limited battery power. As well as network limitations; low bandwidth, high latency, and unreliable connection. Additionally, one may use the concept of push to overcome the other remaining limitations on handsets and enhance its performance. The idea behind push technology is very simple; users can subscribe to desired content, such as the news, and the content providers can then send new or current and up-to-date information without a specific request from users. The normal Internet and WAP model is that information is provided only when requested by the client, either by clicking on a hyperlink or by entering a URL into the browser. The push model, on the other hand, states that information can be originated by the server and sent to the client device without a request by the client, which could save more bandwidth and user’s time. 1.2 Problem Definition Normal Web content can't be displayed on the majority of cell phones. This is not only because cell phone displays are small (for example, Nokia Series 20 phone screens are 84 pixels wide by 48 pixels tall, while the later Series 60 phones have 176-pixel by 208- Chapter One

Transcript of 1 Introduction - University of Khartoum Repository

2

1 Introduction

11 Overview

Mobile manufacture do great effort to make it smaller integrate more service so day by

day mobile phone and PDA ldquoPersonal Digital Assistancerdquo became more popular On the

other hand the World Wide Web (WWW) is also gaining high popularity as a media of

mailing trading news and so on But it is desk-bound on PCs and will restrict people by

time and location Here comes the WAP which combines the Web and wireless

communications The Wireless Application Protocol WAP was introduced and

developed to address all of the handset limitations small display limited input facilities

limited memory amp CPU and limited battery power As well as network limitations low

bandwidth high latency and unreliable connection Additionally one may use the

concept of push to overcome the other remaining limitations on handsets and enhance its

performance

The idea behind push technology is very simple users can subscribe to desired content

such as the news and the content providers can then send new or current and up-to-date

information without a specific request from users The normal Internet and WAP model

is that information is provided only when requested by the client either by clicking on a

hyperlink or by entering a URL into the browser The push model on the other hand

states that information can be originated by the server and sent to the client device

without a request by the client which could save more bandwidth and userrsquos time

12 Problem Definition

Normal Web content cant be displayed on the majority of cell phones This is not only

because cell phone displays are small (for example Nokia Series 20 phone screens are 84

pixels wide by 48 pixels tall while the later Series 60 phones have 176-pixel by 208-

Chapter One

2

pixel screen resolution) but also because the majority of them can display only certain

range of color or monochrome images These issues will play havoc with the beautiful

Web site contents

As if that wasnt bad enough the processing power of cell phones to render Web content

is low the bandwidth available for transferring content is low (a maximum of 144

kilobits per second and often considerably less because of interference) connections may

be lost and the latency (the time it takes for the data to be sent from a server and received

by a cell phone) can be high In short the wireless environment could be described as

very hostile to Web access

Given the problems weve just outlined one can see that delivering Web content requires

rethinking what is delivered and how This rethinking lead to two standards the how is

the province of the Wireless Application Protocol and the what is where Wireless

Markup LanguageWML and WAP push comes in [1]

In most GSM networks however GPRS activation from the network is not generally

supported even it is supported one need to know the IP address of the corresponding

handset for this reason WAP Push messages have to be delivered on top of the SMS

bearer Also To ensure that the end user is correctly browsing WAP pushes the micro-

browser should be configured

13 Project Objective

The objective of this project is to

Designing WAPweb site to serve as content provider whish will then send the

WAP push messages for both purpose configuration and new content

acknowledgement

Designing a push Initiator to process the WAPweb content and handle them to

the Push Proxy Gateway

Building an open source PPG to handle messages from the push initiator and

deliver them to the particular handset over SMS bearer

Chapter 1 Introduction

3

14 Methodology

The WAP server will sit between the Internet and the wireless network and act as

gateway (ie push proxy gateway) between HTTP servers and WAP-enabled devices

HTTP servers serve up HTML documents These gateways have the ability to translate

HTML content into Wireless Markup Language the native format of the WAP browser

but the results are usually pretty poor Thus for better services and information to WAP

browsers one really needs to design WAPweb site to serve as content provider Finally

designing a push Initiator to process the WAPweb content and handle them to the PPG

The primary source of software packages is the open source software As the hole system

is to run on UNIX like system (ie various Linux distributions) The first critical task

investigated was the configuration of the GSM GPRS modem so to be able to act as

virtual SMSC from which the WAP gateway can reach a handset terminal

The open source Push Proxy Gateway (PPG) will be built on the base of the kannel

gateway and equipped with clients database ldquoMySqlrdquo to communicate with GSM

network through the previous modems which could be in the same PC with PPG or

connected to it via network The Push Initiator (PI) had been implemented using Java

programming language from sun Microsystems Finally Nokia toolkit emulator will be

used during project evolution as a testing environment for handheld

15 Thesis Layout

Chapter 2 presents the theoretical aspects of WAP which discuss the protocol

architecture and layering and the relationship to the web model Also the WAP push

framework will be presented

Chapter 3 brief description of hardware and software requirement plus the development

environment

Chapter 4 contains a description of what and how we do to develop a working WAP

push system This chapter is organized so that it starts with an overview and continues

Chapter 1 Introduction

4

with the description and design of all the parts starting with the creation of the push and

ending with the activation in the mobile device

Chapter 5 presents the rest stages of system development such as integration operation

and testing The results will be given in this chapter involved with the analysis

Chapter 6 gives conclusions of the project outcome and the recommendation for future

working

Appendix A list of abbreviations

Appendix B kannel gateway configurations

Appendix C selected codes from the system

5

2 Basic concepts

21 Literature review

The WAP Forum which creates and maintains the WAP specifications was founded in

June 1997 by Ericsson Nokia Motorola and Unwired Planet (later Phonecom later

Openwave Systems) The 10 specification was published in April 1998 but wasnrsquot

implemented in phones at that time The 11 specification came out in July 1999 and

was the first one to be implemented in publicly available phones 121 came out in June

2000 and phones implement it Work on WAP 20 is closing It will converge WAP with

Internet protocols and W3C markup languages [2]

During 2002 and 2003 the idea of WAP push began to get more concern from mobile

network operator In last four years companies began to develop push proxy gateway

unfortunately all of them were protected by taught copyright license This is what

encourages WAP developers and programmers to turn toward kannel which is an Open

Source WAPSMS gateway started by the Wapit Ltd company in June 1999 under

management of Lars Wirzenius later on it turn to the public [3]

In sudan zain (precedent Mobitel) initiated its WAP services for browsing internet on

2006 the same action taken by MTN (precedent areba) Early this year zain established

its WAP push service for emails named zmail

22 WAP architecture

WAP is a set of specifications for developing web-like applications that run over wireless

networks The basic aim of WAP is to provide a web-like experience on small portable

devices - like mobile phones and Personal Digital Assistance PDAs The WAP protocol

suite are analogous to many of those used in existing internet technology yet are

optimized for the challenges raised by small narrowband client devices (such as mobile

Chapter Two

Chapter 2 Basic Concepts

6

phones) and limited over-the-air bandwidthThe WAP Protocol suite covers both the

application level and the underlying transport layers The bearer level of WAP depends

on the type of mobile network It could be CSD SMS CDMA or any of a large number

of possible data carriers Whichever your target client is using the development above

remains the same WAP is designed in a layered fashion so that it can be extensible

flexible and scalable As a result the WAP protocol stack is divided into five layers (as

shown in Figure 21 below)

Wireless Application

Environment (WAE)

Wireless Session Protocol (WSP)

Wireless Transaction Layer Security (WTLS)

Wireless Transaction Protocol (WTP)

USSD CSD ETCSMSCDMA

Wireless Datagram Protocol (WDP)

Other Services and

Applications

Figure 21 Wireless Application Protocol architecture

Chapter 2 Basic Concepts

7

221 Application Layer Wireless Application Environment

The wireless application environment WAE is a standard for developing applications

and services that operate on wireless communication networks The WAE layer consists

of several parts wireless markup language binary XML wireless markup language

scripts and wireless telephony application [5]

2211 WML

Pages or services created using HTML do not work very well on small handheld devices

since they were specifically developed for use on desktop computers with larger color

screens Also low bandwidth wireless bearers wouldnrsquot be suitable for delivering the

large files that HTML pages often consist of Therefore a markup language specifically

adapted to these restrictions has been developedmdashWML

WML provides a navigation model for devices with small display screens and limited

input facilities (no mouse and a limited keyboard) In order to save valuable bandwidth in

the wireless network WML can be encoded into a compact binary format for

transmission between the phone and the network and vice-versa

WML uses uniform resource locators URLs in the following situations

o when specifying navigation eg hyperlinking

o when specifying external resources eg An image or a script

WML is an XML language with the same character sets as an XML document XML is

case-sensitive and therefore is also WML case-sensitive

WML is built on cards and decks A card is a one or more unit of user interaction eg a

choice menu a screen of text or a text entry field This means that the user navigates

through a series of WML cards reviews the contents of each enters requested

information makes choices and moves to another card Cards are grouped into decks [5]

Chapter 2 Basic Concepts

8

2212 WMLScript

WMLScript is a client-side scripting language It is very much like JavaScript which is

used on dynamic HTML(DHTML) web sites but WMLScript has been modified to fit

the currently severe limitations of the WAP environment and is in many ways restricted

compared to JavaScript

Client-side means that the code actually runs on the micro-browser itself The code is

downloaded to the WAP device as part of the deck so that when the code is executed it

does not have to make a trip back to the server to find out what to do next Everything the

application needs is right there Client-side functionality is therefore much faster in the

userrsquos perception

2213 Binary Extensible Markup Language

Binary XML is a compact binary representation of XML The binary XML is design to

reduce the transmission size of XML documents This allows more effective use of

narrow banded communication channels without any loss of functionality or semantic

information [5]

222 Session Layer Wireless Session Protocol

The wireless session protocol layer supports the wireless application environment with

two different session services The first is a connection mode service that operates above

a transaction layer protocol WTP and the second is a connection-less service that

operates above a datagram transport service WSP supports HTTP 11 functionality and

some new features These features include long-lived session a common facility for data

push capability negotiation and session suspendresume [5]

WSP provides support for exchange of content between clients and servers To support

the exchange the WSP establishes a reliable session negotiates on common capabilities

exchanges the data using compact encoding and releases the session The WSP also

supplies functionality to suspend and resume the session in order to save battery while

Chapter 2 Basic Concepts

9

the session is idle The WSP lifecycle is therefore not tied to the underlying transport

layer

WSP is a binary version of HTTP which includes both headers and data Binary

encoding is used to minimize the protocol overhead and to simplify decoding The header

is used to define content type character set encoding languages etc in an extensible

manner WSP supports two types of data transfers push and pull Pull transfer is used

when the client is sending a request and the server is sending a response In the push

mechanism the server pushes data to a client without prior request from the client

This can be done in three different ways Confirmed data can be pushed within an

existing session or non-confirmed data pushes can be done within or without an existing

session

223 Transaction Layer Wireless Transaction Protocol

The wireless transaction protocol WTP is defined to provide the services necessary for

sending requests responses and information WTP runs on top of a datagram service and

optionally a security service To ensure safe connection on top of the datagram layer the

WTP layer performs retransmissions sends acknowledgements and removes duplicated

messages In order to improve the connection efficiency WTP has no explicit connection

or teardown phases The layer also performs segmentation and reassembly to reduce the

number of packets sent

WTP has been defined as a transaction protocol that is suitable for mobile stations and

operates efficiently over wireless datagram networks Some benefits of using WTP are

that it improves reliability over datagram services improves efficiency over connection-

oriented services and that it is message oriented and designed for requestresponse

applications

The wireless transaction protocol is divided into three transaction services It can send

unreliable messages with no result message reliable messages with no result message or

reliable messages with exactly one result message

Chapter 2 Basic Concepts

10

Unreliable Messages With No Result Message

This service provides an unreliable datagram service The service can be used by

applications which occasionally want to send a datagram within an existing session

using WTP No acknowledgement or retransmission is done in this service

Reliable Messages With No Result Message

This service provides a reliable datagram service The service can be used by

applications that want to use a reliable push service The receiver acknowledges the

message and if the original sender receives no acknowledgement the message is

retransmitted

Reliable Messages With One Reliable Result Message

This service provides the basic invokeresponse transaction The receiver acknowledges

the message and if the original sender receives no acknowledgement the message is

retransmitted To confirm the reception of the acknowledgement the original sender

sends an acknowledgement to the receiver The three transactions are shown in next

figure

message message

acknowledge

message

confirm

Unreliable invoke

message with no

result message

Reliable invoke

message with no

result message

Reliable invoke

message with one

reliable result

message

a) b) c)

acknowledge

Figure 22 the three mode of transaction

Chapter 2 Basic Concepts

11

2231 Concatenation and Separation

To reduce the overhead caused by the datagram headers it is desirable to reduce the

number of packets sent over the air In order to reduce the number of messages several

protocol data units can be put into one single datagram This procedure is called the

concatenation procedure The reverse procedure is called the separation procedure [5]

Concatenation can be done when several packets are transported from the same sender to

the same receiver Concatenation can be done at any time The last acknowledgement can

be concatenated with the invoke message of the next transaction [5]

2232 Segmentation and Reassembly

If a packet is lager than the bearers largest capability the message can be segmented and

send in several packets To increase the communication efficiency message groups can be

acknowledged in groups [5]

To decrease the number of packets sent when a communication error occurs the receiver

can request one or multiple lost packets within a group of messages This is done instead

of resending the entire message which could mean that successfully received packets

have to be resent [5]

224 Security Layer Wireless Transport Layer Security

An Optional layer it is responsible for providing security data integrity and

authentication between two communicating applications The WTLS is optimized for low

bandwidth bearer networks with relatively long latency The WTLS is similar to the

Internet transport layer security TLS but has some new features such as datagram

support optimized handshake and dynamic key refreshing [5]

WTLS has been design to function on both connection-oriented and datagram transport

protocols The security layer acts above the transport layer

Chapter 2 Basic Concepts

12

2241 Service Primitives

WTLS uses primitives to ensure security The primitives are used to

Initiate a secure connection

Perform public-key authentication or key exchange with the client

Change into connection state when the handshake has been done

Terminate the connection

Inform the other end about warning level alerts

Request by the server that the client should initiate a new handshake

225 Transport Layer Wireless Datagram Protocol

The wireless datagram layer is a datagram service used by the upper layers WDP is

designed to communicate over different bearer services and especially for wireless

telecommunication networks [6] It Consists of

bull Source and destination address and port

bull Optionally fragmentation

It maps to UDP for IP bearer and moves single packets to and from the phone

226 WDP and IP

In networks with IP as the routing protocol UDP is used instead of WDP IP provides

segmentation and reassemble in a connection-less datagram service UDP provides port

based addressing and other necessary functions Thereby no additional functions are

required by a WDP layer [7]

227 Bearer Interfaces

WAP supports dial-up networking using IP and Point-to-Point Protocol (PPP) as the

bearer interface underneath WDP It also supports Short Message System (SMS) and

General Packet Radio System (GPRS) SMS passes text and binary data between digital

Chapter 2 Basic Concepts

13

phones GPRS is a relatively new technology that implements faster always-on

connections for wireless devices GPRS actually runs on top of IP [7]

As had been learned above WAP is quite similar to web figure 23 provide a brief

comparison between them

WAP

Bearer

WDP Dtatgram

WTLS security

WTP Transaction

WSP Session

WAE

WML and

WMLScript

Web

IP

TCP UDP

TLS-SSL

HTTP

HTML

JavaScript

VBscript

Figure 23 Web vs WAP

Chapter 2 Basic Concepts

14

23 SMS overview

SMS stands for Short Message Service It is a technology that enables the sending and

receiving of messages between mobile phones SMS first appeared in Europe in 1992 It

was included in the GSM (Global System for Mobile Communications) standards right at

the beginning Later it was ported to wireless technologies like CDMA and TDMA The

GSM and SMS standards were originally developed by ETSI ETSI is the abbreviation

for European Telecommunications Standards Institute Now the 3GPP (Third Generation

Partnership Project) is responsible for the development and maintenance of the GSM and

SMS standards [8]

SMS has two operational mode textual mode and binary mode which will allow sending

other data beside pure text

24 Push overview

WAP push provides a standard means to send data to a mobile subscriber without an

explicit request from the subscriber at the time the data is delivered In the normal

clientserver model a client requests a service or information from a server which then

responds by transmitting information to the client This is known as ldquopullrdquo technology

The client pulls information from the server The World Wide Web is the best example of

pull technology where a user enters a URL (the request) which is sent to a server and

the server answers by sending a Web page (the response) to the user (Figure 24 a)

Although WAP push is also based on the clientserver model it provides a means to send

data to the subscriber without an explicit request from the client at the time of delivery

(Figure 24 b)

With push functionality users are able to get information without having to request that

information In many cases it is important for the user to get the information as soon as it

is available Push communications can be used for sending stock quotes traffic reports

and news

Chapter 2 Basic Concepts

15

a) WAP pull model

b) WAP push model

Figure 24 Pull vs Push

24 WAP Push framework

A push operation starts when a server called the push initiator transmits a push messages

to a WAP client Since the push initiator located on the Internet does not use the same

protocol as the WAP client a translating gateway is needed The push initiator contacts

the push proxy gateway via the push access protocol and the Internet protocol The push

proxy gateway translates the information and forwards the pushed content to the WAP

device via the push over the air protocol (figure 25) [9]

Chapter 2 Basic Concepts

16

Push Proxy Gateway

WAP

Client

Push

Access Protocol

Push

over-the air

protocol Push Initiator

Figure 25 the wireless push technology

241 Push Proxy Gateway

The push proxy gateway PPG is the entity that does most of the work in the push

architecture The gateway acts as an access-point for content pushed from the Internet to

the client So the responsibility of the gateway owners to grant access to push proxy

gateway [9]

Besides the actual access-point service the push gateway provides the following services

push initiator identification and authentication

parsing and error detection of content control information

client discovery services

address resolution

binary encoding and compilation of certain content type

protocol conversion

Chapter 2 Basic Concepts

17

Information to the push proxy gateway is sent via the push access protocol PAP The

content of the information is divided into several parts were the first part is information to

the PPG such as recipient information

When the PPG has parsed the control information an acknowledgement is sent to the

push initiator reporting if the service was successful or not

Once the proxy has accepted the content and the push initiator has received the

acknowledgement the proxy is responsible for the transmission to the client The proxy

attempts to find the correct destination device and deliver the content to that client using

the push over the air protocol The contents delivered to the proxy may be translated to

their binary counterpart eg WML documents may be converted to binary XML by the

proxy before the information is transmitted to the client [9]

The proxy must implement a service to enable capability queries from the push initiator

The capability query should be responded with the capabilities of the specified WAP

device The push proxy gateway may also implement broadcasting services where

special addresses may be translated to a broadcast operation [9]

242 Push Access Protocol

The push access protocol PAP is the means by which an Internet-based push initiator

pushes content to a mobile network via the push proxy gateway [9] The push access

protocol is not intended for use over the air

PAP supports the following operations

Push submission

The push message sent from the push initiator to the gateway contains a control

entity a content entity and may contain a capability entity The control entity is

an XML document When the gateway has received the message an XML

response message is sent back to the initiator

Chapter 2 Basic Concepts

18

Result notification

If the push initiator has requested confirmation of successful delivery this XML

message is transmitted from the PPG to the push initiator when the content has

been delivered to the mobile device The push initiator acknowledges this result

message with another XML document

Push cancellation

The purpose of the push cancellation is to allow the push initiator to attempt to

cancel a previously submitted push message Both the cancellation message and

the resulting acknowledgement are sent as XML documents

Status query

The status query operation allows the push initiator to request the current status of

a message that has been previously submitted Both the status query message and

the resulting acknowledgement are sent as XML documents

Client capabilities query

This operation allows the push initiator to query the PPG for the capabilities of a

specific device The query is sent as an XML document and the response is sent

as another XML document

To access the push proxy gateway an address is used The gatewayrsquos underlying

protocols determines which type of address is used eg in HTTP a URL is used To

access a specific device the devicersquos address is included in the XML document

There are two ways to send information to several clients The push initiator can either

send information to several specific addresses or broadcast it to all clients In both cases

only one message is sent to the gateway which either sends the information to some or

all of the clients The clientsrsquo address is depending on the underlying layer [9]

Chapter 2 Basic Concepts

19

243 Push Over-The-Air Protocol

The push proxy gateway and the client communicate using the push over the air protocol

which utilizes WSP session services Pushes can be sent via connection oriented links or

connection-less links Connection-oriented pushes require that an active WSP session is

available but the server can not create a session To solve the case were there is no active

WSP session the push framework introduces a session initiation application in the client

This application listens to session requests from the OTA-server and responds by setting

up a WSP session for push purposes [9]

Push

Over-the air

WSP

Push management

premptive

Push operational

primitives

WSP Servise

Primitives

Figure 26 Push Over-The-Air protocol stack

The push over the air protocol supports two kinds of operations operations to manage the

connection and operations to send actual messages

Push Sends unconfirmed information over a connection-oriented link

Confirmed push Sends confirmed information over a connection-oriented link

Abort push rejects a previously transmitted push operation This is operation is

part of the confirmed push mechanism

Unit push Sends unconfirmed information over a connection-less link

Connect Creates a push session

Chapter 2 Basic Concepts

20

Suspend Request that a push session should be suspended

Resume Request to resumes a previously suspended push session

Disconnect Terminates the push session

Session request Request from the server to initialize a session to a client

244 Service Indication

The service indication SI provides a mechanism composed in an XML message to

notify a client that an external asynchronous event has occurred and indicate a service

that can be loaded in order to react to that event In order to notify the user a message is

sent from the push initiator via the proxy to the client The message will be shown to the

user and there will be a reference to a URI where the appropriate service can be loaded

For example the message could be ldquoYou have new mailrdquo and the URI to your email

service [9]

When the message is received by the client it will be presented to the user The user then

can choose to launch the service in an application eg the WML browser or to postpone

the SI for later handling Postponed SIs will be stored in the client and the user is given

the possibility to act upon them later When the user choose to launch the service the

service is started in the same way as if the user would have started it manually [9]

Messages sent with the service indication can support mechanisms to improve the end-

user-experience

User-intrusiveness levels

To improve the users understanding of the provided service and to affect the users

behavior when the message is delivered it is possible to change the level of user-

intrusiveness

Chapter 2 Basic Concepts

21

Deletion

When a pushed message becomes invalid the service provider can delete the

message in the clients For example an email notification becomes invalid when

the message are read

Replacement

When a pushed message is invalid and updated with a new message the service

provider can replace the origin message with a new one

Handling of out of order delivery

Since the wireless communication is unpredictable it can not be ensured that the

messages are received in the same order as sent This mechanism discards all

messages older than the latest received

Expiration

Some services may only be valid for a certain amount of time when the time has

expired the message is removed from the client

245 Service Loading

The service loading method provides means to convey a URI to a user agent in a mobile

client The method is conveyed in an XML message In difference from the service

indication method the client loads the content of the URI automatically without any

action from the user when the service loading message is received

Thereby the user will experience the content as if it was pushed to the mobile client and

executed In the service loading mechanism there is a reference to a service page that will

automatically be loaded without interaction with the user included For example the client

will automatically start the email service when a message about new mails on the server

is received [9]

Chapter 2 Basic Concepts

22

When the client is busy with some application it is not suitable to execute the referred

content directly upon reception of a message To avoid this client may cache the content

indicated by the URI so it becomes available to the user when the client is ready

Messages sent with the service loading method can support mechanism to improve the

end-user-experience

Control of the level of user interaction

To improve the users understanding of the provided service and the affect the

userrsquos behavior when the message is delivered it is possible to change the level

of user-intrusiveness The service can explicitly specify if the service should be

loaded or not if the client is busy on reception

Pre-emptive content caching

By setting this attribute the service loading can require that the indicated content

is downloaded and cached instead of executed This can be used to improve the

users experience of the services that otherwise would have required content to

be retrieved from an origin

23

Chapter Three

3 System requirements

Several materials and requirements must be incorporated into the design implementation

and testing The following discusses the components necessary to fulfill the project

requirements and environment

31 development environment

There are many development tools to choose from when developing for WAP Push and

hen you combine different environments with different gateways you will get a vast

numbers of choices This large flora of tools makes it difficult to choose a suitable

environment an important issue because a badly chosen one might consume a lot of time

341 Operating system

Kannel (the chosen gateway for the system) is being developed on Linux systems and

should be fairly easy to export to other Unix-like systems Although it should be working

without major problems on Windows (through Cygwin) Solaris and FreeBSD The push

initiator is implemented on java so it is operating system independent

Linux is the logical choice especially when it comes to the world severs and networking

for it promising feature as an open source low cost operating system

342 Programming language

Since system design was planned to be modular to enhance the reuse of its components as

explained above then an object oriented programming language will be a reasonable

choice Another factor is the need for a graphical user interface which imposes using a

programming language with good graphics handling capabilities at the same time it

should be over Linux

Chapter 3 System requirements

24

The best programming language to accomplish the above requirement is found to be java

which has the flowing feature

Cross platform - All clients and servers run the same Java code without any

changes or recompilation This simplifies deployment

Cost effective to develop in Java - The java language has many features that

improve developer productivity promote code reuse and reduce development and

maintenance costs

Works well with Open Source - Java with Linux and the many open source

movement projects and libraries provide a powerful mix that ensures development

is cost-effective efficient and of high quality because extensively tested libraries

components and solutions are available to plug-in to customer development

efforts

343 Nokia Mobile Internet Toolkit 41

To design and implement a WAP application on a Nokia phone the Nokia Internet

Toolkit has to be downloaded and installed on the PC A Nokia simulator is installed as

part of the installation but various phone simulators can be downloaded and installed

This simulator is used for testing purpose Also it has a server simulator based on the

Nokia Active Server if a WAP Gateway is unavailable

32 software requirements

Most of this section has been mentioned in way or other but they will be considered

briefly here

321 Kannel WAP gateway

This is an open source gateway upon which the push proxy gateway of this system will

be built on it available free of charge at kannel project web site

Chapter 3 System requirements

25

322 Linux operating system

It is important to install kannel gateway on it for this project we choose fedora core 7 for

availability reasons

323 JDK16

The java run time environment is required to implement the push initiator

32 hardware requirements

321 PC

Any Personal computer capable of running fedora core 7 with USB interface to be able

connects GSM modem

322 GSM modem

This will act as an alternative to the short message service center SMSC Obviously this

means that GSM network is required too

26

Chapter Four

4 System design

41 System Scenario

The basic scenario of a push session is that a Push Initiator (PI) transmits content to a

WAP client This is done in multiple steps as shown in Figure 31

pushOTAPAP

Gateway

PI

1

2

pull gateway

PPG

3

SMS center

Mobile device

6

5

4

Content provider78 9

Figure 41 WAP push scenario

Chapter 4 System Design

27

The PI communicates with a Push Proxy Gateway (PPG) over the Push Access Protocol

(PAP) (1 and 2) The PPG will then use the Push Over-The-Air Protocol (PushOTA) (3)

to deliver a Uniform Resource Identifier (URI) to the client via a Short Message System

Centre (SMS-C) (4 and 5) The next step for the client is then to activate the URI (6 and

7) and get the content from the server (8 and 9) The mobile device will have to use a

ldquoPull Gatewayrdquo to get the content but it is very likely that this is the same one as the PPG

The same same scenario could be viewed in sequence diagram figure (42)

Push Initiator PPG SMS Center WAP client

Send push message

Send push message response

Send WAP push message

Ack

Send WAP push message

Ack

Message read

Ack

Message read

Ack

Result notification message

Result notification response

Figure 42 WAP push sequence diagram

Chapter 4 System Design

28

43 Modular Design

Conceptually we can envision this push system as consisting of three major components

(presented in the order of the push lifetime)

first there is a Push Initiator Program that reads the generates a notification message and

transmits (pushes) it via a WAP Gateway to the customer phone This message notifies

the user that a service is available if the user accepts will ask the phonersquos browser to pull

the page from our web server via the WAP Gateway

Next there is the Push Proxy Gateway PPG which will receive the push message from

the push initiator and is responsible of doing any needed optimization protocol

compilation and conversion Also it is responsibility of the PPG to find the end user

address and send the push message to the SMS center

Finally there is the SMS center which will do the last delivery of push message to the

intended user if the user were offline the message will be saved for later time until the

WAP client is on

PI PPGSMSC

Figure 43 system modules

Chapter 4 System Design

29

43 Design of system Modules

Following sections of this chapter present a description and design of the system modules

with accompanying graphical representation

431 Push Initiator (PI)

The PI is the first logical component in the WAP Push scenario and therefore the

originator of the push message There are different kinds of PIs One example is an

automated script another one is a semi automated server version written in an applicable

scripting language supporting server side interaction

A push message is sent as an HTTP POST to the Push Proxy Gateway The POST will be

a multipart XML document with the first part being the control entity (Push Access

Protocol) the second part being the content entity (either a Service Indication or a

Service Load) and the third part being the capability entity

HTTP Post

Capability entity

Content entity (SISL)

Control entity (PAP)

Figure 44 architecture of the push message

Chapter 4 System Design

30

4311 Control entity

This part of the push contains the basic information and fields The fields can include

recipient address expiry time bearer type delivery attempt time and a URL to which a

response is to be sent if delivery confirmation is requested by the push initiator

PAP is the protocol used in WAP Push framework for specifying control information and

content that is to be pushed to a client via a Push Proxy Gateway (PPG) A Push Initiator

(PI) triggers push message processing The Push initiator class (Appendix B) of this

design shows how to generate PAP messages

The address of the used PPG should be given as an initialization parameter of the

application (ldquoppg-urlrdquo see Appendix B) This design also provides an implementation

that can be used in a special case when ldquoIPv4 IPv6rdquo type client addressing is applied and

when toolkit is used All other cases including the use of phone numbers (ldquoPLMNrdquo type

address) in sending push messages are considered

The PAP XML contains at the minimum a ltpapgt element a ltpush-messagegt

element and an ltaddressgt element

The important parts of this PAP message are the address value and type The value is

typically a MSISDN and type indicates whether to send to a MSISDN (typical case) or to

an IP Address The TYPE is almost always MSISDN as the Push Initiator (PI) will not

typically have the Mobile Stations IP address - which is generally dynamic

4312 Content entity

This is the actual data that is received by the mobile device The various content types

are Service Indication (SI) Service Load (SL) and Cache Operation (CO) in our project

we will just deal with SI and SL

The SI notifies a client about an external event by inviting the client to interact with it In

other words it informs a client about a service More precisely it sends a message that

Chapter 4 System Design

31

informs the client of a Uniform Resource Identifier (URI) where the client can access the

service

An important attribute of SI is the action attribute it may contain the action to be taken

when the client receives the SI There are two groups that the action attributes can be

divided into

First we have delete and signalmdashnone both of them is used because of their side

effects Ie with delete you take away all SIs with the same si-id as the deletion pushrdquo

including itself and with signal-none you either do nothing or you pay regard to the

info element in that push

The other group consists of signal-low signal-medium and signal-high These

attributes are all used to set the rules for the presentation in the terminal device

o Signal-low

The SI must be postponed without user intervention

o Signal-medium

The SI must be presented as soon as the implementation allows that to be carried out

without disturbing the user (Signal-medium is the value that will be used if none is

specified)

o Signal-high

The SI must be presented as soon as the implementation allows that to be carried out

without disturbing the user or earlier if it seems appropriate (This decision may for

instance be based on user preference settings)

This is the different functionalities supported by the SI we concidered

Expiration

Replacement

Deletion

Chapter 4 System Design

32

Handling of out of order delivery

Handling of information specified in the info element

A PUSH Service Indication (SI) contains at a minimum an ltsigt element and a

ltindicationgt element SL donrsquot differ so much from SI

4313 Capability entity

This entity determines the type of mobile device that is to be served This is determined

by WAP user agent profiling The sender can indicate the hardware vendor and browser

version and type of the intended recipients This capability entity is then matched at the

PPG to see which devices are compatible with the requested capability If there is a

match the content is delivered by the PPG to that specific device

Now a day most devices are compatible with WAP so we donrsquot need to create this entity

more precisely it is optional

After the push has been created in the PI it is up to the system to deliver it to the defined

destination In this system the different responsible entities are the PPG and the SMSC

Both of these two different entities are running on same server but it is only the

configuration of the SMSC that is out of my control since it is run by the operator and is

not controllable in my lab environment

432 Push Proxy Gateway (PPG)

There are various commercial WAP gateways available on the market that are quite

expensive Kannel on the other hand is an open source gateway one doesnrsquot need to pay

for it in addition one can edit the source code himself and construct his own customized

gateway Because Kannel is being developed on Linux systems (RedHat and Debian) it

can be smoothly ported to other UNIX-like operating systems

4321 Kannel gateway architecture

The gateway divides the processing load between the following three hosts

Chapter 4 System Design

33

The bearer box which connects to the SMS (Short Message Service) centers and

or CSD (Circuit Switched Data) routers providing a unified interface to them for

the wapbox The bearer box does this by implementing the WDP (Wireless

Datagram Protocol) layer of the WAP stack

The smsbox implements the rest of the SMS gateway functionality It receives

textual SMS messages from the bearerbox and interprets them as service

requests and responds to them in the appropriate way

The wapbox which hosts the upper layers of the WAP stack Each session and its

transactions are handled by the same wapbox (see figure 35)

1Figure 45 divisions of duties in kannel

4322 Working of the gateway

The bearer box receives UDP (User Datagram Protocol) packets from CSD routers

inspects them to see whether they are WAP packets if so then it will routes them to the

WAP box This simple design allows the bearer box to do a minimum of processing per

smsbox

wapbox

bearerbox

Kannel

SMS center

WAP phone

HTTP server

Chapter 4 System Design

34

packet The bearer box also sends the UDP packets that the other boxes generate which

adds some more routing processing The wapboxes implement the WTP (Wireless

Transaction Protocol) and WSP (Wireless Session Protocol) layers These take HTTP-

like requests from the phones and make the actual HTTP requests to content servers

compress the responses and send them back to the terminals (Sessions are maintained to

make as much use of the limited radio bandwidth as possible)

4323 External interfaces of the gateway

The gateway has interfaces to three external agents

bull SMS centers using various protocols

bull HTTP servers to fetch WAP and SMS content and to push WAP Content The

pull protocol is HTTP push PAP

bull WAP phones implementing the WAP protocol stack and (for push) WAP Push

client

Figure 36 summarize kannel external interfaces

4324 Configuring the gateway

The bearerbox smsbox and wapbox are the main working modules of the gateway and

must be configured before configuring the gateway These three modules are controlled

by a configuration file that has wapbox smsbox and bearerbox groups

Configuring the PPG core group

We use two components the PPG core group and the PPG user group The PPG

core group is used to configure the PI interface(for more details configuration

variables refer to appendix c)

Chapter 4 System Design

35

Mobile telephone

network

The Internet

smsbox

wapbox

bearerbox

Kannel

HTTP

HTTP

HTTP server

Serving WML

files

HTTP server

Serving HTML

files

TCP

TCP

WAPSMS

SMSC

WAP phoneNetwork base station

Workstation used for http

administration

Figure 46 External interfaces of the gateway

4325 Administering the gateway through an HTTP interface

Kannel can be administered via an HTTP interface All commands are given as normal

HTTP queries so they can easily be given from command lines like this one

links -dump httpip-adressportshutdownpassword=yourchoice

But it is advantageous to have graphical user interface for gateway control so we have

designed GUI through http

Chapter 4 System Design

36

433 Short Message Service Centre (SMSC)

A SMSC is an essential component when sending a push message from an IP network to

a mobile device in the architecture supported by the components and devices It is used to

remove the TCPIP layer that the push is encapsulatedrdquo in It is also the entity that

identifies the end-point device When this is done it is also the SMSC that is responsible

for the processing and final message delivery to the device After the process of de-

encapsulation and resolution of the client identity there should not be any difference

between this message and a message that is originated locally from the operator itself

(like a SMS)

In this project we just use a virtual SMS center we try first to get connection to a real

one but our effort was worthless

Finally the following figure depicts the overall flowchart of the WAP push system

(figure 47)

Chapter 4 System Design

37

PI

PPG

Create PAP

HTTP Post

Message

processing

OTA

Connection

oriented

Sessionless Session

oriented

WTP Initiation

WAP clinet

Application

Create content

Create

capability

entity

Database

SMS center

NoYes

Figure 47 the complete flowchart of the system

38

Chapter Five

5 System implementation and results

51 Implementation

511 The Push Proxy Gateway

First of all the Kannel gateway have been compiled and installed using gcc (GNU C

Compiler) this stage go fine except the operating system required more components to

be pre-installed and will configured

Then with stages of configuration to the gateway (Appendix B) it was capable of working

as PPG Figure 51 below show the gateway when it starts

Figure 51 starting kannel gateway

Then a web based user interface had been created to provide an easy way to control the

gateway remotely Figure 52 and figure 53

39

Figure 52 GUI for gateway control

512 The Push initiator

Next the push initiator design had been implemented using java programming language

as in design phase the implementation is taken carefully to make a reusable component

that could be used by other developer

PushInitiator class (Appendix B) implements a simple push initiator which can be used

to create and send messages to a push proxy gateway (PPG)

The method sendPushMessage sends a push message via the PPG to the client The client

is identified by the address which is either the phone number (address type is PLMN) or

IP address The message content and its mime type are also given as arguments to the

method the other tow important method are

createPapMessage This method creates a Push Access Protocol (PAP) type message

40

createSiMessage This method is used to create a service indication (SI) type message

Figure 53 showing running kannel status

513 WAP site

Since this site will be built for testing purpose and making sure that the system is

functional we had not go deep in this section Just simple WAP site with tow page has

been crated

41

52 Service indication

When a SI was pushed to any of the emulator or Nokia phones it was received and

presented in the way it was supposed to as specified in the WAP standard as shown in

figures below This is a proof that the devices claiming to support WAP push do so and

the design is will working See figures 53 through 56

Figure 55 service indication

42

Figure 57 SI details

52 Service load

The emulator correctly receives and interpreted the SL push the same as all of Nokia

phones we have tested

When a SL was pushed to the Ericsson phones it was not presented in the specified way

figure 58 I think that it is because of security reasons The reason for this assumption is

that the phones only supports on or off as security in their push configuration The

emulator on the other hand presents SL correctly Finally the Siemens phone did seem to

interpret SL but the current software was not very consistent It did load the SL without

user interference in the specified way when the user already where having an active

session If the user was offline the phone interface presented a symbol on the display

and did not load the service until the user clicked on the symbol

43

Chapter Six

6 conclusion and future work

In this chapter we will provide the conclusions and proposed future work for interested

individuals

61 Conclusions

In this project a WAP push system has been successfully designed and implemented It

provides a way to partially overcome the limitations encountered when accessing the

World Wide Web using handsets After comparing the proposed project objectives with

those accomplished the main goals are seen to be met

Phones from different manufactures all differ from the WAP-standard in some

ways One of the most obvious differences is the resolution of the display

During the work it has been noticed that the WML pages must be quite small We

have also noticed that the support for tables and some other tags are a bit limited

Even though the WML standard is smaller than the HTML standard it is a little

more complicated to write correct WML pages The main conclusion is that WAP

works pretty well but the phones are a little non-stable

The push proxy gateway is configured and worked probably with virtual SMS

center and it is easy to switch to a real one

The system depends mainly on open sources (ie Linux and kannek)

The design and implementation of the push initiator work well with the kannel

gateway and it should work correctly with other gateways

Chapter 6 Conclusion

44

62 Further Work

The possibilities of wireless push are interesting enough that it has to be worth to know if

the security and conformance problems will be solved in WAP push If they are solved

and the technique is refined then there should be nothing to stop the great number of

services that will follow in its footsteps Therefore there is further work that should be

done and the most interesting parts are in my opinion these

621 Security Aspect

One of the problems today is that the phones supporting push does not have the detailed

security settings that a technique like this needs Therefore it would be interesting to look

into the possibility to add these without confusing the user I suggest furthering looking

into usability aspects of security in WAP Push for short

622 GPS integration possibility

This will provide location dependent delivery of WAP push it will have great

applications in telematic and ecommerce advertising

623 Conformance to Standards

An interesting project would be to examine if the main reason for the nonstandard

solutions in the existing WAP push software is the result of difficulties in

implementation Or if the main reason is that the manufacturers wants to provide

proprietary solutions A reason why one may want to know this is that if the problem is

depending on implementation problems then it might get better

45

Appendix A Abbreviations

CDMA Code Division Multiple Access

CO Cache Operation

DTD Document Type Definition

GSM Global System for Mobile

HTTP Hypertext Transfer Protocol

IP Internet Protocol

MSISDN Mobile Station International Subscriber Directory Number

OTA Over The Air

PAP Push Access Protocol

PushOTA Push Over The Air

PDA Personal Digital Assistant

P1 Push Initiator

PLMN Public Land Mobile Networks

PPG Push Proxy Gateway

SI Service Indication

SIA Session Initiation Application

SIR Session Initiation Request

SL Service Loading

SMPP Short Message Peer to Peer

SMS Short Message System

SMSC Short Message System Center

UCP Universal Computer Protocol

URI Uniform Resource Identifier

URL Uniform Resource Locator

UTC Universal Time Coordinated

WAP Wireless Application Protocol

WBXML WAP binary XML

WDP Wireless Datagram Protocol

WSP Wireless Session Protocol

WTLS Wireless Transport Layer Security

XML Extensible Mark-up Language

46

Appendix B Kannel gateway configurations

THIS IS A SAMPLE CONFIGURATION FOR KANNEL

group = core

admin-port = 13000

admin-password = admin

status-password = admin

admin-deny-ip =

admin-allow-ip = 127001172161455

log-file = tmpkannellog

log-level = 0

http-proxy-host = 172161411

http-proxy-port = 8080

http-proxy-exceptions = 127001

Smsbox related

smsbox-port = 13001

box-deny-ip =

box-allow-ip = 127001

bearerbox-host =localhost

Wapbox related

wapbox-port = 13002

udp-deny-ip =

udp-allow-ip = 127001

bearerbox-host =localhost

SMSC GSM

group = smsc

smsc = at

modemtype = auto

speed =9600

device = devttyS0

SMSC HTTP

group = smsc

smsc = http

system-type = kannel

port = 13016

connect-allow-ip = 127001

Appendix B

47

username = wappush

password = wappush

SMSBOX SETUP

group = smsbox

bearerbox-host = localhost

sendsms-port = 13013

sendsms-chars = 0123456789 +-

log-file = tmpsmsboxlog

log-level = 0

access-log = accesslog

white-list = 127001

black-list =

SEND-SMS USERS

group = sendsms-user

username = wappush

password = wappush

user-deny-ip =

user-allow-ip = 127001

PPG group

group = ppg

ppg-url = wappush

ppg-port = 8080

concurrent-pushes = 100

trusted-pi = true

users = 1024

service-name = ppg

ppg-smsbox-id = dlrbox

WAP PUSH USER

group = wap-push-user

wap-push-user = picom

ppg-username = wappush

ppg-password = wappush

allow-ip = localhost

48

Appendix C Selected Codes

Gateway Control Form

ltDOCTYPE HTML PUBLIC -W3CDTD HTML 32ENgt

lthtmlgt ltheadgt

lttitlegtGateway control formlttitlegt

ltheadgt

ltbody bgcolor=white text=black link=blue vlink=navy

alink=redgt

ltbase target=submitgt

ltscriptgt

function update_status()

if ( adminactionvalue == status )

adminaction = http + adminhostnamevalue +

+ adminportvalue + status +

adminstatusformatvalue

else

adminaction = http + adminhostnamevalue +

+ adminportvalue + + adminactionvalue

adminpasswordvalue = adminpasswordvalue

actiongovalue = GO GET +adminaction

ltscriptgt

lttable align=centergt

lttrgtltp align=centergtlth2gtGateway control

formlth2gtltpgtlttrgt

lttrgt lttdgtHostnamelttdgtlttdgtltinput type=text

name=adminhostname value=localhost

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPortlttdgtlttdgtltinput type=text

name=adminport value=13000

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPasswordlttdgtlttdgtltinput type=password

name=adminpassword value=

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtActionlttdgtlttdgtltselect name=adminaction

onChange=update_status()gt

ltoption value=statusgtStatusltoptiongt

ltoption value=suspendgtSuspendltoptiongt

ltoption value=isolategtIsolateltoptiongt

Appendix C

49

ltoption value=shutdowngtShutdownltoptiongt

ltoption value=resumegtResumeltoptiongt

ltselectgtlttdgt lttrgt

lttrgt lttdgtStatus Formatlttdgtlttdgtltselect

name=adminstatusformat onChange=update_status()gt

ltoption value=gthtmlltoptiongtltoption

value=txtgttxtltoptiongtltoption

value=xmlgtxmlltoptiongtltselectgtlttdgt lttrgt

ltform name=admin method=get

action=httplocalhost13000status

encoding=applicationx-www-formgt

ltinput type=hidden name=password value=gt

lttrgt

lttdgtGolttdgt

ltformgt

lttdgtltinput type=submit value=go name=actiongo

onClick=documentadminsubmit()gtlttdgt

lttrgt

lttablegt

ltbodygt

lthtmlgt

Push Initiator Class

import javanetURL

import javanetHttpURLConnection

import javaio

Class implements a simple push initiator It can be

used to create and send messages to push proxy

gateway (ppg)

public final class PushInitiator

xml version

private final static String XML_VERSION = ltxml

version=10gt

Push Access Protocol (PAP) document type

private final static String PAP_DOCTYPE =

Appendix C

50

ltDOCTYPE pap PUBLIC -WAPFORUMDTD PAP 10EN

httpwwwwapforumorgDTDpap_10dtd gt

content type of the push request multipart body

private final static String CONTENT_TYPE =

multipartrelated boundary=multipart-boundary

type=applicationxml

Service Indication (SI) document type

private static final String SI_DOCTYPE = ltDOCTYPE si

PUBLIC -WAPFORUMDTD SI 10EN +

httpwwwwapforumorgDTDsidtdgt

private static int pushId = 0

PPG url where the pap message is to be sent

private final URL ppgUrl

some push proxy gateways may also require the

authentication of the push initiator

For instance the push initiator may be required to

send an HTTP authorization header in each request

private final String authorization

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

public PushInitiator(URL ppgUrl) thisppgUrl =

ppgUrl

authorization = null

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

param authorization a ltcodegtStringltcodegt value

public PushInitiator(URL ppgUrl String authorization)

thisppgUrl = ppgUrl

Appendix C

51

thisauthorization = authorization

Systemoutprintln(Push Initiator created ppgUrl =

+ ppgUrl)

ltcodegtsendPushMessageltcodegt sends push message to

ppg

param clientAddress a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param message a ltcodegtStringltcodegt value

param mimeType a ltcodegtStringltcodegt value

exception Exception if an error occurs

public void sendPushMessage(String clientAddress

String addressTypeString message String mimeType)

throws Exception

HttpURLConnection http =

(HttpURLConnection)ppgUrlopenConnection()

String ppgServer = ppgUrlgetHost()

httpsetDoInput(true)

httpsetRequestProperty(Content-Type CONTENT_TYPE)

if(authorization = null)

if(authorizationtrim()equals())

httpsetRequestProperty(Authorization

authorization)

httpsetDoOutput(true)

PrintWriter out = new PrintWriter(new

BufferedOutputStream(httpgetOutputStream()))

outprintln(--multipart-boundary)

outprintln(Content-type applicationxml)

outprintln()

outprintln(createPapMessage(clientAddress

addressTypeppgServer genPushId() null))

outprintln()

outprintln(--multipart-boundary)

outprintln(Content-type + mimeType)

outprintln()

outprintln(message)

outprintln()

outprintln(--multipart-boundary--)

outflush()

outclose()

httpconnect()

Appendix C

52

finally read and debug the response received from

PPG

try

debugResponse(http)

catch (Exception e)

Systemerrprintln(Error in receiving the

response)

ltcodegtcreatePapMessageltcodegt creates a Push Access

Protocoltype message

param address a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param ppgServer a ltcodegtStringltcodegt value

param pushId a ltcodegtStringltcodegt value

param notificationTo a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createPapMessage(String address

String addressType String ppgServer String pushId

String notificationTo)

return XML_VERSION + n + PAP_DOCTYPE + n +

ltpap product-name=Mobile Zoo Push

Initiatorgtn +

ltpush-message push-id= + pushId +

(notificationTo = null request-notification-

to= + notificationTo ) + gtn +

ltaddress address-value=WAPPUSH= + address +

TYPE= + addressType +

+ ppgServer + gtn +

ltpush-messagegtnltpapgt

ltcodegtcreateSiMessageltcodegt creates a service

indication type message

param url a ltcodegtStringltcodegt value

param created a ltcodegtStringltcodegt value

param expires a ltcodegtStringltcodegt value

Appendix C

53

param message a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createSiMessage(String url

String sid String created String expires String

action String message)

return XML_VERSION + SI_DOCTYPE +

ltsigtn +

ltindication href= + url + +

(sid = null si-id= + sid + ) +

created = null created= + created +

) +

(action = null action= + action +

) +

(expires = null expires= + expires +

) + gt +

message +

ltindicationgtnltsigt

Debug response

param http a ltcodegtHttpURLConnectionltcodegt value

exception Exception if an error occurs

private void debugResponse(HttpURLConnection http)

throws Exception

Systemoutprintln(httpgetResponseMessage())

String headerName

int i=0

while((headerName = httpgetHeaderFieldKey(i++)) =

null)

Systemoutprintln(headerName + +

httpgetHeaderField(headerName))

Systemoutprintln()

InputStreamReader in = new InputStreamReader(new

BufferedInputStream(httpgetInputStream()))

int c

Appendix C

54

while((c = inread()) = -1)

Systemoutprint((char)c)

Systemoutprintln()

ltcodegtgenPushIdltcodegt generates an unique push id

return a ltcodegtStringltcodegt value

private String genPushId()

pushId = 100000

return SystemcurrentTimeMillis() + + pushId++

55

References

[1] Microsoft ldquoGetting Mobile Using WML and WAP to Display Web Sites on

Mobile Devicesrdquo

URL msdnmicrosoftcomen-uslibraryaa140117(office10)aspx accessed

on April 10 2008

[2] DALE BULBROOK ldquoWAPA Beginnerrsquos Guiderdquo OsborneMcGraw-Hill 2001

[3] WAP Forum Wireless Application Protocol Architecture Specification Access on

Jan 12 2008 Available

httpwww1wapforumorgtechdocumentsWAP-210-WAPArch-2006 07 12-apdf

[4] WAP Forum Push Architectural Overview access on (2008 February 3) Available

httpwww1wapforumorgtechdocumentsWAP-250-PushArchOverview-2007 04

03-apdf

[5] Service indication PDF access on 62008 Available

httpwwww3orgTRhtml401structlinkshtml

[6] WAP Push Technology (openwave) PDF access on (2008 April) Available

URL httpwwwopenwavorg

[7] Web site (httpwwwwapforumorgwhatcopyrighthtm) access on May 2008

[8] ldquoWAP Push Proxy Gateway Specificationrdquo WAP Forum access on 16-August-

2007URI httpwwwwapforumorgPDF

[9] WAP Forum Access on (2008 MAY 31) WAP Service Indication Specification

Available httpwww1wapforumorgtechdocumentsWAP-167-ServiceInd-200507

31-apdf

  • odc_fpwmlandwap_topic3
  • N100E3
  • 21
  • 5

2

pixel screen resolution) but also because the majority of them can display only certain

range of color or monochrome images These issues will play havoc with the beautiful

Web site contents

As if that wasnt bad enough the processing power of cell phones to render Web content

is low the bandwidth available for transferring content is low (a maximum of 144

kilobits per second and often considerably less because of interference) connections may

be lost and the latency (the time it takes for the data to be sent from a server and received

by a cell phone) can be high In short the wireless environment could be described as

very hostile to Web access

Given the problems weve just outlined one can see that delivering Web content requires

rethinking what is delivered and how This rethinking lead to two standards the how is

the province of the Wireless Application Protocol and the what is where Wireless

Markup LanguageWML and WAP push comes in [1]

In most GSM networks however GPRS activation from the network is not generally

supported even it is supported one need to know the IP address of the corresponding

handset for this reason WAP Push messages have to be delivered on top of the SMS

bearer Also To ensure that the end user is correctly browsing WAP pushes the micro-

browser should be configured

13 Project Objective

The objective of this project is to

Designing WAPweb site to serve as content provider whish will then send the

WAP push messages for both purpose configuration and new content

acknowledgement

Designing a push Initiator to process the WAPweb content and handle them to

the Push Proxy Gateway

Building an open source PPG to handle messages from the push initiator and

deliver them to the particular handset over SMS bearer

Chapter 1 Introduction

3

14 Methodology

The WAP server will sit between the Internet and the wireless network and act as

gateway (ie push proxy gateway) between HTTP servers and WAP-enabled devices

HTTP servers serve up HTML documents These gateways have the ability to translate

HTML content into Wireless Markup Language the native format of the WAP browser

but the results are usually pretty poor Thus for better services and information to WAP

browsers one really needs to design WAPweb site to serve as content provider Finally

designing a push Initiator to process the WAPweb content and handle them to the PPG

The primary source of software packages is the open source software As the hole system

is to run on UNIX like system (ie various Linux distributions) The first critical task

investigated was the configuration of the GSM GPRS modem so to be able to act as

virtual SMSC from which the WAP gateway can reach a handset terminal

The open source Push Proxy Gateway (PPG) will be built on the base of the kannel

gateway and equipped with clients database ldquoMySqlrdquo to communicate with GSM

network through the previous modems which could be in the same PC with PPG or

connected to it via network The Push Initiator (PI) had been implemented using Java

programming language from sun Microsystems Finally Nokia toolkit emulator will be

used during project evolution as a testing environment for handheld

15 Thesis Layout

Chapter 2 presents the theoretical aspects of WAP which discuss the protocol

architecture and layering and the relationship to the web model Also the WAP push

framework will be presented

Chapter 3 brief description of hardware and software requirement plus the development

environment

Chapter 4 contains a description of what and how we do to develop a working WAP

push system This chapter is organized so that it starts with an overview and continues

Chapter 1 Introduction

4

with the description and design of all the parts starting with the creation of the push and

ending with the activation in the mobile device

Chapter 5 presents the rest stages of system development such as integration operation

and testing The results will be given in this chapter involved with the analysis

Chapter 6 gives conclusions of the project outcome and the recommendation for future

working

Appendix A list of abbreviations

Appendix B kannel gateway configurations

Appendix C selected codes from the system

5

2 Basic concepts

21 Literature review

The WAP Forum which creates and maintains the WAP specifications was founded in

June 1997 by Ericsson Nokia Motorola and Unwired Planet (later Phonecom later

Openwave Systems) The 10 specification was published in April 1998 but wasnrsquot

implemented in phones at that time The 11 specification came out in July 1999 and

was the first one to be implemented in publicly available phones 121 came out in June

2000 and phones implement it Work on WAP 20 is closing It will converge WAP with

Internet protocols and W3C markup languages [2]

During 2002 and 2003 the idea of WAP push began to get more concern from mobile

network operator In last four years companies began to develop push proxy gateway

unfortunately all of them were protected by taught copyright license This is what

encourages WAP developers and programmers to turn toward kannel which is an Open

Source WAPSMS gateway started by the Wapit Ltd company in June 1999 under

management of Lars Wirzenius later on it turn to the public [3]

In sudan zain (precedent Mobitel) initiated its WAP services for browsing internet on

2006 the same action taken by MTN (precedent areba) Early this year zain established

its WAP push service for emails named zmail

22 WAP architecture

WAP is a set of specifications for developing web-like applications that run over wireless

networks The basic aim of WAP is to provide a web-like experience on small portable

devices - like mobile phones and Personal Digital Assistance PDAs The WAP protocol

suite are analogous to many of those used in existing internet technology yet are

optimized for the challenges raised by small narrowband client devices (such as mobile

Chapter Two

Chapter 2 Basic Concepts

6

phones) and limited over-the-air bandwidthThe WAP Protocol suite covers both the

application level and the underlying transport layers The bearer level of WAP depends

on the type of mobile network It could be CSD SMS CDMA or any of a large number

of possible data carriers Whichever your target client is using the development above

remains the same WAP is designed in a layered fashion so that it can be extensible

flexible and scalable As a result the WAP protocol stack is divided into five layers (as

shown in Figure 21 below)

Wireless Application

Environment (WAE)

Wireless Session Protocol (WSP)

Wireless Transaction Layer Security (WTLS)

Wireless Transaction Protocol (WTP)

USSD CSD ETCSMSCDMA

Wireless Datagram Protocol (WDP)

Other Services and

Applications

Figure 21 Wireless Application Protocol architecture

Chapter 2 Basic Concepts

7

221 Application Layer Wireless Application Environment

The wireless application environment WAE is a standard for developing applications

and services that operate on wireless communication networks The WAE layer consists

of several parts wireless markup language binary XML wireless markup language

scripts and wireless telephony application [5]

2211 WML

Pages or services created using HTML do not work very well on small handheld devices

since they were specifically developed for use on desktop computers with larger color

screens Also low bandwidth wireless bearers wouldnrsquot be suitable for delivering the

large files that HTML pages often consist of Therefore a markup language specifically

adapted to these restrictions has been developedmdashWML

WML provides a navigation model for devices with small display screens and limited

input facilities (no mouse and a limited keyboard) In order to save valuable bandwidth in

the wireless network WML can be encoded into a compact binary format for

transmission between the phone and the network and vice-versa

WML uses uniform resource locators URLs in the following situations

o when specifying navigation eg hyperlinking

o when specifying external resources eg An image or a script

WML is an XML language with the same character sets as an XML document XML is

case-sensitive and therefore is also WML case-sensitive

WML is built on cards and decks A card is a one or more unit of user interaction eg a

choice menu a screen of text or a text entry field This means that the user navigates

through a series of WML cards reviews the contents of each enters requested

information makes choices and moves to another card Cards are grouped into decks [5]

Chapter 2 Basic Concepts

8

2212 WMLScript

WMLScript is a client-side scripting language It is very much like JavaScript which is

used on dynamic HTML(DHTML) web sites but WMLScript has been modified to fit

the currently severe limitations of the WAP environment and is in many ways restricted

compared to JavaScript

Client-side means that the code actually runs on the micro-browser itself The code is

downloaded to the WAP device as part of the deck so that when the code is executed it

does not have to make a trip back to the server to find out what to do next Everything the

application needs is right there Client-side functionality is therefore much faster in the

userrsquos perception

2213 Binary Extensible Markup Language

Binary XML is a compact binary representation of XML The binary XML is design to

reduce the transmission size of XML documents This allows more effective use of

narrow banded communication channels without any loss of functionality or semantic

information [5]

222 Session Layer Wireless Session Protocol

The wireless session protocol layer supports the wireless application environment with

two different session services The first is a connection mode service that operates above

a transaction layer protocol WTP and the second is a connection-less service that

operates above a datagram transport service WSP supports HTTP 11 functionality and

some new features These features include long-lived session a common facility for data

push capability negotiation and session suspendresume [5]

WSP provides support for exchange of content between clients and servers To support

the exchange the WSP establishes a reliable session negotiates on common capabilities

exchanges the data using compact encoding and releases the session The WSP also

supplies functionality to suspend and resume the session in order to save battery while

Chapter 2 Basic Concepts

9

the session is idle The WSP lifecycle is therefore not tied to the underlying transport

layer

WSP is a binary version of HTTP which includes both headers and data Binary

encoding is used to minimize the protocol overhead and to simplify decoding The header

is used to define content type character set encoding languages etc in an extensible

manner WSP supports two types of data transfers push and pull Pull transfer is used

when the client is sending a request and the server is sending a response In the push

mechanism the server pushes data to a client without prior request from the client

This can be done in three different ways Confirmed data can be pushed within an

existing session or non-confirmed data pushes can be done within or without an existing

session

223 Transaction Layer Wireless Transaction Protocol

The wireless transaction protocol WTP is defined to provide the services necessary for

sending requests responses and information WTP runs on top of a datagram service and

optionally a security service To ensure safe connection on top of the datagram layer the

WTP layer performs retransmissions sends acknowledgements and removes duplicated

messages In order to improve the connection efficiency WTP has no explicit connection

or teardown phases The layer also performs segmentation and reassembly to reduce the

number of packets sent

WTP has been defined as a transaction protocol that is suitable for mobile stations and

operates efficiently over wireless datagram networks Some benefits of using WTP are

that it improves reliability over datagram services improves efficiency over connection-

oriented services and that it is message oriented and designed for requestresponse

applications

The wireless transaction protocol is divided into three transaction services It can send

unreliable messages with no result message reliable messages with no result message or

reliable messages with exactly one result message

Chapter 2 Basic Concepts

10

Unreliable Messages With No Result Message

This service provides an unreliable datagram service The service can be used by

applications which occasionally want to send a datagram within an existing session

using WTP No acknowledgement or retransmission is done in this service

Reliable Messages With No Result Message

This service provides a reliable datagram service The service can be used by

applications that want to use a reliable push service The receiver acknowledges the

message and if the original sender receives no acknowledgement the message is

retransmitted

Reliable Messages With One Reliable Result Message

This service provides the basic invokeresponse transaction The receiver acknowledges

the message and if the original sender receives no acknowledgement the message is

retransmitted To confirm the reception of the acknowledgement the original sender

sends an acknowledgement to the receiver The three transactions are shown in next

figure

message message

acknowledge

message

confirm

Unreliable invoke

message with no

result message

Reliable invoke

message with no

result message

Reliable invoke

message with one

reliable result

message

a) b) c)

acknowledge

Figure 22 the three mode of transaction

Chapter 2 Basic Concepts

11

2231 Concatenation and Separation

To reduce the overhead caused by the datagram headers it is desirable to reduce the

number of packets sent over the air In order to reduce the number of messages several

protocol data units can be put into one single datagram This procedure is called the

concatenation procedure The reverse procedure is called the separation procedure [5]

Concatenation can be done when several packets are transported from the same sender to

the same receiver Concatenation can be done at any time The last acknowledgement can

be concatenated with the invoke message of the next transaction [5]

2232 Segmentation and Reassembly

If a packet is lager than the bearers largest capability the message can be segmented and

send in several packets To increase the communication efficiency message groups can be

acknowledged in groups [5]

To decrease the number of packets sent when a communication error occurs the receiver

can request one or multiple lost packets within a group of messages This is done instead

of resending the entire message which could mean that successfully received packets

have to be resent [5]

224 Security Layer Wireless Transport Layer Security

An Optional layer it is responsible for providing security data integrity and

authentication between two communicating applications The WTLS is optimized for low

bandwidth bearer networks with relatively long latency The WTLS is similar to the

Internet transport layer security TLS but has some new features such as datagram

support optimized handshake and dynamic key refreshing [5]

WTLS has been design to function on both connection-oriented and datagram transport

protocols The security layer acts above the transport layer

Chapter 2 Basic Concepts

12

2241 Service Primitives

WTLS uses primitives to ensure security The primitives are used to

Initiate a secure connection

Perform public-key authentication or key exchange with the client

Change into connection state when the handshake has been done

Terminate the connection

Inform the other end about warning level alerts

Request by the server that the client should initiate a new handshake

225 Transport Layer Wireless Datagram Protocol

The wireless datagram layer is a datagram service used by the upper layers WDP is

designed to communicate over different bearer services and especially for wireless

telecommunication networks [6] It Consists of

bull Source and destination address and port

bull Optionally fragmentation

It maps to UDP for IP bearer and moves single packets to and from the phone

226 WDP and IP

In networks with IP as the routing protocol UDP is used instead of WDP IP provides

segmentation and reassemble in a connection-less datagram service UDP provides port

based addressing and other necessary functions Thereby no additional functions are

required by a WDP layer [7]

227 Bearer Interfaces

WAP supports dial-up networking using IP and Point-to-Point Protocol (PPP) as the

bearer interface underneath WDP It also supports Short Message System (SMS) and

General Packet Radio System (GPRS) SMS passes text and binary data between digital

Chapter 2 Basic Concepts

13

phones GPRS is a relatively new technology that implements faster always-on

connections for wireless devices GPRS actually runs on top of IP [7]

As had been learned above WAP is quite similar to web figure 23 provide a brief

comparison between them

WAP

Bearer

WDP Dtatgram

WTLS security

WTP Transaction

WSP Session

WAE

WML and

WMLScript

Web

IP

TCP UDP

TLS-SSL

HTTP

HTML

JavaScript

VBscript

Figure 23 Web vs WAP

Chapter 2 Basic Concepts

14

23 SMS overview

SMS stands for Short Message Service It is a technology that enables the sending and

receiving of messages between mobile phones SMS first appeared in Europe in 1992 It

was included in the GSM (Global System for Mobile Communications) standards right at

the beginning Later it was ported to wireless technologies like CDMA and TDMA The

GSM and SMS standards were originally developed by ETSI ETSI is the abbreviation

for European Telecommunications Standards Institute Now the 3GPP (Third Generation

Partnership Project) is responsible for the development and maintenance of the GSM and

SMS standards [8]

SMS has two operational mode textual mode and binary mode which will allow sending

other data beside pure text

24 Push overview

WAP push provides a standard means to send data to a mobile subscriber without an

explicit request from the subscriber at the time the data is delivered In the normal

clientserver model a client requests a service or information from a server which then

responds by transmitting information to the client This is known as ldquopullrdquo technology

The client pulls information from the server The World Wide Web is the best example of

pull technology where a user enters a URL (the request) which is sent to a server and

the server answers by sending a Web page (the response) to the user (Figure 24 a)

Although WAP push is also based on the clientserver model it provides a means to send

data to the subscriber without an explicit request from the client at the time of delivery

(Figure 24 b)

With push functionality users are able to get information without having to request that

information In many cases it is important for the user to get the information as soon as it

is available Push communications can be used for sending stock quotes traffic reports

and news

Chapter 2 Basic Concepts

15

a) WAP pull model

b) WAP push model

Figure 24 Pull vs Push

24 WAP Push framework

A push operation starts when a server called the push initiator transmits a push messages

to a WAP client Since the push initiator located on the Internet does not use the same

protocol as the WAP client a translating gateway is needed The push initiator contacts

the push proxy gateway via the push access protocol and the Internet protocol The push

proxy gateway translates the information and forwards the pushed content to the WAP

device via the push over the air protocol (figure 25) [9]

Chapter 2 Basic Concepts

16

Push Proxy Gateway

WAP

Client

Push

Access Protocol

Push

over-the air

protocol Push Initiator

Figure 25 the wireless push technology

241 Push Proxy Gateway

The push proxy gateway PPG is the entity that does most of the work in the push

architecture The gateway acts as an access-point for content pushed from the Internet to

the client So the responsibility of the gateway owners to grant access to push proxy

gateway [9]

Besides the actual access-point service the push gateway provides the following services

push initiator identification and authentication

parsing and error detection of content control information

client discovery services

address resolution

binary encoding and compilation of certain content type

protocol conversion

Chapter 2 Basic Concepts

17

Information to the push proxy gateway is sent via the push access protocol PAP The

content of the information is divided into several parts were the first part is information to

the PPG such as recipient information

When the PPG has parsed the control information an acknowledgement is sent to the

push initiator reporting if the service was successful or not

Once the proxy has accepted the content and the push initiator has received the

acknowledgement the proxy is responsible for the transmission to the client The proxy

attempts to find the correct destination device and deliver the content to that client using

the push over the air protocol The contents delivered to the proxy may be translated to

their binary counterpart eg WML documents may be converted to binary XML by the

proxy before the information is transmitted to the client [9]

The proxy must implement a service to enable capability queries from the push initiator

The capability query should be responded with the capabilities of the specified WAP

device The push proxy gateway may also implement broadcasting services where

special addresses may be translated to a broadcast operation [9]

242 Push Access Protocol

The push access protocol PAP is the means by which an Internet-based push initiator

pushes content to a mobile network via the push proxy gateway [9] The push access

protocol is not intended for use over the air

PAP supports the following operations

Push submission

The push message sent from the push initiator to the gateway contains a control

entity a content entity and may contain a capability entity The control entity is

an XML document When the gateway has received the message an XML

response message is sent back to the initiator

Chapter 2 Basic Concepts

18

Result notification

If the push initiator has requested confirmation of successful delivery this XML

message is transmitted from the PPG to the push initiator when the content has

been delivered to the mobile device The push initiator acknowledges this result

message with another XML document

Push cancellation

The purpose of the push cancellation is to allow the push initiator to attempt to

cancel a previously submitted push message Both the cancellation message and

the resulting acknowledgement are sent as XML documents

Status query

The status query operation allows the push initiator to request the current status of

a message that has been previously submitted Both the status query message and

the resulting acknowledgement are sent as XML documents

Client capabilities query

This operation allows the push initiator to query the PPG for the capabilities of a

specific device The query is sent as an XML document and the response is sent

as another XML document

To access the push proxy gateway an address is used The gatewayrsquos underlying

protocols determines which type of address is used eg in HTTP a URL is used To

access a specific device the devicersquos address is included in the XML document

There are two ways to send information to several clients The push initiator can either

send information to several specific addresses or broadcast it to all clients In both cases

only one message is sent to the gateway which either sends the information to some or

all of the clients The clientsrsquo address is depending on the underlying layer [9]

Chapter 2 Basic Concepts

19

243 Push Over-The-Air Protocol

The push proxy gateway and the client communicate using the push over the air protocol

which utilizes WSP session services Pushes can be sent via connection oriented links or

connection-less links Connection-oriented pushes require that an active WSP session is

available but the server can not create a session To solve the case were there is no active

WSP session the push framework introduces a session initiation application in the client

This application listens to session requests from the OTA-server and responds by setting

up a WSP session for push purposes [9]

Push

Over-the air

WSP

Push management

premptive

Push operational

primitives

WSP Servise

Primitives

Figure 26 Push Over-The-Air protocol stack

The push over the air protocol supports two kinds of operations operations to manage the

connection and operations to send actual messages

Push Sends unconfirmed information over a connection-oriented link

Confirmed push Sends confirmed information over a connection-oriented link

Abort push rejects a previously transmitted push operation This is operation is

part of the confirmed push mechanism

Unit push Sends unconfirmed information over a connection-less link

Connect Creates a push session

Chapter 2 Basic Concepts

20

Suspend Request that a push session should be suspended

Resume Request to resumes a previously suspended push session

Disconnect Terminates the push session

Session request Request from the server to initialize a session to a client

244 Service Indication

The service indication SI provides a mechanism composed in an XML message to

notify a client that an external asynchronous event has occurred and indicate a service

that can be loaded in order to react to that event In order to notify the user a message is

sent from the push initiator via the proxy to the client The message will be shown to the

user and there will be a reference to a URI where the appropriate service can be loaded

For example the message could be ldquoYou have new mailrdquo and the URI to your email

service [9]

When the message is received by the client it will be presented to the user The user then

can choose to launch the service in an application eg the WML browser or to postpone

the SI for later handling Postponed SIs will be stored in the client and the user is given

the possibility to act upon them later When the user choose to launch the service the

service is started in the same way as if the user would have started it manually [9]

Messages sent with the service indication can support mechanisms to improve the end-

user-experience

User-intrusiveness levels

To improve the users understanding of the provided service and to affect the users

behavior when the message is delivered it is possible to change the level of user-

intrusiveness

Chapter 2 Basic Concepts

21

Deletion

When a pushed message becomes invalid the service provider can delete the

message in the clients For example an email notification becomes invalid when

the message are read

Replacement

When a pushed message is invalid and updated with a new message the service

provider can replace the origin message with a new one

Handling of out of order delivery

Since the wireless communication is unpredictable it can not be ensured that the

messages are received in the same order as sent This mechanism discards all

messages older than the latest received

Expiration

Some services may only be valid for a certain amount of time when the time has

expired the message is removed from the client

245 Service Loading

The service loading method provides means to convey a URI to a user agent in a mobile

client The method is conveyed in an XML message In difference from the service

indication method the client loads the content of the URI automatically without any

action from the user when the service loading message is received

Thereby the user will experience the content as if it was pushed to the mobile client and

executed In the service loading mechanism there is a reference to a service page that will

automatically be loaded without interaction with the user included For example the client

will automatically start the email service when a message about new mails on the server

is received [9]

Chapter 2 Basic Concepts

22

When the client is busy with some application it is not suitable to execute the referred

content directly upon reception of a message To avoid this client may cache the content

indicated by the URI so it becomes available to the user when the client is ready

Messages sent with the service loading method can support mechanism to improve the

end-user-experience

Control of the level of user interaction

To improve the users understanding of the provided service and the affect the

userrsquos behavior when the message is delivered it is possible to change the level

of user-intrusiveness The service can explicitly specify if the service should be

loaded or not if the client is busy on reception

Pre-emptive content caching

By setting this attribute the service loading can require that the indicated content

is downloaded and cached instead of executed This can be used to improve the

users experience of the services that otherwise would have required content to

be retrieved from an origin

23

Chapter Three

3 System requirements

Several materials and requirements must be incorporated into the design implementation

and testing The following discusses the components necessary to fulfill the project

requirements and environment

31 development environment

There are many development tools to choose from when developing for WAP Push and

hen you combine different environments with different gateways you will get a vast

numbers of choices This large flora of tools makes it difficult to choose a suitable

environment an important issue because a badly chosen one might consume a lot of time

341 Operating system

Kannel (the chosen gateway for the system) is being developed on Linux systems and

should be fairly easy to export to other Unix-like systems Although it should be working

without major problems on Windows (through Cygwin) Solaris and FreeBSD The push

initiator is implemented on java so it is operating system independent

Linux is the logical choice especially when it comes to the world severs and networking

for it promising feature as an open source low cost operating system

342 Programming language

Since system design was planned to be modular to enhance the reuse of its components as

explained above then an object oriented programming language will be a reasonable

choice Another factor is the need for a graphical user interface which imposes using a

programming language with good graphics handling capabilities at the same time it

should be over Linux

Chapter 3 System requirements

24

The best programming language to accomplish the above requirement is found to be java

which has the flowing feature

Cross platform - All clients and servers run the same Java code without any

changes or recompilation This simplifies deployment

Cost effective to develop in Java - The java language has many features that

improve developer productivity promote code reuse and reduce development and

maintenance costs

Works well with Open Source - Java with Linux and the many open source

movement projects and libraries provide a powerful mix that ensures development

is cost-effective efficient and of high quality because extensively tested libraries

components and solutions are available to plug-in to customer development

efforts

343 Nokia Mobile Internet Toolkit 41

To design and implement a WAP application on a Nokia phone the Nokia Internet

Toolkit has to be downloaded and installed on the PC A Nokia simulator is installed as

part of the installation but various phone simulators can be downloaded and installed

This simulator is used for testing purpose Also it has a server simulator based on the

Nokia Active Server if a WAP Gateway is unavailable

32 software requirements

Most of this section has been mentioned in way or other but they will be considered

briefly here

321 Kannel WAP gateway

This is an open source gateway upon which the push proxy gateway of this system will

be built on it available free of charge at kannel project web site

Chapter 3 System requirements

25

322 Linux operating system

It is important to install kannel gateway on it for this project we choose fedora core 7 for

availability reasons

323 JDK16

The java run time environment is required to implement the push initiator

32 hardware requirements

321 PC

Any Personal computer capable of running fedora core 7 with USB interface to be able

connects GSM modem

322 GSM modem

This will act as an alternative to the short message service center SMSC Obviously this

means that GSM network is required too

26

Chapter Four

4 System design

41 System Scenario

The basic scenario of a push session is that a Push Initiator (PI) transmits content to a

WAP client This is done in multiple steps as shown in Figure 31

pushOTAPAP

Gateway

PI

1

2

pull gateway

PPG

3

SMS center

Mobile device

6

5

4

Content provider78 9

Figure 41 WAP push scenario

Chapter 4 System Design

27

The PI communicates with a Push Proxy Gateway (PPG) over the Push Access Protocol

(PAP) (1 and 2) The PPG will then use the Push Over-The-Air Protocol (PushOTA) (3)

to deliver a Uniform Resource Identifier (URI) to the client via a Short Message System

Centre (SMS-C) (4 and 5) The next step for the client is then to activate the URI (6 and

7) and get the content from the server (8 and 9) The mobile device will have to use a

ldquoPull Gatewayrdquo to get the content but it is very likely that this is the same one as the PPG

The same same scenario could be viewed in sequence diagram figure (42)

Push Initiator PPG SMS Center WAP client

Send push message

Send push message response

Send WAP push message

Ack

Send WAP push message

Ack

Message read

Ack

Message read

Ack

Result notification message

Result notification response

Figure 42 WAP push sequence diagram

Chapter 4 System Design

28

43 Modular Design

Conceptually we can envision this push system as consisting of three major components

(presented in the order of the push lifetime)

first there is a Push Initiator Program that reads the generates a notification message and

transmits (pushes) it via a WAP Gateway to the customer phone This message notifies

the user that a service is available if the user accepts will ask the phonersquos browser to pull

the page from our web server via the WAP Gateway

Next there is the Push Proxy Gateway PPG which will receive the push message from

the push initiator and is responsible of doing any needed optimization protocol

compilation and conversion Also it is responsibility of the PPG to find the end user

address and send the push message to the SMS center

Finally there is the SMS center which will do the last delivery of push message to the

intended user if the user were offline the message will be saved for later time until the

WAP client is on

PI PPGSMSC

Figure 43 system modules

Chapter 4 System Design

29

43 Design of system Modules

Following sections of this chapter present a description and design of the system modules

with accompanying graphical representation

431 Push Initiator (PI)

The PI is the first logical component in the WAP Push scenario and therefore the

originator of the push message There are different kinds of PIs One example is an

automated script another one is a semi automated server version written in an applicable

scripting language supporting server side interaction

A push message is sent as an HTTP POST to the Push Proxy Gateway The POST will be

a multipart XML document with the first part being the control entity (Push Access

Protocol) the second part being the content entity (either a Service Indication or a

Service Load) and the third part being the capability entity

HTTP Post

Capability entity

Content entity (SISL)

Control entity (PAP)

Figure 44 architecture of the push message

Chapter 4 System Design

30

4311 Control entity

This part of the push contains the basic information and fields The fields can include

recipient address expiry time bearer type delivery attempt time and a URL to which a

response is to be sent if delivery confirmation is requested by the push initiator

PAP is the protocol used in WAP Push framework for specifying control information and

content that is to be pushed to a client via a Push Proxy Gateway (PPG) A Push Initiator

(PI) triggers push message processing The Push initiator class (Appendix B) of this

design shows how to generate PAP messages

The address of the used PPG should be given as an initialization parameter of the

application (ldquoppg-urlrdquo see Appendix B) This design also provides an implementation

that can be used in a special case when ldquoIPv4 IPv6rdquo type client addressing is applied and

when toolkit is used All other cases including the use of phone numbers (ldquoPLMNrdquo type

address) in sending push messages are considered

The PAP XML contains at the minimum a ltpapgt element a ltpush-messagegt

element and an ltaddressgt element

The important parts of this PAP message are the address value and type The value is

typically a MSISDN and type indicates whether to send to a MSISDN (typical case) or to

an IP Address The TYPE is almost always MSISDN as the Push Initiator (PI) will not

typically have the Mobile Stations IP address - which is generally dynamic

4312 Content entity

This is the actual data that is received by the mobile device The various content types

are Service Indication (SI) Service Load (SL) and Cache Operation (CO) in our project

we will just deal with SI and SL

The SI notifies a client about an external event by inviting the client to interact with it In

other words it informs a client about a service More precisely it sends a message that

Chapter 4 System Design

31

informs the client of a Uniform Resource Identifier (URI) where the client can access the

service

An important attribute of SI is the action attribute it may contain the action to be taken

when the client receives the SI There are two groups that the action attributes can be

divided into

First we have delete and signalmdashnone both of them is used because of their side

effects Ie with delete you take away all SIs with the same si-id as the deletion pushrdquo

including itself and with signal-none you either do nothing or you pay regard to the

info element in that push

The other group consists of signal-low signal-medium and signal-high These

attributes are all used to set the rules for the presentation in the terminal device

o Signal-low

The SI must be postponed without user intervention

o Signal-medium

The SI must be presented as soon as the implementation allows that to be carried out

without disturbing the user (Signal-medium is the value that will be used if none is

specified)

o Signal-high

The SI must be presented as soon as the implementation allows that to be carried out

without disturbing the user or earlier if it seems appropriate (This decision may for

instance be based on user preference settings)

This is the different functionalities supported by the SI we concidered

Expiration

Replacement

Deletion

Chapter 4 System Design

32

Handling of out of order delivery

Handling of information specified in the info element

A PUSH Service Indication (SI) contains at a minimum an ltsigt element and a

ltindicationgt element SL donrsquot differ so much from SI

4313 Capability entity

This entity determines the type of mobile device that is to be served This is determined

by WAP user agent profiling The sender can indicate the hardware vendor and browser

version and type of the intended recipients This capability entity is then matched at the

PPG to see which devices are compatible with the requested capability If there is a

match the content is delivered by the PPG to that specific device

Now a day most devices are compatible with WAP so we donrsquot need to create this entity

more precisely it is optional

After the push has been created in the PI it is up to the system to deliver it to the defined

destination In this system the different responsible entities are the PPG and the SMSC

Both of these two different entities are running on same server but it is only the

configuration of the SMSC that is out of my control since it is run by the operator and is

not controllable in my lab environment

432 Push Proxy Gateway (PPG)

There are various commercial WAP gateways available on the market that are quite

expensive Kannel on the other hand is an open source gateway one doesnrsquot need to pay

for it in addition one can edit the source code himself and construct his own customized

gateway Because Kannel is being developed on Linux systems (RedHat and Debian) it

can be smoothly ported to other UNIX-like operating systems

4321 Kannel gateway architecture

The gateway divides the processing load between the following three hosts

Chapter 4 System Design

33

The bearer box which connects to the SMS (Short Message Service) centers and

or CSD (Circuit Switched Data) routers providing a unified interface to them for

the wapbox The bearer box does this by implementing the WDP (Wireless

Datagram Protocol) layer of the WAP stack

The smsbox implements the rest of the SMS gateway functionality It receives

textual SMS messages from the bearerbox and interprets them as service

requests and responds to them in the appropriate way

The wapbox which hosts the upper layers of the WAP stack Each session and its

transactions are handled by the same wapbox (see figure 35)

1Figure 45 divisions of duties in kannel

4322 Working of the gateway

The bearer box receives UDP (User Datagram Protocol) packets from CSD routers

inspects them to see whether they are WAP packets if so then it will routes them to the

WAP box This simple design allows the bearer box to do a minimum of processing per

smsbox

wapbox

bearerbox

Kannel

SMS center

WAP phone

HTTP server

Chapter 4 System Design

34

packet The bearer box also sends the UDP packets that the other boxes generate which

adds some more routing processing The wapboxes implement the WTP (Wireless

Transaction Protocol) and WSP (Wireless Session Protocol) layers These take HTTP-

like requests from the phones and make the actual HTTP requests to content servers

compress the responses and send them back to the terminals (Sessions are maintained to

make as much use of the limited radio bandwidth as possible)

4323 External interfaces of the gateway

The gateway has interfaces to three external agents

bull SMS centers using various protocols

bull HTTP servers to fetch WAP and SMS content and to push WAP Content The

pull protocol is HTTP push PAP

bull WAP phones implementing the WAP protocol stack and (for push) WAP Push

client

Figure 36 summarize kannel external interfaces

4324 Configuring the gateway

The bearerbox smsbox and wapbox are the main working modules of the gateway and

must be configured before configuring the gateway These three modules are controlled

by a configuration file that has wapbox smsbox and bearerbox groups

Configuring the PPG core group

We use two components the PPG core group and the PPG user group The PPG

core group is used to configure the PI interface(for more details configuration

variables refer to appendix c)

Chapter 4 System Design

35

Mobile telephone

network

The Internet

smsbox

wapbox

bearerbox

Kannel

HTTP

HTTP

HTTP server

Serving WML

files

HTTP server

Serving HTML

files

TCP

TCP

WAPSMS

SMSC

WAP phoneNetwork base station

Workstation used for http

administration

Figure 46 External interfaces of the gateway

4325 Administering the gateway through an HTTP interface

Kannel can be administered via an HTTP interface All commands are given as normal

HTTP queries so they can easily be given from command lines like this one

links -dump httpip-adressportshutdownpassword=yourchoice

But it is advantageous to have graphical user interface for gateway control so we have

designed GUI through http

Chapter 4 System Design

36

433 Short Message Service Centre (SMSC)

A SMSC is an essential component when sending a push message from an IP network to

a mobile device in the architecture supported by the components and devices It is used to

remove the TCPIP layer that the push is encapsulatedrdquo in It is also the entity that

identifies the end-point device When this is done it is also the SMSC that is responsible

for the processing and final message delivery to the device After the process of de-

encapsulation and resolution of the client identity there should not be any difference

between this message and a message that is originated locally from the operator itself

(like a SMS)

In this project we just use a virtual SMS center we try first to get connection to a real

one but our effort was worthless

Finally the following figure depicts the overall flowchart of the WAP push system

(figure 47)

Chapter 4 System Design

37

PI

PPG

Create PAP

HTTP Post

Message

processing

OTA

Connection

oriented

Sessionless Session

oriented

WTP Initiation

WAP clinet

Application

Create content

Create

capability

entity

Database

SMS center

NoYes

Figure 47 the complete flowchart of the system

38

Chapter Five

5 System implementation and results

51 Implementation

511 The Push Proxy Gateway

First of all the Kannel gateway have been compiled and installed using gcc (GNU C

Compiler) this stage go fine except the operating system required more components to

be pre-installed and will configured

Then with stages of configuration to the gateway (Appendix B) it was capable of working

as PPG Figure 51 below show the gateway when it starts

Figure 51 starting kannel gateway

Then a web based user interface had been created to provide an easy way to control the

gateway remotely Figure 52 and figure 53

39

Figure 52 GUI for gateway control

512 The Push initiator

Next the push initiator design had been implemented using java programming language

as in design phase the implementation is taken carefully to make a reusable component

that could be used by other developer

PushInitiator class (Appendix B) implements a simple push initiator which can be used

to create and send messages to a push proxy gateway (PPG)

The method sendPushMessage sends a push message via the PPG to the client The client

is identified by the address which is either the phone number (address type is PLMN) or

IP address The message content and its mime type are also given as arguments to the

method the other tow important method are

createPapMessage This method creates a Push Access Protocol (PAP) type message

40

createSiMessage This method is used to create a service indication (SI) type message

Figure 53 showing running kannel status

513 WAP site

Since this site will be built for testing purpose and making sure that the system is

functional we had not go deep in this section Just simple WAP site with tow page has

been crated

41

52 Service indication

When a SI was pushed to any of the emulator or Nokia phones it was received and

presented in the way it was supposed to as specified in the WAP standard as shown in

figures below This is a proof that the devices claiming to support WAP push do so and

the design is will working See figures 53 through 56

Figure 55 service indication

42

Figure 57 SI details

52 Service load

The emulator correctly receives and interpreted the SL push the same as all of Nokia

phones we have tested

When a SL was pushed to the Ericsson phones it was not presented in the specified way

figure 58 I think that it is because of security reasons The reason for this assumption is

that the phones only supports on or off as security in their push configuration The

emulator on the other hand presents SL correctly Finally the Siemens phone did seem to

interpret SL but the current software was not very consistent It did load the SL without

user interference in the specified way when the user already where having an active

session If the user was offline the phone interface presented a symbol on the display

and did not load the service until the user clicked on the symbol

43

Chapter Six

6 conclusion and future work

In this chapter we will provide the conclusions and proposed future work for interested

individuals

61 Conclusions

In this project a WAP push system has been successfully designed and implemented It

provides a way to partially overcome the limitations encountered when accessing the

World Wide Web using handsets After comparing the proposed project objectives with

those accomplished the main goals are seen to be met

Phones from different manufactures all differ from the WAP-standard in some

ways One of the most obvious differences is the resolution of the display

During the work it has been noticed that the WML pages must be quite small We

have also noticed that the support for tables and some other tags are a bit limited

Even though the WML standard is smaller than the HTML standard it is a little

more complicated to write correct WML pages The main conclusion is that WAP

works pretty well but the phones are a little non-stable

The push proxy gateway is configured and worked probably with virtual SMS

center and it is easy to switch to a real one

The system depends mainly on open sources (ie Linux and kannek)

The design and implementation of the push initiator work well with the kannel

gateway and it should work correctly with other gateways

Chapter 6 Conclusion

44

62 Further Work

The possibilities of wireless push are interesting enough that it has to be worth to know if

the security and conformance problems will be solved in WAP push If they are solved

and the technique is refined then there should be nothing to stop the great number of

services that will follow in its footsteps Therefore there is further work that should be

done and the most interesting parts are in my opinion these

621 Security Aspect

One of the problems today is that the phones supporting push does not have the detailed

security settings that a technique like this needs Therefore it would be interesting to look

into the possibility to add these without confusing the user I suggest furthering looking

into usability aspects of security in WAP Push for short

622 GPS integration possibility

This will provide location dependent delivery of WAP push it will have great

applications in telematic and ecommerce advertising

623 Conformance to Standards

An interesting project would be to examine if the main reason for the nonstandard

solutions in the existing WAP push software is the result of difficulties in

implementation Or if the main reason is that the manufacturers wants to provide

proprietary solutions A reason why one may want to know this is that if the problem is

depending on implementation problems then it might get better

45

Appendix A Abbreviations

CDMA Code Division Multiple Access

CO Cache Operation

DTD Document Type Definition

GSM Global System for Mobile

HTTP Hypertext Transfer Protocol

IP Internet Protocol

MSISDN Mobile Station International Subscriber Directory Number

OTA Over The Air

PAP Push Access Protocol

PushOTA Push Over The Air

PDA Personal Digital Assistant

P1 Push Initiator

PLMN Public Land Mobile Networks

PPG Push Proxy Gateway

SI Service Indication

SIA Session Initiation Application

SIR Session Initiation Request

SL Service Loading

SMPP Short Message Peer to Peer

SMS Short Message System

SMSC Short Message System Center

UCP Universal Computer Protocol

URI Uniform Resource Identifier

URL Uniform Resource Locator

UTC Universal Time Coordinated

WAP Wireless Application Protocol

WBXML WAP binary XML

WDP Wireless Datagram Protocol

WSP Wireless Session Protocol

WTLS Wireless Transport Layer Security

XML Extensible Mark-up Language

46

Appendix B Kannel gateway configurations

THIS IS A SAMPLE CONFIGURATION FOR KANNEL

group = core

admin-port = 13000

admin-password = admin

status-password = admin

admin-deny-ip =

admin-allow-ip = 127001172161455

log-file = tmpkannellog

log-level = 0

http-proxy-host = 172161411

http-proxy-port = 8080

http-proxy-exceptions = 127001

Smsbox related

smsbox-port = 13001

box-deny-ip =

box-allow-ip = 127001

bearerbox-host =localhost

Wapbox related

wapbox-port = 13002

udp-deny-ip =

udp-allow-ip = 127001

bearerbox-host =localhost

SMSC GSM

group = smsc

smsc = at

modemtype = auto

speed =9600

device = devttyS0

SMSC HTTP

group = smsc

smsc = http

system-type = kannel

port = 13016

connect-allow-ip = 127001

Appendix B

47

username = wappush

password = wappush

SMSBOX SETUP

group = smsbox

bearerbox-host = localhost

sendsms-port = 13013

sendsms-chars = 0123456789 +-

log-file = tmpsmsboxlog

log-level = 0

access-log = accesslog

white-list = 127001

black-list =

SEND-SMS USERS

group = sendsms-user

username = wappush

password = wappush

user-deny-ip =

user-allow-ip = 127001

PPG group

group = ppg

ppg-url = wappush

ppg-port = 8080

concurrent-pushes = 100

trusted-pi = true

users = 1024

service-name = ppg

ppg-smsbox-id = dlrbox

WAP PUSH USER

group = wap-push-user

wap-push-user = picom

ppg-username = wappush

ppg-password = wappush

allow-ip = localhost

48

Appendix C Selected Codes

Gateway Control Form

ltDOCTYPE HTML PUBLIC -W3CDTD HTML 32ENgt

lthtmlgt ltheadgt

lttitlegtGateway control formlttitlegt

ltheadgt

ltbody bgcolor=white text=black link=blue vlink=navy

alink=redgt

ltbase target=submitgt

ltscriptgt

function update_status()

if ( adminactionvalue == status )

adminaction = http + adminhostnamevalue +

+ adminportvalue + status +

adminstatusformatvalue

else

adminaction = http + adminhostnamevalue +

+ adminportvalue + + adminactionvalue

adminpasswordvalue = adminpasswordvalue

actiongovalue = GO GET +adminaction

ltscriptgt

lttable align=centergt

lttrgtltp align=centergtlth2gtGateway control

formlth2gtltpgtlttrgt

lttrgt lttdgtHostnamelttdgtlttdgtltinput type=text

name=adminhostname value=localhost

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPortlttdgtlttdgtltinput type=text

name=adminport value=13000

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPasswordlttdgtlttdgtltinput type=password

name=adminpassword value=

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtActionlttdgtlttdgtltselect name=adminaction

onChange=update_status()gt

ltoption value=statusgtStatusltoptiongt

ltoption value=suspendgtSuspendltoptiongt

ltoption value=isolategtIsolateltoptiongt

Appendix C

49

ltoption value=shutdowngtShutdownltoptiongt

ltoption value=resumegtResumeltoptiongt

ltselectgtlttdgt lttrgt

lttrgt lttdgtStatus Formatlttdgtlttdgtltselect

name=adminstatusformat onChange=update_status()gt

ltoption value=gthtmlltoptiongtltoption

value=txtgttxtltoptiongtltoption

value=xmlgtxmlltoptiongtltselectgtlttdgt lttrgt

ltform name=admin method=get

action=httplocalhost13000status

encoding=applicationx-www-formgt

ltinput type=hidden name=password value=gt

lttrgt

lttdgtGolttdgt

ltformgt

lttdgtltinput type=submit value=go name=actiongo

onClick=documentadminsubmit()gtlttdgt

lttrgt

lttablegt

ltbodygt

lthtmlgt

Push Initiator Class

import javanetURL

import javanetHttpURLConnection

import javaio

Class implements a simple push initiator It can be

used to create and send messages to push proxy

gateway (ppg)

public final class PushInitiator

xml version

private final static String XML_VERSION = ltxml

version=10gt

Push Access Protocol (PAP) document type

private final static String PAP_DOCTYPE =

Appendix C

50

ltDOCTYPE pap PUBLIC -WAPFORUMDTD PAP 10EN

httpwwwwapforumorgDTDpap_10dtd gt

content type of the push request multipart body

private final static String CONTENT_TYPE =

multipartrelated boundary=multipart-boundary

type=applicationxml

Service Indication (SI) document type

private static final String SI_DOCTYPE = ltDOCTYPE si

PUBLIC -WAPFORUMDTD SI 10EN +

httpwwwwapforumorgDTDsidtdgt

private static int pushId = 0

PPG url where the pap message is to be sent

private final URL ppgUrl

some push proxy gateways may also require the

authentication of the push initiator

For instance the push initiator may be required to

send an HTTP authorization header in each request

private final String authorization

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

public PushInitiator(URL ppgUrl) thisppgUrl =

ppgUrl

authorization = null

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

param authorization a ltcodegtStringltcodegt value

public PushInitiator(URL ppgUrl String authorization)

thisppgUrl = ppgUrl

Appendix C

51

thisauthorization = authorization

Systemoutprintln(Push Initiator created ppgUrl =

+ ppgUrl)

ltcodegtsendPushMessageltcodegt sends push message to

ppg

param clientAddress a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param message a ltcodegtStringltcodegt value

param mimeType a ltcodegtStringltcodegt value

exception Exception if an error occurs

public void sendPushMessage(String clientAddress

String addressTypeString message String mimeType)

throws Exception

HttpURLConnection http =

(HttpURLConnection)ppgUrlopenConnection()

String ppgServer = ppgUrlgetHost()

httpsetDoInput(true)

httpsetRequestProperty(Content-Type CONTENT_TYPE)

if(authorization = null)

if(authorizationtrim()equals())

httpsetRequestProperty(Authorization

authorization)

httpsetDoOutput(true)

PrintWriter out = new PrintWriter(new

BufferedOutputStream(httpgetOutputStream()))

outprintln(--multipart-boundary)

outprintln(Content-type applicationxml)

outprintln()

outprintln(createPapMessage(clientAddress

addressTypeppgServer genPushId() null))

outprintln()

outprintln(--multipart-boundary)

outprintln(Content-type + mimeType)

outprintln()

outprintln(message)

outprintln()

outprintln(--multipart-boundary--)

outflush()

outclose()

httpconnect()

Appendix C

52

finally read and debug the response received from

PPG

try

debugResponse(http)

catch (Exception e)

Systemerrprintln(Error in receiving the

response)

ltcodegtcreatePapMessageltcodegt creates a Push Access

Protocoltype message

param address a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param ppgServer a ltcodegtStringltcodegt value

param pushId a ltcodegtStringltcodegt value

param notificationTo a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createPapMessage(String address

String addressType String ppgServer String pushId

String notificationTo)

return XML_VERSION + n + PAP_DOCTYPE + n +

ltpap product-name=Mobile Zoo Push

Initiatorgtn +

ltpush-message push-id= + pushId +

(notificationTo = null request-notification-

to= + notificationTo ) + gtn +

ltaddress address-value=WAPPUSH= + address +

TYPE= + addressType +

+ ppgServer + gtn +

ltpush-messagegtnltpapgt

ltcodegtcreateSiMessageltcodegt creates a service

indication type message

param url a ltcodegtStringltcodegt value

param created a ltcodegtStringltcodegt value

param expires a ltcodegtStringltcodegt value

Appendix C

53

param message a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createSiMessage(String url

String sid String created String expires String

action String message)

return XML_VERSION + SI_DOCTYPE +

ltsigtn +

ltindication href= + url + +

(sid = null si-id= + sid + ) +

created = null created= + created +

) +

(action = null action= + action +

) +

(expires = null expires= + expires +

) + gt +

message +

ltindicationgtnltsigt

Debug response

param http a ltcodegtHttpURLConnectionltcodegt value

exception Exception if an error occurs

private void debugResponse(HttpURLConnection http)

throws Exception

Systemoutprintln(httpgetResponseMessage())

String headerName

int i=0

while((headerName = httpgetHeaderFieldKey(i++)) =

null)

Systemoutprintln(headerName + +

httpgetHeaderField(headerName))

Systemoutprintln()

InputStreamReader in = new InputStreamReader(new

BufferedInputStream(httpgetInputStream()))

int c

Appendix C

54

while((c = inread()) = -1)

Systemoutprint((char)c)

Systemoutprintln()

ltcodegtgenPushIdltcodegt generates an unique push id

return a ltcodegtStringltcodegt value

private String genPushId()

pushId = 100000

return SystemcurrentTimeMillis() + + pushId++

55

References

[1] Microsoft ldquoGetting Mobile Using WML and WAP to Display Web Sites on

Mobile Devicesrdquo

URL msdnmicrosoftcomen-uslibraryaa140117(office10)aspx accessed

on April 10 2008

[2] DALE BULBROOK ldquoWAPA Beginnerrsquos Guiderdquo OsborneMcGraw-Hill 2001

[3] WAP Forum Wireless Application Protocol Architecture Specification Access on

Jan 12 2008 Available

httpwww1wapforumorgtechdocumentsWAP-210-WAPArch-2006 07 12-apdf

[4] WAP Forum Push Architectural Overview access on (2008 February 3) Available

httpwww1wapforumorgtechdocumentsWAP-250-PushArchOverview-2007 04

03-apdf

[5] Service indication PDF access on 62008 Available

httpwwww3orgTRhtml401structlinkshtml

[6] WAP Push Technology (openwave) PDF access on (2008 April) Available

URL httpwwwopenwavorg

[7] Web site (httpwwwwapforumorgwhatcopyrighthtm) access on May 2008

[8] ldquoWAP Push Proxy Gateway Specificationrdquo WAP Forum access on 16-August-

2007URI httpwwwwapforumorgPDF

[9] WAP Forum Access on (2008 MAY 31) WAP Service Indication Specification

Available httpwww1wapforumorgtechdocumentsWAP-167-ServiceInd-200507

31-apdf

  • odc_fpwmlandwap_topic3
  • N100E3
  • 21
  • 5

Chapter 1 Introduction

3

14 Methodology

The WAP server will sit between the Internet and the wireless network and act as

gateway (ie push proxy gateway) between HTTP servers and WAP-enabled devices

HTTP servers serve up HTML documents These gateways have the ability to translate

HTML content into Wireless Markup Language the native format of the WAP browser

but the results are usually pretty poor Thus for better services and information to WAP

browsers one really needs to design WAPweb site to serve as content provider Finally

designing a push Initiator to process the WAPweb content and handle them to the PPG

The primary source of software packages is the open source software As the hole system

is to run on UNIX like system (ie various Linux distributions) The first critical task

investigated was the configuration of the GSM GPRS modem so to be able to act as

virtual SMSC from which the WAP gateway can reach a handset terminal

The open source Push Proxy Gateway (PPG) will be built on the base of the kannel

gateway and equipped with clients database ldquoMySqlrdquo to communicate with GSM

network through the previous modems which could be in the same PC with PPG or

connected to it via network The Push Initiator (PI) had been implemented using Java

programming language from sun Microsystems Finally Nokia toolkit emulator will be

used during project evolution as a testing environment for handheld

15 Thesis Layout

Chapter 2 presents the theoretical aspects of WAP which discuss the protocol

architecture and layering and the relationship to the web model Also the WAP push

framework will be presented

Chapter 3 brief description of hardware and software requirement plus the development

environment

Chapter 4 contains a description of what and how we do to develop a working WAP

push system This chapter is organized so that it starts with an overview and continues

Chapter 1 Introduction

4

with the description and design of all the parts starting with the creation of the push and

ending with the activation in the mobile device

Chapter 5 presents the rest stages of system development such as integration operation

and testing The results will be given in this chapter involved with the analysis

Chapter 6 gives conclusions of the project outcome and the recommendation for future

working

Appendix A list of abbreviations

Appendix B kannel gateway configurations

Appendix C selected codes from the system

5

2 Basic concepts

21 Literature review

The WAP Forum which creates and maintains the WAP specifications was founded in

June 1997 by Ericsson Nokia Motorola and Unwired Planet (later Phonecom later

Openwave Systems) The 10 specification was published in April 1998 but wasnrsquot

implemented in phones at that time The 11 specification came out in July 1999 and

was the first one to be implemented in publicly available phones 121 came out in June

2000 and phones implement it Work on WAP 20 is closing It will converge WAP with

Internet protocols and W3C markup languages [2]

During 2002 and 2003 the idea of WAP push began to get more concern from mobile

network operator In last four years companies began to develop push proxy gateway

unfortunately all of them were protected by taught copyright license This is what

encourages WAP developers and programmers to turn toward kannel which is an Open

Source WAPSMS gateway started by the Wapit Ltd company in June 1999 under

management of Lars Wirzenius later on it turn to the public [3]

In sudan zain (precedent Mobitel) initiated its WAP services for browsing internet on

2006 the same action taken by MTN (precedent areba) Early this year zain established

its WAP push service for emails named zmail

22 WAP architecture

WAP is a set of specifications for developing web-like applications that run over wireless

networks The basic aim of WAP is to provide a web-like experience on small portable

devices - like mobile phones and Personal Digital Assistance PDAs The WAP protocol

suite are analogous to many of those used in existing internet technology yet are

optimized for the challenges raised by small narrowband client devices (such as mobile

Chapter Two

Chapter 2 Basic Concepts

6

phones) and limited over-the-air bandwidthThe WAP Protocol suite covers both the

application level and the underlying transport layers The bearer level of WAP depends

on the type of mobile network It could be CSD SMS CDMA or any of a large number

of possible data carriers Whichever your target client is using the development above

remains the same WAP is designed in a layered fashion so that it can be extensible

flexible and scalable As a result the WAP protocol stack is divided into five layers (as

shown in Figure 21 below)

Wireless Application

Environment (WAE)

Wireless Session Protocol (WSP)

Wireless Transaction Layer Security (WTLS)

Wireless Transaction Protocol (WTP)

USSD CSD ETCSMSCDMA

Wireless Datagram Protocol (WDP)

Other Services and

Applications

Figure 21 Wireless Application Protocol architecture

Chapter 2 Basic Concepts

7

221 Application Layer Wireless Application Environment

The wireless application environment WAE is a standard for developing applications

and services that operate on wireless communication networks The WAE layer consists

of several parts wireless markup language binary XML wireless markup language

scripts and wireless telephony application [5]

2211 WML

Pages or services created using HTML do not work very well on small handheld devices

since they were specifically developed for use on desktop computers with larger color

screens Also low bandwidth wireless bearers wouldnrsquot be suitable for delivering the

large files that HTML pages often consist of Therefore a markup language specifically

adapted to these restrictions has been developedmdashWML

WML provides a navigation model for devices with small display screens and limited

input facilities (no mouse and a limited keyboard) In order to save valuable bandwidth in

the wireless network WML can be encoded into a compact binary format for

transmission between the phone and the network and vice-versa

WML uses uniform resource locators URLs in the following situations

o when specifying navigation eg hyperlinking

o when specifying external resources eg An image or a script

WML is an XML language with the same character sets as an XML document XML is

case-sensitive and therefore is also WML case-sensitive

WML is built on cards and decks A card is a one or more unit of user interaction eg a

choice menu a screen of text or a text entry field This means that the user navigates

through a series of WML cards reviews the contents of each enters requested

information makes choices and moves to another card Cards are grouped into decks [5]

Chapter 2 Basic Concepts

8

2212 WMLScript

WMLScript is a client-side scripting language It is very much like JavaScript which is

used on dynamic HTML(DHTML) web sites but WMLScript has been modified to fit

the currently severe limitations of the WAP environment and is in many ways restricted

compared to JavaScript

Client-side means that the code actually runs on the micro-browser itself The code is

downloaded to the WAP device as part of the deck so that when the code is executed it

does not have to make a trip back to the server to find out what to do next Everything the

application needs is right there Client-side functionality is therefore much faster in the

userrsquos perception

2213 Binary Extensible Markup Language

Binary XML is a compact binary representation of XML The binary XML is design to

reduce the transmission size of XML documents This allows more effective use of

narrow banded communication channels without any loss of functionality or semantic

information [5]

222 Session Layer Wireless Session Protocol

The wireless session protocol layer supports the wireless application environment with

two different session services The first is a connection mode service that operates above

a transaction layer protocol WTP and the second is a connection-less service that

operates above a datagram transport service WSP supports HTTP 11 functionality and

some new features These features include long-lived session a common facility for data

push capability negotiation and session suspendresume [5]

WSP provides support for exchange of content between clients and servers To support

the exchange the WSP establishes a reliable session negotiates on common capabilities

exchanges the data using compact encoding and releases the session The WSP also

supplies functionality to suspend and resume the session in order to save battery while

Chapter 2 Basic Concepts

9

the session is idle The WSP lifecycle is therefore not tied to the underlying transport

layer

WSP is a binary version of HTTP which includes both headers and data Binary

encoding is used to minimize the protocol overhead and to simplify decoding The header

is used to define content type character set encoding languages etc in an extensible

manner WSP supports two types of data transfers push and pull Pull transfer is used

when the client is sending a request and the server is sending a response In the push

mechanism the server pushes data to a client without prior request from the client

This can be done in three different ways Confirmed data can be pushed within an

existing session or non-confirmed data pushes can be done within or without an existing

session

223 Transaction Layer Wireless Transaction Protocol

The wireless transaction protocol WTP is defined to provide the services necessary for

sending requests responses and information WTP runs on top of a datagram service and

optionally a security service To ensure safe connection on top of the datagram layer the

WTP layer performs retransmissions sends acknowledgements and removes duplicated

messages In order to improve the connection efficiency WTP has no explicit connection

or teardown phases The layer also performs segmentation and reassembly to reduce the

number of packets sent

WTP has been defined as a transaction protocol that is suitable for mobile stations and

operates efficiently over wireless datagram networks Some benefits of using WTP are

that it improves reliability over datagram services improves efficiency over connection-

oriented services and that it is message oriented and designed for requestresponse

applications

The wireless transaction protocol is divided into three transaction services It can send

unreliable messages with no result message reliable messages with no result message or

reliable messages with exactly one result message

Chapter 2 Basic Concepts

10

Unreliable Messages With No Result Message

This service provides an unreliable datagram service The service can be used by

applications which occasionally want to send a datagram within an existing session

using WTP No acknowledgement or retransmission is done in this service

Reliable Messages With No Result Message

This service provides a reliable datagram service The service can be used by

applications that want to use a reliable push service The receiver acknowledges the

message and if the original sender receives no acknowledgement the message is

retransmitted

Reliable Messages With One Reliable Result Message

This service provides the basic invokeresponse transaction The receiver acknowledges

the message and if the original sender receives no acknowledgement the message is

retransmitted To confirm the reception of the acknowledgement the original sender

sends an acknowledgement to the receiver The three transactions are shown in next

figure

message message

acknowledge

message

confirm

Unreliable invoke

message with no

result message

Reliable invoke

message with no

result message

Reliable invoke

message with one

reliable result

message

a) b) c)

acknowledge

Figure 22 the three mode of transaction

Chapter 2 Basic Concepts

11

2231 Concatenation and Separation

To reduce the overhead caused by the datagram headers it is desirable to reduce the

number of packets sent over the air In order to reduce the number of messages several

protocol data units can be put into one single datagram This procedure is called the

concatenation procedure The reverse procedure is called the separation procedure [5]

Concatenation can be done when several packets are transported from the same sender to

the same receiver Concatenation can be done at any time The last acknowledgement can

be concatenated with the invoke message of the next transaction [5]

2232 Segmentation and Reassembly

If a packet is lager than the bearers largest capability the message can be segmented and

send in several packets To increase the communication efficiency message groups can be

acknowledged in groups [5]

To decrease the number of packets sent when a communication error occurs the receiver

can request one or multiple lost packets within a group of messages This is done instead

of resending the entire message which could mean that successfully received packets

have to be resent [5]

224 Security Layer Wireless Transport Layer Security

An Optional layer it is responsible for providing security data integrity and

authentication between two communicating applications The WTLS is optimized for low

bandwidth bearer networks with relatively long latency The WTLS is similar to the

Internet transport layer security TLS but has some new features such as datagram

support optimized handshake and dynamic key refreshing [5]

WTLS has been design to function on both connection-oriented and datagram transport

protocols The security layer acts above the transport layer

Chapter 2 Basic Concepts

12

2241 Service Primitives

WTLS uses primitives to ensure security The primitives are used to

Initiate a secure connection

Perform public-key authentication or key exchange with the client

Change into connection state when the handshake has been done

Terminate the connection

Inform the other end about warning level alerts

Request by the server that the client should initiate a new handshake

225 Transport Layer Wireless Datagram Protocol

The wireless datagram layer is a datagram service used by the upper layers WDP is

designed to communicate over different bearer services and especially for wireless

telecommunication networks [6] It Consists of

bull Source and destination address and port

bull Optionally fragmentation

It maps to UDP for IP bearer and moves single packets to and from the phone

226 WDP and IP

In networks with IP as the routing protocol UDP is used instead of WDP IP provides

segmentation and reassemble in a connection-less datagram service UDP provides port

based addressing and other necessary functions Thereby no additional functions are

required by a WDP layer [7]

227 Bearer Interfaces

WAP supports dial-up networking using IP and Point-to-Point Protocol (PPP) as the

bearer interface underneath WDP It also supports Short Message System (SMS) and

General Packet Radio System (GPRS) SMS passes text and binary data between digital

Chapter 2 Basic Concepts

13

phones GPRS is a relatively new technology that implements faster always-on

connections for wireless devices GPRS actually runs on top of IP [7]

As had been learned above WAP is quite similar to web figure 23 provide a brief

comparison between them

WAP

Bearer

WDP Dtatgram

WTLS security

WTP Transaction

WSP Session

WAE

WML and

WMLScript

Web

IP

TCP UDP

TLS-SSL

HTTP

HTML

JavaScript

VBscript

Figure 23 Web vs WAP

Chapter 2 Basic Concepts

14

23 SMS overview

SMS stands for Short Message Service It is a technology that enables the sending and

receiving of messages between mobile phones SMS first appeared in Europe in 1992 It

was included in the GSM (Global System for Mobile Communications) standards right at

the beginning Later it was ported to wireless technologies like CDMA and TDMA The

GSM and SMS standards were originally developed by ETSI ETSI is the abbreviation

for European Telecommunications Standards Institute Now the 3GPP (Third Generation

Partnership Project) is responsible for the development and maintenance of the GSM and

SMS standards [8]

SMS has two operational mode textual mode and binary mode which will allow sending

other data beside pure text

24 Push overview

WAP push provides a standard means to send data to a mobile subscriber without an

explicit request from the subscriber at the time the data is delivered In the normal

clientserver model a client requests a service or information from a server which then

responds by transmitting information to the client This is known as ldquopullrdquo technology

The client pulls information from the server The World Wide Web is the best example of

pull technology where a user enters a URL (the request) which is sent to a server and

the server answers by sending a Web page (the response) to the user (Figure 24 a)

Although WAP push is also based on the clientserver model it provides a means to send

data to the subscriber without an explicit request from the client at the time of delivery

(Figure 24 b)

With push functionality users are able to get information without having to request that

information In many cases it is important for the user to get the information as soon as it

is available Push communications can be used for sending stock quotes traffic reports

and news

Chapter 2 Basic Concepts

15

a) WAP pull model

b) WAP push model

Figure 24 Pull vs Push

24 WAP Push framework

A push operation starts when a server called the push initiator transmits a push messages

to a WAP client Since the push initiator located on the Internet does not use the same

protocol as the WAP client a translating gateway is needed The push initiator contacts

the push proxy gateway via the push access protocol and the Internet protocol The push

proxy gateway translates the information and forwards the pushed content to the WAP

device via the push over the air protocol (figure 25) [9]

Chapter 2 Basic Concepts

16

Push Proxy Gateway

WAP

Client

Push

Access Protocol

Push

over-the air

protocol Push Initiator

Figure 25 the wireless push technology

241 Push Proxy Gateway

The push proxy gateway PPG is the entity that does most of the work in the push

architecture The gateway acts as an access-point for content pushed from the Internet to

the client So the responsibility of the gateway owners to grant access to push proxy

gateway [9]

Besides the actual access-point service the push gateway provides the following services

push initiator identification and authentication

parsing and error detection of content control information

client discovery services

address resolution

binary encoding and compilation of certain content type

protocol conversion

Chapter 2 Basic Concepts

17

Information to the push proxy gateway is sent via the push access protocol PAP The

content of the information is divided into several parts were the first part is information to

the PPG such as recipient information

When the PPG has parsed the control information an acknowledgement is sent to the

push initiator reporting if the service was successful or not

Once the proxy has accepted the content and the push initiator has received the

acknowledgement the proxy is responsible for the transmission to the client The proxy

attempts to find the correct destination device and deliver the content to that client using

the push over the air protocol The contents delivered to the proxy may be translated to

their binary counterpart eg WML documents may be converted to binary XML by the

proxy before the information is transmitted to the client [9]

The proxy must implement a service to enable capability queries from the push initiator

The capability query should be responded with the capabilities of the specified WAP

device The push proxy gateway may also implement broadcasting services where

special addresses may be translated to a broadcast operation [9]

242 Push Access Protocol

The push access protocol PAP is the means by which an Internet-based push initiator

pushes content to a mobile network via the push proxy gateway [9] The push access

protocol is not intended for use over the air

PAP supports the following operations

Push submission

The push message sent from the push initiator to the gateway contains a control

entity a content entity and may contain a capability entity The control entity is

an XML document When the gateway has received the message an XML

response message is sent back to the initiator

Chapter 2 Basic Concepts

18

Result notification

If the push initiator has requested confirmation of successful delivery this XML

message is transmitted from the PPG to the push initiator when the content has

been delivered to the mobile device The push initiator acknowledges this result

message with another XML document

Push cancellation

The purpose of the push cancellation is to allow the push initiator to attempt to

cancel a previously submitted push message Both the cancellation message and

the resulting acknowledgement are sent as XML documents

Status query

The status query operation allows the push initiator to request the current status of

a message that has been previously submitted Both the status query message and

the resulting acknowledgement are sent as XML documents

Client capabilities query

This operation allows the push initiator to query the PPG for the capabilities of a

specific device The query is sent as an XML document and the response is sent

as another XML document

To access the push proxy gateway an address is used The gatewayrsquos underlying

protocols determines which type of address is used eg in HTTP a URL is used To

access a specific device the devicersquos address is included in the XML document

There are two ways to send information to several clients The push initiator can either

send information to several specific addresses or broadcast it to all clients In both cases

only one message is sent to the gateway which either sends the information to some or

all of the clients The clientsrsquo address is depending on the underlying layer [9]

Chapter 2 Basic Concepts

19

243 Push Over-The-Air Protocol

The push proxy gateway and the client communicate using the push over the air protocol

which utilizes WSP session services Pushes can be sent via connection oriented links or

connection-less links Connection-oriented pushes require that an active WSP session is

available but the server can not create a session To solve the case were there is no active

WSP session the push framework introduces a session initiation application in the client

This application listens to session requests from the OTA-server and responds by setting

up a WSP session for push purposes [9]

Push

Over-the air

WSP

Push management

premptive

Push operational

primitives

WSP Servise

Primitives

Figure 26 Push Over-The-Air protocol stack

The push over the air protocol supports two kinds of operations operations to manage the

connection and operations to send actual messages

Push Sends unconfirmed information over a connection-oriented link

Confirmed push Sends confirmed information over a connection-oriented link

Abort push rejects a previously transmitted push operation This is operation is

part of the confirmed push mechanism

Unit push Sends unconfirmed information over a connection-less link

Connect Creates a push session

Chapter 2 Basic Concepts

20

Suspend Request that a push session should be suspended

Resume Request to resumes a previously suspended push session

Disconnect Terminates the push session

Session request Request from the server to initialize a session to a client

244 Service Indication

The service indication SI provides a mechanism composed in an XML message to

notify a client that an external asynchronous event has occurred and indicate a service

that can be loaded in order to react to that event In order to notify the user a message is

sent from the push initiator via the proxy to the client The message will be shown to the

user and there will be a reference to a URI where the appropriate service can be loaded

For example the message could be ldquoYou have new mailrdquo and the URI to your email

service [9]

When the message is received by the client it will be presented to the user The user then

can choose to launch the service in an application eg the WML browser or to postpone

the SI for later handling Postponed SIs will be stored in the client and the user is given

the possibility to act upon them later When the user choose to launch the service the

service is started in the same way as if the user would have started it manually [9]

Messages sent with the service indication can support mechanisms to improve the end-

user-experience

User-intrusiveness levels

To improve the users understanding of the provided service and to affect the users

behavior when the message is delivered it is possible to change the level of user-

intrusiveness

Chapter 2 Basic Concepts

21

Deletion

When a pushed message becomes invalid the service provider can delete the

message in the clients For example an email notification becomes invalid when

the message are read

Replacement

When a pushed message is invalid and updated with a new message the service

provider can replace the origin message with a new one

Handling of out of order delivery

Since the wireless communication is unpredictable it can not be ensured that the

messages are received in the same order as sent This mechanism discards all

messages older than the latest received

Expiration

Some services may only be valid for a certain amount of time when the time has

expired the message is removed from the client

245 Service Loading

The service loading method provides means to convey a URI to a user agent in a mobile

client The method is conveyed in an XML message In difference from the service

indication method the client loads the content of the URI automatically without any

action from the user when the service loading message is received

Thereby the user will experience the content as if it was pushed to the mobile client and

executed In the service loading mechanism there is a reference to a service page that will

automatically be loaded without interaction with the user included For example the client

will automatically start the email service when a message about new mails on the server

is received [9]

Chapter 2 Basic Concepts

22

When the client is busy with some application it is not suitable to execute the referred

content directly upon reception of a message To avoid this client may cache the content

indicated by the URI so it becomes available to the user when the client is ready

Messages sent with the service loading method can support mechanism to improve the

end-user-experience

Control of the level of user interaction

To improve the users understanding of the provided service and the affect the

userrsquos behavior when the message is delivered it is possible to change the level

of user-intrusiveness The service can explicitly specify if the service should be

loaded or not if the client is busy on reception

Pre-emptive content caching

By setting this attribute the service loading can require that the indicated content

is downloaded and cached instead of executed This can be used to improve the

users experience of the services that otherwise would have required content to

be retrieved from an origin

23

Chapter Three

3 System requirements

Several materials and requirements must be incorporated into the design implementation

and testing The following discusses the components necessary to fulfill the project

requirements and environment

31 development environment

There are many development tools to choose from when developing for WAP Push and

hen you combine different environments with different gateways you will get a vast

numbers of choices This large flora of tools makes it difficult to choose a suitable

environment an important issue because a badly chosen one might consume a lot of time

341 Operating system

Kannel (the chosen gateway for the system) is being developed on Linux systems and

should be fairly easy to export to other Unix-like systems Although it should be working

without major problems on Windows (through Cygwin) Solaris and FreeBSD The push

initiator is implemented on java so it is operating system independent

Linux is the logical choice especially when it comes to the world severs and networking

for it promising feature as an open source low cost operating system

342 Programming language

Since system design was planned to be modular to enhance the reuse of its components as

explained above then an object oriented programming language will be a reasonable

choice Another factor is the need for a graphical user interface which imposes using a

programming language with good graphics handling capabilities at the same time it

should be over Linux

Chapter 3 System requirements

24

The best programming language to accomplish the above requirement is found to be java

which has the flowing feature

Cross platform - All clients and servers run the same Java code without any

changes or recompilation This simplifies deployment

Cost effective to develop in Java - The java language has many features that

improve developer productivity promote code reuse and reduce development and

maintenance costs

Works well with Open Source - Java with Linux and the many open source

movement projects and libraries provide a powerful mix that ensures development

is cost-effective efficient and of high quality because extensively tested libraries

components and solutions are available to plug-in to customer development

efforts

343 Nokia Mobile Internet Toolkit 41

To design and implement a WAP application on a Nokia phone the Nokia Internet

Toolkit has to be downloaded and installed on the PC A Nokia simulator is installed as

part of the installation but various phone simulators can be downloaded and installed

This simulator is used for testing purpose Also it has a server simulator based on the

Nokia Active Server if a WAP Gateway is unavailable

32 software requirements

Most of this section has been mentioned in way or other but they will be considered

briefly here

321 Kannel WAP gateway

This is an open source gateway upon which the push proxy gateway of this system will

be built on it available free of charge at kannel project web site

Chapter 3 System requirements

25

322 Linux operating system

It is important to install kannel gateway on it for this project we choose fedora core 7 for

availability reasons

323 JDK16

The java run time environment is required to implement the push initiator

32 hardware requirements

321 PC

Any Personal computer capable of running fedora core 7 with USB interface to be able

connects GSM modem

322 GSM modem

This will act as an alternative to the short message service center SMSC Obviously this

means that GSM network is required too

26

Chapter Four

4 System design

41 System Scenario

The basic scenario of a push session is that a Push Initiator (PI) transmits content to a

WAP client This is done in multiple steps as shown in Figure 31

pushOTAPAP

Gateway

PI

1

2

pull gateway

PPG

3

SMS center

Mobile device

6

5

4

Content provider78 9

Figure 41 WAP push scenario

Chapter 4 System Design

27

The PI communicates with a Push Proxy Gateway (PPG) over the Push Access Protocol

(PAP) (1 and 2) The PPG will then use the Push Over-The-Air Protocol (PushOTA) (3)

to deliver a Uniform Resource Identifier (URI) to the client via a Short Message System

Centre (SMS-C) (4 and 5) The next step for the client is then to activate the URI (6 and

7) and get the content from the server (8 and 9) The mobile device will have to use a

ldquoPull Gatewayrdquo to get the content but it is very likely that this is the same one as the PPG

The same same scenario could be viewed in sequence diagram figure (42)

Push Initiator PPG SMS Center WAP client

Send push message

Send push message response

Send WAP push message

Ack

Send WAP push message

Ack

Message read

Ack

Message read

Ack

Result notification message

Result notification response

Figure 42 WAP push sequence diagram

Chapter 4 System Design

28

43 Modular Design

Conceptually we can envision this push system as consisting of three major components

(presented in the order of the push lifetime)

first there is a Push Initiator Program that reads the generates a notification message and

transmits (pushes) it via a WAP Gateway to the customer phone This message notifies

the user that a service is available if the user accepts will ask the phonersquos browser to pull

the page from our web server via the WAP Gateway

Next there is the Push Proxy Gateway PPG which will receive the push message from

the push initiator and is responsible of doing any needed optimization protocol

compilation and conversion Also it is responsibility of the PPG to find the end user

address and send the push message to the SMS center

Finally there is the SMS center which will do the last delivery of push message to the

intended user if the user were offline the message will be saved for later time until the

WAP client is on

PI PPGSMSC

Figure 43 system modules

Chapter 4 System Design

29

43 Design of system Modules

Following sections of this chapter present a description and design of the system modules

with accompanying graphical representation

431 Push Initiator (PI)

The PI is the first logical component in the WAP Push scenario and therefore the

originator of the push message There are different kinds of PIs One example is an

automated script another one is a semi automated server version written in an applicable

scripting language supporting server side interaction

A push message is sent as an HTTP POST to the Push Proxy Gateway The POST will be

a multipart XML document with the first part being the control entity (Push Access

Protocol) the second part being the content entity (either a Service Indication or a

Service Load) and the third part being the capability entity

HTTP Post

Capability entity

Content entity (SISL)

Control entity (PAP)

Figure 44 architecture of the push message

Chapter 4 System Design

30

4311 Control entity

This part of the push contains the basic information and fields The fields can include

recipient address expiry time bearer type delivery attempt time and a URL to which a

response is to be sent if delivery confirmation is requested by the push initiator

PAP is the protocol used in WAP Push framework for specifying control information and

content that is to be pushed to a client via a Push Proxy Gateway (PPG) A Push Initiator

(PI) triggers push message processing The Push initiator class (Appendix B) of this

design shows how to generate PAP messages

The address of the used PPG should be given as an initialization parameter of the

application (ldquoppg-urlrdquo see Appendix B) This design also provides an implementation

that can be used in a special case when ldquoIPv4 IPv6rdquo type client addressing is applied and

when toolkit is used All other cases including the use of phone numbers (ldquoPLMNrdquo type

address) in sending push messages are considered

The PAP XML contains at the minimum a ltpapgt element a ltpush-messagegt

element and an ltaddressgt element

The important parts of this PAP message are the address value and type The value is

typically a MSISDN and type indicates whether to send to a MSISDN (typical case) or to

an IP Address The TYPE is almost always MSISDN as the Push Initiator (PI) will not

typically have the Mobile Stations IP address - which is generally dynamic

4312 Content entity

This is the actual data that is received by the mobile device The various content types

are Service Indication (SI) Service Load (SL) and Cache Operation (CO) in our project

we will just deal with SI and SL

The SI notifies a client about an external event by inviting the client to interact with it In

other words it informs a client about a service More precisely it sends a message that

Chapter 4 System Design

31

informs the client of a Uniform Resource Identifier (URI) where the client can access the

service

An important attribute of SI is the action attribute it may contain the action to be taken

when the client receives the SI There are two groups that the action attributes can be

divided into

First we have delete and signalmdashnone both of them is used because of their side

effects Ie with delete you take away all SIs with the same si-id as the deletion pushrdquo

including itself and with signal-none you either do nothing or you pay regard to the

info element in that push

The other group consists of signal-low signal-medium and signal-high These

attributes are all used to set the rules for the presentation in the terminal device

o Signal-low

The SI must be postponed without user intervention

o Signal-medium

The SI must be presented as soon as the implementation allows that to be carried out

without disturbing the user (Signal-medium is the value that will be used if none is

specified)

o Signal-high

The SI must be presented as soon as the implementation allows that to be carried out

without disturbing the user or earlier if it seems appropriate (This decision may for

instance be based on user preference settings)

This is the different functionalities supported by the SI we concidered

Expiration

Replacement

Deletion

Chapter 4 System Design

32

Handling of out of order delivery

Handling of information specified in the info element

A PUSH Service Indication (SI) contains at a minimum an ltsigt element and a

ltindicationgt element SL donrsquot differ so much from SI

4313 Capability entity

This entity determines the type of mobile device that is to be served This is determined

by WAP user agent profiling The sender can indicate the hardware vendor and browser

version and type of the intended recipients This capability entity is then matched at the

PPG to see which devices are compatible with the requested capability If there is a

match the content is delivered by the PPG to that specific device

Now a day most devices are compatible with WAP so we donrsquot need to create this entity

more precisely it is optional

After the push has been created in the PI it is up to the system to deliver it to the defined

destination In this system the different responsible entities are the PPG and the SMSC

Both of these two different entities are running on same server but it is only the

configuration of the SMSC that is out of my control since it is run by the operator and is

not controllable in my lab environment

432 Push Proxy Gateway (PPG)

There are various commercial WAP gateways available on the market that are quite

expensive Kannel on the other hand is an open source gateway one doesnrsquot need to pay

for it in addition one can edit the source code himself and construct his own customized

gateway Because Kannel is being developed on Linux systems (RedHat and Debian) it

can be smoothly ported to other UNIX-like operating systems

4321 Kannel gateway architecture

The gateway divides the processing load between the following three hosts

Chapter 4 System Design

33

The bearer box which connects to the SMS (Short Message Service) centers and

or CSD (Circuit Switched Data) routers providing a unified interface to them for

the wapbox The bearer box does this by implementing the WDP (Wireless

Datagram Protocol) layer of the WAP stack

The smsbox implements the rest of the SMS gateway functionality It receives

textual SMS messages from the bearerbox and interprets them as service

requests and responds to them in the appropriate way

The wapbox which hosts the upper layers of the WAP stack Each session and its

transactions are handled by the same wapbox (see figure 35)

1Figure 45 divisions of duties in kannel

4322 Working of the gateway

The bearer box receives UDP (User Datagram Protocol) packets from CSD routers

inspects them to see whether they are WAP packets if so then it will routes them to the

WAP box This simple design allows the bearer box to do a minimum of processing per

smsbox

wapbox

bearerbox

Kannel

SMS center

WAP phone

HTTP server

Chapter 4 System Design

34

packet The bearer box also sends the UDP packets that the other boxes generate which

adds some more routing processing The wapboxes implement the WTP (Wireless

Transaction Protocol) and WSP (Wireless Session Protocol) layers These take HTTP-

like requests from the phones and make the actual HTTP requests to content servers

compress the responses and send them back to the terminals (Sessions are maintained to

make as much use of the limited radio bandwidth as possible)

4323 External interfaces of the gateway

The gateway has interfaces to three external agents

bull SMS centers using various protocols

bull HTTP servers to fetch WAP and SMS content and to push WAP Content The

pull protocol is HTTP push PAP

bull WAP phones implementing the WAP protocol stack and (for push) WAP Push

client

Figure 36 summarize kannel external interfaces

4324 Configuring the gateway

The bearerbox smsbox and wapbox are the main working modules of the gateway and

must be configured before configuring the gateway These three modules are controlled

by a configuration file that has wapbox smsbox and bearerbox groups

Configuring the PPG core group

We use two components the PPG core group and the PPG user group The PPG

core group is used to configure the PI interface(for more details configuration

variables refer to appendix c)

Chapter 4 System Design

35

Mobile telephone

network

The Internet

smsbox

wapbox

bearerbox

Kannel

HTTP

HTTP

HTTP server

Serving WML

files

HTTP server

Serving HTML

files

TCP

TCP

WAPSMS

SMSC

WAP phoneNetwork base station

Workstation used for http

administration

Figure 46 External interfaces of the gateway

4325 Administering the gateway through an HTTP interface

Kannel can be administered via an HTTP interface All commands are given as normal

HTTP queries so they can easily be given from command lines like this one

links -dump httpip-adressportshutdownpassword=yourchoice

But it is advantageous to have graphical user interface for gateway control so we have

designed GUI through http

Chapter 4 System Design

36

433 Short Message Service Centre (SMSC)

A SMSC is an essential component when sending a push message from an IP network to

a mobile device in the architecture supported by the components and devices It is used to

remove the TCPIP layer that the push is encapsulatedrdquo in It is also the entity that

identifies the end-point device When this is done it is also the SMSC that is responsible

for the processing and final message delivery to the device After the process of de-

encapsulation and resolution of the client identity there should not be any difference

between this message and a message that is originated locally from the operator itself

(like a SMS)

In this project we just use a virtual SMS center we try first to get connection to a real

one but our effort was worthless

Finally the following figure depicts the overall flowchart of the WAP push system

(figure 47)

Chapter 4 System Design

37

PI

PPG

Create PAP

HTTP Post

Message

processing

OTA

Connection

oriented

Sessionless Session

oriented

WTP Initiation

WAP clinet

Application

Create content

Create

capability

entity

Database

SMS center

NoYes

Figure 47 the complete flowchart of the system

38

Chapter Five

5 System implementation and results

51 Implementation

511 The Push Proxy Gateway

First of all the Kannel gateway have been compiled and installed using gcc (GNU C

Compiler) this stage go fine except the operating system required more components to

be pre-installed and will configured

Then with stages of configuration to the gateway (Appendix B) it was capable of working

as PPG Figure 51 below show the gateway when it starts

Figure 51 starting kannel gateway

Then a web based user interface had been created to provide an easy way to control the

gateway remotely Figure 52 and figure 53

39

Figure 52 GUI for gateway control

512 The Push initiator

Next the push initiator design had been implemented using java programming language

as in design phase the implementation is taken carefully to make a reusable component

that could be used by other developer

PushInitiator class (Appendix B) implements a simple push initiator which can be used

to create and send messages to a push proxy gateway (PPG)

The method sendPushMessage sends a push message via the PPG to the client The client

is identified by the address which is either the phone number (address type is PLMN) or

IP address The message content and its mime type are also given as arguments to the

method the other tow important method are

createPapMessage This method creates a Push Access Protocol (PAP) type message

40

createSiMessage This method is used to create a service indication (SI) type message

Figure 53 showing running kannel status

513 WAP site

Since this site will be built for testing purpose and making sure that the system is

functional we had not go deep in this section Just simple WAP site with tow page has

been crated

41

52 Service indication

When a SI was pushed to any of the emulator or Nokia phones it was received and

presented in the way it was supposed to as specified in the WAP standard as shown in

figures below This is a proof that the devices claiming to support WAP push do so and

the design is will working See figures 53 through 56

Figure 55 service indication

42

Figure 57 SI details

52 Service load

The emulator correctly receives and interpreted the SL push the same as all of Nokia

phones we have tested

When a SL was pushed to the Ericsson phones it was not presented in the specified way

figure 58 I think that it is because of security reasons The reason for this assumption is

that the phones only supports on or off as security in their push configuration The

emulator on the other hand presents SL correctly Finally the Siemens phone did seem to

interpret SL but the current software was not very consistent It did load the SL without

user interference in the specified way when the user already where having an active

session If the user was offline the phone interface presented a symbol on the display

and did not load the service until the user clicked on the symbol

43

Chapter Six

6 conclusion and future work

In this chapter we will provide the conclusions and proposed future work for interested

individuals

61 Conclusions

In this project a WAP push system has been successfully designed and implemented It

provides a way to partially overcome the limitations encountered when accessing the

World Wide Web using handsets After comparing the proposed project objectives with

those accomplished the main goals are seen to be met

Phones from different manufactures all differ from the WAP-standard in some

ways One of the most obvious differences is the resolution of the display

During the work it has been noticed that the WML pages must be quite small We

have also noticed that the support for tables and some other tags are a bit limited

Even though the WML standard is smaller than the HTML standard it is a little

more complicated to write correct WML pages The main conclusion is that WAP

works pretty well but the phones are a little non-stable

The push proxy gateway is configured and worked probably with virtual SMS

center and it is easy to switch to a real one

The system depends mainly on open sources (ie Linux and kannek)

The design and implementation of the push initiator work well with the kannel

gateway and it should work correctly with other gateways

Chapter 6 Conclusion

44

62 Further Work

The possibilities of wireless push are interesting enough that it has to be worth to know if

the security and conformance problems will be solved in WAP push If they are solved

and the technique is refined then there should be nothing to stop the great number of

services that will follow in its footsteps Therefore there is further work that should be

done and the most interesting parts are in my opinion these

621 Security Aspect

One of the problems today is that the phones supporting push does not have the detailed

security settings that a technique like this needs Therefore it would be interesting to look

into the possibility to add these without confusing the user I suggest furthering looking

into usability aspects of security in WAP Push for short

622 GPS integration possibility

This will provide location dependent delivery of WAP push it will have great

applications in telematic and ecommerce advertising

623 Conformance to Standards

An interesting project would be to examine if the main reason for the nonstandard

solutions in the existing WAP push software is the result of difficulties in

implementation Or if the main reason is that the manufacturers wants to provide

proprietary solutions A reason why one may want to know this is that if the problem is

depending on implementation problems then it might get better

45

Appendix A Abbreviations

CDMA Code Division Multiple Access

CO Cache Operation

DTD Document Type Definition

GSM Global System for Mobile

HTTP Hypertext Transfer Protocol

IP Internet Protocol

MSISDN Mobile Station International Subscriber Directory Number

OTA Over The Air

PAP Push Access Protocol

PushOTA Push Over The Air

PDA Personal Digital Assistant

P1 Push Initiator

PLMN Public Land Mobile Networks

PPG Push Proxy Gateway

SI Service Indication

SIA Session Initiation Application

SIR Session Initiation Request

SL Service Loading

SMPP Short Message Peer to Peer

SMS Short Message System

SMSC Short Message System Center

UCP Universal Computer Protocol

URI Uniform Resource Identifier

URL Uniform Resource Locator

UTC Universal Time Coordinated

WAP Wireless Application Protocol

WBXML WAP binary XML

WDP Wireless Datagram Protocol

WSP Wireless Session Protocol

WTLS Wireless Transport Layer Security

XML Extensible Mark-up Language

46

Appendix B Kannel gateway configurations

THIS IS A SAMPLE CONFIGURATION FOR KANNEL

group = core

admin-port = 13000

admin-password = admin

status-password = admin

admin-deny-ip =

admin-allow-ip = 127001172161455

log-file = tmpkannellog

log-level = 0

http-proxy-host = 172161411

http-proxy-port = 8080

http-proxy-exceptions = 127001

Smsbox related

smsbox-port = 13001

box-deny-ip =

box-allow-ip = 127001

bearerbox-host =localhost

Wapbox related

wapbox-port = 13002

udp-deny-ip =

udp-allow-ip = 127001

bearerbox-host =localhost

SMSC GSM

group = smsc

smsc = at

modemtype = auto

speed =9600

device = devttyS0

SMSC HTTP

group = smsc

smsc = http

system-type = kannel

port = 13016

connect-allow-ip = 127001

Appendix B

47

username = wappush

password = wappush

SMSBOX SETUP

group = smsbox

bearerbox-host = localhost

sendsms-port = 13013

sendsms-chars = 0123456789 +-

log-file = tmpsmsboxlog

log-level = 0

access-log = accesslog

white-list = 127001

black-list =

SEND-SMS USERS

group = sendsms-user

username = wappush

password = wappush

user-deny-ip =

user-allow-ip = 127001

PPG group

group = ppg

ppg-url = wappush

ppg-port = 8080

concurrent-pushes = 100

trusted-pi = true

users = 1024

service-name = ppg

ppg-smsbox-id = dlrbox

WAP PUSH USER

group = wap-push-user

wap-push-user = picom

ppg-username = wappush

ppg-password = wappush

allow-ip = localhost

48

Appendix C Selected Codes

Gateway Control Form

ltDOCTYPE HTML PUBLIC -W3CDTD HTML 32ENgt

lthtmlgt ltheadgt

lttitlegtGateway control formlttitlegt

ltheadgt

ltbody bgcolor=white text=black link=blue vlink=navy

alink=redgt

ltbase target=submitgt

ltscriptgt

function update_status()

if ( adminactionvalue == status )

adminaction = http + adminhostnamevalue +

+ adminportvalue + status +

adminstatusformatvalue

else

adminaction = http + adminhostnamevalue +

+ adminportvalue + + adminactionvalue

adminpasswordvalue = adminpasswordvalue

actiongovalue = GO GET +adminaction

ltscriptgt

lttable align=centergt

lttrgtltp align=centergtlth2gtGateway control

formlth2gtltpgtlttrgt

lttrgt lttdgtHostnamelttdgtlttdgtltinput type=text

name=adminhostname value=localhost

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPortlttdgtlttdgtltinput type=text

name=adminport value=13000

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPasswordlttdgtlttdgtltinput type=password

name=adminpassword value=

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtActionlttdgtlttdgtltselect name=adminaction

onChange=update_status()gt

ltoption value=statusgtStatusltoptiongt

ltoption value=suspendgtSuspendltoptiongt

ltoption value=isolategtIsolateltoptiongt

Appendix C

49

ltoption value=shutdowngtShutdownltoptiongt

ltoption value=resumegtResumeltoptiongt

ltselectgtlttdgt lttrgt

lttrgt lttdgtStatus Formatlttdgtlttdgtltselect

name=adminstatusformat onChange=update_status()gt

ltoption value=gthtmlltoptiongtltoption

value=txtgttxtltoptiongtltoption

value=xmlgtxmlltoptiongtltselectgtlttdgt lttrgt

ltform name=admin method=get

action=httplocalhost13000status

encoding=applicationx-www-formgt

ltinput type=hidden name=password value=gt

lttrgt

lttdgtGolttdgt

ltformgt

lttdgtltinput type=submit value=go name=actiongo

onClick=documentadminsubmit()gtlttdgt

lttrgt

lttablegt

ltbodygt

lthtmlgt

Push Initiator Class

import javanetURL

import javanetHttpURLConnection

import javaio

Class implements a simple push initiator It can be

used to create and send messages to push proxy

gateway (ppg)

public final class PushInitiator

xml version

private final static String XML_VERSION = ltxml

version=10gt

Push Access Protocol (PAP) document type

private final static String PAP_DOCTYPE =

Appendix C

50

ltDOCTYPE pap PUBLIC -WAPFORUMDTD PAP 10EN

httpwwwwapforumorgDTDpap_10dtd gt

content type of the push request multipart body

private final static String CONTENT_TYPE =

multipartrelated boundary=multipart-boundary

type=applicationxml

Service Indication (SI) document type

private static final String SI_DOCTYPE = ltDOCTYPE si

PUBLIC -WAPFORUMDTD SI 10EN +

httpwwwwapforumorgDTDsidtdgt

private static int pushId = 0

PPG url where the pap message is to be sent

private final URL ppgUrl

some push proxy gateways may also require the

authentication of the push initiator

For instance the push initiator may be required to

send an HTTP authorization header in each request

private final String authorization

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

public PushInitiator(URL ppgUrl) thisppgUrl =

ppgUrl

authorization = null

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

param authorization a ltcodegtStringltcodegt value

public PushInitiator(URL ppgUrl String authorization)

thisppgUrl = ppgUrl

Appendix C

51

thisauthorization = authorization

Systemoutprintln(Push Initiator created ppgUrl =

+ ppgUrl)

ltcodegtsendPushMessageltcodegt sends push message to

ppg

param clientAddress a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param message a ltcodegtStringltcodegt value

param mimeType a ltcodegtStringltcodegt value

exception Exception if an error occurs

public void sendPushMessage(String clientAddress

String addressTypeString message String mimeType)

throws Exception

HttpURLConnection http =

(HttpURLConnection)ppgUrlopenConnection()

String ppgServer = ppgUrlgetHost()

httpsetDoInput(true)

httpsetRequestProperty(Content-Type CONTENT_TYPE)

if(authorization = null)

if(authorizationtrim()equals())

httpsetRequestProperty(Authorization

authorization)

httpsetDoOutput(true)

PrintWriter out = new PrintWriter(new

BufferedOutputStream(httpgetOutputStream()))

outprintln(--multipart-boundary)

outprintln(Content-type applicationxml)

outprintln()

outprintln(createPapMessage(clientAddress

addressTypeppgServer genPushId() null))

outprintln()

outprintln(--multipart-boundary)

outprintln(Content-type + mimeType)

outprintln()

outprintln(message)

outprintln()

outprintln(--multipart-boundary--)

outflush()

outclose()

httpconnect()

Appendix C

52

finally read and debug the response received from

PPG

try

debugResponse(http)

catch (Exception e)

Systemerrprintln(Error in receiving the

response)

ltcodegtcreatePapMessageltcodegt creates a Push Access

Protocoltype message

param address a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param ppgServer a ltcodegtStringltcodegt value

param pushId a ltcodegtStringltcodegt value

param notificationTo a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createPapMessage(String address

String addressType String ppgServer String pushId

String notificationTo)

return XML_VERSION + n + PAP_DOCTYPE + n +

ltpap product-name=Mobile Zoo Push

Initiatorgtn +

ltpush-message push-id= + pushId +

(notificationTo = null request-notification-

to= + notificationTo ) + gtn +

ltaddress address-value=WAPPUSH= + address +

TYPE= + addressType +

+ ppgServer + gtn +

ltpush-messagegtnltpapgt

ltcodegtcreateSiMessageltcodegt creates a service

indication type message

param url a ltcodegtStringltcodegt value

param created a ltcodegtStringltcodegt value

param expires a ltcodegtStringltcodegt value

Appendix C

53

param message a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createSiMessage(String url

String sid String created String expires String

action String message)

return XML_VERSION + SI_DOCTYPE +

ltsigtn +

ltindication href= + url + +

(sid = null si-id= + sid + ) +

created = null created= + created +

) +

(action = null action= + action +

) +

(expires = null expires= + expires +

) + gt +

message +

ltindicationgtnltsigt

Debug response

param http a ltcodegtHttpURLConnectionltcodegt value

exception Exception if an error occurs

private void debugResponse(HttpURLConnection http)

throws Exception

Systemoutprintln(httpgetResponseMessage())

String headerName

int i=0

while((headerName = httpgetHeaderFieldKey(i++)) =

null)

Systemoutprintln(headerName + +

httpgetHeaderField(headerName))

Systemoutprintln()

InputStreamReader in = new InputStreamReader(new

BufferedInputStream(httpgetInputStream()))

int c

Appendix C

54

while((c = inread()) = -1)

Systemoutprint((char)c)

Systemoutprintln()

ltcodegtgenPushIdltcodegt generates an unique push id

return a ltcodegtStringltcodegt value

private String genPushId()

pushId = 100000

return SystemcurrentTimeMillis() + + pushId++

55

References

[1] Microsoft ldquoGetting Mobile Using WML and WAP to Display Web Sites on

Mobile Devicesrdquo

URL msdnmicrosoftcomen-uslibraryaa140117(office10)aspx accessed

on April 10 2008

[2] DALE BULBROOK ldquoWAPA Beginnerrsquos Guiderdquo OsborneMcGraw-Hill 2001

[3] WAP Forum Wireless Application Protocol Architecture Specification Access on

Jan 12 2008 Available

httpwww1wapforumorgtechdocumentsWAP-210-WAPArch-2006 07 12-apdf

[4] WAP Forum Push Architectural Overview access on (2008 February 3) Available

httpwww1wapforumorgtechdocumentsWAP-250-PushArchOverview-2007 04

03-apdf

[5] Service indication PDF access on 62008 Available

httpwwww3orgTRhtml401structlinkshtml

[6] WAP Push Technology (openwave) PDF access on (2008 April) Available

URL httpwwwopenwavorg

[7] Web site (httpwwwwapforumorgwhatcopyrighthtm) access on May 2008

[8] ldquoWAP Push Proxy Gateway Specificationrdquo WAP Forum access on 16-August-

2007URI httpwwwwapforumorgPDF

[9] WAP Forum Access on (2008 MAY 31) WAP Service Indication Specification

Available httpwww1wapforumorgtechdocumentsWAP-167-ServiceInd-200507

31-apdf

  • odc_fpwmlandwap_topic3
  • N100E3
  • 21
  • 5

Chapter 1 Introduction

4

with the description and design of all the parts starting with the creation of the push and

ending with the activation in the mobile device

Chapter 5 presents the rest stages of system development such as integration operation

and testing The results will be given in this chapter involved with the analysis

Chapter 6 gives conclusions of the project outcome and the recommendation for future

working

Appendix A list of abbreviations

Appendix B kannel gateway configurations

Appendix C selected codes from the system

5

2 Basic concepts

21 Literature review

The WAP Forum which creates and maintains the WAP specifications was founded in

June 1997 by Ericsson Nokia Motorola and Unwired Planet (later Phonecom later

Openwave Systems) The 10 specification was published in April 1998 but wasnrsquot

implemented in phones at that time The 11 specification came out in July 1999 and

was the first one to be implemented in publicly available phones 121 came out in June

2000 and phones implement it Work on WAP 20 is closing It will converge WAP with

Internet protocols and W3C markup languages [2]

During 2002 and 2003 the idea of WAP push began to get more concern from mobile

network operator In last four years companies began to develop push proxy gateway

unfortunately all of them were protected by taught copyright license This is what

encourages WAP developers and programmers to turn toward kannel which is an Open

Source WAPSMS gateway started by the Wapit Ltd company in June 1999 under

management of Lars Wirzenius later on it turn to the public [3]

In sudan zain (precedent Mobitel) initiated its WAP services for browsing internet on

2006 the same action taken by MTN (precedent areba) Early this year zain established

its WAP push service for emails named zmail

22 WAP architecture

WAP is a set of specifications for developing web-like applications that run over wireless

networks The basic aim of WAP is to provide a web-like experience on small portable

devices - like mobile phones and Personal Digital Assistance PDAs The WAP protocol

suite are analogous to many of those used in existing internet technology yet are

optimized for the challenges raised by small narrowband client devices (such as mobile

Chapter Two

Chapter 2 Basic Concepts

6

phones) and limited over-the-air bandwidthThe WAP Protocol suite covers both the

application level and the underlying transport layers The bearer level of WAP depends

on the type of mobile network It could be CSD SMS CDMA or any of a large number

of possible data carriers Whichever your target client is using the development above

remains the same WAP is designed in a layered fashion so that it can be extensible

flexible and scalable As a result the WAP protocol stack is divided into five layers (as

shown in Figure 21 below)

Wireless Application

Environment (WAE)

Wireless Session Protocol (WSP)

Wireless Transaction Layer Security (WTLS)

Wireless Transaction Protocol (WTP)

USSD CSD ETCSMSCDMA

Wireless Datagram Protocol (WDP)

Other Services and

Applications

Figure 21 Wireless Application Protocol architecture

Chapter 2 Basic Concepts

7

221 Application Layer Wireless Application Environment

The wireless application environment WAE is a standard for developing applications

and services that operate on wireless communication networks The WAE layer consists

of several parts wireless markup language binary XML wireless markup language

scripts and wireless telephony application [5]

2211 WML

Pages or services created using HTML do not work very well on small handheld devices

since they were specifically developed for use on desktop computers with larger color

screens Also low bandwidth wireless bearers wouldnrsquot be suitable for delivering the

large files that HTML pages often consist of Therefore a markup language specifically

adapted to these restrictions has been developedmdashWML

WML provides a navigation model for devices with small display screens and limited

input facilities (no mouse and a limited keyboard) In order to save valuable bandwidth in

the wireless network WML can be encoded into a compact binary format for

transmission between the phone and the network and vice-versa

WML uses uniform resource locators URLs in the following situations

o when specifying navigation eg hyperlinking

o when specifying external resources eg An image or a script

WML is an XML language with the same character sets as an XML document XML is

case-sensitive and therefore is also WML case-sensitive

WML is built on cards and decks A card is a one or more unit of user interaction eg a

choice menu a screen of text or a text entry field This means that the user navigates

through a series of WML cards reviews the contents of each enters requested

information makes choices and moves to another card Cards are grouped into decks [5]

Chapter 2 Basic Concepts

8

2212 WMLScript

WMLScript is a client-side scripting language It is very much like JavaScript which is

used on dynamic HTML(DHTML) web sites but WMLScript has been modified to fit

the currently severe limitations of the WAP environment and is in many ways restricted

compared to JavaScript

Client-side means that the code actually runs on the micro-browser itself The code is

downloaded to the WAP device as part of the deck so that when the code is executed it

does not have to make a trip back to the server to find out what to do next Everything the

application needs is right there Client-side functionality is therefore much faster in the

userrsquos perception

2213 Binary Extensible Markup Language

Binary XML is a compact binary representation of XML The binary XML is design to

reduce the transmission size of XML documents This allows more effective use of

narrow banded communication channels without any loss of functionality or semantic

information [5]

222 Session Layer Wireless Session Protocol

The wireless session protocol layer supports the wireless application environment with

two different session services The first is a connection mode service that operates above

a transaction layer protocol WTP and the second is a connection-less service that

operates above a datagram transport service WSP supports HTTP 11 functionality and

some new features These features include long-lived session a common facility for data

push capability negotiation and session suspendresume [5]

WSP provides support for exchange of content between clients and servers To support

the exchange the WSP establishes a reliable session negotiates on common capabilities

exchanges the data using compact encoding and releases the session The WSP also

supplies functionality to suspend and resume the session in order to save battery while

Chapter 2 Basic Concepts

9

the session is idle The WSP lifecycle is therefore not tied to the underlying transport

layer

WSP is a binary version of HTTP which includes both headers and data Binary

encoding is used to minimize the protocol overhead and to simplify decoding The header

is used to define content type character set encoding languages etc in an extensible

manner WSP supports two types of data transfers push and pull Pull transfer is used

when the client is sending a request and the server is sending a response In the push

mechanism the server pushes data to a client without prior request from the client

This can be done in three different ways Confirmed data can be pushed within an

existing session or non-confirmed data pushes can be done within or without an existing

session

223 Transaction Layer Wireless Transaction Protocol

The wireless transaction protocol WTP is defined to provide the services necessary for

sending requests responses and information WTP runs on top of a datagram service and

optionally a security service To ensure safe connection on top of the datagram layer the

WTP layer performs retransmissions sends acknowledgements and removes duplicated

messages In order to improve the connection efficiency WTP has no explicit connection

or teardown phases The layer also performs segmentation and reassembly to reduce the

number of packets sent

WTP has been defined as a transaction protocol that is suitable for mobile stations and

operates efficiently over wireless datagram networks Some benefits of using WTP are

that it improves reliability over datagram services improves efficiency over connection-

oriented services and that it is message oriented and designed for requestresponse

applications

The wireless transaction protocol is divided into three transaction services It can send

unreliable messages with no result message reliable messages with no result message or

reliable messages with exactly one result message

Chapter 2 Basic Concepts

10

Unreliable Messages With No Result Message

This service provides an unreliable datagram service The service can be used by

applications which occasionally want to send a datagram within an existing session

using WTP No acknowledgement or retransmission is done in this service

Reliable Messages With No Result Message

This service provides a reliable datagram service The service can be used by

applications that want to use a reliable push service The receiver acknowledges the

message and if the original sender receives no acknowledgement the message is

retransmitted

Reliable Messages With One Reliable Result Message

This service provides the basic invokeresponse transaction The receiver acknowledges

the message and if the original sender receives no acknowledgement the message is

retransmitted To confirm the reception of the acknowledgement the original sender

sends an acknowledgement to the receiver The three transactions are shown in next

figure

message message

acknowledge

message

confirm

Unreliable invoke

message with no

result message

Reliable invoke

message with no

result message

Reliable invoke

message with one

reliable result

message

a) b) c)

acknowledge

Figure 22 the three mode of transaction

Chapter 2 Basic Concepts

11

2231 Concatenation and Separation

To reduce the overhead caused by the datagram headers it is desirable to reduce the

number of packets sent over the air In order to reduce the number of messages several

protocol data units can be put into one single datagram This procedure is called the

concatenation procedure The reverse procedure is called the separation procedure [5]

Concatenation can be done when several packets are transported from the same sender to

the same receiver Concatenation can be done at any time The last acknowledgement can

be concatenated with the invoke message of the next transaction [5]

2232 Segmentation and Reassembly

If a packet is lager than the bearers largest capability the message can be segmented and

send in several packets To increase the communication efficiency message groups can be

acknowledged in groups [5]

To decrease the number of packets sent when a communication error occurs the receiver

can request one or multiple lost packets within a group of messages This is done instead

of resending the entire message which could mean that successfully received packets

have to be resent [5]

224 Security Layer Wireless Transport Layer Security

An Optional layer it is responsible for providing security data integrity and

authentication between two communicating applications The WTLS is optimized for low

bandwidth bearer networks with relatively long latency The WTLS is similar to the

Internet transport layer security TLS but has some new features such as datagram

support optimized handshake and dynamic key refreshing [5]

WTLS has been design to function on both connection-oriented and datagram transport

protocols The security layer acts above the transport layer

Chapter 2 Basic Concepts

12

2241 Service Primitives

WTLS uses primitives to ensure security The primitives are used to

Initiate a secure connection

Perform public-key authentication or key exchange with the client

Change into connection state when the handshake has been done

Terminate the connection

Inform the other end about warning level alerts

Request by the server that the client should initiate a new handshake

225 Transport Layer Wireless Datagram Protocol

The wireless datagram layer is a datagram service used by the upper layers WDP is

designed to communicate over different bearer services and especially for wireless

telecommunication networks [6] It Consists of

bull Source and destination address and port

bull Optionally fragmentation

It maps to UDP for IP bearer and moves single packets to and from the phone

226 WDP and IP

In networks with IP as the routing protocol UDP is used instead of WDP IP provides

segmentation and reassemble in a connection-less datagram service UDP provides port

based addressing and other necessary functions Thereby no additional functions are

required by a WDP layer [7]

227 Bearer Interfaces

WAP supports dial-up networking using IP and Point-to-Point Protocol (PPP) as the

bearer interface underneath WDP It also supports Short Message System (SMS) and

General Packet Radio System (GPRS) SMS passes text and binary data between digital

Chapter 2 Basic Concepts

13

phones GPRS is a relatively new technology that implements faster always-on

connections for wireless devices GPRS actually runs on top of IP [7]

As had been learned above WAP is quite similar to web figure 23 provide a brief

comparison between them

WAP

Bearer

WDP Dtatgram

WTLS security

WTP Transaction

WSP Session

WAE

WML and

WMLScript

Web

IP

TCP UDP

TLS-SSL

HTTP

HTML

JavaScript

VBscript

Figure 23 Web vs WAP

Chapter 2 Basic Concepts

14

23 SMS overview

SMS stands for Short Message Service It is a technology that enables the sending and

receiving of messages between mobile phones SMS first appeared in Europe in 1992 It

was included in the GSM (Global System for Mobile Communications) standards right at

the beginning Later it was ported to wireless technologies like CDMA and TDMA The

GSM and SMS standards were originally developed by ETSI ETSI is the abbreviation

for European Telecommunications Standards Institute Now the 3GPP (Third Generation

Partnership Project) is responsible for the development and maintenance of the GSM and

SMS standards [8]

SMS has two operational mode textual mode and binary mode which will allow sending

other data beside pure text

24 Push overview

WAP push provides a standard means to send data to a mobile subscriber without an

explicit request from the subscriber at the time the data is delivered In the normal

clientserver model a client requests a service or information from a server which then

responds by transmitting information to the client This is known as ldquopullrdquo technology

The client pulls information from the server The World Wide Web is the best example of

pull technology where a user enters a URL (the request) which is sent to a server and

the server answers by sending a Web page (the response) to the user (Figure 24 a)

Although WAP push is also based on the clientserver model it provides a means to send

data to the subscriber without an explicit request from the client at the time of delivery

(Figure 24 b)

With push functionality users are able to get information without having to request that

information In many cases it is important for the user to get the information as soon as it

is available Push communications can be used for sending stock quotes traffic reports

and news

Chapter 2 Basic Concepts

15

a) WAP pull model

b) WAP push model

Figure 24 Pull vs Push

24 WAP Push framework

A push operation starts when a server called the push initiator transmits a push messages

to a WAP client Since the push initiator located on the Internet does not use the same

protocol as the WAP client a translating gateway is needed The push initiator contacts

the push proxy gateway via the push access protocol and the Internet protocol The push

proxy gateway translates the information and forwards the pushed content to the WAP

device via the push over the air protocol (figure 25) [9]

Chapter 2 Basic Concepts

16

Push Proxy Gateway

WAP

Client

Push

Access Protocol

Push

over-the air

protocol Push Initiator

Figure 25 the wireless push technology

241 Push Proxy Gateway

The push proxy gateway PPG is the entity that does most of the work in the push

architecture The gateway acts as an access-point for content pushed from the Internet to

the client So the responsibility of the gateway owners to grant access to push proxy

gateway [9]

Besides the actual access-point service the push gateway provides the following services

push initiator identification and authentication

parsing and error detection of content control information

client discovery services

address resolution

binary encoding and compilation of certain content type

protocol conversion

Chapter 2 Basic Concepts

17

Information to the push proxy gateway is sent via the push access protocol PAP The

content of the information is divided into several parts were the first part is information to

the PPG such as recipient information

When the PPG has parsed the control information an acknowledgement is sent to the

push initiator reporting if the service was successful or not

Once the proxy has accepted the content and the push initiator has received the

acknowledgement the proxy is responsible for the transmission to the client The proxy

attempts to find the correct destination device and deliver the content to that client using

the push over the air protocol The contents delivered to the proxy may be translated to

their binary counterpart eg WML documents may be converted to binary XML by the

proxy before the information is transmitted to the client [9]

The proxy must implement a service to enable capability queries from the push initiator

The capability query should be responded with the capabilities of the specified WAP

device The push proxy gateway may also implement broadcasting services where

special addresses may be translated to a broadcast operation [9]

242 Push Access Protocol

The push access protocol PAP is the means by which an Internet-based push initiator

pushes content to a mobile network via the push proxy gateway [9] The push access

protocol is not intended for use over the air

PAP supports the following operations

Push submission

The push message sent from the push initiator to the gateway contains a control

entity a content entity and may contain a capability entity The control entity is

an XML document When the gateway has received the message an XML

response message is sent back to the initiator

Chapter 2 Basic Concepts

18

Result notification

If the push initiator has requested confirmation of successful delivery this XML

message is transmitted from the PPG to the push initiator when the content has

been delivered to the mobile device The push initiator acknowledges this result

message with another XML document

Push cancellation

The purpose of the push cancellation is to allow the push initiator to attempt to

cancel a previously submitted push message Both the cancellation message and

the resulting acknowledgement are sent as XML documents

Status query

The status query operation allows the push initiator to request the current status of

a message that has been previously submitted Both the status query message and

the resulting acknowledgement are sent as XML documents

Client capabilities query

This operation allows the push initiator to query the PPG for the capabilities of a

specific device The query is sent as an XML document and the response is sent

as another XML document

To access the push proxy gateway an address is used The gatewayrsquos underlying

protocols determines which type of address is used eg in HTTP a URL is used To

access a specific device the devicersquos address is included in the XML document

There are two ways to send information to several clients The push initiator can either

send information to several specific addresses or broadcast it to all clients In both cases

only one message is sent to the gateway which either sends the information to some or

all of the clients The clientsrsquo address is depending on the underlying layer [9]

Chapter 2 Basic Concepts

19

243 Push Over-The-Air Protocol

The push proxy gateway and the client communicate using the push over the air protocol

which utilizes WSP session services Pushes can be sent via connection oriented links or

connection-less links Connection-oriented pushes require that an active WSP session is

available but the server can not create a session To solve the case were there is no active

WSP session the push framework introduces a session initiation application in the client

This application listens to session requests from the OTA-server and responds by setting

up a WSP session for push purposes [9]

Push

Over-the air

WSP

Push management

premptive

Push operational

primitives

WSP Servise

Primitives

Figure 26 Push Over-The-Air protocol stack

The push over the air protocol supports two kinds of operations operations to manage the

connection and operations to send actual messages

Push Sends unconfirmed information over a connection-oriented link

Confirmed push Sends confirmed information over a connection-oriented link

Abort push rejects a previously transmitted push operation This is operation is

part of the confirmed push mechanism

Unit push Sends unconfirmed information over a connection-less link

Connect Creates a push session

Chapter 2 Basic Concepts

20

Suspend Request that a push session should be suspended

Resume Request to resumes a previously suspended push session

Disconnect Terminates the push session

Session request Request from the server to initialize a session to a client

244 Service Indication

The service indication SI provides a mechanism composed in an XML message to

notify a client that an external asynchronous event has occurred and indicate a service

that can be loaded in order to react to that event In order to notify the user a message is

sent from the push initiator via the proxy to the client The message will be shown to the

user and there will be a reference to a URI where the appropriate service can be loaded

For example the message could be ldquoYou have new mailrdquo and the URI to your email

service [9]

When the message is received by the client it will be presented to the user The user then

can choose to launch the service in an application eg the WML browser or to postpone

the SI for later handling Postponed SIs will be stored in the client and the user is given

the possibility to act upon them later When the user choose to launch the service the

service is started in the same way as if the user would have started it manually [9]

Messages sent with the service indication can support mechanisms to improve the end-

user-experience

User-intrusiveness levels

To improve the users understanding of the provided service and to affect the users

behavior when the message is delivered it is possible to change the level of user-

intrusiveness

Chapter 2 Basic Concepts

21

Deletion

When a pushed message becomes invalid the service provider can delete the

message in the clients For example an email notification becomes invalid when

the message are read

Replacement

When a pushed message is invalid and updated with a new message the service

provider can replace the origin message with a new one

Handling of out of order delivery

Since the wireless communication is unpredictable it can not be ensured that the

messages are received in the same order as sent This mechanism discards all

messages older than the latest received

Expiration

Some services may only be valid for a certain amount of time when the time has

expired the message is removed from the client

245 Service Loading

The service loading method provides means to convey a URI to a user agent in a mobile

client The method is conveyed in an XML message In difference from the service

indication method the client loads the content of the URI automatically without any

action from the user when the service loading message is received

Thereby the user will experience the content as if it was pushed to the mobile client and

executed In the service loading mechanism there is a reference to a service page that will

automatically be loaded without interaction with the user included For example the client

will automatically start the email service when a message about new mails on the server

is received [9]

Chapter 2 Basic Concepts

22

When the client is busy with some application it is not suitable to execute the referred

content directly upon reception of a message To avoid this client may cache the content

indicated by the URI so it becomes available to the user when the client is ready

Messages sent with the service loading method can support mechanism to improve the

end-user-experience

Control of the level of user interaction

To improve the users understanding of the provided service and the affect the

userrsquos behavior when the message is delivered it is possible to change the level

of user-intrusiveness The service can explicitly specify if the service should be

loaded or not if the client is busy on reception

Pre-emptive content caching

By setting this attribute the service loading can require that the indicated content

is downloaded and cached instead of executed This can be used to improve the

users experience of the services that otherwise would have required content to

be retrieved from an origin

23

Chapter Three

3 System requirements

Several materials and requirements must be incorporated into the design implementation

and testing The following discusses the components necessary to fulfill the project

requirements and environment

31 development environment

There are many development tools to choose from when developing for WAP Push and

hen you combine different environments with different gateways you will get a vast

numbers of choices This large flora of tools makes it difficult to choose a suitable

environment an important issue because a badly chosen one might consume a lot of time

341 Operating system

Kannel (the chosen gateway for the system) is being developed on Linux systems and

should be fairly easy to export to other Unix-like systems Although it should be working

without major problems on Windows (through Cygwin) Solaris and FreeBSD The push

initiator is implemented on java so it is operating system independent

Linux is the logical choice especially when it comes to the world severs and networking

for it promising feature as an open source low cost operating system

342 Programming language

Since system design was planned to be modular to enhance the reuse of its components as

explained above then an object oriented programming language will be a reasonable

choice Another factor is the need for a graphical user interface which imposes using a

programming language with good graphics handling capabilities at the same time it

should be over Linux

Chapter 3 System requirements

24

The best programming language to accomplish the above requirement is found to be java

which has the flowing feature

Cross platform - All clients and servers run the same Java code without any

changes or recompilation This simplifies deployment

Cost effective to develop in Java - The java language has many features that

improve developer productivity promote code reuse and reduce development and

maintenance costs

Works well with Open Source - Java with Linux and the many open source

movement projects and libraries provide a powerful mix that ensures development

is cost-effective efficient and of high quality because extensively tested libraries

components and solutions are available to plug-in to customer development

efforts

343 Nokia Mobile Internet Toolkit 41

To design and implement a WAP application on a Nokia phone the Nokia Internet

Toolkit has to be downloaded and installed on the PC A Nokia simulator is installed as

part of the installation but various phone simulators can be downloaded and installed

This simulator is used for testing purpose Also it has a server simulator based on the

Nokia Active Server if a WAP Gateway is unavailable

32 software requirements

Most of this section has been mentioned in way or other but they will be considered

briefly here

321 Kannel WAP gateway

This is an open source gateway upon which the push proxy gateway of this system will

be built on it available free of charge at kannel project web site

Chapter 3 System requirements

25

322 Linux operating system

It is important to install kannel gateway on it for this project we choose fedora core 7 for

availability reasons

323 JDK16

The java run time environment is required to implement the push initiator

32 hardware requirements

321 PC

Any Personal computer capable of running fedora core 7 with USB interface to be able

connects GSM modem

322 GSM modem

This will act as an alternative to the short message service center SMSC Obviously this

means that GSM network is required too

26

Chapter Four

4 System design

41 System Scenario

The basic scenario of a push session is that a Push Initiator (PI) transmits content to a

WAP client This is done in multiple steps as shown in Figure 31

pushOTAPAP

Gateway

PI

1

2

pull gateway

PPG

3

SMS center

Mobile device

6

5

4

Content provider78 9

Figure 41 WAP push scenario

Chapter 4 System Design

27

The PI communicates with a Push Proxy Gateway (PPG) over the Push Access Protocol

(PAP) (1 and 2) The PPG will then use the Push Over-The-Air Protocol (PushOTA) (3)

to deliver a Uniform Resource Identifier (URI) to the client via a Short Message System

Centre (SMS-C) (4 and 5) The next step for the client is then to activate the URI (6 and

7) and get the content from the server (8 and 9) The mobile device will have to use a

ldquoPull Gatewayrdquo to get the content but it is very likely that this is the same one as the PPG

The same same scenario could be viewed in sequence diagram figure (42)

Push Initiator PPG SMS Center WAP client

Send push message

Send push message response

Send WAP push message

Ack

Send WAP push message

Ack

Message read

Ack

Message read

Ack

Result notification message

Result notification response

Figure 42 WAP push sequence diagram

Chapter 4 System Design

28

43 Modular Design

Conceptually we can envision this push system as consisting of three major components

(presented in the order of the push lifetime)

first there is a Push Initiator Program that reads the generates a notification message and

transmits (pushes) it via a WAP Gateway to the customer phone This message notifies

the user that a service is available if the user accepts will ask the phonersquos browser to pull

the page from our web server via the WAP Gateway

Next there is the Push Proxy Gateway PPG which will receive the push message from

the push initiator and is responsible of doing any needed optimization protocol

compilation and conversion Also it is responsibility of the PPG to find the end user

address and send the push message to the SMS center

Finally there is the SMS center which will do the last delivery of push message to the

intended user if the user were offline the message will be saved for later time until the

WAP client is on

PI PPGSMSC

Figure 43 system modules

Chapter 4 System Design

29

43 Design of system Modules

Following sections of this chapter present a description and design of the system modules

with accompanying graphical representation

431 Push Initiator (PI)

The PI is the first logical component in the WAP Push scenario and therefore the

originator of the push message There are different kinds of PIs One example is an

automated script another one is a semi automated server version written in an applicable

scripting language supporting server side interaction

A push message is sent as an HTTP POST to the Push Proxy Gateway The POST will be

a multipart XML document with the first part being the control entity (Push Access

Protocol) the second part being the content entity (either a Service Indication or a

Service Load) and the third part being the capability entity

HTTP Post

Capability entity

Content entity (SISL)

Control entity (PAP)

Figure 44 architecture of the push message

Chapter 4 System Design

30

4311 Control entity

This part of the push contains the basic information and fields The fields can include

recipient address expiry time bearer type delivery attempt time and a URL to which a

response is to be sent if delivery confirmation is requested by the push initiator

PAP is the protocol used in WAP Push framework for specifying control information and

content that is to be pushed to a client via a Push Proxy Gateway (PPG) A Push Initiator

(PI) triggers push message processing The Push initiator class (Appendix B) of this

design shows how to generate PAP messages

The address of the used PPG should be given as an initialization parameter of the

application (ldquoppg-urlrdquo see Appendix B) This design also provides an implementation

that can be used in a special case when ldquoIPv4 IPv6rdquo type client addressing is applied and

when toolkit is used All other cases including the use of phone numbers (ldquoPLMNrdquo type

address) in sending push messages are considered

The PAP XML contains at the minimum a ltpapgt element a ltpush-messagegt

element and an ltaddressgt element

The important parts of this PAP message are the address value and type The value is

typically a MSISDN and type indicates whether to send to a MSISDN (typical case) or to

an IP Address The TYPE is almost always MSISDN as the Push Initiator (PI) will not

typically have the Mobile Stations IP address - which is generally dynamic

4312 Content entity

This is the actual data that is received by the mobile device The various content types

are Service Indication (SI) Service Load (SL) and Cache Operation (CO) in our project

we will just deal with SI and SL

The SI notifies a client about an external event by inviting the client to interact with it In

other words it informs a client about a service More precisely it sends a message that

Chapter 4 System Design

31

informs the client of a Uniform Resource Identifier (URI) where the client can access the

service

An important attribute of SI is the action attribute it may contain the action to be taken

when the client receives the SI There are two groups that the action attributes can be

divided into

First we have delete and signalmdashnone both of them is used because of their side

effects Ie with delete you take away all SIs with the same si-id as the deletion pushrdquo

including itself and with signal-none you either do nothing or you pay regard to the

info element in that push

The other group consists of signal-low signal-medium and signal-high These

attributes are all used to set the rules for the presentation in the terminal device

o Signal-low

The SI must be postponed without user intervention

o Signal-medium

The SI must be presented as soon as the implementation allows that to be carried out

without disturbing the user (Signal-medium is the value that will be used if none is

specified)

o Signal-high

The SI must be presented as soon as the implementation allows that to be carried out

without disturbing the user or earlier if it seems appropriate (This decision may for

instance be based on user preference settings)

This is the different functionalities supported by the SI we concidered

Expiration

Replacement

Deletion

Chapter 4 System Design

32

Handling of out of order delivery

Handling of information specified in the info element

A PUSH Service Indication (SI) contains at a minimum an ltsigt element and a

ltindicationgt element SL donrsquot differ so much from SI

4313 Capability entity

This entity determines the type of mobile device that is to be served This is determined

by WAP user agent profiling The sender can indicate the hardware vendor and browser

version and type of the intended recipients This capability entity is then matched at the

PPG to see which devices are compatible with the requested capability If there is a

match the content is delivered by the PPG to that specific device

Now a day most devices are compatible with WAP so we donrsquot need to create this entity

more precisely it is optional

After the push has been created in the PI it is up to the system to deliver it to the defined

destination In this system the different responsible entities are the PPG and the SMSC

Both of these two different entities are running on same server but it is only the

configuration of the SMSC that is out of my control since it is run by the operator and is

not controllable in my lab environment

432 Push Proxy Gateway (PPG)

There are various commercial WAP gateways available on the market that are quite

expensive Kannel on the other hand is an open source gateway one doesnrsquot need to pay

for it in addition one can edit the source code himself and construct his own customized

gateway Because Kannel is being developed on Linux systems (RedHat and Debian) it

can be smoothly ported to other UNIX-like operating systems

4321 Kannel gateway architecture

The gateway divides the processing load between the following three hosts

Chapter 4 System Design

33

The bearer box which connects to the SMS (Short Message Service) centers and

or CSD (Circuit Switched Data) routers providing a unified interface to them for

the wapbox The bearer box does this by implementing the WDP (Wireless

Datagram Protocol) layer of the WAP stack

The smsbox implements the rest of the SMS gateway functionality It receives

textual SMS messages from the bearerbox and interprets them as service

requests and responds to them in the appropriate way

The wapbox which hosts the upper layers of the WAP stack Each session and its

transactions are handled by the same wapbox (see figure 35)

1Figure 45 divisions of duties in kannel

4322 Working of the gateway

The bearer box receives UDP (User Datagram Protocol) packets from CSD routers

inspects them to see whether they are WAP packets if so then it will routes them to the

WAP box This simple design allows the bearer box to do a minimum of processing per

smsbox

wapbox

bearerbox

Kannel

SMS center

WAP phone

HTTP server

Chapter 4 System Design

34

packet The bearer box also sends the UDP packets that the other boxes generate which

adds some more routing processing The wapboxes implement the WTP (Wireless

Transaction Protocol) and WSP (Wireless Session Protocol) layers These take HTTP-

like requests from the phones and make the actual HTTP requests to content servers

compress the responses and send them back to the terminals (Sessions are maintained to

make as much use of the limited radio bandwidth as possible)

4323 External interfaces of the gateway

The gateway has interfaces to three external agents

bull SMS centers using various protocols

bull HTTP servers to fetch WAP and SMS content and to push WAP Content The

pull protocol is HTTP push PAP

bull WAP phones implementing the WAP protocol stack and (for push) WAP Push

client

Figure 36 summarize kannel external interfaces

4324 Configuring the gateway

The bearerbox smsbox and wapbox are the main working modules of the gateway and

must be configured before configuring the gateway These three modules are controlled

by a configuration file that has wapbox smsbox and bearerbox groups

Configuring the PPG core group

We use two components the PPG core group and the PPG user group The PPG

core group is used to configure the PI interface(for more details configuration

variables refer to appendix c)

Chapter 4 System Design

35

Mobile telephone

network

The Internet

smsbox

wapbox

bearerbox

Kannel

HTTP

HTTP

HTTP server

Serving WML

files

HTTP server

Serving HTML

files

TCP

TCP

WAPSMS

SMSC

WAP phoneNetwork base station

Workstation used for http

administration

Figure 46 External interfaces of the gateway

4325 Administering the gateway through an HTTP interface

Kannel can be administered via an HTTP interface All commands are given as normal

HTTP queries so they can easily be given from command lines like this one

links -dump httpip-adressportshutdownpassword=yourchoice

But it is advantageous to have graphical user interface for gateway control so we have

designed GUI through http

Chapter 4 System Design

36

433 Short Message Service Centre (SMSC)

A SMSC is an essential component when sending a push message from an IP network to

a mobile device in the architecture supported by the components and devices It is used to

remove the TCPIP layer that the push is encapsulatedrdquo in It is also the entity that

identifies the end-point device When this is done it is also the SMSC that is responsible

for the processing and final message delivery to the device After the process of de-

encapsulation and resolution of the client identity there should not be any difference

between this message and a message that is originated locally from the operator itself

(like a SMS)

In this project we just use a virtual SMS center we try first to get connection to a real

one but our effort was worthless

Finally the following figure depicts the overall flowchart of the WAP push system

(figure 47)

Chapter 4 System Design

37

PI

PPG

Create PAP

HTTP Post

Message

processing

OTA

Connection

oriented

Sessionless Session

oriented

WTP Initiation

WAP clinet

Application

Create content

Create

capability

entity

Database

SMS center

NoYes

Figure 47 the complete flowchart of the system

38

Chapter Five

5 System implementation and results

51 Implementation

511 The Push Proxy Gateway

First of all the Kannel gateway have been compiled and installed using gcc (GNU C

Compiler) this stage go fine except the operating system required more components to

be pre-installed and will configured

Then with stages of configuration to the gateway (Appendix B) it was capable of working

as PPG Figure 51 below show the gateway when it starts

Figure 51 starting kannel gateway

Then a web based user interface had been created to provide an easy way to control the

gateway remotely Figure 52 and figure 53

39

Figure 52 GUI for gateway control

512 The Push initiator

Next the push initiator design had been implemented using java programming language

as in design phase the implementation is taken carefully to make a reusable component

that could be used by other developer

PushInitiator class (Appendix B) implements a simple push initiator which can be used

to create and send messages to a push proxy gateway (PPG)

The method sendPushMessage sends a push message via the PPG to the client The client

is identified by the address which is either the phone number (address type is PLMN) or

IP address The message content and its mime type are also given as arguments to the

method the other tow important method are

createPapMessage This method creates a Push Access Protocol (PAP) type message

40

createSiMessage This method is used to create a service indication (SI) type message

Figure 53 showing running kannel status

513 WAP site

Since this site will be built for testing purpose and making sure that the system is

functional we had not go deep in this section Just simple WAP site with tow page has

been crated

41

52 Service indication

When a SI was pushed to any of the emulator or Nokia phones it was received and

presented in the way it was supposed to as specified in the WAP standard as shown in

figures below This is a proof that the devices claiming to support WAP push do so and

the design is will working See figures 53 through 56

Figure 55 service indication

42

Figure 57 SI details

52 Service load

The emulator correctly receives and interpreted the SL push the same as all of Nokia

phones we have tested

When a SL was pushed to the Ericsson phones it was not presented in the specified way

figure 58 I think that it is because of security reasons The reason for this assumption is

that the phones only supports on or off as security in their push configuration The

emulator on the other hand presents SL correctly Finally the Siemens phone did seem to

interpret SL but the current software was not very consistent It did load the SL without

user interference in the specified way when the user already where having an active

session If the user was offline the phone interface presented a symbol on the display

and did not load the service until the user clicked on the symbol

43

Chapter Six

6 conclusion and future work

In this chapter we will provide the conclusions and proposed future work for interested

individuals

61 Conclusions

In this project a WAP push system has been successfully designed and implemented It

provides a way to partially overcome the limitations encountered when accessing the

World Wide Web using handsets After comparing the proposed project objectives with

those accomplished the main goals are seen to be met

Phones from different manufactures all differ from the WAP-standard in some

ways One of the most obvious differences is the resolution of the display

During the work it has been noticed that the WML pages must be quite small We

have also noticed that the support for tables and some other tags are a bit limited

Even though the WML standard is smaller than the HTML standard it is a little

more complicated to write correct WML pages The main conclusion is that WAP

works pretty well but the phones are a little non-stable

The push proxy gateway is configured and worked probably with virtual SMS

center and it is easy to switch to a real one

The system depends mainly on open sources (ie Linux and kannek)

The design and implementation of the push initiator work well with the kannel

gateway and it should work correctly with other gateways

Chapter 6 Conclusion

44

62 Further Work

The possibilities of wireless push are interesting enough that it has to be worth to know if

the security and conformance problems will be solved in WAP push If they are solved

and the technique is refined then there should be nothing to stop the great number of

services that will follow in its footsteps Therefore there is further work that should be

done and the most interesting parts are in my opinion these

621 Security Aspect

One of the problems today is that the phones supporting push does not have the detailed

security settings that a technique like this needs Therefore it would be interesting to look

into the possibility to add these without confusing the user I suggest furthering looking

into usability aspects of security in WAP Push for short

622 GPS integration possibility

This will provide location dependent delivery of WAP push it will have great

applications in telematic and ecommerce advertising

623 Conformance to Standards

An interesting project would be to examine if the main reason for the nonstandard

solutions in the existing WAP push software is the result of difficulties in

implementation Or if the main reason is that the manufacturers wants to provide

proprietary solutions A reason why one may want to know this is that if the problem is

depending on implementation problems then it might get better

45

Appendix A Abbreviations

CDMA Code Division Multiple Access

CO Cache Operation

DTD Document Type Definition

GSM Global System for Mobile

HTTP Hypertext Transfer Protocol

IP Internet Protocol

MSISDN Mobile Station International Subscriber Directory Number

OTA Over The Air

PAP Push Access Protocol

PushOTA Push Over The Air

PDA Personal Digital Assistant

P1 Push Initiator

PLMN Public Land Mobile Networks

PPG Push Proxy Gateway

SI Service Indication

SIA Session Initiation Application

SIR Session Initiation Request

SL Service Loading

SMPP Short Message Peer to Peer

SMS Short Message System

SMSC Short Message System Center

UCP Universal Computer Protocol

URI Uniform Resource Identifier

URL Uniform Resource Locator

UTC Universal Time Coordinated

WAP Wireless Application Protocol

WBXML WAP binary XML

WDP Wireless Datagram Protocol

WSP Wireless Session Protocol

WTLS Wireless Transport Layer Security

XML Extensible Mark-up Language

46

Appendix B Kannel gateway configurations

THIS IS A SAMPLE CONFIGURATION FOR KANNEL

group = core

admin-port = 13000

admin-password = admin

status-password = admin

admin-deny-ip =

admin-allow-ip = 127001172161455

log-file = tmpkannellog

log-level = 0

http-proxy-host = 172161411

http-proxy-port = 8080

http-proxy-exceptions = 127001

Smsbox related

smsbox-port = 13001

box-deny-ip =

box-allow-ip = 127001

bearerbox-host =localhost

Wapbox related

wapbox-port = 13002

udp-deny-ip =

udp-allow-ip = 127001

bearerbox-host =localhost

SMSC GSM

group = smsc

smsc = at

modemtype = auto

speed =9600

device = devttyS0

SMSC HTTP

group = smsc

smsc = http

system-type = kannel

port = 13016

connect-allow-ip = 127001

Appendix B

47

username = wappush

password = wappush

SMSBOX SETUP

group = smsbox

bearerbox-host = localhost

sendsms-port = 13013

sendsms-chars = 0123456789 +-

log-file = tmpsmsboxlog

log-level = 0

access-log = accesslog

white-list = 127001

black-list =

SEND-SMS USERS

group = sendsms-user

username = wappush

password = wappush

user-deny-ip =

user-allow-ip = 127001

PPG group

group = ppg

ppg-url = wappush

ppg-port = 8080

concurrent-pushes = 100

trusted-pi = true

users = 1024

service-name = ppg

ppg-smsbox-id = dlrbox

WAP PUSH USER

group = wap-push-user

wap-push-user = picom

ppg-username = wappush

ppg-password = wappush

allow-ip = localhost

48

Appendix C Selected Codes

Gateway Control Form

ltDOCTYPE HTML PUBLIC -W3CDTD HTML 32ENgt

lthtmlgt ltheadgt

lttitlegtGateway control formlttitlegt

ltheadgt

ltbody bgcolor=white text=black link=blue vlink=navy

alink=redgt

ltbase target=submitgt

ltscriptgt

function update_status()

if ( adminactionvalue == status )

adminaction = http + adminhostnamevalue +

+ adminportvalue + status +

adminstatusformatvalue

else

adminaction = http + adminhostnamevalue +

+ adminportvalue + + adminactionvalue

adminpasswordvalue = adminpasswordvalue

actiongovalue = GO GET +adminaction

ltscriptgt

lttable align=centergt

lttrgtltp align=centergtlth2gtGateway control

formlth2gtltpgtlttrgt

lttrgt lttdgtHostnamelttdgtlttdgtltinput type=text

name=adminhostname value=localhost

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPortlttdgtlttdgtltinput type=text

name=adminport value=13000

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPasswordlttdgtlttdgtltinput type=password

name=adminpassword value=

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtActionlttdgtlttdgtltselect name=adminaction

onChange=update_status()gt

ltoption value=statusgtStatusltoptiongt

ltoption value=suspendgtSuspendltoptiongt

ltoption value=isolategtIsolateltoptiongt

Appendix C

49

ltoption value=shutdowngtShutdownltoptiongt

ltoption value=resumegtResumeltoptiongt

ltselectgtlttdgt lttrgt

lttrgt lttdgtStatus Formatlttdgtlttdgtltselect

name=adminstatusformat onChange=update_status()gt

ltoption value=gthtmlltoptiongtltoption

value=txtgttxtltoptiongtltoption

value=xmlgtxmlltoptiongtltselectgtlttdgt lttrgt

ltform name=admin method=get

action=httplocalhost13000status

encoding=applicationx-www-formgt

ltinput type=hidden name=password value=gt

lttrgt

lttdgtGolttdgt

ltformgt

lttdgtltinput type=submit value=go name=actiongo

onClick=documentadminsubmit()gtlttdgt

lttrgt

lttablegt

ltbodygt

lthtmlgt

Push Initiator Class

import javanetURL

import javanetHttpURLConnection

import javaio

Class implements a simple push initiator It can be

used to create and send messages to push proxy

gateway (ppg)

public final class PushInitiator

xml version

private final static String XML_VERSION = ltxml

version=10gt

Push Access Protocol (PAP) document type

private final static String PAP_DOCTYPE =

Appendix C

50

ltDOCTYPE pap PUBLIC -WAPFORUMDTD PAP 10EN

httpwwwwapforumorgDTDpap_10dtd gt

content type of the push request multipart body

private final static String CONTENT_TYPE =

multipartrelated boundary=multipart-boundary

type=applicationxml

Service Indication (SI) document type

private static final String SI_DOCTYPE = ltDOCTYPE si

PUBLIC -WAPFORUMDTD SI 10EN +

httpwwwwapforumorgDTDsidtdgt

private static int pushId = 0

PPG url where the pap message is to be sent

private final URL ppgUrl

some push proxy gateways may also require the

authentication of the push initiator

For instance the push initiator may be required to

send an HTTP authorization header in each request

private final String authorization

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

public PushInitiator(URL ppgUrl) thisppgUrl =

ppgUrl

authorization = null

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

param authorization a ltcodegtStringltcodegt value

public PushInitiator(URL ppgUrl String authorization)

thisppgUrl = ppgUrl

Appendix C

51

thisauthorization = authorization

Systemoutprintln(Push Initiator created ppgUrl =

+ ppgUrl)

ltcodegtsendPushMessageltcodegt sends push message to

ppg

param clientAddress a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param message a ltcodegtStringltcodegt value

param mimeType a ltcodegtStringltcodegt value

exception Exception if an error occurs

public void sendPushMessage(String clientAddress

String addressTypeString message String mimeType)

throws Exception

HttpURLConnection http =

(HttpURLConnection)ppgUrlopenConnection()

String ppgServer = ppgUrlgetHost()

httpsetDoInput(true)

httpsetRequestProperty(Content-Type CONTENT_TYPE)

if(authorization = null)

if(authorizationtrim()equals())

httpsetRequestProperty(Authorization

authorization)

httpsetDoOutput(true)

PrintWriter out = new PrintWriter(new

BufferedOutputStream(httpgetOutputStream()))

outprintln(--multipart-boundary)

outprintln(Content-type applicationxml)

outprintln()

outprintln(createPapMessage(clientAddress

addressTypeppgServer genPushId() null))

outprintln()

outprintln(--multipart-boundary)

outprintln(Content-type + mimeType)

outprintln()

outprintln(message)

outprintln()

outprintln(--multipart-boundary--)

outflush()

outclose()

httpconnect()

Appendix C

52

finally read and debug the response received from

PPG

try

debugResponse(http)

catch (Exception e)

Systemerrprintln(Error in receiving the

response)

ltcodegtcreatePapMessageltcodegt creates a Push Access

Protocoltype message

param address a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param ppgServer a ltcodegtStringltcodegt value

param pushId a ltcodegtStringltcodegt value

param notificationTo a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createPapMessage(String address

String addressType String ppgServer String pushId

String notificationTo)

return XML_VERSION + n + PAP_DOCTYPE + n +

ltpap product-name=Mobile Zoo Push

Initiatorgtn +

ltpush-message push-id= + pushId +

(notificationTo = null request-notification-

to= + notificationTo ) + gtn +

ltaddress address-value=WAPPUSH= + address +

TYPE= + addressType +

+ ppgServer + gtn +

ltpush-messagegtnltpapgt

ltcodegtcreateSiMessageltcodegt creates a service

indication type message

param url a ltcodegtStringltcodegt value

param created a ltcodegtStringltcodegt value

param expires a ltcodegtStringltcodegt value

Appendix C

53

param message a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createSiMessage(String url

String sid String created String expires String

action String message)

return XML_VERSION + SI_DOCTYPE +

ltsigtn +

ltindication href= + url + +

(sid = null si-id= + sid + ) +

created = null created= + created +

) +

(action = null action= + action +

) +

(expires = null expires= + expires +

) + gt +

message +

ltindicationgtnltsigt

Debug response

param http a ltcodegtHttpURLConnectionltcodegt value

exception Exception if an error occurs

private void debugResponse(HttpURLConnection http)

throws Exception

Systemoutprintln(httpgetResponseMessage())

String headerName

int i=0

while((headerName = httpgetHeaderFieldKey(i++)) =

null)

Systemoutprintln(headerName + +

httpgetHeaderField(headerName))

Systemoutprintln()

InputStreamReader in = new InputStreamReader(new

BufferedInputStream(httpgetInputStream()))

int c

Appendix C

54

while((c = inread()) = -1)

Systemoutprint((char)c)

Systemoutprintln()

ltcodegtgenPushIdltcodegt generates an unique push id

return a ltcodegtStringltcodegt value

private String genPushId()

pushId = 100000

return SystemcurrentTimeMillis() + + pushId++

55

References

[1] Microsoft ldquoGetting Mobile Using WML and WAP to Display Web Sites on

Mobile Devicesrdquo

URL msdnmicrosoftcomen-uslibraryaa140117(office10)aspx accessed

on April 10 2008

[2] DALE BULBROOK ldquoWAPA Beginnerrsquos Guiderdquo OsborneMcGraw-Hill 2001

[3] WAP Forum Wireless Application Protocol Architecture Specification Access on

Jan 12 2008 Available

httpwww1wapforumorgtechdocumentsWAP-210-WAPArch-2006 07 12-apdf

[4] WAP Forum Push Architectural Overview access on (2008 February 3) Available

httpwww1wapforumorgtechdocumentsWAP-250-PushArchOverview-2007 04

03-apdf

[5] Service indication PDF access on 62008 Available

httpwwww3orgTRhtml401structlinkshtml

[6] WAP Push Technology (openwave) PDF access on (2008 April) Available

URL httpwwwopenwavorg

[7] Web site (httpwwwwapforumorgwhatcopyrighthtm) access on May 2008

[8] ldquoWAP Push Proxy Gateway Specificationrdquo WAP Forum access on 16-August-

2007URI httpwwwwapforumorgPDF

[9] WAP Forum Access on (2008 MAY 31) WAP Service Indication Specification

Available httpwww1wapforumorgtechdocumentsWAP-167-ServiceInd-200507

31-apdf

  • odc_fpwmlandwap_topic3
  • N100E3
  • 21
  • 5

5

2 Basic concepts

21 Literature review

The WAP Forum which creates and maintains the WAP specifications was founded in

June 1997 by Ericsson Nokia Motorola and Unwired Planet (later Phonecom later

Openwave Systems) The 10 specification was published in April 1998 but wasnrsquot

implemented in phones at that time The 11 specification came out in July 1999 and

was the first one to be implemented in publicly available phones 121 came out in June

2000 and phones implement it Work on WAP 20 is closing It will converge WAP with

Internet protocols and W3C markup languages [2]

During 2002 and 2003 the idea of WAP push began to get more concern from mobile

network operator In last four years companies began to develop push proxy gateway

unfortunately all of them were protected by taught copyright license This is what

encourages WAP developers and programmers to turn toward kannel which is an Open

Source WAPSMS gateway started by the Wapit Ltd company in June 1999 under

management of Lars Wirzenius later on it turn to the public [3]

In sudan zain (precedent Mobitel) initiated its WAP services for browsing internet on

2006 the same action taken by MTN (precedent areba) Early this year zain established

its WAP push service for emails named zmail

22 WAP architecture

WAP is a set of specifications for developing web-like applications that run over wireless

networks The basic aim of WAP is to provide a web-like experience on small portable

devices - like mobile phones and Personal Digital Assistance PDAs The WAP protocol

suite are analogous to many of those used in existing internet technology yet are

optimized for the challenges raised by small narrowband client devices (such as mobile

Chapter Two

Chapter 2 Basic Concepts

6

phones) and limited over-the-air bandwidthThe WAP Protocol suite covers both the

application level and the underlying transport layers The bearer level of WAP depends

on the type of mobile network It could be CSD SMS CDMA or any of a large number

of possible data carriers Whichever your target client is using the development above

remains the same WAP is designed in a layered fashion so that it can be extensible

flexible and scalable As a result the WAP protocol stack is divided into five layers (as

shown in Figure 21 below)

Wireless Application

Environment (WAE)

Wireless Session Protocol (WSP)

Wireless Transaction Layer Security (WTLS)

Wireless Transaction Protocol (WTP)

USSD CSD ETCSMSCDMA

Wireless Datagram Protocol (WDP)

Other Services and

Applications

Figure 21 Wireless Application Protocol architecture

Chapter 2 Basic Concepts

7

221 Application Layer Wireless Application Environment

The wireless application environment WAE is a standard for developing applications

and services that operate on wireless communication networks The WAE layer consists

of several parts wireless markup language binary XML wireless markup language

scripts and wireless telephony application [5]

2211 WML

Pages or services created using HTML do not work very well on small handheld devices

since they were specifically developed for use on desktop computers with larger color

screens Also low bandwidth wireless bearers wouldnrsquot be suitable for delivering the

large files that HTML pages often consist of Therefore a markup language specifically

adapted to these restrictions has been developedmdashWML

WML provides a navigation model for devices with small display screens and limited

input facilities (no mouse and a limited keyboard) In order to save valuable bandwidth in

the wireless network WML can be encoded into a compact binary format for

transmission between the phone and the network and vice-versa

WML uses uniform resource locators URLs in the following situations

o when specifying navigation eg hyperlinking

o when specifying external resources eg An image or a script

WML is an XML language with the same character sets as an XML document XML is

case-sensitive and therefore is also WML case-sensitive

WML is built on cards and decks A card is a one or more unit of user interaction eg a

choice menu a screen of text or a text entry field This means that the user navigates

through a series of WML cards reviews the contents of each enters requested

information makes choices and moves to another card Cards are grouped into decks [5]

Chapter 2 Basic Concepts

8

2212 WMLScript

WMLScript is a client-side scripting language It is very much like JavaScript which is

used on dynamic HTML(DHTML) web sites but WMLScript has been modified to fit

the currently severe limitations of the WAP environment and is in many ways restricted

compared to JavaScript

Client-side means that the code actually runs on the micro-browser itself The code is

downloaded to the WAP device as part of the deck so that when the code is executed it

does not have to make a trip back to the server to find out what to do next Everything the

application needs is right there Client-side functionality is therefore much faster in the

userrsquos perception

2213 Binary Extensible Markup Language

Binary XML is a compact binary representation of XML The binary XML is design to

reduce the transmission size of XML documents This allows more effective use of

narrow banded communication channels without any loss of functionality or semantic

information [5]

222 Session Layer Wireless Session Protocol

The wireless session protocol layer supports the wireless application environment with

two different session services The first is a connection mode service that operates above

a transaction layer protocol WTP and the second is a connection-less service that

operates above a datagram transport service WSP supports HTTP 11 functionality and

some new features These features include long-lived session a common facility for data

push capability negotiation and session suspendresume [5]

WSP provides support for exchange of content between clients and servers To support

the exchange the WSP establishes a reliable session negotiates on common capabilities

exchanges the data using compact encoding and releases the session The WSP also

supplies functionality to suspend and resume the session in order to save battery while

Chapter 2 Basic Concepts

9

the session is idle The WSP lifecycle is therefore not tied to the underlying transport

layer

WSP is a binary version of HTTP which includes both headers and data Binary

encoding is used to minimize the protocol overhead and to simplify decoding The header

is used to define content type character set encoding languages etc in an extensible

manner WSP supports two types of data transfers push and pull Pull transfer is used

when the client is sending a request and the server is sending a response In the push

mechanism the server pushes data to a client without prior request from the client

This can be done in three different ways Confirmed data can be pushed within an

existing session or non-confirmed data pushes can be done within or without an existing

session

223 Transaction Layer Wireless Transaction Protocol

The wireless transaction protocol WTP is defined to provide the services necessary for

sending requests responses and information WTP runs on top of a datagram service and

optionally a security service To ensure safe connection on top of the datagram layer the

WTP layer performs retransmissions sends acknowledgements and removes duplicated

messages In order to improve the connection efficiency WTP has no explicit connection

or teardown phases The layer also performs segmentation and reassembly to reduce the

number of packets sent

WTP has been defined as a transaction protocol that is suitable for mobile stations and

operates efficiently over wireless datagram networks Some benefits of using WTP are

that it improves reliability over datagram services improves efficiency over connection-

oriented services and that it is message oriented and designed for requestresponse

applications

The wireless transaction protocol is divided into three transaction services It can send

unreliable messages with no result message reliable messages with no result message or

reliable messages with exactly one result message

Chapter 2 Basic Concepts

10

Unreliable Messages With No Result Message

This service provides an unreliable datagram service The service can be used by

applications which occasionally want to send a datagram within an existing session

using WTP No acknowledgement or retransmission is done in this service

Reliable Messages With No Result Message

This service provides a reliable datagram service The service can be used by

applications that want to use a reliable push service The receiver acknowledges the

message and if the original sender receives no acknowledgement the message is

retransmitted

Reliable Messages With One Reliable Result Message

This service provides the basic invokeresponse transaction The receiver acknowledges

the message and if the original sender receives no acknowledgement the message is

retransmitted To confirm the reception of the acknowledgement the original sender

sends an acknowledgement to the receiver The three transactions are shown in next

figure

message message

acknowledge

message

confirm

Unreliable invoke

message with no

result message

Reliable invoke

message with no

result message

Reliable invoke

message with one

reliable result

message

a) b) c)

acknowledge

Figure 22 the three mode of transaction

Chapter 2 Basic Concepts

11

2231 Concatenation and Separation

To reduce the overhead caused by the datagram headers it is desirable to reduce the

number of packets sent over the air In order to reduce the number of messages several

protocol data units can be put into one single datagram This procedure is called the

concatenation procedure The reverse procedure is called the separation procedure [5]

Concatenation can be done when several packets are transported from the same sender to

the same receiver Concatenation can be done at any time The last acknowledgement can

be concatenated with the invoke message of the next transaction [5]

2232 Segmentation and Reassembly

If a packet is lager than the bearers largest capability the message can be segmented and

send in several packets To increase the communication efficiency message groups can be

acknowledged in groups [5]

To decrease the number of packets sent when a communication error occurs the receiver

can request one or multiple lost packets within a group of messages This is done instead

of resending the entire message which could mean that successfully received packets

have to be resent [5]

224 Security Layer Wireless Transport Layer Security

An Optional layer it is responsible for providing security data integrity and

authentication between two communicating applications The WTLS is optimized for low

bandwidth bearer networks with relatively long latency The WTLS is similar to the

Internet transport layer security TLS but has some new features such as datagram

support optimized handshake and dynamic key refreshing [5]

WTLS has been design to function on both connection-oriented and datagram transport

protocols The security layer acts above the transport layer

Chapter 2 Basic Concepts

12

2241 Service Primitives

WTLS uses primitives to ensure security The primitives are used to

Initiate a secure connection

Perform public-key authentication or key exchange with the client

Change into connection state when the handshake has been done

Terminate the connection

Inform the other end about warning level alerts

Request by the server that the client should initiate a new handshake

225 Transport Layer Wireless Datagram Protocol

The wireless datagram layer is a datagram service used by the upper layers WDP is

designed to communicate over different bearer services and especially for wireless

telecommunication networks [6] It Consists of

bull Source and destination address and port

bull Optionally fragmentation

It maps to UDP for IP bearer and moves single packets to and from the phone

226 WDP and IP

In networks with IP as the routing protocol UDP is used instead of WDP IP provides

segmentation and reassemble in a connection-less datagram service UDP provides port

based addressing and other necessary functions Thereby no additional functions are

required by a WDP layer [7]

227 Bearer Interfaces

WAP supports dial-up networking using IP and Point-to-Point Protocol (PPP) as the

bearer interface underneath WDP It also supports Short Message System (SMS) and

General Packet Radio System (GPRS) SMS passes text and binary data between digital

Chapter 2 Basic Concepts

13

phones GPRS is a relatively new technology that implements faster always-on

connections for wireless devices GPRS actually runs on top of IP [7]

As had been learned above WAP is quite similar to web figure 23 provide a brief

comparison between them

WAP

Bearer

WDP Dtatgram

WTLS security

WTP Transaction

WSP Session

WAE

WML and

WMLScript

Web

IP

TCP UDP

TLS-SSL

HTTP

HTML

JavaScript

VBscript

Figure 23 Web vs WAP

Chapter 2 Basic Concepts

14

23 SMS overview

SMS stands for Short Message Service It is a technology that enables the sending and

receiving of messages between mobile phones SMS first appeared in Europe in 1992 It

was included in the GSM (Global System for Mobile Communications) standards right at

the beginning Later it was ported to wireless technologies like CDMA and TDMA The

GSM and SMS standards were originally developed by ETSI ETSI is the abbreviation

for European Telecommunications Standards Institute Now the 3GPP (Third Generation

Partnership Project) is responsible for the development and maintenance of the GSM and

SMS standards [8]

SMS has two operational mode textual mode and binary mode which will allow sending

other data beside pure text

24 Push overview

WAP push provides a standard means to send data to a mobile subscriber without an

explicit request from the subscriber at the time the data is delivered In the normal

clientserver model a client requests a service or information from a server which then

responds by transmitting information to the client This is known as ldquopullrdquo technology

The client pulls information from the server The World Wide Web is the best example of

pull technology where a user enters a URL (the request) which is sent to a server and

the server answers by sending a Web page (the response) to the user (Figure 24 a)

Although WAP push is also based on the clientserver model it provides a means to send

data to the subscriber without an explicit request from the client at the time of delivery

(Figure 24 b)

With push functionality users are able to get information without having to request that

information In many cases it is important for the user to get the information as soon as it

is available Push communications can be used for sending stock quotes traffic reports

and news

Chapter 2 Basic Concepts

15

a) WAP pull model

b) WAP push model

Figure 24 Pull vs Push

24 WAP Push framework

A push operation starts when a server called the push initiator transmits a push messages

to a WAP client Since the push initiator located on the Internet does not use the same

protocol as the WAP client a translating gateway is needed The push initiator contacts

the push proxy gateway via the push access protocol and the Internet protocol The push

proxy gateway translates the information and forwards the pushed content to the WAP

device via the push over the air protocol (figure 25) [9]

Chapter 2 Basic Concepts

16

Push Proxy Gateway

WAP

Client

Push

Access Protocol

Push

over-the air

protocol Push Initiator

Figure 25 the wireless push technology

241 Push Proxy Gateway

The push proxy gateway PPG is the entity that does most of the work in the push

architecture The gateway acts as an access-point for content pushed from the Internet to

the client So the responsibility of the gateway owners to grant access to push proxy

gateway [9]

Besides the actual access-point service the push gateway provides the following services

push initiator identification and authentication

parsing and error detection of content control information

client discovery services

address resolution

binary encoding and compilation of certain content type

protocol conversion

Chapter 2 Basic Concepts

17

Information to the push proxy gateway is sent via the push access protocol PAP The

content of the information is divided into several parts were the first part is information to

the PPG such as recipient information

When the PPG has parsed the control information an acknowledgement is sent to the

push initiator reporting if the service was successful or not

Once the proxy has accepted the content and the push initiator has received the

acknowledgement the proxy is responsible for the transmission to the client The proxy

attempts to find the correct destination device and deliver the content to that client using

the push over the air protocol The contents delivered to the proxy may be translated to

their binary counterpart eg WML documents may be converted to binary XML by the

proxy before the information is transmitted to the client [9]

The proxy must implement a service to enable capability queries from the push initiator

The capability query should be responded with the capabilities of the specified WAP

device The push proxy gateway may also implement broadcasting services where

special addresses may be translated to a broadcast operation [9]

242 Push Access Protocol

The push access protocol PAP is the means by which an Internet-based push initiator

pushes content to a mobile network via the push proxy gateway [9] The push access

protocol is not intended for use over the air

PAP supports the following operations

Push submission

The push message sent from the push initiator to the gateway contains a control

entity a content entity and may contain a capability entity The control entity is

an XML document When the gateway has received the message an XML

response message is sent back to the initiator

Chapter 2 Basic Concepts

18

Result notification

If the push initiator has requested confirmation of successful delivery this XML

message is transmitted from the PPG to the push initiator when the content has

been delivered to the mobile device The push initiator acknowledges this result

message with another XML document

Push cancellation

The purpose of the push cancellation is to allow the push initiator to attempt to

cancel a previously submitted push message Both the cancellation message and

the resulting acknowledgement are sent as XML documents

Status query

The status query operation allows the push initiator to request the current status of

a message that has been previously submitted Both the status query message and

the resulting acknowledgement are sent as XML documents

Client capabilities query

This operation allows the push initiator to query the PPG for the capabilities of a

specific device The query is sent as an XML document and the response is sent

as another XML document

To access the push proxy gateway an address is used The gatewayrsquos underlying

protocols determines which type of address is used eg in HTTP a URL is used To

access a specific device the devicersquos address is included in the XML document

There are two ways to send information to several clients The push initiator can either

send information to several specific addresses or broadcast it to all clients In both cases

only one message is sent to the gateway which either sends the information to some or

all of the clients The clientsrsquo address is depending on the underlying layer [9]

Chapter 2 Basic Concepts

19

243 Push Over-The-Air Protocol

The push proxy gateway and the client communicate using the push over the air protocol

which utilizes WSP session services Pushes can be sent via connection oriented links or

connection-less links Connection-oriented pushes require that an active WSP session is

available but the server can not create a session To solve the case were there is no active

WSP session the push framework introduces a session initiation application in the client

This application listens to session requests from the OTA-server and responds by setting

up a WSP session for push purposes [9]

Push

Over-the air

WSP

Push management

premptive

Push operational

primitives

WSP Servise

Primitives

Figure 26 Push Over-The-Air protocol stack

The push over the air protocol supports two kinds of operations operations to manage the

connection and operations to send actual messages

Push Sends unconfirmed information over a connection-oriented link

Confirmed push Sends confirmed information over a connection-oriented link

Abort push rejects a previously transmitted push operation This is operation is

part of the confirmed push mechanism

Unit push Sends unconfirmed information over a connection-less link

Connect Creates a push session

Chapter 2 Basic Concepts

20

Suspend Request that a push session should be suspended

Resume Request to resumes a previously suspended push session

Disconnect Terminates the push session

Session request Request from the server to initialize a session to a client

244 Service Indication

The service indication SI provides a mechanism composed in an XML message to

notify a client that an external asynchronous event has occurred and indicate a service

that can be loaded in order to react to that event In order to notify the user a message is

sent from the push initiator via the proxy to the client The message will be shown to the

user and there will be a reference to a URI where the appropriate service can be loaded

For example the message could be ldquoYou have new mailrdquo and the URI to your email

service [9]

When the message is received by the client it will be presented to the user The user then

can choose to launch the service in an application eg the WML browser or to postpone

the SI for later handling Postponed SIs will be stored in the client and the user is given

the possibility to act upon them later When the user choose to launch the service the

service is started in the same way as if the user would have started it manually [9]

Messages sent with the service indication can support mechanisms to improve the end-

user-experience

User-intrusiveness levels

To improve the users understanding of the provided service and to affect the users

behavior when the message is delivered it is possible to change the level of user-

intrusiveness

Chapter 2 Basic Concepts

21

Deletion

When a pushed message becomes invalid the service provider can delete the

message in the clients For example an email notification becomes invalid when

the message are read

Replacement

When a pushed message is invalid and updated with a new message the service

provider can replace the origin message with a new one

Handling of out of order delivery

Since the wireless communication is unpredictable it can not be ensured that the

messages are received in the same order as sent This mechanism discards all

messages older than the latest received

Expiration

Some services may only be valid for a certain amount of time when the time has

expired the message is removed from the client

245 Service Loading

The service loading method provides means to convey a URI to a user agent in a mobile

client The method is conveyed in an XML message In difference from the service

indication method the client loads the content of the URI automatically without any

action from the user when the service loading message is received

Thereby the user will experience the content as if it was pushed to the mobile client and

executed In the service loading mechanism there is a reference to a service page that will

automatically be loaded without interaction with the user included For example the client

will automatically start the email service when a message about new mails on the server

is received [9]

Chapter 2 Basic Concepts

22

When the client is busy with some application it is not suitable to execute the referred

content directly upon reception of a message To avoid this client may cache the content

indicated by the URI so it becomes available to the user when the client is ready

Messages sent with the service loading method can support mechanism to improve the

end-user-experience

Control of the level of user interaction

To improve the users understanding of the provided service and the affect the

userrsquos behavior when the message is delivered it is possible to change the level

of user-intrusiveness The service can explicitly specify if the service should be

loaded or not if the client is busy on reception

Pre-emptive content caching

By setting this attribute the service loading can require that the indicated content

is downloaded and cached instead of executed This can be used to improve the

users experience of the services that otherwise would have required content to

be retrieved from an origin

23

Chapter Three

3 System requirements

Several materials and requirements must be incorporated into the design implementation

and testing The following discusses the components necessary to fulfill the project

requirements and environment

31 development environment

There are many development tools to choose from when developing for WAP Push and

hen you combine different environments with different gateways you will get a vast

numbers of choices This large flora of tools makes it difficult to choose a suitable

environment an important issue because a badly chosen one might consume a lot of time

341 Operating system

Kannel (the chosen gateway for the system) is being developed on Linux systems and

should be fairly easy to export to other Unix-like systems Although it should be working

without major problems on Windows (through Cygwin) Solaris and FreeBSD The push

initiator is implemented on java so it is operating system independent

Linux is the logical choice especially when it comes to the world severs and networking

for it promising feature as an open source low cost operating system

342 Programming language

Since system design was planned to be modular to enhance the reuse of its components as

explained above then an object oriented programming language will be a reasonable

choice Another factor is the need for a graphical user interface which imposes using a

programming language with good graphics handling capabilities at the same time it

should be over Linux

Chapter 3 System requirements

24

The best programming language to accomplish the above requirement is found to be java

which has the flowing feature

Cross platform - All clients and servers run the same Java code without any

changes or recompilation This simplifies deployment

Cost effective to develop in Java - The java language has many features that

improve developer productivity promote code reuse and reduce development and

maintenance costs

Works well with Open Source - Java with Linux and the many open source

movement projects and libraries provide a powerful mix that ensures development

is cost-effective efficient and of high quality because extensively tested libraries

components and solutions are available to plug-in to customer development

efforts

343 Nokia Mobile Internet Toolkit 41

To design and implement a WAP application on a Nokia phone the Nokia Internet

Toolkit has to be downloaded and installed on the PC A Nokia simulator is installed as

part of the installation but various phone simulators can be downloaded and installed

This simulator is used for testing purpose Also it has a server simulator based on the

Nokia Active Server if a WAP Gateway is unavailable

32 software requirements

Most of this section has been mentioned in way or other but they will be considered

briefly here

321 Kannel WAP gateway

This is an open source gateway upon which the push proxy gateway of this system will

be built on it available free of charge at kannel project web site

Chapter 3 System requirements

25

322 Linux operating system

It is important to install kannel gateway on it for this project we choose fedora core 7 for

availability reasons

323 JDK16

The java run time environment is required to implement the push initiator

32 hardware requirements

321 PC

Any Personal computer capable of running fedora core 7 with USB interface to be able

connects GSM modem

322 GSM modem

This will act as an alternative to the short message service center SMSC Obviously this

means that GSM network is required too

26

Chapter Four

4 System design

41 System Scenario

The basic scenario of a push session is that a Push Initiator (PI) transmits content to a

WAP client This is done in multiple steps as shown in Figure 31

pushOTAPAP

Gateway

PI

1

2

pull gateway

PPG

3

SMS center

Mobile device

6

5

4

Content provider78 9

Figure 41 WAP push scenario

Chapter 4 System Design

27

The PI communicates with a Push Proxy Gateway (PPG) over the Push Access Protocol

(PAP) (1 and 2) The PPG will then use the Push Over-The-Air Protocol (PushOTA) (3)

to deliver a Uniform Resource Identifier (URI) to the client via a Short Message System

Centre (SMS-C) (4 and 5) The next step for the client is then to activate the URI (6 and

7) and get the content from the server (8 and 9) The mobile device will have to use a

ldquoPull Gatewayrdquo to get the content but it is very likely that this is the same one as the PPG

The same same scenario could be viewed in sequence diagram figure (42)

Push Initiator PPG SMS Center WAP client

Send push message

Send push message response

Send WAP push message

Ack

Send WAP push message

Ack

Message read

Ack

Message read

Ack

Result notification message

Result notification response

Figure 42 WAP push sequence diagram

Chapter 4 System Design

28

43 Modular Design

Conceptually we can envision this push system as consisting of three major components

(presented in the order of the push lifetime)

first there is a Push Initiator Program that reads the generates a notification message and

transmits (pushes) it via a WAP Gateway to the customer phone This message notifies

the user that a service is available if the user accepts will ask the phonersquos browser to pull

the page from our web server via the WAP Gateway

Next there is the Push Proxy Gateway PPG which will receive the push message from

the push initiator and is responsible of doing any needed optimization protocol

compilation and conversion Also it is responsibility of the PPG to find the end user

address and send the push message to the SMS center

Finally there is the SMS center which will do the last delivery of push message to the

intended user if the user were offline the message will be saved for later time until the

WAP client is on

PI PPGSMSC

Figure 43 system modules

Chapter 4 System Design

29

43 Design of system Modules

Following sections of this chapter present a description and design of the system modules

with accompanying graphical representation

431 Push Initiator (PI)

The PI is the first logical component in the WAP Push scenario and therefore the

originator of the push message There are different kinds of PIs One example is an

automated script another one is a semi automated server version written in an applicable

scripting language supporting server side interaction

A push message is sent as an HTTP POST to the Push Proxy Gateway The POST will be

a multipart XML document with the first part being the control entity (Push Access

Protocol) the second part being the content entity (either a Service Indication or a

Service Load) and the third part being the capability entity

HTTP Post

Capability entity

Content entity (SISL)

Control entity (PAP)

Figure 44 architecture of the push message

Chapter 4 System Design

30

4311 Control entity

This part of the push contains the basic information and fields The fields can include

recipient address expiry time bearer type delivery attempt time and a URL to which a

response is to be sent if delivery confirmation is requested by the push initiator

PAP is the protocol used in WAP Push framework for specifying control information and

content that is to be pushed to a client via a Push Proxy Gateway (PPG) A Push Initiator

(PI) triggers push message processing The Push initiator class (Appendix B) of this

design shows how to generate PAP messages

The address of the used PPG should be given as an initialization parameter of the

application (ldquoppg-urlrdquo see Appendix B) This design also provides an implementation

that can be used in a special case when ldquoIPv4 IPv6rdquo type client addressing is applied and

when toolkit is used All other cases including the use of phone numbers (ldquoPLMNrdquo type

address) in sending push messages are considered

The PAP XML contains at the minimum a ltpapgt element a ltpush-messagegt

element and an ltaddressgt element

The important parts of this PAP message are the address value and type The value is

typically a MSISDN and type indicates whether to send to a MSISDN (typical case) or to

an IP Address The TYPE is almost always MSISDN as the Push Initiator (PI) will not

typically have the Mobile Stations IP address - which is generally dynamic

4312 Content entity

This is the actual data that is received by the mobile device The various content types

are Service Indication (SI) Service Load (SL) and Cache Operation (CO) in our project

we will just deal with SI and SL

The SI notifies a client about an external event by inviting the client to interact with it In

other words it informs a client about a service More precisely it sends a message that

Chapter 4 System Design

31

informs the client of a Uniform Resource Identifier (URI) where the client can access the

service

An important attribute of SI is the action attribute it may contain the action to be taken

when the client receives the SI There are two groups that the action attributes can be

divided into

First we have delete and signalmdashnone both of them is used because of their side

effects Ie with delete you take away all SIs with the same si-id as the deletion pushrdquo

including itself and with signal-none you either do nothing or you pay regard to the

info element in that push

The other group consists of signal-low signal-medium and signal-high These

attributes are all used to set the rules for the presentation in the terminal device

o Signal-low

The SI must be postponed without user intervention

o Signal-medium

The SI must be presented as soon as the implementation allows that to be carried out

without disturbing the user (Signal-medium is the value that will be used if none is

specified)

o Signal-high

The SI must be presented as soon as the implementation allows that to be carried out

without disturbing the user or earlier if it seems appropriate (This decision may for

instance be based on user preference settings)

This is the different functionalities supported by the SI we concidered

Expiration

Replacement

Deletion

Chapter 4 System Design

32

Handling of out of order delivery

Handling of information specified in the info element

A PUSH Service Indication (SI) contains at a minimum an ltsigt element and a

ltindicationgt element SL donrsquot differ so much from SI

4313 Capability entity

This entity determines the type of mobile device that is to be served This is determined

by WAP user agent profiling The sender can indicate the hardware vendor and browser

version and type of the intended recipients This capability entity is then matched at the

PPG to see which devices are compatible with the requested capability If there is a

match the content is delivered by the PPG to that specific device

Now a day most devices are compatible with WAP so we donrsquot need to create this entity

more precisely it is optional

After the push has been created in the PI it is up to the system to deliver it to the defined

destination In this system the different responsible entities are the PPG and the SMSC

Both of these two different entities are running on same server but it is only the

configuration of the SMSC that is out of my control since it is run by the operator and is

not controllable in my lab environment

432 Push Proxy Gateway (PPG)

There are various commercial WAP gateways available on the market that are quite

expensive Kannel on the other hand is an open source gateway one doesnrsquot need to pay

for it in addition one can edit the source code himself and construct his own customized

gateway Because Kannel is being developed on Linux systems (RedHat and Debian) it

can be smoothly ported to other UNIX-like operating systems

4321 Kannel gateway architecture

The gateway divides the processing load between the following three hosts

Chapter 4 System Design

33

The bearer box which connects to the SMS (Short Message Service) centers and

or CSD (Circuit Switched Data) routers providing a unified interface to them for

the wapbox The bearer box does this by implementing the WDP (Wireless

Datagram Protocol) layer of the WAP stack

The smsbox implements the rest of the SMS gateway functionality It receives

textual SMS messages from the bearerbox and interprets them as service

requests and responds to them in the appropriate way

The wapbox which hosts the upper layers of the WAP stack Each session and its

transactions are handled by the same wapbox (see figure 35)

1Figure 45 divisions of duties in kannel

4322 Working of the gateway

The bearer box receives UDP (User Datagram Protocol) packets from CSD routers

inspects them to see whether they are WAP packets if so then it will routes them to the

WAP box This simple design allows the bearer box to do a minimum of processing per

smsbox

wapbox

bearerbox

Kannel

SMS center

WAP phone

HTTP server

Chapter 4 System Design

34

packet The bearer box also sends the UDP packets that the other boxes generate which

adds some more routing processing The wapboxes implement the WTP (Wireless

Transaction Protocol) and WSP (Wireless Session Protocol) layers These take HTTP-

like requests from the phones and make the actual HTTP requests to content servers

compress the responses and send them back to the terminals (Sessions are maintained to

make as much use of the limited radio bandwidth as possible)

4323 External interfaces of the gateway

The gateway has interfaces to three external agents

bull SMS centers using various protocols

bull HTTP servers to fetch WAP and SMS content and to push WAP Content The

pull protocol is HTTP push PAP

bull WAP phones implementing the WAP protocol stack and (for push) WAP Push

client

Figure 36 summarize kannel external interfaces

4324 Configuring the gateway

The bearerbox smsbox and wapbox are the main working modules of the gateway and

must be configured before configuring the gateway These three modules are controlled

by a configuration file that has wapbox smsbox and bearerbox groups

Configuring the PPG core group

We use two components the PPG core group and the PPG user group The PPG

core group is used to configure the PI interface(for more details configuration

variables refer to appendix c)

Chapter 4 System Design

35

Mobile telephone

network

The Internet

smsbox

wapbox

bearerbox

Kannel

HTTP

HTTP

HTTP server

Serving WML

files

HTTP server

Serving HTML

files

TCP

TCP

WAPSMS

SMSC

WAP phoneNetwork base station

Workstation used for http

administration

Figure 46 External interfaces of the gateway

4325 Administering the gateway through an HTTP interface

Kannel can be administered via an HTTP interface All commands are given as normal

HTTP queries so they can easily be given from command lines like this one

links -dump httpip-adressportshutdownpassword=yourchoice

But it is advantageous to have graphical user interface for gateway control so we have

designed GUI through http

Chapter 4 System Design

36

433 Short Message Service Centre (SMSC)

A SMSC is an essential component when sending a push message from an IP network to

a mobile device in the architecture supported by the components and devices It is used to

remove the TCPIP layer that the push is encapsulatedrdquo in It is also the entity that

identifies the end-point device When this is done it is also the SMSC that is responsible

for the processing and final message delivery to the device After the process of de-

encapsulation and resolution of the client identity there should not be any difference

between this message and a message that is originated locally from the operator itself

(like a SMS)

In this project we just use a virtual SMS center we try first to get connection to a real

one but our effort was worthless

Finally the following figure depicts the overall flowchart of the WAP push system

(figure 47)

Chapter 4 System Design

37

PI

PPG

Create PAP

HTTP Post

Message

processing

OTA

Connection

oriented

Sessionless Session

oriented

WTP Initiation

WAP clinet

Application

Create content

Create

capability

entity

Database

SMS center

NoYes

Figure 47 the complete flowchart of the system

38

Chapter Five

5 System implementation and results

51 Implementation

511 The Push Proxy Gateway

First of all the Kannel gateway have been compiled and installed using gcc (GNU C

Compiler) this stage go fine except the operating system required more components to

be pre-installed and will configured

Then with stages of configuration to the gateway (Appendix B) it was capable of working

as PPG Figure 51 below show the gateway when it starts

Figure 51 starting kannel gateway

Then a web based user interface had been created to provide an easy way to control the

gateway remotely Figure 52 and figure 53

39

Figure 52 GUI for gateway control

512 The Push initiator

Next the push initiator design had been implemented using java programming language

as in design phase the implementation is taken carefully to make a reusable component

that could be used by other developer

PushInitiator class (Appendix B) implements a simple push initiator which can be used

to create and send messages to a push proxy gateway (PPG)

The method sendPushMessage sends a push message via the PPG to the client The client

is identified by the address which is either the phone number (address type is PLMN) or

IP address The message content and its mime type are also given as arguments to the

method the other tow important method are

createPapMessage This method creates a Push Access Protocol (PAP) type message

40

createSiMessage This method is used to create a service indication (SI) type message

Figure 53 showing running kannel status

513 WAP site

Since this site will be built for testing purpose and making sure that the system is

functional we had not go deep in this section Just simple WAP site with tow page has

been crated

41

52 Service indication

When a SI was pushed to any of the emulator or Nokia phones it was received and

presented in the way it was supposed to as specified in the WAP standard as shown in

figures below This is a proof that the devices claiming to support WAP push do so and

the design is will working See figures 53 through 56

Figure 55 service indication

42

Figure 57 SI details

52 Service load

The emulator correctly receives and interpreted the SL push the same as all of Nokia

phones we have tested

When a SL was pushed to the Ericsson phones it was not presented in the specified way

figure 58 I think that it is because of security reasons The reason for this assumption is

that the phones only supports on or off as security in their push configuration The

emulator on the other hand presents SL correctly Finally the Siemens phone did seem to

interpret SL but the current software was not very consistent It did load the SL without

user interference in the specified way when the user already where having an active

session If the user was offline the phone interface presented a symbol on the display

and did not load the service until the user clicked on the symbol

43

Chapter Six

6 conclusion and future work

In this chapter we will provide the conclusions and proposed future work for interested

individuals

61 Conclusions

In this project a WAP push system has been successfully designed and implemented It

provides a way to partially overcome the limitations encountered when accessing the

World Wide Web using handsets After comparing the proposed project objectives with

those accomplished the main goals are seen to be met

Phones from different manufactures all differ from the WAP-standard in some

ways One of the most obvious differences is the resolution of the display

During the work it has been noticed that the WML pages must be quite small We

have also noticed that the support for tables and some other tags are a bit limited

Even though the WML standard is smaller than the HTML standard it is a little

more complicated to write correct WML pages The main conclusion is that WAP

works pretty well but the phones are a little non-stable

The push proxy gateway is configured and worked probably with virtual SMS

center and it is easy to switch to a real one

The system depends mainly on open sources (ie Linux and kannek)

The design and implementation of the push initiator work well with the kannel

gateway and it should work correctly with other gateways

Chapter 6 Conclusion

44

62 Further Work

The possibilities of wireless push are interesting enough that it has to be worth to know if

the security and conformance problems will be solved in WAP push If they are solved

and the technique is refined then there should be nothing to stop the great number of

services that will follow in its footsteps Therefore there is further work that should be

done and the most interesting parts are in my opinion these

621 Security Aspect

One of the problems today is that the phones supporting push does not have the detailed

security settings that a technique like this needs Therefore it would be interesting to look

into the possibility to add these without confusing the user I suggest furthering looking

into usability aspects of security in WAP Push for short

622 GPS integration possibility

This will provide location dependent delivery of WAP push it will have great

applications in telematic and ecommerce advertising

623 Conformance to Standards

An interesting project would be to examine if the main reason for the nonstandard

solutions in the existing WAP push software is the result of difficulties in

implementation Or if the main reason is that the manufacturers wants to provide

proprietary solutions A reason why one may want to know this is that if the problem is

depending on implementation problems then it might get better

45

Appendix A Abbreviations

CDMA Code Division Multiple Access

CO Cache Operation

DTD Document Type Definition

GSM Global System for Mobile

HTTP Hypertext Transfer Protocol

IP Internet Protocol

MSISDN Mobile Station International Subscriber Directory Number

OTA Over The Air

PAP Push Access Protocol

PushOTA Push Over The Air

PDA Personal Digital Assistant

P1 Push Initiator

PLMN Public Land Mobile Networks

PPG Push Proxy Gateway

SI Service Indication

SIA Session Initiation Application

SIR Session Initiation Request

SL Service Loading

SMPP Short Message Peer to Peer

SMS Short Message System

SMSC Short Message System Center

UCP Universal Computer Protocol

URI Uniform Resource Identifier

URL Uniform Resource Locator

UTC Universal Time Coordinated

WAP Wireless Application Protocol

WBXML WAP binary XML

WDP Wireless Datagram Protocol

WSP Wireless Session Protocol

WTLS Wireless Transport Layer Security

XML Extensible Mark-up Language

46

Appendix B Kannel gateway configurations

THIS IS A SAMPLE CONFIGURATION FOR KANNEL

group = core

admin-port = 13000

admin-password = admin

status-password = admin

admin-deny-ip =

admin-allow-ip = 127001172161455

log-file = tmpkannellog

log-level = 0

http-proxy-host = 172161411

http-proxy-port = 8080

http-proxy-exceptions = 127001

Smsbox related

smsbox-port = 13001

box-deny-ip =

box-allow-ip = 127001

bearerbox-host =localhost

Wapbox related

wapbox-port = 13002

udp-deny-ip =

udp-allow-ip = 127001

bearerbox-host =localhost

SMSC GSM

group = smsc

smsc = at

modemtype = auto

speed =9600

device = devttyS0

SMSC HTTP

group = smsc

smsc = http

system-type = kannel

port = 13016

connect-allow-ip = 127001

Appendix B

47

username = wappush

password = wappush

SMSBOX SETUP

group = smsbox

bearerbox-host = localhost

sendsms-port = 13013

sendsms-chars = 0123456789 +-

log-file = tmpsmsboxlog

log-level = 0

access-log = accesslog

white-list = 127001

black-list =

SEND-SMS USERS

group = sendsms-user

username = wappush

password = wappush

user-deny-ip =

user-allow-ip = 127001

PPG group

group = ppg

ppg-url = wappush

ppg-port = 8080

concurrent-pushes = 100

trusted-pi = true

users = 1024

service-name = ppg

ppg-smsbox-id = dlrbox

WAP PUSH USER

group = wap-push-user

wap-push-user = picom

ppg-username = wappush

ppg-password = wappush

allow-ip = localhost

48

Appendix C Selected Codes

Gateway Control Form

ltDOCTYPE HTML PUBLIC -W3CDTD HTML 32ENgt

lthtmlgt ltheadgt

lttitlegtGateway control formlttitlegt

ltheadgt

ltbody bgcolor=white text=black link=blue vlink=navy

alink=redgt

ltbase target=submitgt

ltscriptgt

function update_status()

if ( adminactionvalue == status )

adminaction = http + adminhostnamevalue +

+ adminportvalue + status +

adminstatusformatvalue

else

adminaction = http + adminhostnamevalue +

+ adminportvalue + + adminactionvalue

adminpasswordvalue = adminpasswordvalue

actiongovalue = GO GET +adminaction

ltscriptgt

lttable align=centergt

lttrgtltp align=centergtlth2gtGateway control

formlth2gtltpgtlttrgt

lttrgt lttdgtHostnamelttdgtlttdgtltinput type=text

name=adminhostname value=localhost

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPortlttdgtlttdgtltinput type=text

name=adminport value=13000

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPasswordlttdgtlttdgtltinput type=password

name=adminpassword value=

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtActionlttdgtlttdgtltselect name=adminaction

onChange=update_status()gt

ltoption value=statusgtStatusltoptiongt

ltoption value=suspendgtSuspendltoptiongt

ltoption value=isolategtIsolateltoptiongt

Appendix C

49

ltoption value=shutdowngtShutdownltoptiongt

ltoption value=resumegtResumeltoptiongt

ltselectgtlttdgt lttrgt

lttrgt lttdgtStatus Formatlttdgtlttdgtltselect

name=adminstatusformat onChange=update_status()gt

ltoption value=gthtmlltoptiongtltoption

value=txtgttxtltoptiongtltoption

value=xmlgtxmlltoptiongtltselectgtlttdgt lttrgt

ltform name=admin method=get

action=httplocalhost13000status

encoding=applicationx-www-formgt

ltinput type=hidden name=password value=gt

lttrgt

lttdgtGolttdgt

ltformgt

lttdgtltinput type=submit value=go name=actiongo

onClick=documentadminsubmit()gtlttdgt

lttrgt

lttablegt

ltbodygt

lthtmlgt

Push Initiator Class

import javanetURL

import javanetHttpURLConnection

import javaio

Class implements a simple push initiator It can be

used to create and send messages to push proxy

gateway (ppg)

public final class PushInitiator

xml version

private final static String XML_VERSION = ltxml

version=10gt

Push Access Protocol (PAP) document type

private final static String PAP_DOCTYPE =

Appendix C

50

ltDOCTYPE pap PUBLIC -WAPFORUMDTD PAP 10EN

httpwwwwapforumorgDTDpap_10dtd gt

content type of the push request multipart body

private final static String CONTENT_TYPE =

multipartrelated boundary=multipart-boundary

type=applicationxml

Service Indication (SI) document type

private static final String SI_DOCTYPE = ltDOCTYPE si

PUBLIC -WAPFORUMDTD SI 10EN +

httpwwwwapforumorgDTDsidtdgt

private static int pushId = 0

PPG url where the pap message is to be sent

private final URL ppgUrl

some push proxy gateways may also require the

authentication of the push initiator

For instance the push initiator may be required to

send an HTTP authorization header in each request

private final String authorization

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

public PushInitiator(URL ppgUrl) thisppgUrl =

ppgUrl

authorization = null

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

param authorization a ltcodegtStringltcodegt value

public PushInitiator(URL ppgUrl String authorization)

thisppgUrl = ppgUrl

Appendix C

51

thisauthorization = authorization

Systemoutprintln(Push Initiator created ppgUrl =

+ ppgUrl)

ltcodegtsendPushMessageltcodegt sends push message to

ppg

param clientAddress a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param message a ltcodegtStringltcodegt value

param mimeType a ltcodegtStringltcodegt value

exception Exception if an error occurs

public void sendPushMessage(String clientAddress

String addressTypeString message String mimeType)

throws Exception

HttpURLConnection http =

(HttpURLConnection)ppgUrlopenConnection()

String ppgServer = ppgUrlgetHost()

httpsetDoInput(true)

httpsetRequestProperty(Content-Type CONTENT_TYPE)

if(authorization = null)

if(authorizationtrim()equals())

httpsetRequestProperty(Authorization

authorization)

httpsetDoOutput(true)

PrintWriter out = new PrintWriter(new

BufferedOutputStream(httpgetOutputStream()))

outprintln(--multipart-boundary)

outprintln(Content-type applicationxml)

outprintln()

outprintln(createPapMessage(clientAddress

addressTypeppgServer genPushId() null))

outprintln()

outprintln(--multipart-boundary)

outprintln(Content-type + mimeType)

outprintln()

outprintln(message)

outprintln()

outprintln(--multipart-boundary--)

outflush()

outclose()

httpconnect()

Appendix C

52

finally read and debug the response received from

PPG

try

debugResponse(http)

catch (Exception e)

Systemerrprintln(Error in receiving the

response)

ltcodegtcreatePapMessageltcodegt creates a Push Access

Protocoltype message

param address a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param ppgServer a ltcodegtStringltcodegt value

param pushId a ltcodegtStringltcodegt value

param notificationTo a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createPapMessage(String address

String addressType String ppgServer String pushId

String notificationTo)

return XML_VERSION + n + PAP_DOCTYPE + n +

ltpap product-name=Mobile Zoo Push

Initiatorgtn +

ltpush-message push-id= + pushId +

(notificationTo = null request-notification-

to= + notificationTo ) + gtn +

ltaddress address-value=WAPPUSH= + address +

TYPE= + addressType +

+ ppgServer + gtn +

ltpush-messagegtnltpapgt

ltcodegtcreateSiMessageltcodegt creates a service

indication type message

param url a ltcodegtStringltcodegt value

param created a ltcodegtStringltcodegt value

param expires a ltcodegtStringltcodegt value

Appendix C

53

param message a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createSiMessage(String url

String sid String created String expires String

action String message)

return XML_VERSION + SI_DOCTYPE +

ltsigtn +

ltindication href= + url + +

(sid = null si-id= + sid + ) +

created = null created= + created +

) +

(action = null action= + action +

) +

(expires = null expires= + expires +

) + gt +

message +

ltindicationgtnltsigt

Debug response

param http a ltcodegtHttpURLConnectionltcodegt value

exception Exception if an error occurs

private void debugResponse(HttpURLConnection http)

throws Exception

Systemoutprintln(httpgetResponseMessage())

String headerName

int i=0

while((headerName = httpgetHeaderFieldKey(i++)) =

null)

Systemoutprintln(headerName + +

httpgetHeaderField(headerName))

Systemoutprintln()

InputStreamReader in = new InputStreamReader(new

BufferedInputStream(httpgetInputStream()))

int c

Appendix C

54

while((c = inread()) = -1)

Systemoutprint((char)c)

Systemoutprintln()

ltcodegtgenPushIdltcodegt generates an unique push id

return a ltcodegtStringltcodegt value

private String genPushId()

pushId = 100000

return SystemcurrentTimeMillis() + + pushId++

55

References

[1] Microsoft ldquoGetting Mobile Using WML and WAP to Display Web Sites on

Mobile Devicesrdquo

URL msdnmicrosoftcomen-uslibraryaa140117(office10)aspx accessed

on April 10 2008

[2] DALE BULBROOK ldquoWAPA Beginnerrsquos Guiderdquo OsborneMcGraw-Hill 2001

[3] WAP Forum Wireless Application Protocol Architecture Specification Access on

Jan 12 2008 Available

httpwww1wapforumorgtechdocumentsWAP-210-WAPArch-2006 07 12-apdf

[4] WAP Forum Push Architectural Overview access on (2008 February 3) Available

httpwww1wapforumorgtechdocumentsWAP-250-PushArchOverview-2007 04

03-apdf

[5] Service indication PDF access on 62008 Available

httpwwww3orgTRhtml401structlinkshtml

[6] WAP Push Technology (openwave) PDF access on (2008 April) Available

URL httpwwwopenwavorg

[7] Web site (httpwwwwapforumorgwhatcopyrighthtm) access on May 2008

[8] ldquoWAP Push Proxy Gateway Specificationrdquo WAP Forum access on 16-August-

2007URI httpwwwwapforumorgPDF

[9] WAP Forum Access on (2008 MAY 31) WAP Service Indication Specification

Available httpwww1wapforumorgtechdocumentsWAP-167-ServiceInd-200507

31-apdf

  • odc_fpwmlandwap_topic3
  • N100E3
  • 21
  • 5

Chapter 2 Basic Concepts

6

phones) and limited over-the-air bandwidthThe WAP Protocol suite covers both the

application level and the underlying transport layers The bearer level of WAP depends

on the type of mobile network It could be CSD SMS CDMA or any of a large number

of possible data carriers Whichever your target client is using the development above

remains the same WAP is designed in a layered fashion so that it can be extensible

flexible and scalable As a result the WAP protocol stack is divided into five layers (as

shown in Figure 21 below)

Wireless Application

Environment (WAE)

Wireless Session Protocol (WSP)

Wireless Transaction Layer Security (WTLS)

Wireless Transaction Protocol (WTP)

USSD CSD ETCSMSCDMA

Wireless Datagram Protocol (WDP)

Other Services and

Applications

Figure 21 Wireless Application Protocol architecture

Chapter 2 Basic Concepts

7

221 Application Layer Wireless Application Environment

The wireless application environment WAE is a standard for developing applications

and services that operate on wireless communication networks The WAE layer consists

of several parts wireless markup language binary XML wireless markup language

scripts and wireless telephony application [5]

2211 WML

Pages or services created using HTML do not work very well on small handheld devices

since they were specifically developed for use on desktop computers with larger color

screens Also low bandwidth wireless bearers wouldnrsquot be suitable for delivering the

large files that HTML pages often consist of Therefore a markup language specifically

adapted to these restrictions has been developedmdashWML

WML provides a navigation model for devices with small display screens and limited

input facilities (no mouse and a limited keyboard) In order to save valuable bandwidth in

the wireless network WML can be encoded into a compact binary format for

transmission between the phone and the network and vice-versa

WML uses uniform resource locators URLs in the following situations

o when specifying navigation eg hyperlinking

o when specifying external resources eg An image or a script

WML is an XML language with the same character sets as an XML document XML is

case-sensitive and therefore is also WML case-sensitive

WML is built on cards and decks A card is a one or more unit of user interaction eg a

choice menu a screen of text or a text entry field This means that the user navigates

through a series of WML cards reviews the contents of each enters requested

information makes choices and moves to another card Cards are grouped into decks [5]

Chapter 2 Basic Concepts

8

2212 WMLScript

WMLScript is a client-side scripting language It is very much like JavaScript which is

used on dynamic HTML(DHTML) web sites but WMLScript has been modified to fit

the currently severe limitations of the WAP environment and is in many ways restricted

compared to JavaScript

Client-side means that the code actually runs on the micro-browser itself The code is

downloaded to the WAP device as part of the deck so that when the code is executed it

does not have to make a trip back to the server to find out what to do next Everything the

application needs is right there Client-side functionality is therefore much faster in the

userrsquos perception

2213 Binary Extensible Markup Language

Binary XML is a compact binary representation of XML The binary XML is design to

reduce the transmission size of XML documents This allows more effective use of

narrow banded communication channels without any loss of functionality or semantic

information [5]

222 Session Layer Wireless Session Protocol

The wireless session protocol layer supports the wireless application environment with

two different session services The first is a connection mode service that operates above

a transaction layer protocol WTP and the second is a connection-less service that

operates above a datagram transport service WSP supports HTTP 11 functionality and

some new features These features include long-lived session a common facility for data

push capability negotiation and session suspendresume [5]

WSP provides support for exchange of content between clients and servers To support

the exchange the WSP establishes a reliable session negotiates on common capabilities

exchanges the data using compact encoding and releases the session The WSP also

supplies functionality to suspend and resume the session in order to save battery while

Chapter 2 Basic Concepts

9

the session is idle The WSP lifecycle is therefore not tied to the underlying transport

layer

WSP is a binary version of HTTP which includes both headers and data Binary

encoding is used to minimize the protocol overhead and to simplify decoding The header

is used to define content type character set encoding languages etc in an extensible

manner WSP supports two types of data transfers push and pull Pull transfer is used

when the client is sending a request and the server is sending a response In the push

mechanism the server pushes data to a client without prior request from the client

This can be done in three different ways Confirmed data can be pushed within an

existing session or non-confirmed data pushes can be done within or without an existing

session

223 Transaction Layer Wireless Transaction Protocol

The wireless transaction protocol WTP is defined to provide the services necessary for

sending requests responses and information WTP runs on top of a datagram service and

optionally a security service To ensure safe connection on top of the datagram layer the

WTP layer performs retransmissions sends acknowledgements and removes duplicated

messages In order to improve the connection efficiency WTP has no explicit connection

or teardown phases The layer also performs segmentation and reassembly to reduce the

number of packets sent

WTP has been defined as a transaction protocol that is suitable for mobile stations and

operates efficiently over wireless datagram networks Some benefits of using WTP are

that it improves reliability over datagram services improves efficiency over connection-

oriented services and that it is message oriented and designed for requestresponse

applications

The wireless transaction protocol is divided into three transaction services It can send

unreliable messages with no result message reliable messages with no result message or

reliable messages with exactly one result message

Chapter 2 Basic Concepts

10

Unreliable Messages With No Result Message

This service provides an unreliable datagram service The service can be used by

applications which occasionally want to send a datagram within an existing session

using WTP No acknowledgement or retransmission is done in this service

Reliable Messages With No Result Message

This service provides a reliable datagram service The service can be used by

applications that want to use a reliable push service The receiver acknowledges the

message and if the original sender receives no acknowledgement the message is

retransmitted

Reliable Messages With One Reliable Result Message

This service provides the basic invokeresponse transaction The receiver acknowledges

the message and if the original sender receives no acknowledgement the message is

retransmitted To confirm the reception of the acknowledgement the original sender

sends an acknowledgement to the receiver The three transactions are shown in next

figure

message message

acknowledge

message

confirm

Unreliable invoke

message with no

result message

Reliable invoke

message with no

result message

Reliable invoke

message with one

reliable result

message

a) b) c)

acknowledge

Figure 22 the three mode of transaction

Chapter 2 Basic Concepts

11

2231 Concatenation and Separation

To reduce the overhead caused by the datagram headers it is desirable to reduce the

number of packets sent over the air In order to reduce the number of messages several

protocol data units can be put into one single datagram This procedure is called the

concatenation procedure The reverse procedure is called the separation procedure [5]

Concatenation can be done when several packets are transported from the same sender to

the same receiver Concatenation can be done at any time The last acknowledgement can

be concatenated with the invoke message of the next transaction [5]

2232 Segmentation and Reassembly

If a packet is lager than the bearers largest capability the message can be segmented and

send in several packets To increase the communication efficiency message groups can be

acknowledged in groups [5]

To decrease the number of packets sent when a communication error occurs the receiver

can request one or multiple lost packets within a group of messages This is done instead

of resending the entire message which could mean that successfully received packets

have to be resent [5]

224 Security Layer Wireless Transport Layer Security

An Optional layer it is responsible for providing security data integrity and

authentication between two communicating applications The WTLS is optimized for low

bandwidth bearer networks with relatively long latency The WTLS is similar to the

Internet transport layer security TLS but has some new features such as datagram

support optimized handshake and dynamic key refreshing [5]

WTLS has been design to function on both connection-oriented and datagram transport

protocols The security layer acts above the transport layer

Chapter 2 Basic Concepts

12

2241 Service Primitives

WTLS uses primitives to ensure security The primitives are used to

Initiate a secure connection

Perform public-key authentication or key exchange with the client

Change into connection state when the handshake has been done

Terminate the connection

Inform the other end about warning level alerts

Request by the server that the client should initiate a new handshake

225 Transport Layer Wireless Datagram Protocol

The wireless datagram layer is a datagram service used by the upper layers WDP is

designed to communicate over different bearer services and especially for wireless

telecommunication networks [6] It Consists of

bull Source and destination address and port

bull Optionally fragmentation

It maps to UDP for IP bearer and moves single packets to and from the phone

226 WDP and IP

In networks with IP as the routing protocol UDP is used instead of WDP IP provides

segmentation and reassemble in a connection-less datagram service UDP provides port

based addressing and other necessary functions Thereby no additional functions are

required by a WDP layer [7]

227 Bearer Interfaces

WAP supports dial-up networking using IP and Point-to-Point Protocol (PPP) as the

bearer interface underneath WDP It also supports Short Message System (SMS) and

General Packet Radio System (GPRS) SMS passes text and binary data between digital

Chapter 2 Basic Concepts

13

phones GPRS is a relatively new technology that implements faster always-on

connections for wireless devices GPRS actually runs on top of IP [7]

As had been learned above WAP is quite similar to web figure 23 provide a brief

comparison between them

WAP

Bearer

WDP Dtatgram

WTLS security

WTP Transaction

WSP Session

WAE

WML and

WMLScript

Web

IP

TCP UDP

TLS-SSL

HTTP

HTML

JavaScript

VBscript

Figure 23 Web vs WAP

Chapter 2 Basic Concepts

14

23 SMS overview

SMS stands for Short Message Service It is a technology that enables the sending and

receiving of messages between mobile phones SMS first appeared in Europe in 1992 It

was included in the GSM (Global System for Mobile Communications) standards right at

the beginning Later it was ported to wireless technologies like CDMA and TDMA The

GSM and SMS standards were originally developed by ETSI ETSI is the abbreviation

for European Telecommunications Standards Institute Now the 3GPP (Third Generation

Partnership Project) is responsible for the development and maintenance of the GSM and

SMS standards [8]

SMS has two operational mode textual mode and binary mode which will allow sending

other data beside pure text

24 Push overview

WAP push provides a standard means to send data to a mobile subscriber without an

explicit request from the subscriber at the time the data is delivered In the normal

clientserver model a client requests a service or information from a server which then

responds by transmitting information to the client This is known as ldquopullrdquo technology

The client pulls information from the server The World Wide Web is the best example of

pull technology where a user enters a URL (the request) which is sent to a server and

the server answers by sending a Web page (the response) to the user (Figure 24 a)

Although WAP push is also based on the clientserver model it provides a means to send

data to the subscriber without an explicit request from the client at the time of delivery

(Figure 24 b)

With push functionality users are able to get information without having to request that

information In many cases it is important for the user to get the information as soon as it

is available Push communications can be used for sending stock quotes traffic reports

and news

Chapter 2 Basic Concepts

15

a) WAP pull model

b) WAP push model

Figure 24 Pull vs Push

24 WAP Push framework

A push operation starts when a server called the push initiator transmits a push messages

to a WAP client Since the push initiator located on the Internet does not use the same

protocol as the WAP client a translating gateway is needed The push initiator contacts

the push proxy gateway via the push access protocol and the Internet protocol The push

proxy gateway translates the information and forwards the pushed content to the WAP

device via the push over the air protocol (figure 25) [9]

Chapter 2 Basic Concepts

16

Push Proxy Gateway

WAP

Client

Push

Access Protocol

Push

over-the air

protocol Push Initiator

Figure 25 the wireless push technology

241 Push Proxy Gateway

The push proxy gateway PPG is the entity that does most of the work in the push

architecture The gateway acts as an access-point for content pushed from the Internet to

the client So the responsibility of the gateway owners to grant access to push proxy

gateway [9]

Besides the actual access-point service the push gateway provides the following services

push initiator identification and authentication

parsing and error detection of content control information

client discovery services

address resolution

binary encoding and compilation of certain content type

protocol conversion

Chapter 2 Basic Concepts

17

Information to the push proxy gateway is sent via the push access protocol PAP The

content of the information is divided into several parts were the first part is information to

the PPG such as recipient information

When the PPG has parsed the control information an acknowledgement is sent to the

push initiator reporting if the service was successful or not

Once the proxy has accepted the content and the push initiator has received the

acknowledgement the proxy is responsible for the transmission to the client The proxy

attempts to find the correct destination device and deliver the content to that client using

the push over the air protocol The contents delivered to the proxy may be translated to

their binary counterpart eg WML documents may be converted to binary XML by the

proxy before the information is transmitted to the client [9]

The proxy must implement a service to enable capability queries from the push initiator

The capability query should be responded with the capabilities of the specified WAP

device The push proxy gateway may also implement broadcasting services where

special addresses may be translated to a broadcast operation [9]

242 Push Access Protocol

The push access protocol PAP is the means by which an Internet-based push initiator

pushes content to a mobile network via the push proxy gateway [9] The push access

protocol is not intended for use over the air

PAP supports the following operations

Push submission

The push message sent from the push initiator to the gateway contains a control

entity a content entity and may contain a capability entity The control entity is

an XML document When the gateway has received the message an XML

response message is sent back to the initiator

Chapter 2 Basic Concepts

18

Result notification

If the push initiator has requested confirmation of successful delivery this XML

message is transmitted from the PPG to the push initiator when the content has

been delivered to the mobile device The push initiator acknowledges this result

message with another XML document

Push cancellation

The purpose of the push cancellation is to allow the push initiator to attempt to

cancel a previously submitted push message Both the cancellation message and

the resulting acknowledgement are sent as XML documents

Status query

The status query operation allows the push initiator to request the current status of

a message that has been previously submitted Both the status query message and

the resulting acknowledgement are sent as XML documents

Client capabilities query

This operation allows the push initiator to query the PPG for the capabilities of a

specific device The query is sent as an XML document and the response is sent

as another XML document

To access the push proxy gateway an address is used The gatewayrsquos underlying

protocols determines which type of address is used eg in HTTP a URL is used To

access a specific device the devicersquos address is included in the XML document

There are two ways to send information to several clients The push initiator can either

send information to several specific addresses or broadcast it to all clients In both cases

only one message is sent to the gateway which either sends the information to some or

all of the clients The clientsrsquo address is depending on the underlying layer [9]

Chapter 2 Basic Concepts

19

243 Push Over-The-Air Protocol

The push proxy gateway and the client communicate using the push over the air protocol

which utilizes WSP session services Pushes can be sent via connection oriented links or

connection-less links Connection-oriented pushes require that an active WSP session is

available but the server can not create a session To solve the case were there is no active

WSP session the push framework introduces a session initiation application in the client

This application listens to session requests from the OTA-server and responds by setting

up a WSP session for push purposes [9]

Push

Over-the air

WSP

Push management

premptive

Push operational

primitives

WSP Servise

Primitives

Figure 26 Push Over-The-Air protocol stack

The push over the air protocol supports two kinds of operations operations to manage the

connection and operations to send actual messages

Push Sends unconfirmed information over a connection-oriented link

Confirmed push Sends confirmed information over a connection-oriented link

Abort push rejects a previously transmitted push operation This is operation is

part of the confirmed push mechanism

Unit push Sends unconfirmed information over a connection-less link

Connect Creates a push session

Chapter 2 Basic Concepts

20

Suspend Request that a push session should be suspended

Resume Request to resumes a previously suspended push session

Disconnect Terminates the push session

Session request Request from the server to initialize a session to a client

244 Service Indication

The service indication SI provides a mechanism composed in an XML message to

notify a client that an external asynchronous event has occurred and indicate a service

that can be loaded in order to react to that event In order to notify the user a message is

sent from the push initiator via the proxy to the client The message will be shown to the

user and there will be a reference to a URI where the appropriate service can be loaded

For example the message could be ldquoYou have new mailrdquo and the URI to your email

service [9]

When the message is received by the client it will be presented to the user The user then

can choose to launch the service in an application eg the WML browser or to postpone

the SI for later handling Postponed SIs will be stored in the client and the user is given

the possibility to act upon them later When the user choose to launch the service the

service is started in the same way as if the user would have started it manually [9]

Messages sent with the service indication can support mechanisms to improve the end-

user-experience

User-intrusiveness levels

To improve the users understanding of the provided service and to affect the users

behavior when the message is delivered it is possible to change the level of user-

intrusiveness

Chapter 2 Basic Concepts

21

Deletion

When a pushed message becomes invalid the service provider can delete the

message in the clients For example an email notification becomes invalid when

the message are read

Replacement

When a pushed message is invalid and updated with a new message the service

provider can replace the origin message with a new one

Handling of out of order delivery

Since the wireless communication is unpredictable it can not be ensured that the

messages are received in the same order as sent This mechanism discards all

messages older than the latest received

Expiration

Some services may only be valid for a certain amount of time when the time has

expired the message is removed from the client

245 Service Loading

The service loading method provides means to convey a URI to a user agent in a mobile

client The method is conveyed in an XML message In difference from the service

indication method the client loads the content of the URI automatically without any

action from the user when the service loading message is received

Thereby the user will experience the content as if it was pushed to the mobile client and

executed In the service loading mechanism there is a reference to a service page that will

automatically be loaded without interaction with the user included For example the client

will automatically start the email service when a message about new mails on the server

is received [9]

Chapter 2 Basic Concepts

22

When the client is busy with some application it is not suitable to execute the referred

content directly upon reception of a message To avoid this client may cache the content

indicated by the URI so it becomes available to the user when the client is ready

Messages sent with the service loading method can support mechanism to improve the

end-user-experience

Control of the level of user interaction

To improve the users understanding of the provided service and the affect the

userrsquos behavior when the message is delivered it is possible to change the level

of user-intrusiveness The service can explicitly specify if the service should be

loaded or not if the client is busy on reception

Pre-emptive content caching

By setting this attribute the service loading can require that the indicated content

is downloaded and cached instead of executed This can be used to improve the

users experience of the services that otherwise would have required content to

be retrieved from an origin

23

Chapter Three

3 System requirements

Several materials and requirements must be incorporated into the design implementation

and testing The following discusses the components necessary to fulfill the project

requirements and environment

31 development environment

There are many development tools to choose from when developing for WAP Push and

hen you combine different environments with different gateways you will get a vast

numbers of choices This large flora of tools makes it difficult to choose a suitable

environment an important issue because a badly chosen one might consume a lot of time

341 Operating system

Kannel (the chosen gateway for the system) is being developed on Linux systems and

should be fairly easy to export to other Unix-like systems Although it should be working

without major problems on Windows (through Cygwin) Solaris and FreeBSD The push

initiator is implemented on java so it is operating system independent

Linux is the logical choice especially when it comes to the world severs and networking

for it promising feature as an open source low cost operating system

342 Programming language

Since system design was planned to be modular to enhance the reuse of its components as

explained above then an object oriented programming language will be a reasonable

choice Another factor is the need for a graphical user interface which imposes using a

programming language with good graphics handling capabilities at the same time it

should be over Linux

Chapter 3 System requirements

24

The best programming language to accomplish the above requirement is found to be java

which has the flowing feature

Cross platform - All clients and servers run the same Java code without any

changes or recompilation This simplifies deployment

Cost effective to develop in Java - The java language has many features that

improve developer productivity promote code reuse and reduce development and

maintenance costs

Works well with Open Source - Java with Linux and the many open source

movement projects and libraries provide a powerful mix that ensures development

is cost-effective efficient and of high quality because extensively tested libraries

components and solutions are available to plug-in to customer development

efforts

343 Nokia Mobile Internet Toolkit 41

To design and implement a WAP application on a Nokia phone the Nokia Internet

Toolkit has to be downloaded and installed on the PC A Nokia simulator is installed as

part of the installation but various phone simulators can be downloaded and installed

This simulator is used for testing purpose Also it has a server simulator based on the

Nokia Active Server if a WAP Gateway is unavailable

32 software requirements

Most of this section has been mentioned in way or other but they will be considered

briefly here

321 Kannel WAP gateway

This is an open source gateway upon which the push proxy gateway of this system will

be built on it available free of charge at kannel project web site

Chapter 3 System requirements

25

322 Linux operating system

It is important to install kannel gateway on it for this project we choose fedora core 7 for

availability reasons

323 JDK16

The java run time environment is required to implement the push initiator

32 hardware requirements

321 PC

Any Personal computer capable of running fedora core 7 with USB interface to be able

connects GSM modem

322 GSM modem

This will act as an alternative to the short message service center SMSC Obviously this

means that GSM network is required too

26

Chapter Four

4 System design

41 System Scenario

The basic scenario of a push session is that a Push Initiator (PI) transmits content to a

WAP client This is done in multiple steps as shown in Figure 31

pushOTAPAP

Gateway

PI

1

2

pull gateway

PPG

3

SMS center

Mobile device

6

5

4

Content provider78 9

Figure 41 WAP push scenario

Chapter 4 System Design

27

The PI communicates with a Push Proxy Gateway (PPG) over the Push Access Protocol

(PAP) (1 and 2) The PPG will then use the Push Over-The-Air Protocol (PushOTA) (3)

to deliver a Uniform Resource Identifier (URI) to the client via a Short Message System

Centre (SMS-C) (4 and 5) The next step for the client is then to activate the URI (6 and

7) and get the content from the server (8 and 9) The mobile device will have to use a

ldquoPull Gatewayrdquo to get the content but it is very likely that this is the same one as the PPG

The same same scenario could be viewed in sequence diagram figure (42)

Push Initiator PPG SMS Center WAP client

Send push message

Send push message response

Send WAP push message

Ack

Send WAP push message

Ack

Message read

Ack

Message read

Ack

Result notification message

Result notification response

Figure 42 WAP push sequence diagram

Chapter 4 System Design

28

43 Modular Design

Conceptually we can envision this push system as consisting of three major components

(presented in the order of the push lifetime)

first there is a Push Initiator Program that reads the generates a notification message and

transmits (pushes) it via a WAP Gateway to the customer phone This message notifies

the user that a service is available if the user accepts will ask the phonersquos browser to pull

the page from our web server via the WAP Gateway

Next there is the Push Proxy Gateway PPG which will receive the push message from

the push initiator and is responsible of doing any needed optimization protocol

compilation and conversion Also it is responsibility of the PPG to find the end user

address and send the push message to the SMS center

Finally there is the SMS center which will do the last delivery of push message to the

intended user if the user were offline the message will be saved for later time until the

WAP client is on

PI PPGSMSC

Figure 43 system modules

Chapter 4 System Design

29

43 Design of system Modules

Following sections of this chapter present a description and design of the system modules

with accompanying graphical representation

431 Push Initiator (PI)

The PI is the first logical component in the WAP Push scenario and therefore the

originator of the push message There are different kinds of PIs One example is an

automated script another one is a semi automated server version written in an applicable

scripting language supporting server side interaction

A push message is sent as an HTTP POST to the Push Proxy Gateway The POST will be

a multipart XML document with the first part being the control entity (Push Access

Protocol) the second part being the content entity (either a Service Indication or a

Service Load) and the third part being the capability entity

HTTP Post

Capability entity

Content entity (SISL)

Control entity (PAP)

Figure 44 architecture of the push message

Chapter 4 System Design

30

4311 Control entity

This part of the push contains the basic information and fields The fields can include

recipient address expiry time bearer type delivery attempt time and a URL to which a

response is to be sent if delivery confirmation is requested by the push initiator

PAP is the protocol used in WAP Push framework for specifying control information and

content that is to be pushed to a client via a Push Proxy Gateway (PPG) A Push Initiator

(PI) triggers push message processing The Push initiator class (Appendix B) of this

design shows how to generate PAP messages

The address of the used PPG should be given as an initialization parameter of the

application (ldquoppg-urlrdquo see Appendix B) This design also provides an implementation

that can be used in a special case when ldquoIPv4 IPv6rdquo type client addressing is applied and

when toolkit is used All other cases including the use of phone numbers (ldquoPLMNrdquo type

address) in sending push messages are considered

The PAP XML contains at the minimum a ltpapgt element a ltpush-messagegt

element and an ltaddressgt element

The important parts of this PAP message are the address value and type The value is

typically a MSISDN and type indicates whether to send to a MSISDN (typical case) or to

an IP Address The TYPE is almost always MSISDN as the Push Initiator (PI) will not

typically have the Mobile Stations IP address - which is generally dynamic

4312 Content entity

This is the actual data that is received by the mobile device The various content types

are Service Indication (SI) Service Load (SL) and Cache Operation (CO) in our project

we will just deal with SI and SL

The SI notifies a client about an external event by inviting the client to interact with it In

other words it informs a client about a service More precisely it sends a message that

Chapter 4 System Design

31

informs the client of a Uniform Resource Identifier (URI) where the client can access the

service

An important attribute of SI is the action attribute it may contain the action to be taken

when the client receives the SI There are two groups that the action attributes can be

divided into

First we have delete and signalmdashnone both of them is used because of their side

effects Ie with delete you take away all SIs with the same si-id as the deletion pushrdquo

including itself and with signal-none you either do nothing or you pay regard to the

info element in that push

The other group consists of signal-low signal-medium and signal-high These

attributes are all used to set the rules for the presentation in the terminal device

o Signal-low

The SI must be postponed without user intervention

o Signal-medium

The SI must be presented as soon as the implementation allows that to be carried out

without disturbing the user (Signal-medium is the value that will be used if none is

specified)

o Signal-high

The SI must be presented as soon as the implementation allows that to be carried out

without disturbing the user or earlier if it seems appropriate (This decision may for

instance be based on user preference settings)

This is the different functionalities supported by the SI we concidered

Expiration

Replacement

Deletion

Chapter 4 System Design

32

Handling of out of order delivery

Handling of information specified in the info element

A PUSH Service Indication (SI) contains at a minimum an ltsigt element and a

ltindicationgt element SL donrsquot differ so much from SI

4313 Capability entity

This entity determines the type of mobile device that is to be served This is determined

by WAP user agent profiling The sender can indicate the hardware vendor and browser

version and type of the intended recipients This capability entity is then matched at the

PPG to see which devices are compatible with the requested capability If there is a

match the content is delivered by the PPG to that specific device

Now a day most devices are compatible with WAP so we donrsquot need to create this entity

more precisely it is optional

After the push has been created in the PI it is up to the system to deliver it to the defined

destination In this system the different responsible entities are the PPG and the SMSC

Both of these two different entities are running on same server but it is only the

configuration of the SMSC that is out of my control since it is run by the operator and is

not controllable in my lab environment

432 Push Proxy Gateway (PPG)

There are various commercial WAP gateways available on the market that are quite

expensive Kannel on the other hand is an open source gateway one doesnrsquot need to pay

for it in addition one can edit the source code himself and construct his own customized

gateway Because Kannel is being developed on Linux systems (RedHat and Debian) it

can be smoothly ported to other UNIX-like operating systems

4321 Kannel gateway architecture

The gateway divides the processing load between the following three hosts

Chapter 4 System Design

33

The bearer box which connects to the SMS (Short Message Service) centers and

or CSD (Circuit Switched Data) routers providing a unified interface to them for

the wapbox The bearer box does this by implementing the WDP (Wireless

Datagram Protocol) layer of the WAP stack

The smsbox implements the rest of the SMS gateway functionality It receives

textual SMS messages from the bearerbox and interprets them as service

requests and responds to them in the appropriate way

The wapbox which hosts the upper layers of the WAP stack Each session and its

transactions are handled by the same wapbox (see figure 35)

1Figure 45 divisions of duties in kannel

4322 Working of the gateway

The bearer box receives UDP (User Datagram Protocol) packets from CSD routers

inspects them to see whether they are WAP packets if so then it will routes them to the

WAP box This simple design allows the bearer box to do a minimum of processing per

smsbox

wapbox

bearerbox

Kannel

SMS center

WAP phone

HTTP server

Chapter 4 System Design

34

packet The bearer box also sends the UDP packets that the other boxes generate which

adds some more routing processing The wapboxes implement the WTP (Wireless

Transaction Protocol) and WSP (Wireless Session Protocol) layers These take HTTP-

like requests from the phones and make the actual HTTP requests to content servers

compress the responses and send them back to the terminals (Sessions are maintained to

make as much use of the limited radio bandwidth as possible)

4323 External interfaces of the gateway

The gateway has interfaces to three external agents

bull SMS centers using various protocols

bull HTTP servers to fetch WAP and SMS content and to push WAP Content The

pull protocol is HTTP push PAP

bull WAP phones implementing the WAP protocol stack and (for push) WAP Push

client

Figure 36 summarize kannel external interfaces

4324 Configuring the gateway

The bearerbox smsbox and wapbox are the main working modules of the gateway and

must be configured before configuring the gateway These three modules are controlled

by a configuration file that has wapbox smsbox and bearerbox groups

Configuring the PPG core group

We use two components the PPG core group and the PPG user group The PPG

core group is used to configure the PI interface(for more details configuration

variables refer to appendix c)

Chapter 4 System Design

35

Mobile telephone

network

The Internet

smsbox

wapbox

bearerbox

Kannel

HTTP

HTTP

HTTP server

Serving WML

files

HTTP server

Serving HTML

files

TCP

TCP

WAPSMS

SMSC

WAP phoneNetwork base station

Workstation used for http

administration

Figure 46 External interfaces of the gateway

4325 Administering the gateway through an HTTP interface

Kannel can be administered via an HTTP interface All commands are given as normal

HTTP queries so they can easily be given from command lines like this one

links -dump httpip-adressportshutdownpassword=yourchoice

But it is advantageous to have graphical user interface for gateway control so we have

designed GUI through http

Chapter 4 System Design

36

433 Short Message Service Centre (SMSC)

A SMSC is an essential component when sending a push message from an IP network to

a mobile device in the architecture supported by the components and devices It is used to

remove the TCPIP layer that the push is encapsulatedrdquo in It is also the entity that

identifies the end-point device When this is done it is also the SMSC that is responsible

for the processing and final message delivery to the device After the process of de-

encapsulation and resolution of the client identity there should not be any difference

between this message and a message that is originated locally from the operator itself

(like a SMS)

In this project we just use a virtual SMS center we try first to get connection to a real

one but our effort was worthless

Finally the following figure depicts the overall flowchart of the WAP push system

(figure 47)

Chapter 4 System Design

37

PI

PPG

Create PAP

HTTP Post

Message

processing

OTA

Connection

oriented

Sessionless Session

oriented

WTP Initiation

WAP clinet

Application

Create content

Create

capability

entity

Database

SMS center

NoYes

Figure 47 the complete flowchart of the system

38

Chapter Five

5 System implementation and results

51 Implementation

511 The Push Proxy Gateway

First of all the Kannel gateway have been compiled and installed using gcc (GNU C

Compiler) this stage go fine except the operating system required more components to

be pre-installed and will configured

Then with stages of configuration to the gateway (Appendix B) it was capable of working

as PPG Figure 51 below show the gateway when it starts

Figure 51 starting kannel gateway

Then a web based user interface had been created to provide an easy way to control the

gateway remotely Figure 52 and figure 53

39

Figure 52 GUI for gateway control

512 The Push initiator

Next the push initiator design had been implemented using java programming language

as in design phase the implementation is taken carefully to make a reusable component

that could be used by other developer

PushInitiator class (Appendix B) implements a simple push initiator which can be used

to create and send messages to a push proxy gateway (PPG)

The method sendPushMessage sends a push message via the PPG to the client The client

is identified by the address which is either the phone number (address type is PLMN) or

IP address The message content and its mime type are also given as arguments to the

method the other tow important method are

createPapMessage This method creates a Push Access Protocol (PAP) type message

40

createSiMessage This method is used to create a service indication (SI) type message

Figure 53 showing running kannel status

513 WAP site

Since this site will be built for testing purpose and making sure that the system is

functional we had not go deep in this section Just simple WAP site with tow page has

been crated

41

52 Service indication

When a SI was pushed to any of the emulator or Nokia phones it was received and

presented in the way it was supposed to as specified in the WAP standard as shown in

figures below This is a proof that the devices claiming to support WAP push do so and

the design is will working See figures 53 through 56

Figure 55 service indication

42

Figure 57 SI details

52 Service load

The emulator correctly receives and interpreted the SL push the same as all of Nokia

phones we have tested

When a SL was pushed to the Ericsson phones it was not presented in the specified way

figure 58 I think that it is because of security reasons The reason for this assumption is

that the phones only supports on or off as security in their push configuration The

emulator on the other hand presents SL correctly Finally the Siemens phone did seem to

interpret SL but the current software was not very consistent It did load the SL without

user interference in the specified way when the user already where having an active

session If the user was offline the phone interface presented a symbol on the display

and did not load the service until the user clicked on the symbol

43

Chapter Six

6 conclusion and future work

In this chapter we will provide the conclusions and proposed future work for interested

individuals

61 Conclusions

In this project a WAP push system has been successfully designed and implemented It

provides a way to partially overcome the limitations encountered when accessing the

World Wide Web using handsets After comparing the proposed project objectives with

those accomplished the main goals are seen to be met

Phones from different manufactures all differ from the WAP-standard in some

ways One of the most obvious differences is the resolution of the display

During the work it has been noticed that the WML pages must be quite small We

have also noticed that the support for tables and some other tags are a bit limited

Even though the WML standard is smaller than the HTML standard it is a little

more complicated to write correct WML pages The main conclusion is that WAP

works pretty well but the phones are a little non-stable

The push proxy gateway is configured and worked probably with virtual SMS

center and it is easy to switch to a real one

The system depends mainly on open sources (ie Linux and kannek)

The design and implementation of the push initiator work well with the kannel

gateway and it should work correctly with other gateways

Chapter 6 Conclusion

44

62 Further Work

The possibilities of wireless push are interesting enough that it has to be worth to know if

the security and conformance problems will be solved in WAP push If they are solved

and the technique is refined then there should be nothing to stop the great number of

services that will follow in its footsteps Therefore there is further work that should be

done and the most interesting parts are in my opinion these

621 Security Aspect

One of the problems today is that the phones supporting push does not have the detailed

security settings that a technique like this needs Therefore it would be interesting to look

into the possibility to add these without confusing the user I suggest furthering looking

into usability aspects of security in WAP Push for short

622 GPS integration possibility

This will provide location dependent delivery of WAP push it will have great

applications in telematic and ecommerce advertising

623 Conformance to Standards

An interesting project would be to examine if the main reason for the nonstandard

solutions in the existing WAP push software is the result of difficulties in

implementation Or if the main reason is that the manufacturers wants to provide

proprietary solutions A reason why one may want to know this is that if the problem is

depending on implementation problems then it might get better

45

Appendix A Abbreviations

CDMA Code Division Multiple Access

CO Cache Operation

DTD Document Type Definition

GSM Global System for Mobile

HTTP Hypertext Transfer Protocol

IP Internet Protocol

MSISDN Mobile Station International Subscriber Directory Number

OTA Over The Air

PAP Push Access Protocol

PushOTA Push Over The Air

PDA Personal Digital Assistant

P1 Push Initiator

PLMN Public Land Mobile Networks

PPG Push Proxy Gateway

SI Service Indication

SIA Session Initiation Application

SIR Session Initiation Request

SL Service Loading

SMPP Short Message Peer to Peer

SMS Short Message System

SMSC Short Message System Center

UCP Universal Computer Protocol

URI Uniform Resource Identifier

URL Uniform Resource Locator

UTC Universal Time Coordinated

WAP Wireless Application Protocol

WBXML WAP binary XML

WDP Wireless Datagram Protocol

WSP Wireless Session Protocol

WTLS Wireless Transport Layer Security

XML Extensible Mark-up Language

46

Appendix B Kannel gateway configurations

THIS IS A SAMPLE CONFIGURATION FOR KANNEL

group = core

admin-port = 13000

admin-password = admin

status-password = admin

admin-deny-ip =

admin-allow-ip = 127001172161455

log-file = tmpkannellog

log-level = 0

http-proxy-host = 172161411

http-proxy-port = 8080

http-proxy-exceptions = 127001

Smsbox related

smsbox-port = 13001

box-deny-ip =

box-allow-ip = 127001

bearerbox-host =localhost

Wapbox related

wapbox-port = 13002

udp-deny-ip =

udp-allow-ip = 127001

bearerbox-host =localhost

SMSC GSM

group = smsc

smsc = at

modemtype = auto

speed =9600

device = devttyS0

SMSC HTTP

group = smsc

smsc = http

system-type = kannel

port = 13016

connect-allow-ip = 127001

Appendix B

47

username = wappush

password = wappush

SMSBOX SETUP

group = smsbox

bearerbox-host = localhost

sendsms-port = 13013

sendsms-chars = 0123456789 +-

log-file = tmpsmsboxlog

log-level = 0

access-log = accesslog

white-list = 127001

black-list =

SEND-SMS USERS

group = sendsms-user

username = wappush

password = wappush

user-deny-ip =

user-allow-ip = 127001

PPG group

group = ppg

ppg-url = wappush

ppg-port = 8080

concurrent-pushes = 100

trusted-pi = true

users = 1024

service-name = ppg

ppg-smsbox-id = dlrbox

WAP PUSH USER

group = wap-push-user

wap-push-user = picom

ppg-username = wappush

ppg-password = wappush

allow-ip = localhost

48

Appendix C Selected Codes

Gateway Control Form

ltDOCTYPE HTML PUBLIC -W3CDTD HTML 32ENgt

lthtmlgt ltheadgt

lttitlegtGateway control formlttitlegt

ltheadgt

ltbody bgcolor=white text=black link=blue vlink=navy

alink=redgt

ltbase target=submitgt

ltscriptgt

function update_status()

if ( adminactionvalue == status )

adminaction = http + adminhostnamevalue +

+ adminportvalue + status +

adminstatusformatvalue

else

adminaction = http + adminhostnamevalue +

+ adminportvalue + + adminactionvalue

adminpasswordvalue = adminpasswordvalue

actiongovalue = GO GET +adminaction

ltscriptgt

lttable align=centergt

lttrgtltp align=centergtlth2gtGateway control

formlth2gtltpgtlttrgt

lttrgt lttdgtHostnamelttdgtlttdgtltinput type=text

name=adminhostname value=localhost

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPortlttdgtlttdgtltinput type=text

name=adminport value=13000

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPasswordlttdgtlttdgtltinput type=password

name=adminpassword value=

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtActionlttdgtlttdgtltselect name=adminaction

onChange=update_status()gt

ltoption value=statusgtStatusltoptiongt

ltoption value=suspendgtSuspendltoptiongt

ltoption value=isolategtIsolateltoptiongt

Appendix C

49

ltoption value=shutdowngtShutdownltoptiongt

ltoption value=resumegtResumeltoptiongt

ltselectgtlttdgt lttrgt

lttrgt lttdgtStatus Formatlttdgtlttdgtltselect

name=adminstatusformat onChange=update_status()gt

ltoption value=gthtmlltoptiongtltoption

value=txtgttxtltoptiongtltoption

value=xmlgtxmlltoptiongtltselectgtlttdgt lttrgt

ltform name=admin method=get

action=httplocalhost13000status

encoding=applicationx-www-formgt

ltinput type=hidden name=password value=gt

lttrgt

lttdgtGolttdgt

ltformgt

lttdgtltinput type=submit value=go name=actiongo

onClick=documentadminsubmit()gtlttdgt

lttrgt

lttablegt

ltbodygt

lthtmlgt

Push Initiator Class

import javanetURL

import javanetHttpURLConnection

import javaio

Class implements a simple push initiator It can be

used to create and send messages to push proxy

gateway (ppg)

public final class PushInitiator

xml version

private final static String XML_VERSION = ltxml

version=10gt

Push Access Protocol (PAP) document type

private final static String PAP_DOCTYPE =

Appendix C

50

ltDOCTYPE pap PUBLIC -WAPFORUMDTD PAP 10EN

httpwwwwapforumorgDTDpap_10dtd gt

content type of the push request multipart body

private final static String CONTENT_TYPE =

multipartrelated boundary=multipart-boundary

type=applicationxml

Service Indication (SI) document type

private static final String SI_DOCTYPE = ltDOCTYPE si

PUBLIC -WAPFORUMDTD SI 10EN +

httpwwwwapforumorgDTDsidtdgt

private static int pushId = 0

PPG url where the pap message is to be sent

private final URL ppgUrl

some push proxy gateways may also require the

authentication of the push initiator

For instance the push initiator may be required to

send an HTTP authorization header in each request

private final String authorization

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

public PushInitiator(URL ppgUrl) thisppgUrl =

ppgUrl

authorization = null

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

param authorization a ltcodegtStringltcodegt value

public PushInitiator(URL ppgUrl String authorization)

thisppgUrl = ppgUrl

Appendix C

51

thisauthorization = authorization

Systemoutprintln(Push Initiator created ppgUrl =

+ ppgUrl)

ltcodegtsendPushMessageltcodegt sends push message to

ppg

param clientAddress a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param message a ltcodegtStringltcodegt value

param mimeType a ltcodegtStringltcodegt value

exception Exception if an error occurs

public void sendPushMessage(String clientAddress

String addressTypeString message String mimeType)

throws Exception

HttpURLConnection http =

(HttpURLConnection)ppgUrlopenConnection()

String ppgServer = ppgUrlgetHost()

httpsetDoInput(true)

httpsetRequestProperty(Content-Type CONTENT_TYPE)

if(authorization = null)

if(authorizationtrim()equals())

httpsetRequestProperty(Authorization

authorization)

httpsetDoOutput(true)

PrintWriter out = new PrintWriter(new

BufferedOutputStream(httpgetOutputStream()))

outprintln(--multipart-boundary)

outprintln(Content-type applicationxml)

outprintln()

outprintln(createPapMessage(clientAddress

addressTypeppgServer genPushId() null))

outprintln()

outprintln(--multipart-boundary)

outprintln(Content-type + mimeType)

outprintln()

outprintln(message)

outprintln()

outprintln(--multipart-boundary--)

outflush()

outclose()

httpconnect()

Appendix C

52

finally read and debug the response received from

PPG

try

debugResponse(http)

catch (Exception e)

Systemerrprintln(Error in receiving the

response)

ltcodegtcreatePapMessageltcodegt creates a Push Access

Protocoltype message

param address a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param ppgServer a ltcodegtStringltcodegt value

param pushId a ltcodegtStringltcodegt value

param notificationTo a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createPapMessage(String address

String addressType String ppgServer String pushId

String notificationTo)

return XML_VERSION + n + PAP_DOCTYPE + n +

ltpap product-name=Mobile Zoo Push

Initiatorgtn +

ltpush-message push-id= + pushId +

(notificationTo = null request-notification-

to= + notificationTo ) + gtn +

ltaddress address-value=WAPPUSH= + address +

TYPE= + addressType +

+ ppgServer + gtn +

ltpush-messagegtnltpapgt

ltcodegtcreateSiMessageltcodegt creates a service

indication type message

param url a ltcodegtStringltcodegt value

param created a ltcodegtStringltcodegt value

param expires a ltcodegtStringltcodegt value

Appendix C

53

param message a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createSiMessage(String url

String sid String created String expires String

action String message)

return XML_VERSION + SI_DOCTYPE +

ltsigtn +

ltindication href= + url + +

(sid = null si-id= + sid + ) +

created = null created= + created +

) +

(action = null action= + action +

) +

(expires = null expires= + expires +

) + gt +

message +

ltindicationgtnltsigt

Debug response

param http a ltcodegtHttpURLConnectionltcodegt value

exception Exception if an error occurs

private void debugResponse(HttpURLConnection http)

throws Exception

Systemoutprintln(httpgetResponseMessage())

String headerName

int i=0

while((headerName = httpgetHeaderFieldKey(i++)) =

null)

Systemoutprintln(headerName + +

httpgetHeaderField(headerName))

Systemoutprintln()

InputStreamReader in = new InputStreamReader(new

BufferedInputStream(httpgetInputStream()))

int c

Appendix C

54

while((c = inread()) = -1)

Systemoutprint((char)c)

Systemoutprintln()

ltcodegtgenPushIdltcodegt generates an unique push id

return a ltcodegtStringltcodegt value

private String genPushId()

pushId = 100000

return SystemcurrentTimeMillis() + + pushId++

55

References

[1] Microsoft ldquoGetting Mobile Using WML and WAP to Display Web Sites on

Mobile Devicesrdquo

URL msdnmicrosoftcomen-uslibraryaa140117(office10)aspx accessed

on April 10 2008

[2] DALE BULBROOK ldquoWAPA Beginnerrsquos Guiderdquo OsborneMcGraw-Hill 2001

[3] WAP Forum Wireless Application Protocol Architecture Specification Access on

Jan 12 2008 Available

httpwww1wapforumorgtechdocumentsWAP-210-WAPArch-2006 07 12-apdf

[4] WAP Forum Push Architectural Overview access on (2008 February 3) Available

httpwww1wapforumorgtechdocumentsWAP-250-PushArchOverview-2007 04

03-apdf

[5] Service indication PDF access on 62008 Available

httpwwww3orgTRhtml401structlinkshtml

[6] WAP Push Technology (openwave) PDF access on (2008 April) Available

URL httpwwwopenwavorg

[7] Web site (httpwwwwapforumorgwhatcopyrighthtm) access on May 2008

[8] ldquoWAP Push Proxy Gateway Specificationrdquo WAP Forum access on 16-August-

2007URI httpwwwwapforumorgPDF

[9] WAP Forum Access on (2008 MAY 31) WAP Service Indication Specification

Available httpwww1wapforumorgtechdocumentsWAP-167-ServiceInd-200507

31-apdf

  • odc_fpwmlandwap_topic3
  • N100E3
  • 21
  • 5

Chapter 2 Basic Concepts

7

221 Application Layer Wireless Application Environment

The wireless application environment WAE is a standard for developing applications

and services that operate on wireless communication networks The WAE layer consists

of several parts wireless markup language binary XML wireless markup language

scripts and wireless telephony application [5]

2211 WML

Pages or services created using HTML do not work very well on small handheld devices

since they were specifically developed for use on desktop computers with larger color

screens Also low bandwidth wireless bearers wouldnrsquot be suitable for delivering the

large files that HTML pages often consist of Therefore a markup language specifically

adapted to these restrictions has been developedmdashWML

WML provides a navigation model for devices with small display screens and limited

input facilities (no mouse and a limited keyboard) In order to save valuable bandwidth in

the wireless network WML can be encoded into a compact binary format for

transmission between the phone and the network and vice-versa

WML uses uniform resource locators URLs in the following situations

o when specifying navigation eg hyperlinking

o when specifying external resources eg An image or a script

WML is an XML language with the same character sets as an XML document XML is

case-sensitive and therefore is also WML case-sensitive

WML is built on cards and decks A card is a one or more unit of user interaction eg a

choice menu a screen of text or a text entry field This means that the user navigates

through a series of WML cards reviews the contents of each enters requested

information makes choices and moves to another card Cards are grouped into decks [5]

Chapter 2 Basic Concepts

8

2212 WMLScript

WMLScript is a client-side scripting language It is very much like JavaScript which is

used on dynamic HTML(DHTML) web sites but WMLScript has been modified to fit

the currently severe limitations of the WAP environment and is in many ways restricted

compared to JavaScript

Client-side means that the code actually runs on the micro-browser itself The code is

downloaded to the WAP device as part of the deck so that when the code is executed it

does not have to make a trip back to the server to find out what to do next Everything the

application needs is right there Client-side functionality is therefore much faster in the

userrsquos perception

2213 Binary Extensible Markup Language

Binary XML is a compact binary representation of XML The binary XML is design to

reduce the transmission size of XML documents This allows more effective use of

narrow banded communication channels without any loss of functionality or semantic

information [5]

222 Session Layer Wireless Session Protocol

The wireless session protocol layer supports the wireless application environment with

two different session services The first is a connection mode service that operates above

a transaction layer protocol WTP and the second is a connection-less service that

operates above a datagram transport service WSP supports HTTP 11 functionality and

some new features These features include long-lived session a common facility for data

push capability negotiation and session suspendresume [5]

WSP provides support for exchange of content between clients and servers To support

the exchange the WSP establishes a reliable session negotiates on common capabilities

exchanges the data using compact encoding and releases the session The WSP also

supplies functionality to suspend and resume the session in order to save battery while

Chapter 2 Basic Concepts

9

the session is idle The WSP lifecycle is therefore not tied to the underlying transport

layer

WSP is a binary version of HTTP which includes both headers and data Binary

encoding is used to minimize the protocol overhead and to simplify decoding The header

is used to define content type character set encoding languages etc in an extensible

manner WSP supports two types of data transfers push and pull Pull transfer is used

when the client is sending a request and the server is sending a response In the push

mechanism the server pushes data to a client without prior request from the client

This can be done in three different ways Confirmed data can be pushed within an

existing session or non-confirmed data pushes can be done within or without an existing

session

223 Transaction Layer Wireless Transaction Protocol

The wireless transaction protocol WTP is defined to provide the services necessary for

sending requests responses and information WTP runs on top of a datagram service and

optionally a security service To ensure safe connection on top of the datagram layer the

WTP layer performs retransmissions sends acknowledgements and removes duplicated

messages In order to improve the connection efficiency WTP has no explicit connection

or teardown phases The layer also performs segmentation and reassembly to reduce the

number of packets sent

WTP has been defined as a transaction protocol that is suitable for mobile stations and

operates efficiently over wireless datagram networks Some benefits of using WTP are

that it improves reliability over datagram services improves efficiency over connection-

oriented services and that it is message oriented and designed for requestresponse

applications

The wireless transaction protocol is divided into three transaction services It can send

unreliable messages with no result message reliable messages with no result message or

reliable messages with exactly one result message

Chapter 2 Basic Concepts

10

Unreliable Messages With No Result Message

This service provides an unreliable datagram service The service can be used by

applications which occasionally want to send a datagram within an existing session

using WTP No acknowledgement or retransmission is done in this service

Reliable Messages With No Result Message

This service provides a reliable datagram service The service can be used by

applications that want to use a reliable push service The receiver acknowledges the

message and if the original sender receives no acknowledgement the message is

retransmitted

Reliable Messages With One Reliable Result Message

This service provides the basic invokeresponse transaction The receiver acknowledges

the message and if the original sender receives no acknowledgement the message is

retransmitted To confirm the reception of the acknowledgement the original sender

sends an acknowledgement to the receiver The three transactions are shown in next

figure

message message

acknowledge

message

confirm

Unreliable invoke

message with no

result message

Reliable invoke

message with no

result message

Reliable invoke

message with one

reliable result

message

a) b) c)

acknowledge

Figure 22 the three mode of transaction

Chapter 2 Basic Concepts

11

2231 Concatenation and Separation

To reduce the overhead caused by the datagram headers it is desirable to reduce the

number of packets sent over the air In order to reduce the number of messages several

protocol data units can be put into one single datagram This procedure is called the

concatenation procedure The reverse procedure is called the separation procedure [5]

Concatenation can be done when several packets are transported from the same sender to

the same receiver Concatenation can be done at any time The last acknowledgement can

be concatenated with the invoke message of the next transaction [5]

2232 Segmentation and Reassembly

If a packet is lager than the bearers largest capability the message can be segmented and

send in several packets To increase the communication efficiency message groups can be

acknowledged in groups [5]

To decrease the number of packets sent when a communication error occurs the receiver

can request one or multiple lost packets within a group of messages This is done instead

of resending the entire message which could mean that successfully received packets

have to be resent [5]

224 Security Layer Wireless Transport Layer Security

An Optional layer it is responsible for providing security data integrity and

authentication between two communicating applications The WTLS is optimized for low

bandwidth bearer networks with relatively long latency The WTLS is similar to the

Internet transport layer security TLS but has some new features such as datagram

support optimized handshake and dynamic key refreshing [5]

WTLS has been design to function on both connection-oriented and datagram transport

protocols The security layer acts above the transport layer

Chapter 2 Basic Concepts

12

2241 Service Primitives

WTLS uses primitives to ensure security The primitives are used to

Initiate a secure connection

Perform public-key authentication or key exchange with the client

Change into connection state when the handshake has been done

Terminate the connection

Inform the other end about warning level alerts

Request by the server that the client should initiate a new handshake

225 Transport Layer Wireless Datagram Protocol

The wireless datagram layer is a datagram service used by the upper layers WDP is

designed to communicate over different bearer services and especially for wireless

telecommunication networks [6] It Consists of

bull Source and destination address and port

bull Optionally fragmentation

It maps to UDP for IP bearer and moves single packets to and from the phone

226 WDP and IP

In networks with IP as the routing protocol UDP is used instead of WDP IP provides

segmentation and reassemble in a connection-less datagram service UDP provides port

based addressing and other necessary functions Thereby no additional functions are

required by a WDP layer [7]

227 Bearer Interfaces

WAP supports dial-up networking using IP and Point-to-Point Protocol (PPP) as the

bearer interface underneath WDP It also supports Short Message System (SMS) and

General Packet Radio System (GPRS) SMS passes text and binary data between digital

Chapter 2 Basic Concepts

13

phones GPRS is a relatively new technology that implements faster always-on

connections for wireless devices GPRS actually runs on top of IP [7]

As had been learned above WAP is quite similar to web figure 23 provide a brief

comparison between them

WAP

Bearer

WDP Dtatgram

WTLS security

WTP Transaction

WSP Session

WAE

WML and

WMLScript

Web

IP

TCP UDP

TLS-SSL

HTTP

HTML

JavaScript

VBscript

Figure 23 Web vs WAP

Chapter 2 Basic Concepts

14

23 SMS overview

SMS stands for Short Message Service It is a technology that enables the sending and

receiving of messages between mobile phones SMS first appeared in Europe in 1992 It

was included in the GSM (Global System for Mobile Communications) standards right at

the beginning Later it was ported to wireless technologies like CDMA and TDMA The

GSM and SMS standards were originally developed by ETSI ETSI is the abbreviation

for European Telecommunications Standards Institute Now the 3GPP (Third Generation

Partnership Project) is responsible for the development and maintenance of the GSM and

SMS standards [8]

SMS has two operational mode textual mode and binary mode which will allow sending

other data beside pure text

24 Push overview

WAP push provides a standard means to send data to a mobile subscriber without an

explicit request from the subscriber at the time the data is delivered In the normal

clientserver model a client requests a service or information from a server which then

responds by transmitting information to the client This is known as ldquopullrdquo technology

The client pulls information from the server The World Wide Web is the best example of

pull technology where a user enters a URL (the request) which is sent to a server and

the server answers by sending a Web page (the response) to the user (Figure 24 a)

Although WAP push is also based on the clientserver model it provides a means to send

data to the subscriber without an explicit request from the client at the time of delivery

(Figure 24 b)

With push functionality users are able to get information without having to request that

information In many cases it is important for the user to get the information as soon as it

is available Push communications can be used for sending stock quotes traffic reports

and news

Chapter 2 Basic Concepts

15

a) WAP pull model

b) WAP push model

Figure 24 Pull vs Push

24 WAP Push framework

A push operation starts when a server called the push initiator transmits a push messages

to a WAP client Since the push initiator located on the Internet does not use the same

protocol as the WAP client a translating gateway is needed The push initiator contacts

the push proxy gateway via the push access protocol and the Internet protocol The push

proxy gateway translates the information and forwards the pushed content to the WAP

device via the push over the air protocol (figure 25) [9]

Chapter 2 Basic Concepts

16

Push Proxy Gateway

WAP

Client

Push

Access Protocol

Push

over-the air

protocol Push Initiator

Figure 25 the wireless push technology

241 Push Proxy Gateway

The push proxy gateway PPG is the entity that does most of the work in the push

architecture The gateway acts as an access-point for content pushed from the Internet to

the client So the responsibility of the gateway owners to grant access to push proxy

gateway [9]

Besides the actual access-point service the push gateway provides the following services

push initiator identification and authentication

parsing and error detection of content control information

client discovery services

address resolution

binary encoding and compilation of certain content type

protocol conversion

Chapter 2 Basic Concepts

17

Information to the push proxy gateway is sent via the push access protocol PAP The

content of the information is divided into several parts were the first part is information to

the PPG such as recipient information

When the PPG has parsed the control information an acknowledgement is sent to the

push initiator reporting if the service was successful or not

Once the proxy has accepted the content and the push initiator has received the

acknowledgement the proxy is responsible for the transmission to the client The proxy

attempts to find the correct destination device and deliver the content to that client using

the push over the air protocol The contents delivered to the proxy may be translated to

their binary counterpart eg WML documents may be converted to binary XML by the

proxy before the information is transmitted to the client [9]

The proxy must implement a service to enable capability queries from the push initiator

The capability query should be responded with the capabilities of the specified WAP

device The push proxy gateway may also implement broadcasting services where

special addresses may be translated to a broadcast operation [9]

242 Push Access Protocol

The push access protocol PAP is the means by which an Internet-based push initiator

pushes content to a mobile network via the push proxy gateway [9] The push access

protocol is not intended for use over the air

PAP supports the following operations

Push submission

The push message sent from the push initiator to the gateway contains a control

entity a content entity and may contain a capability entity The control entity is

an XML document When the gateway has received the message an XML

response message is sent back to the initiator

Chapter 2 Basic Concepts

18

Result notification

If the push initiator has requested confirmation of successful delivery this XML

message is transmitted from the PPG to the push initiator when the content has

been delivered to the mobile device The push initiator acknowledges this result

message with another XML document

Push cancellation

The purpose of the push cancellation is to allow the push initiator to attempt to

cancel a previously submitted push message Both the cancellation message and

the resulting acknowledgement are sent as XML documents

Status query

The status query operation allows the push initiator to request the current status of

a message that has been previously submitted Both the status query message and

the resulting acknowledgement are sent as XML documents

Client capabilities query

This operation allows the push initiator to query the PPG for the capabilities of a

specific device The query is sent as an XML document and the response is sent

as another XML document

To access the push proxy gateway an address is used The gatewayrsquos underlying

protocols determines which type of address is used eg in HTTP a URL is used To

access a specific device the devicersquos address is included in the XML document

There are two ways to send information to several clients The push initiator can either

send information to several specific addresses or broadcast it to all clients In both cases

only one message is sent to the gateway which either sends the information to some or

all of the clients The clientsrsquo address is depending on the underlying layer [9]

Chapter 2 Basic Concepts

19

243 Push Over-The-Air Protocol

The push proxy gateway and the client communicate using the push over the air protocol

which utilizes WSP session services Pushes can be sent via connection oriented links or

connection-less links Connection-oriented pushes require that an active WSP session is

available but the server can not create a session To solve the case were there is no active

WSP session the push framework introduces a session initiation application in the client

This application listens to session requests from the OTA-server and responds by setting

up a WSP session for push purposes [9]

Push

Over-the air

WSP

Push management

premptive

Push operational

primitives

WSP Servise

Primitives

Figure 26 Push Over-The-Air protocol stack

The push over the air protocol supports two kinds of operations operations to manage the

connection and operations to send actual messages

Push Sends unconfirmed information over a connection-oriented link

Confirmed push Sends confirmed information over a connection-oriented link

Abort push rejects a previously transmitted push operation This is operation is

part of the confirmed push mechanism

Unit push Sends unconfirmed information over a connection-less link

Connect Creates a push session

Chapter 2 Basic Concepts

20

Suspend Request that a push session should be suspended

Resume Request to resumes a previously suspended push session

Disconnect Terminates the push session

Session request Request from the server to initialize a session to a client

244 Service Indication

The service indication SI provides a mechanism composed in an XML message to

notify a client that an external asynchronous event has occurred and indicate a service

that can be loaded in order to react to that event In order to notify the user a message is

sent from the push initiator via the proxy to the client The message will be shown to the

user and there will be a reference to a URI where the appropriate service can be loaded

For example the message could be ldquoYou have new mailrdquo and the URI to your email

service [9]

When the message is received by the client it will be presented to the user The user then

can choose to launch the service in an application eg the WML browser or to postpone

the SI for later handling Postponed SIs will be stored in the client and the user is given

the possibility to act upon them later When the user choose to launch the service the

service is started in the same way as if the user would have started it manually [9]

Messages sent with the service indication can support mechanisms to improve the end-

user-experience

User-intrusiveness levels

To improve the users understanding of the provided service and to affect the users

behavior when the message is delivered it is possible to change the level of user-

intrusiveness

Chapter 2 Basic Concepts

21

Deletion

When a pushed message becomes invalid the service provider can delete the

message in the clients For example an email notification becomes invalid when

the message are read

Replacement

When a pushed message is invalid and updated with a new message the service

provider can replace the origin message with a new one

Handling of out of order delivery

Since the wireless communication is unpredictable it can not be ensured that the

messages are received in the same order as sent This mechanism discards all

messages older than the latest received

Expiration

Some services may only be valid for a certain amount of time when the time has

expired the message is removed from the client

245 Service Loading

The service loading method provides means to convey a URI to a user agent in a mobile

client The method is conveyed in an XML message In difference from the service

indication method the client loads the content of the URI automatically without any

action from the user when the service loading message is received

Thereby the user will experience the content as if it was pushed to the mobile client and

executed In the service loading mechanism there is a reference to a service page that will

automatically be loaded without interaction with the user included For example the client

will automatically start the email service when a message about new mails on the server

is received [9]

Chapter 2 Basic Concepts

22

When the client is busy with some application it is not suitable to execute the referred

content directly upon reception of a message To avoid this client may cache the content

indicated by the URI so it becomes available to the user when the client is ready

Messages sent with the service loading method can support mechanism to improve the

end-user-experience

Control of the level of user interaction

To improve the users understanding of the provided service and the affect the

userrsquos behavior when the message is delivered it is possible to change the level

of user-intrusiveness The service can explicitly specify if the service should be

loaded or not if the client is busy on reception

Pre-emptive content caching

By setting this attribute the service loading can require that the indicated content

is downloaded and cached instead of executed This can be used to improve the

users experience of the services that otherwise would have required content to

be retrieved from an origin

23

Chapter Three

3 System requirements

Several materials and requirements must be incorporated into the design implementation

and testing The following discusses the components necessary to fulfill the project

requirements and environment

31 development environment

There are many development tools to choose from when developing for WAP Push and

hen you combine different environments with different gateways you will get a vast

numbers of choices This large flora of tools makes it difficult to choose a suitable

environment an important issue because a badly chosen one might consume a lot of time

341 Operating system

Kannel (the chosen gateway for the system) is being developed on Linux systems and

should be fairly easy to export to other Unix-like systems Although it should be working

without major problems on Windows (through Cygwin) Solaris and FreeBSD The push

initiator is implemented on java so it is operating system independent

Linux is the logical choice especially when it comes to the world severs and networking

for it promising feature as an open source low cost operating system

342 Programming language

Since system design was planned to be modular to enhance the reuse of its components as

explained above then an object oriented programming language will be a reasonable

choice Another factor is the need for a graphical user interface which imposes using a

programming language with good graphics handling capabilities at the same time it

should be over Linux

Chapter 3 System requirements

24

The best programming language to accomplish the above requirement is found to be java

which has the flowing feature

Cross platform - All clients and servers run the same Java code without any

changes or recompilation This simplifies deployment

Cost effective to develop in Java - The java language has many features that

improve developer productivity promote code reuse and reduce development and

maintenance costs

Works well with Open Source - Java with Linux and the many open source

movement projects and libraries provide a powerful mix that ensures development

is cost-effective efficient and of high quality because extensively tested libraries

components and solutions are available to plug-in to customer development

efforts

343 Nokia Mobile Internet Toolkit 41

To design and implement a WAP application on a Nokia phone the Nokia Internet

Toolkit has to be downloaded and installed on the PC A Nokia simulator is installed as

part of the installation but various phone simulators can be downloaded and installed

This simulator is used for testing purpose Also it has a server simulator based on the

Nokia Active Server if a WAP Gateway is unavailable

32 software requirements

Most of this section has been mentioned in way or other but they will be considered

briefly here

321 Kannel WAP gateway

This is an open source gateway upon which the push proxy gateway of this system will

be built on it available free of charge at kannel project web site

Chapter 3 System requirements

25

322 Linux operating system

It is important to install kannel gateway on it for this project we choose fedora core 7 for

availability reasons

323 JDK16

The java run time environment is required to implement the push initiator

32 hardware requirements

321 PC

Any Personal computer capable of running fedora core 7 with USB interface to be able

connects GSM modem

322 GSM modem

This will act as an alternative to the short message service center SMSC Obviously this

means that GSM network is required too

26

Chapter Four

4 System design

41 System Scenario

The basic scenario of a push session is that a Push Initiator (PI) transmits content to a

WAP client This is done in multiple steps as shown in Figure 31

pushOTAPAP

Gateway

PI

1

2

pull gateway

PPG

3

SMS center

Mobile device

6

5

4

Content provider78 9

Figure 41 WAP push scenario

Chapter 4 System Design

27

The PI communicates with a Push Proxy Gateway (PPG) over the Push Access Protocol

(PAP) (1 and 2) The PPG will then use the Push Over-The-Air Protocol (PushOTA) (3)

to deliver a Uniform Resource Identifier (URI) to the client via a Short Message System

Centre (SMS-C) (4 and 5) The next step for the client is then to activate the URI (6 and

7) and get the content from the server (8 and 9) The mobile device will have to use a

ldquoPull Gatewayrdquo to get the content but it is very likely that this is the same one as the PPG

The same same scenario could be viewed in sequence diagram figure (42)

Push Initiator PPG SMS Center WAP client

Send push message

Send push message response

Send WAP push message

Ack

Send WAP push message

Ack

Message read

Ack

Message read

Ack

Result notification message

Result notification response

Figure 42 WAP push sequence diagram

Chapter 4 System Design

28

43 Modular Design

Conceptually we can envision this push system as consisting of three major components

(presented in the order of the push lifetime)

first there is a Push Initiator Program that reads the generates a notification message and

transmits (pushes) it via a WAP Gateway to the customer phone This message notifies

the user that a service is available if the user accepts will ask the phonersquos browser to pull

the page from our web server via the WAP Gateway

Next there is the Push Proxy Gateway PPG which will receive the push message from

the push initiator and is responsible of doing any needed optimization protocol

compilation and conversion Also it is responsibility of the PPG to find the end user

address and send the push message to the SMS center

Finally there is the SMS center which will do the last delivery of push message to the

intended user if the user were offline the message will be saved for later time until the

WAP client is on

PI PPGSMSC

Figure 43 system modules

Chapter 4 System Design

29

43 Design of system Modules

Following sections of this chapter present a description and design of the system modules

with accompanying graphical representation

431 Push Initiator (PI)

The PI is the first logical component in the WAP Push scenario and therefore the

originator of the push message There are different kinds of PIs One example is an

automated script another one is a semi automated server version written in an applicable

scripting language supporting server side interaction

A push message is sent as an HTTP POST to the Push Proxy Gateway The POST will be

a multipart XML document with the first part being the control entity (Push Access

Protocol) the second part being the content entity (either a Service Indication or a

Service Load) and the third part being the capability entity

HTTP Post

Capability entity

Content entity (SISL)

Control entity (PAP)

Figure 44 architecture of the push message

Chapter 4 System Design

30

4311 Control entity

This part of the push contains the basic information and fields The fields can include

recipient address expiry time bearer type delivery attempt time and a URL to which a

response is to be sent if delivery confirmation is requested by the push initiator

PAP is the protocol used in WAP Push framework for specifying control information and

content that is to be pushed to a client via a Push Proxy Gateway (PPG) A Push Initiator

(PI) triggers push message processing The Push initiator class (Appendix B) of this

design shows how to generate PAP messages

The address of the used PPG should be given as an initialization parameter of the

application (ldquoppg-urlrdquo see Appendix B) This design also provides an implementation

that can be used in a special case when ldquoIPv4 IPv6rdquo type client addressing is applied and

when toolkit is used All other cases including the use of phone numbers (ldquoPLMNrdquo type

address) in sending push messages are considered

The PAP XML contains at the minimum a ltpapgt element a ltpush-messagegt

element and an ltaddressgt element

The important parts of this PAP message are the address value and type The value is

typically a MSISDN and type indicates whether to send to a MSISDN (typical case) or to

an IP Address The TYPE is almost always MSISDN as the Push Initiator (PI) will not

typically have the Mobile Stations IP address - which is generally dynamic

4312 Content entity

This is the actual data that is received by the mobile device The various content types

are Service Indication (SI) Service Load (SL) and Cache Operation (CO) in our project

we will just deal with SI and SL

The SI notifies a client about an external event by inviting the client to interact with it In

other words it informs a client about a service More precisely it sends a message that

Chapter 4 System Design

31

informs the client of a Uniform Resource Identifier (URI) where the client can access the

service

An important attribute of SI is the action attribute it may contain the action to be taken

when the client receives the SI There are two groups that the action attributes can be

divided into

First we have delete and signalmdashnone both of them is used because of their side

effects Ie with delete you take away all SIs with the same si-id as the deletion pushrdquo

including itself and with signal-none you either do nothing or you pay regard to the

info element in that push

The other group consists of signal-low signal-medium and signal-high These

attributes are all used to set the rules for the presentation in the terminal device

o Signal-low

The SI must be postponed without user intervention

o Signal-medium

The SI must be presented as soon as the implementation allows that to be carried out

without disturbing the user (Signal-medium is the value that will be used if none is

specified)

o Signal-high

The SI must be presented as soon as the implementation allows that to be carried out

without disturbing the user or earlier if it seems appropriate (This decision may for

instance be based on user preference settings)

This is the different functionalities supported by the SI we concidered

Expiration

Replacement

Deletion

Chapter 4 System Design

32

Handling of out of order delivery

Handling of information specified in the info element

A PUSH Service Indication (SI) contains at a minimum an ltsigt element and a

ltindicationgt element SL donrsquot differ so much from SI

4313 Capability entity

This entity determines the type of mobile device that is to be served This is determined

by WAP user agent profiling The sender can indicate the hardware vendor and browser

version and type of the intended recipients This capability entity is then matched at the

PPG to see which devices are compatible with the requested capability If there is a

match the content is delivered by the PPG to that specific device

Now a day most devices are compatible with WAP so we donrsquot need to create this entity

more precisely it is optional

After the push has been created in the PI it is up to the system to deliver it to the defined

destination In this system the different responsible entities are the PPG and the SMSC

Both of these two different entities are running on same server but it is only the

configuration of the SMSC that is out of my control since it is run by the operator and is

not controllable in my lab environment

432 Push Proxy Gateway (PPG)

There are various commercial WAP gateways available on the market that are quite

expensive Kannel on the other hand is an open source gateway one doesnrsquot need to pay

for it in addition one can edit the source code himself and construct his own customized

gateway Because Kannel is being developed on Linux systems (RedHat and Debian) it

can be smoothly ported to other UNIX-like operating systems

4321 Kannel gateway architecture

The gateway divides the processing load between the following three hosts

Chapter 4 System Design

33

The bearer box which connects to the SMS (Short Message Service) centers and

or CSD (Circuit Switched Data) routers providing a unified interface to them for

the wapbox The bearer box does this by implementing the WDP (Wireless

Datagram Protocol) layer of the WAP stack

The smsbox implements the rest of the SMS gateway functionality It receives

textual SMS messages from the bearerbox and interprets them as service

requests and responds to them in the appropriate way

The wapbox which hosts the upper layers of the WAP stack Each session and its

transactions are handled by the same wapbox (see figure 35)

1Figure 45 divisions of duties in kannel

4322 Working of the gateway

The bearer box receives UDP (User Datagram Protocol) packets from CSD routers

inspects them to see whether they are WAP packets if so then it will routes them to the

WAP box This simple design allows the bearer box to do a minimum of processing per

smsbox

wapbox

bearerbox

Kannel

SMS center

WAP phone

HTTP server

Chapter 4 System Design

34

packet The bearer box also sends the UDP packets that the other boxes generate which

adds some more routing processing The wapboxes implement the WTP (Wireless

Transaction Protocol) and WSP (Wireless Session Protocol) layers These take HTTP-

like requests from the phones and make the actual HTTP requests to content servers

compress the responses and send them back to the terminals (Sessions are maintained to

make as much use of the limited radio bandwidth as possible)

4323 External interfaces of the gateway

The gateway has interfaces to three external agents

bull SMS centers using various protocols

bull HTTP servers to fetch WAP and SMS content and to push WAP Content The

pull protocol is HTTP push PAP

bull WAP phones implementing the WAP protocol stack and (for push) WAP Push

client

Figure 36 summarize kannel external interfaces

4324 Configuring the gateway

The bearerbox smsbox and wapbox are the main working modules of the gateway and

must be configured before configuring the gateway These three modules are controlled

by a configuration file that has wapbox smsbox and bearerbox groups

Configuring the PPG core group

We use two components the PPG core group and the PPG user group The PPG

core group is used to configure the PI interface(for more details configuration

variables refer to appendix c)

Chapter 4 System Design

35

Mobile telephone

network

The Internet

smsbox

wapbox

bearerbox

Kannel

HTTP

HTTP

HTTP server

Serving WML

files

HTTP server

Serving HTML

files

TCP

TCP

WAPSMS

SMSC

WAP phoneNetwork base station

Workstation used for http

administration

Figure 46 External interfaces of the gateway

4325 Administering the gateway through an HTTP interface

Kannel can be administered via an HTTP interface All commands are given as normal

HTTP queries so they can easily be given from command lines like this one

links -dump httpip-adressportshutdownpassword=yourchoice

But it is advantageous to have graphical user interface for gateway control so we have

designed GUI through http

Chapter 4 System Design

36

433 Short Message Service Centre (SMSC)

A SMSC is an essential component when sending a push message from an IP network to

a mobile device in the architecture supported by the components and devices It is used to

remove the TCPIP layer that the push is encapsulatedrdquo in It is also the entity that

identifies the end-point device When this is done it is also the SMSC that is responsible

for the processing and final message delivery to the device After the process of de-

encapsulation and resolution of the client identity there should not be any difference

between this message and a message that is originated locally from the operator itself

(like a SMS)

In this project we just use a virtual SMS center we try first to get connection to a real

one but our effort was worthless

Finally the following figure depicts the overall flowchart of the WAP push system

(figure 47)

Chapter 4 System Design

37

PI

PPG

Create PAP

HTTP Post

Message

processing

OTA

Connection

oriented

Sessionless Session

oriented

WTP Initiation

WAP clinet

Application

Create content

Create

capability

entity

Database

SMS center

NoYes

Figure 47 the complete flowchart of the system

38

Chapter Five

5 System implementation and results

51 Implementation

511 The Push Proxy Gateway

First of all the Kannel gateway have been compiled and installed using gcc (GNU C

Compiler) this stage go fine except the operating system required more components to

be pre-installed and will configured

Then with stages of configuration to the gateway (Appendix B) it was capable of working

as PPG Figure 51 below show the gateway when it starts

Figure 51 starting kannel gateway

Then a web based user interface had been created to provide an easy way to control the

gateway remotely Figure 52 and figure 53

39

Figure 52 GUI for gateway control

512 The Push initiator

Next the push initiator design had been implemented using java programming language

as in design phase the implementation is taken carefully to make a reusable component

that could be used by other developer

PushInitiator class (Appendix B) implements a simple push initiator which can be used

to create and send messages to a push proxy gateway (PPG)

The method sendPushMessage sends a push message via the PPG to the client The client

is identified by the address which is either the phone number (address type is PLMN) or

IP address The message content and its mime type are also given as arguments to the

method the other tow important method are

createPapMessage This method creates a Push Access Protocol (PAP) type message

40

createSiMessage This method is used to create a service indication (SI) type message

Figure 53 showing running kannel status

513 WAP site

Since this site will be built for testing purpose and making sure that the system is

functional we had not go deep in this section Just simple WAP site with tow page has

been crated

41

52 Service indication

When a SI was pushed to any of the emulator or Nokia phones it was received and

presented in the way it was supposed to as specified in the WAP standard as shown in

figures below This is a proof that the devices claiming to support WAP push do so and

the design is will working See figures 53 through 56

Figure 55 service indication

42

Figure 57 SI details

52 Service load

The emulator correctly receives and interpreted the SL push the same as all of Nokia

phones we have tested

When a SL was pushed to the Ericsson phones it was not presented in the specified way

figure 58 I think that it is because of security reasons The reason for this assumption is

that the phones only supports on or off as security in their push configuration The

emulator on the other hand presents SL correctly Finally the Siemens phone did seem to

interpret SL but the current software was not very consistent It did load the SL without

user interference in the specified way when the user already where having an active

session If the user was offline the phone interface presented a symbol on the display

and did not load the service until the user clicked on the symbol

43

Chapter Six

6 conclusion and future work

In this chapter we will provide the conclusions and proposed future work for interested

individuals

61 Conclusions

In this project a WAP push system has been successfully designed and implemented It

provides a way to partially overcome the limitations encountered when accessing the

World Wide Web using handsets After comparing the proposed project objectives with

those accomplished the main goals are seen to be met

Phones from different manufactures all differ from the WAP-standard in some

ways One of the most obvious differences is the resolution of the display

During the work it has been noticed that the WML pages must be quite small We

have also noticed that the support for tables and some other tags are a bit limited

Even though the WML standard is smaller than the HTML standard it is a little

more complicated to write correct WML pages The main conclusion is that WAP

works pretty well but the phones are a little non-stable

The push proxy gateway is configured and worked probably with virtual SMS

center and it is easy to switch to a real one

The system depends mainly on open sources (ie Linux and kannek)

The design and implementation of the push initiator work well with the kannel

gateway and it should work correctly with other gateways

Chapter 6 Conclusion

44

62 Further Work

The possibilities of wireless push are interesting enough that it has to be worth to know if

the security and conformance problems will be solved in WAP push If they are solved

and the technique is refined then there should be nothing to stop the great number of

services that will follow in its footsteps Therefore there is further work that should be

done and the most interesting parts are in my opinion these

621 Security Aspect

One of the problems today is that the phones supporting push does not have the detailed

security settings that a technique like this needs Therefore it would be interesting to look

into the possibility to add these without confusing the user I suggest furthering looking

into usability aspects of security in WAP Push for short

622 GPS integration possibility

This will provide location dependent delivery of WAP push it will have great

applications in telematic and ecommerce advertising

623 Conformance to Standards

An interesting project would be to examine if the main reason for the nonstandard

solutions in the existing WAP push software is the result of difficulties in

implementation Or if the main reason is that the manufacturers wants to provide

proprietary solutions A reason why one may want to know this is that if the problem is

depending on implementation problems then it might get better

45

Appendix A Abbreviations

CDMA Code Division Multiple Access

CO Cache Operation

DTD Document Type Definition

GSM Global System for Mobile

HTTP Hypertext Transfer Protocol

IP Internet Protocol

MSISDN Mobile Station International Subscriber Directory Number

OTA Over The Air

PAP Push Access Protocol

PushOTA Push Over The Air

PDA Personal Digital Assistant

P1 Push Initiator

PLMN Public Land Mobile Networks

PPG Push Proxy Gateway

SI Service Indication

SIA Session Initiation Application

SIR Session Initiation Request

SL Service Loading

SMPP Short Message Peer to Peer

SMS Short Message System

SMSC Short Message System Center

UCP Universal Computer Protocol

URI Uniform Resource Identifier

URL Uniform Resource Locator

UTC Universal Time Coordinated

WAP Wireless Application Protocol

WBXML WAP binary XML

WDP Wireless Datagram Protocol

WSP Wireless Session Protocol

WTLS Wireless Transport Layer Security

XML Extensible Mark-up Language

46

Appendix B Kannel gateway configurations

THIS IS A SAMPLE CONFIGURATION FOR KANNEL

group = core

admin-port = 13000

admin-password = admin

status-password = admin

admin-deny-ip =

admin-allow-ip = 127001172161455

log-file = tmpkannellog

log-level = 0

http-proxy-host = 172161411

http-proxy-port = 8080

http-proxy-exceptions = 127001

Smsbox related

smsbox-port = 13001

box-deny-ip =

box-allow-ip = 127001

bearerbox-host =localhost

Wapbox related

wapbox-port = 13002

udp-deny-ip =

udp-allow-ip = 127001

bearerbox-host =localhost

SMSC GSM

group = smsc

smsc = at

modemtype = auto

speed =9600

device = devttyS0

SMSC HTTP

group = smsc

smsc = http

system-type = kannel

port = 13016

connect-allow-ip = 127001

Appendix B

47

username = wappush

password = wappush

SMSBOX SETUP

group = smsbox

bearerbox-host = localhost

sendsms-port = 13013

sendsms-chars = 0123456789 +-

log-file = tmpsmsboxlog

log-level = 0

access-log = accesslog

white-list = 127001

black-list =

SEND-SMS USERS

group = sendsms-user

username = wappush

password = wappush

user-deny-ip =

user-allow-ip = 127001

PPG group

group = ppg

ppg-url = wappush

ppg-port = 8080

concurrent-pushes = 100

trusted-pi = true

users = 1024

service-name = ppg

ppg-smsbox-id = dlrbox

WAP PUSH USER

group = wap-push-user

wap-push-user = picom

ppg-username = wappush

ppg-password = wappush

allow-ip = localhost

48

Appendix C Selected Codes

Gateway Control Form

ltDOCTYPE HTML PUBLIC -W3CDTD HTML 32ENgt

lthtmlgt ltheadgt

lttitlegtGateway control formlttitlegt

ltheadgt

ltbody bgcolor=white text=black link=blue vlink=navy

alink=redgt

ltbase target=submitgt

ltscriptgt

function update_status()

if ( adminactionvalue == status )

adminaction = http + adminhostnamevalue +

+ adminportvalue + status +

adminstatusformatvalue

else

adminaction = http + adminhostnamevalue +

+ adminportvalue + + adminactionvalue

adminpasswordvalue = adminpasswordvalue

actiongovalue = GO GET +adminaction

ltscriptgt

lttable align=centergt

lttrgtltp align=centergtlth2gtGateway control

formlth2gtltpgtlttrgt

lttrgt lttdgtHostnamelttdgtlttdgtltinput type=text

name=adminhostname value=localhost

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPortlttdgtlttdgtltinput type=text

name=adminport value=13000

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPasswordlttdgtlttdgtltinput type=password

name=adminpassword value=

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtActionlttdgtlttdgtltselect name=adminaction

onChange=update_status()gt

ltoption value=statusgtStatusltoptiongt

ltoption value=suspendgtSuspendltoptiongt

ltoption value=isolategtIsolateltoptiongt

Appendix C

49

ltoption value=shutdowngtShutdownltoptiongt

ltoption value=resumegtResumeltoptiongt

ltselectgtlttdgt lttrgt

lttrgt lttdgtStatus Formatlttdgtlttdgtltselect

name=adminstatusformat onChange=update_status()gt

ltoption value=gthtmlltoptiongtltoption

value=txtgttxtltoptiongtltoption

value=xmlgtxmlltoptiongtltselectgtlttdgt lttrgt

ltform name=admin method=get

action=httplocalhost13000status

encoding=applicationx-www-formgt

ltinput type=hidden name=password value=gt

lttrgt

lttdgtGolttdgt

ltformgt

lttdgtltinput type=submit value=go name=actiongo

onClick=documentadminsubmit()gtlttdgt

lttrgt

lttablegt

ltbodygt

lthtmlgt

Push Initiator Class

import javanetURL

import javanetHttpURLConnection

import javaio

Class implements a simple push initiator It can be

used to create and send messages to push proxy

gateway (ppg)

public final class PushInitiator

xml version

private final static String XML_VERSION = ltxml

version=10gt

Push Access Protocol (PAP) document type

private final static String PAP_DOCTYPE =

Appendix C

50

ltDOCTYPE pap PUBLIC -WAPFORUMDTD PAP 10EN

httpwwwwapforumorgDTDpap_10dtd gt

content type of the push request multipart body

private final static String CONTENT_TYPE =

multipartrelated boundary=multipart-boundary

type=applicationxml

Service Indication (SI) document type

private static final String SI_DOCTYPE = ltDOCTYPE si

PUBLIC -WAPFORUMDTD SI 10EN +

httpwwwwapforumorgDTDsidtdgt

private static int pushId = 0

PPG url where the pap message is to be sent

private final URL ppgUrl

some push proxy gateways may also require the

authentication of the push initiator

For instance the push initiator may be required to

send an HTTP authorization header in each request

private final String authorization

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

public PushInitiator(URL ppgUrl) thisppgUrl =

ppgUrl

authorization = null

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

param authorization a ltcodegtStringltcodegt value

public PushInitiator(URL ppgUrl String authorization)

thisppgUrl = ppgUrl

Appendix C

51

thisauthorization = authorization

Systemoutprintln(Push Initiator created ppgUrl =

+ ppgUrl)

ltcodegtsendPushMessageltcodegt sends push message to

ppg

param clientAddress a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param message a ltcodegtStringltcodegt value

param mimeType a ltcodegtStringltcodegt value

exception Exception if an error occurs

public void sendPushMessage(String clientAddress

String addressTypeString message String mimeType)

throws Exception

HttpURLConnection http =

(HttpURLConnection)ppgUrlopenConnection()

String ppgServer = ppgUrlgetHost()

httpsetDoInput(true)

httpsetRequestProperty(Content-Type CONTENT_TYPE)

if(authorization = null)

if(authorizationtrim()equals())

httpsetRequestProperty(Authorization

authorization)

httpsetDoOutput(true)

PrintWriter out = new PrintWriter(new

BufferedOutputStream(httpgetOutputStream()))

outprintln(--multipart-boundary)

outprintln(Content-type applicationxml)

outprintln()

outprintln(createPapMessage(clientAddress

addressTypeppgServer genPushId() null))

outprintln()

outprintln(--multipart-boundary)

outprintln(Content-type + mimeType)

outprintln()

outprintln(message)

outprintln()

outprintln(--multipart-boundary--)

outflush()

outclose()

httpconnect()

Appendix C

52

finally read and debug the response received from

PPG

try

debugResponse(http)

catch (Exception e)

Systemerrprintln(Error in receiving the

response)

ltcodegtcreatePapMessageltcodegt creates a Push Access

Protocoltype message

param address a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param ppgServer a ltcodegtStringltcodegt value

param pushId a ltcodegtStringltcodegt value

param notificationTo a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createPapMessage(String address

String addressType String ppgServer String pushId

String notificationTo)

return XML_VERSION + n + PAP_DOCTYPE + n +

ltpap product-name=Mobile Zoo Push

Initiatorgtn +

ltpush-message push-id= + pushId +

(notificationTo = null request-notification-

to= + notificationTo ) + gtn +

ltaddress address-value=WAPPUSH= + address +

TYPE= + addressType +

+ ppgServer + gtn +

ltpush-messagegtnltpapgt

ltcodegtcreateSiMessageltcodegt creates a service

indication type message

param url a ltcodegtStringltcodegt value

param created a ltcodegtStringltcodegt value

param expires a ltcodegtStringltcodegt value

Appendix C

53

param message a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createSiMessage(String url

String sid String created String expires String

action String message)

return XML_VERSION + SI_DOCTYPE +

ltsigtn +

ltindication href= + url + +

(sid = null si-id= + sid + ) +

created = null created= + created +

) +

(action = null action= + action +

) +

(expires = null expires= + expires +

) + gt +

message +

ltindicationgtnltsigt

Debug response

param http a ltcodegtHttpURLConnectionltcodegt value

exception Exception if an error occurs

private void debugResponse(HttpURLConnection http)

throws Exception

Systemoutprintln(httpgetResponseMessage())

String headerName

int i=0

while((headerName = httpgetHeaderFieldKey(i++)) =

null)

Systemoutprintln(headerName + +

httpgetHeaderField(headerName))

Systemoutprintln()

InputStreamReader in = new InputStreamReader(new

BufferedInputStream(httpgetInputStream()))

int c

Appendix C

54

while((c = inread()) = -1)

Systemoutprint((char)c)

Systemoutprintln()

ltcodegtgenPushIdltcodegt generates an unique push id

return a ltcodegtStringltcodegt value

private String genPushId()

pushId = 100000

return SystemcurrentTimeMillis() + + pushId++

55

References

[1] Microsoft ldquoGetting Mobile Using WML and WAP to Display Web Sites on

Mobile Devicesrdquo

URL msdnmicrosoftcomen-uslibraryaa140117(office10)aspx accessed

on April 10 2008

[2] DALE BULBROOK ldquoWAPA Beginnerrsquos Guiderdquo OsborneMcGraw-Hill 2001

[3] WAP Forum Wireless Application Protocol Architecture Specification Access on

Jan 12 2008 Available

httpwww1wapforumorgtechdocumentsWAP-210-WAPArch-2006 07 12-apdf

[4] WAP Forum Push Architectural Overview access on (2008 February 3) Available

httpwww1wapforumorgtechdocumentsWAP-250-PushArchOverview-2007 04

03-apdf

[5] Service indication PDF access on 62008 Available

httpwwww3orgTRhtml401structlinkshtml

[6] WAP Push Technology (openwave) PDF access on (2008 April) Available

URL httpwwwopenwavorg

[7] Web site (httpwwwwapforumorgwhatcopyrighthtm) access on May 2008

[8] ldquoWAP Push Proxy Gateway Specificationrdquo WAP Forum access on 16-August-

2007URI httpwwwwapforumorgPDF

[9] WAP Forum Access on (2008 MAY 31) WAP Service Indication Specification

Available httpwww1wapforumorgtechdocumentsWAP-167-ServiceInd-200507

31-apdf

  • odc_fpwmlandwap_topic3
  • N100E3
  • 21
  • 5

Chapter 2 Basic Concepts

8

2212 WMLScript

WMLScript is a client-side scripting language It is very much like JavaScript which is

used on dynamic HTML(DHTML) web sites but WMLScript has been modified to fit

the currently severe limitations of the WAP environment and is in many ways restricted

compared to JavaScript

Client-side means that the code actually runs on the micro-browser itself The code is

downloaded to the WAP device as part of the deck so that when the code is executed it

does not have to make a trip back to the server to find out what to do next Everything the

application needs is right there Client-side functionality is therefore much faster in the

userrsquos perception

2213 Binary Extensible Markup Language

Binary XML is a compact binary representation of XML The binary XML is design to

reduce the transmission size of XML documents This allows more effective use of

narrow banded communication channels without any loss of functionality or semantic

information [5]

222 Session Layer Wireless Session Protocol

The wireless session protocol layer supports the wireless application environment with

two different session services The first is a connection mode service that operates above

a transaction layer protocol WTP and the second is a connection-less service that

operates above a datagram transport service WSP supports HTTP 11 functionality and

some new features These features include long-lived session a common facility for data

push capability negotiation and session suspendresume [5]

WSP provides support for exchange of content between clients and servers To support

the exchange the WSP establishes a reliable session negotiates on common capabilities

exchanges the data using compact encoding and releases the session The WSP also

supplies functionality to suspend and resume the session in order to save battery while

Chapter 2 Basic Concepts

9

the session is idle The WSP lifecycle is therefore not tied to the underlying transport

layer

WSP is a binary version of HTTP which includes both headers and data Binary

encoding is used to minimize the protocol overhead and to simplify decoding The header

is used to define content type character set encoding languages etc in an extensible

manner WSP supports two types of data transfers push and pull Pull transfer is used

when the client is sending a request and the server is sending a response In the push

mechanism the server pushes data to a client without prior request from the client

This can be done in three different ways Confirmed data can be pushed within an

existing session or non-confirmed data pushes can be done within or without an existing

session

223 Transaction Layer Wireless Transaction Protocol

The wireless transaction protocol WTP is defined to provide the services necessary for

sending requests responses and information WTP runs on top of a datagram service and

optionally a security service To ensure safe connection on top of the datagram layer the

WTP layer performs retransmissions sends acknowledgements and removes duplicated

messages In order to improve the connection efficiency WTP has no explicit connection

or teardown phases The layer also performs segmentation and reassembly to reduce the

number of packets sent

WTP has been defined as a transaction protocol that is suitable for mobile stations and

operates efficiently over wireless datagram networks Some benefits of using WTP are

that it improves reliability over datagram services improves efficiency over connection-

oriented services and that it is message oriented and designed for requestresponse

applications

The wireless transaction protocol is divided into three transaction services It can send

unreliable messages with no result message reliable messages with no result message or

reliable messages with exactly one result message

Chapter 2 Basic Concepts

10

Unreliable Messages With No Result Message

This service provides an unreliable datagram service The service can be used by

applications which occasionally want to send a datagram within an existing session

using WTP No acknowledgement or retransmission is done in this service

Reliable Messages With No Result Message

This service provides a reliable datagram service The service can be used by

applications that want to use a reliable push service The receiver acknowledges the

message and if the original sender receives no acknowledgement the message is

retransmitted

Reliable Messages With One Reliable Result Message

This service provides the basic invokeresponse transaction The receiver acknowledges

the message and if the original sender receives no acknowledgement the message is

retransmitted To confirm the reception of the acknowledgement the original sender

sends an acknowledgement to the receiver The three transactions are shown in next

figure

message message

acknowledge

message

confirm

Unreliable invoke

message with no

result message

Reliable invoke

message with no

result message

Reliable invoke

message with one

reliable result

message

a) b) c)

acknowledge

Figure 22 the three mode of transaction

Chapter 2 Basic Concepts

11

2231 Concatenation and Separation

To reduce the overhead caused by the datagram headers it is desirable to reduce the

number of packets sent over the air In order to reduce the number of messages several

protocol data units can be put into one single datagram This procedure is called the

concatenation procedure The reverse procedure is called the separation procedure [5]

Concatenation can be done when several packets are transported from the same sender to

the same receiver Concatenation can be done at any time The last acknowledgement can

be concatenated with the invoke message of the next transaction [5]

2232 Segmentation and Reassembly

If a packet is lager than the bearers largest capability the message can be segmented and

send in several packets To increase the communication efficiency message groups can be

acknowledged in groups [5]

To decrease the number of packets sent when a communication error occurs the receiver

can request one or multiple lost packets within a group of messages This is done instead

of resending the entire message which could mean that successfully received packets

have to be resent [5]

224 Security Layer Wireless Transport Layer Security

An Optional layer it is responsible for providing security data integrity and

authentication between two communicating applications The WTLS is optimized for low

bandwidth bearer networks with relatively long latency The WTLS is similar to the

Internet transport layer security TLS but has some new features such as datagram

support optimized handshake and dynamic key refreshing [5]

WTLS has been design to function on both connection-oriented and datagram transport

protocols The security layer acts above the transport layer

Chapter 2 Basic Concepts

12

2241 Service Primitives

WTLS uses primitives to ensure security The primitives are used to

Initiate a secure connection

Perform public-key authentication or key exchange with the client

Change into connection state when the handshake has been done

Terminate the connection

Inform the other end about warning level alerts

Request by the server that the client should initiate a new handshake

225 Transport Layer Wireless Datagram Protocol

The wireless datagram layer is a datagram service used by the upper layers WDP is

designed to communicate over different bearer services and especially for wireless

telecommunication networks [6] It Consists of

bull Source and destination address and port

bull Optionally fragmentation

It maps to UDP for IP bearer and moves single packets to and from the phone

226 WDP and IP

In networks with IP as the routing protocol UDP is used instead of WDP IP provides

segmentation and reassemble in a connection-less datagram service UDP provides port

based addressing and other necessary functions Thereby no additional functions are

required by a WDP layer [7]

227 Bearer Interfaces

WAP supports dial-up networking using IP and Point-to-Point Protocol (PPP) as the

bearer interface underneath WDP It also supports Short Message System (SMS) and

General Packet Radio System (GPRS) SMS passes text and binary data between digital

Chapter 2 Basic Concepts

13

phones GPRS is a relatively new technology that implements faster always-on

connections for wireless devices GPRS actually runs on top of IP [7]

As had been learned above WAP is quite similar to web figure 23 provide a brief

comparison between them

WAP

Bearer

WDP Dtatgram

WTLS security

WTP Transaction

WSP Session

WAE

WML and

WMLScript

Web

IP

TCP UDP

TLS-SSL

HTTP

HTML

JavaScript

VBscript

Figure 23 Web vs WAP

Chapter 2 Basic Concepts

14

23 SMS overview

SMS stands for Short Message Service It is a technology that enables the sending and

receiving of messages between mobile phones SMS first appeared in Europe in 1992 It

was included in the GSM (Global System for Mobile Communications) standards right at

the beginning Later it was ported to wireless technologies like CDMA and TDMA The

GSM and SMS standards were originally developed by ETSI ETSI is the abbreviation

for European Telecommunications Standards Institute Now the 3GPP (Third Generation

Partnership Project) is responsible for the development and maintenance of the GSM and

SMS standards [8]

SMS has two operational mode textual mode and binary mode which will allow sending

other data beside pure text

24 Push overview

WAP push provides a standard means to send data to a mobile subscriber without an

explicit request from the subscriber at the time the data is delivered In the normal

clientserver model a client requests a service or information from a server which then

responds by transmitting information to the client This is known as ldquopullrdquo technology

The client pulls information from the server The World Wide Web is the best example of

pull technology where a user enters a URL (the request) which is sent to a server and

the server answers by sending a Web page (the response) to the user (Figure 24 a)

Although WAP push is also based on the clientserver model it provides a means to send

data to the subscriber without an explicit request from the client at the time of delivery

(Figure 24 b)

With push functionality users are able to get information without having to request that

information In many cases it is important for the user to get the information as soon as it

is available Push communications can be used for sending stock quotes traffic reports

and news

Chapter 2 Basic Concepts

15

a) WAP pull model

b) WAP push model

Figure 24 Pull vs Push

24 WAP Push framework

A push operation starts when a server called the push initiator transmits a push messages

to a WAP client Since the push initiator located on the Internet does not use the same

protocol as the WAP client a translating gateway is needed The push initiator contacts

the push proxy gateway via the push access protocol and the Internet protocol The push

proxy gateway translates the information and forwards the pushed content to the WAP

device via the push over the air protocol (figure 25) [9]

Chapter 2 Basic Concepts

16

Push Proxy Gateway

WAP

Client

Push

Access Protocol

Push

over-the air

protocol Push Initiator

Figure 25 the wireless push technology

241 Push Proxy Gateway

The push proxy gateway PPG is the entity that does most of the work in the push

architecture The gateway acts as an access-point for content pushed from the Internet to

the client So the responsibility of the gateway owners to grant access to push proxy

gateway [9]

Besides the actual access-point service the push gateway provides the following services

push initiator identification and authentication

parsing and error detection of content control information

client discovery services

address resolution

binary encoding and compilation of certain content type

protocol conversion

Chapter 2 Basic Concepts

17

Information to the push proxy gateway is sent via the push access protocol PAP The

content of the information is divided into several parts were the first part is information to

the PPG such as recipient information

When the PPG has parsed the control information an acknowledgement is sent to the

push initiator reporting if the service was successful or not

Once the proxy has accepted the content and the push initiator has received the

acknowledgement the proxy is responsible for the transmission to the client The proxy

attempts to find the correct destination device and deliver the content to that client using

the push over the air protocol The contents delivered to the proxy may be translated to

their binary counterpart eg WML documents may be converted to binary XML by the

proxy before the information is transmitted to the client [9]

The proxy must implement a service to enable capability queries from the push initiator

The capability query should be responded with the capabilities of the specified WAP

device The push proxy gateway may also implement broadcasting services where

special addresses may be translated to a broadcast operation [9]

242 Push Access Protocol

The push access protocol PAP is the means by which an Internet-based push initiator

pushes content to a mobile network via the push proxy gateway [9] The push access

protocol is not intended for use over the air

PAP supports the following operations

Push submission

The push message sent from the push initiator to the gateway contains a control

entity a content entity and may contain a capability entity The control entity is

an XML document When the gateway has received the message an XML

response message is sent back to the initiator

Chapter 2 Basic Concepts

18

Result notification

If the push initiator has requested confirmation of successful delivery this XML

message is transmitted from the PPG to the push initiator when the content has

been delivered to the mobile device The push initiator acknowledges this result

message with another XML document

Push cancellation

The purpose of the push cancellation is to allow the push initiator to attempt to

cancel a previously submitted push message Both the cancellation message and

the resulting acknowledgement are sent as XML documents

Status query

The status query operation allows the push initiator to request the current status of

a message that has been previously submitted Both the status query message and

the resulting acknowledgement are sent as XML documents

Client capabilities query

This operation allows the push initiator to query the PPG for the capabilities of a

specific device The query is sent as an XML document and the response is sent

as another XML document

To access the push proxy gateway an address is used The gatewayrsquos underlying

protocols determines which type of address is used eg in HTTP a URL is used To

access a specific device the devicersquos address is included in the XML document

There are two ways to send information to several clients The push initiator can either

send information to several specific addresses or broadcast it to all clients In both cases

only one message is sent to the gateway which either sends the information to some or

all of the clients The clientsrsquo address is depending on the underlying layer [9]

Chapter 2 Basic Concepts

19

243 Push Over-The-Air Protocol

The push proxy gateway and the client communicate using the push over the air protocol

which utilizes WSP session services Pushes can be sent via connection oriented links or

connection-less links Connection-oriented pushes require that an active WSP session is

available but the server can not create a session To solve the case were there is no active

WSP session the push framework introduces a session initiation application in the client

This application listens to session requests from the OTA-server and responds by setting

up a WSP session for push purposes [9]

Push

Over-the air

WSP

Push management

premptive

Push operational

primitives

WSP Servise

Primitives

Figure 26 Push Over-The-Air protocol stack

The push over the air protocol supports two kinds of operations operations to manage the

connection and operations to send actual messages

Push Sends unconfirmed information over a connection-oriented link

Confirmed push Sends confirmed information over a connection-oriented link

Abort push rejects a previously transmitted push operation This is operation is

part of the confirmed push mechanism

Unit push Sends unconfirmed information over a connection-less link

Connect Creates a push session

Chapter 2 Basic Concepts

20

Suspend Request that a push session should be suspended

Resume Request to resumes a previously suspended push session

Disconnect Terminates the push session

Session request Request from the server to initialize a session to a client

244 Service Indication

The service indication SI provides a mechanism composed in an XML message to

notify a client that an external asynchronous event has occurred and indicate a service

that can be loaded in order to react to that event In order to notify the user a message is

sent from the push initiator via the proxy to the client The message will be shown to the

user and there will be a reference to a URI where the appropriate service can be loaded

For example the message could be ldquoYou have new mailrdquo and the URI to your email

service [9]

When the message is received by the client it will be presented to the user The user then

can choose to launch the service in an application eg the WML browser or to postpone

the SI for later handling Postponed SIs will be stored in the client and the user is given

the possibility to act upon them later When the user choose to launch the service the

service is started in the same way as if the user would have started it manually [9]

Messages sent with the service indication can support mechanisms to improve the end-

user-experience

User-intrusiveness levels

To improve the users understanding of the provided service and to affect the users

behavior when the message is delivered it is possible to change the level of user-

intrusiveness

Chapter 2 Basic Concepts

21

Deletion

When a pushed message becomes invalid the service provider can delete the

message in the clients For example an email notification becomes invalid when

the message are read

Replacement

When a pushed message is invalid and updated with a new message the service

provider can replace the origin message with a new one

Handling of out of order delivery

Since the wireless communication is unpredictable it can not be ensured that the

messages are received in the same order as sent This mechanism discards all

messages older than the latest received

Expiration

Some services may only be valid for a certain amount of time when the time has

expired the message is removed from the client

245 Service Loading

The service loading method provides means to convey a URI to a user agent in a mobile

client The method is conveyed in an XML message In difference from the service

indication method the client loads the content of the URI automatically without any

action from the user when the service loading message is received

Thereby the user will experience the content as if it was pushed to the mobile client and

executed In the service loading mechanism there is a reference to a service page that will

automatically be loaded without interaction with the user included For example the client

will automatically start the email service when a message about new mails on the server

is received [9]

Chapter 2 Basic Concepts

22

When the client is busy with some application it is not suitable to execute the referred

content directly upon reception of a message To avoid this client may cache the content

indicated by the URI so it becomes available to the user when the client is ready

Messages sent with the service loading method can support mechanism to improve the

end-user-experience

Control of the level of user interaction

To improve the users understanding of the provided service and the affect the

userrsquos behavior when the message is delivered it is possible to change the level

of user-intrusiveness The service can explicitly specify if the service should be

loaded or not if the client is busy on reception

Pre-emptive content caching

By setting this attribute the service loading can require that the indicated content

is downloaded and cached instead of executed This can be used to improve the

users experience of the services that otherwise would have required content to

be retrieved from an origin

23

Chapter Three

3 System requirements

Several materials and requirements must be incorporated into the design implementation

and testing The following discusses the components necessary to fulfill the project

requirements and environment

31 development environment

There are many development tools to choose from when developing for WAP Push and

hen you combine different environments with different gateways you will get a vast

numbers of choices This large flora of tools makes it difficult to choose a suitable

environment an important issue because a badly chosen one might consume a lot of time

341 Operating system

Kannel (the chosen gateway for the system) is being developed on Linux systems and

should be fairly easy to export to other Unix-like systems Although it should be working

without major problems on Windows (through Cygwin) Solaris and FreeBSD The push

initiator is implemented on java so it is operating system independent

Linux is the logical choice especially when it comes to the world severs and networking

for it promising feature as an open source low cost operating system

342 Programming language

Since system design was planned to be modular to enhance the reuse of its components as

explained above then an object oriented programming language will be a reasonable

choice Another factor is the need for a graphical user interface which imposes using a

programming language with good graphics handling capabilities at the same time it

should be over Linux

Chapter 3 System requirements

24

The best programming language to accomplish the above requirement is found to be java

which has the flowing feature

Cross platform - All clients and servers run the same Java code without any

changes or recompilation This simplifies deployment

Cost effective to develop in Java - The java language has many features that

improve developer productivity promote code reuse and reduce development and

maintenance costs

Works well with Open Source - Java with Linux and the many open source

movement projects and libraries provide a powerful mix that ensures development

is cost-effective efficient and of high quality because extensively tested libraries

components and solutions are available to plug-in to customer development

efforts

343 Nokia Mobile Internet Toolkit 41

To design and implement a WAP application on a Nokia phone the Nokia Internet

Toolkit has to be downloaded and installed on the PC A Nokia simulator is installed as

part of the installation but various phone simulators can be downloaded and installed

This simulator is used for testing purpose Also it has a server simulator based on the

Nokia Active Server if a WAP Gateway is unavailable

32 software requirements

Most of this section has been mentioned in way or other but they will be considered

briefly here

321 Kannel WAP gateway

This is an open source gateway upon which the push proxy gateway of this system will

be built on it available free of charge at kannel project web site

Chapter 3 System requirements

25

322 Linux operating system

It is important to install kannel gateway on it for this project we choose fedora core 7 for

availability reasons

323 JDK16

The java run time environment is required to implement the push initiator

32 hardware requirements

321 PC

Any Personal computer capable of running fedora core 7 with USB interface to be able

connects GSM modem

322 GSM modem

This will act as an alternative to the short message service center SMSC Obviously this

means that GSM network is required too

26

Chapter Four

4 System design

41 System Scenario

The basic scenario of a push session is that a Push Initiator (PI) transmits content to a

WAP client This is done in multiple steps as shown in Figure 31

pushOTAPAP

Gateway

PI

1

2

pull gateway

PPG

3

SMS center

Mobile device

6

5

4

Content provider78 9

Figure 41 WAP push scenario

Chapter 4 System Design

27

The PI communicates with a Push Proxy Gateway (PPG) over the Push Access Protocol

(PAP) (1 and 2) The PPG will then use the Push Over-The-Air Protocol (PushOTA) (3)

to deliver a Uniform Resource Identifier (URI) to the client via a Short Message System

Centre (SMS-C) (4 and 5) The next step for the client is then to activate the URI (6 and

7) and get the content from the server (8 and 9) The mobile device will have to use a

ldquoPull Gatewayrdquo to get the content but it is very likely that this is the same one as the PPG

The same same scenario could be viewed in sequence diagram figure (42)

Push Initiator PPG SMS Center WAP client

Send push message

Send push message response

Send WAP push message

Ack

Send WAP push message

Ack

Message read

Ack

Message read

Ack

Result notification message

Result notification response

Figure 42 WAP push sequence diagram

Chapter 4 System Design

28

43 Modular Design

Conceptually we can envision this push system as consisting of three major components

(presented in the order of the push lifetime)

first there is a Push Initiator Program that reads the generates a notification message and

transmits (pushes) it via a WAP Gateway to the customer phone This message notifies

the user that a service is available if the user accepts will ask the phonersquos browser to pull

the page from our web server via the WAP Gateway

Next there is the Push Proxy Gateway PPG which will receive the push message from

the push initiator and is responsible of doing any needed optimization protocol

compilation and conversion Also it is responsibility of the PPG to find the end user

address and send the push message to the SMS center

Finally there is the SMS center which will do the last delivery of push message to the

intended user if the user were offline the message will be saved for later time until the

WAP client is on

PI PPGSMSC

Figure 43 system modules

Chapter 4 System Design

29

43 Design of system Modules

Following sections of this chapter present a description and design of the system modules

with accompanying graphical representation

431 Push Initiator (PI)

The PI is the first logical component in the WAP Push scenario and therefore the

originator of the push message There are different kinds of PIs One example is an

automated script another one is a semi automated server version written in an applicable

scripting language supporting server side interaction

A push message is sent as an HTTP POST to the Push Proxy Gateway The POST will be

a multipart XML document with the first part being the control entity (Push Access

Protocol) the second part being the content entity (either a Service Indication or a

Service Load) and the third part being the capability entity

HTTP Post

Capability entity

Content entity (SISL)

Control entity (PAP)

Figure 44 architecture of the push message

Chapter 4 System Design

30

4311 Control entity

This part of the push contains the basic information and fields The fields can include

recipient address expiry time bearer type delivery attempt time and a URL to which a

response is to be sent if delivery confirmation is requested by the push initiator

PAP is the protocol used in WAP Push framework for specifying control information and

content that is to be pushed to a client via a Push Proxy Gateway (PPG) A Push Initiator

(PI) triggers push message processing The Push initiator class (Appendix B) of this

design shows how to generate PAP messages

The address of the used PPG should be given as an initialization parameter of the

application (ldquoppg-urlrdquo see Appendix B) This design also provides an implementation

that can be used in a special case when ldquoIPv4 IPv6rdquo type client addressing is applied and

when toolkit is used All other cases including the use of phone numbers (ldquoPLMNrdquo type

address) in sending push messages are considered

The PAP XML contains at the minimum a ltpapgt element a ltpush-messagegt

element and an ltaddressgt element

The important parts of this PAP message are the address value and type The value is

typically a MSISDN and type indicates whether to send to a MSISDN (typical case) or to

an IP Address The TYPE is almost always MSISDN as the Push Initiator (PI) will not

typically have the Mobile Stations IP address - which is generally dynamic

4312 Content entity

This is the actual data that is received by the mobile device The various content types

are Service Indication (SI) Service Load (SL) and Cache Operation (CO) in our project

we will just deal with SI and SL

The SI notifies a client about an external event by inviting the client to interact with it In

other words it informs a client about a service More precisely it sends a message that

Chapter 4 System Design

31

informs the client of a Uniform Resource Identifier (URI) where the client can access the

service

An important attribute of SI is the action attribute it may contain the action to be taken

when the client receives the SI There are two groups that the action attributes can be

divided into

First we have delete and signalmdashnone both of them is used because of their side

effects Ie with delete you take away all SIs with the same si-id as the deletion pushrdquo

including itself and with signal-none you either do nothing or you pay regard to the

info element in that push

The other group consists of signal-low signal-medium and signal-high These

attributes are all used to set the rules for the presentation in the terminal device

o Signal-low

The SI must be postponed without user intervention

o Signal-medium

The SI must be presented as soon as the implementation allows that to be carried out

without disturbing the user (Signal-medium is the value that will be used if none is

specified)

o Signal-high

The SI must be presented as soon as the implementation allows that to be carried out

without disturbing the user or earlier if it seems appropriate (This decision may for

instance be based on user preference settings)

This is the different functionalities supported by the SI we concidered

Expiration

Replacement

Deletion

Chapter 4 System Design

32

Handling of out of order delivery

Handling of information specified in the info element

A PUSH Service Indication (SI) contains at a minimum an ltsigt element and a

ltindicationgt element SL donrsquot differ so much from SI

4313 Capability entity

This entity determines the type of mobile device that is to be served This is determined

by WAP user agent profiling The sender can indicate the hardware vendor and browser

version and type of the intended recipients This capability entity is then matched at the

PPG to see which devices are compatible with the requested capability If there is a

match the content is delivered by the PPG to that specific device

Now a day most devices are compatible with WAP so we donrsquot need to create this entity

more precisely it is optional

After the push has been created in the PI it is up to the system to deliver it to the defined

destination In this system the different responsible entities are the PPG and the SMSC

Both of these two different entities are running on same server but it is only the

configuration of the SMSC that is out of my control since it is run by the operator and is

not controllable in my lab environment

432 Push Proxy Gateway (PPG)

There are various commercial WAP gateways available on the market that are quite

expensive Kannel on the other hand is an open source gateway one doesnrsquot need to pay

for it in addition one can edit the source code himself and construct his own customized

gateway Because Kannel is being developed on Linux systems (RedHat and Debian) it

can be smoothly ported to other UNIX-like operating systems

4321 Kannel gateway architecture

The gateway divides the processing load between the following three hosts

Chapter 4 System Design

33

The bearer box which connects to the SMS (Short Message Service) centers and

or CSD (Circuit Switched Data) routers providing a unified interface to them for

the wapbox The bearer box does this by implementing the WDP (Wireless

Datagram Protocol) layer of the WAP stack

The smsbox implements the rest of the SMS gateway functionality It receives

textual SMS messages from the bearerbox and interprets them as service

requests and responds to them in the appropriate way

The wapbox which hosts the upper layers of the WAP stack Each session and its

transactions are handled by the same wapbox (see figure 35)

1Figure 45 divisions of duties in kannel

4322 Working of the gateway

The bearer box receives UDP (User Datagram Protocol) packets from CSD routers

inspects them to see whether they are WAP packets if so then it will routes them to the

WAP box This simple design allows the bearer box to do a minimum of processing per

smsbox

wapbox

bearerbox

Kannel

SMS center

WAP phone

HTTP server

Chapter 4 System Design

34

packet The bearer box also sends the UDP packets that the other boxes generate which

adds some more routing processing The wapboxes implement the WTP (Wireless

Transaction Protocol) and WSP (Wireless Session Protocol) layers These take HTTP-

like requests from the phones and make the actual HTTP requests to content servers

compress the responses and send them back to the terminals (Sessions are maintained to

make as much use of the limited radio bandwidth as possible)

4323 External interfaces of the gateway

The gateway has interfaces to three external agents

bull SMS centers using various protocols

bull HTTP servers to fetch WAP and SMS content and to push WAP Content The

pull protocol is HTTP push PAP

bull WAP phones implementing the WAP protocol stack and (for push) WAP Push

client

Figure 36 summarize kannel external interfaces

4324 Configuring the gateway

The bearerbox smsbox and wapbox are the main working modules of the gateway and

must be configured before configuring the gateway These three modules are controlled

by a configuration file that has wapbox smsbox and bearerbox groups

Configuring the PPG core group

We use two components the PPG core group and the PPG user group The PPG

core group is used to configure the PI interface(for more details configuration

variables refer to appendix c)

Chapter 4 System Design

35

Mobile telephone

network

The Internet

smsbox

wapbox

bearerbox

Kannel

HTTP

HTTP

HTTP server

Serving WML

files

HTTP server

Serving HTML

files

TCP

TCP

WAPSMS

SMSC

WAP phoneNetwork base station

Workstation used for http

administration

Figure 46 External interfaces of the gateway

4325 Administering the gateway through an HTTP interface

Kannel can be administered via an HTTP interface All commands are given as normal

HTTP queries so they can easily be given from command lines like this one

links -dump httpip-adressportshutdownpassword=yourchoice

But it is advantageous to have graphical user interface for gateway control so we have

designed GUI through http

Chapter 4 System Design

36

433 Short Message Service Centre (SMSC)

A SMSC is an essential component when sending a push message from an IP network to

a mobile device in the architecture supported by the components and devices It is used to

remove the TCPIP layer that the push is encapsulatedrdquo in It is also the entity that

identifies the end-point device When this is done it is also the SMSC that is responsible

for the processing and final message delivery to the device After the process of de-

encapsulation and resolution of the client identity there should not be any difference

between this message and a message that is originated locally from the operator itself

(like a SMS)

In this project we just use a virtual SMS center we try first to get connection to a real

one but our effort was worthless

Finally the following figure depicts the overall flowchart of the WAP push system

(figure 47)

Chapter 4 System Design

37

PI

PPG

Create PAP

HTTP Post

Message

processing

OTA

Connection

oriented

Sessionless Session

oriented

WTP Initiation

WAP clinet

Application

Create content

Create

capability

entity

Database

SMS center

NoYes

Figure 47 the complete flowchart of the system

38

Chapter Five

5 System implementation and results

51 Implementation

511 The Push Proxy Gateway

First of all the Kannel gateway have been compiled and installed using gcc (GNU C

Compiler) this stage go fine except the operating system required more components to

be pre-installed and will configured

Then with stages of configuration to the gateway (Appendix B) it was capable of working

as PPG Figure 51 below show the gateway when it starts

Figure 51 starting kannel gateway

Then a web based user interface had been created to provide an easy way to control the

gateway remotely Figure 52 and figure 53

39

Figure 52 GUI for gateway control

512 The Push initiator

Next the push initiator design had been implemented using java programming language

as in design phase the implementation is taken carefully to make a reusable component

that could be used by other developer

PushInitiator class (Appendix B) implements a simple push initiator which can be used

to create and send messages to a push proxy gateway (PPG)

The method sendPushMessage sends a push message via the PPG to the client The client

is identified by the address which is either the phone number (address type is PLMN) or

IP address The message content and its mime type are also given as arguments to the

method the other tow important method are

createPapMessage This method creates a Push Access Protocol (PAP) type message

40

createSiMessage This method is used to create a service indication (SI) type message

Figure 53 showing running kannel status

513 WAP site

Since this site will be built for testing purpose and making sure that the system is

functional we had not go deep in this section Just simple WAP site with tow page has

been crated

41

52 Service indication

When a SI was pushed to any of the emulator or Nokia phones it was received and

presented in the way it was supposed to as specified in the WAP standard as shown in

figures below This is a proof that the devices claiming to support WAP push do so and

the design is will working See figures 53 through 56

Figure 55 service indication

42

Figure 57 SI details

52 Service load

The emulator correctly receives and interpreted the SL push the same as all of Nokia

phones we have tested

When a SL was pushed to the Ericsson phones it was not presented in the specified way

figure 58 I think that it is because of security reasons The reason for this assumption is

that the phones only supports on or off as security in their push configuration The

emulator on the other hand presents SL correctly Finally the Siemens phone did seem to

interpret SL but the current software was not very consistent It did load the SL without

user interference in the specified way when the user already where having an active

session If the user was offline the phone interface presented a symbol on the display

and did not load the service until the user clicked on the symbol

43

Chapter Six

6 conclusion and future work

In this chapter we will provide the conclusions and proposed future work for interested

individuals

61 Conclusions

In this project a WAP push system has been successfully designed and implemented It

provides a way to partially overcome the limitations encountered when accessing the

World Wide Web using handsets After comparing the proposed project objectives with

those accomplished the main goals are seen to be met

Phones from different manufactures all differ from the WAP-standard in some

ways One of the most obvious differences is the resolution of the display

During the work it has been noticed that the WML pages must be quite small We

have also noticed that the support for tables and some other tags are a bit limited

Even though the WML standard is smaller than the HTML standard it is a little

more complicated to write correct WML pages The main conclusion is that WAP

works pretty well but the phones are a little non-stable

The push proxy gateway is configured and worked probably with virtual SMS

center and it is easy to switch to a real one

The system depends mainly on open sources (ie Linux and kannek)

The design and implementation of the push initiator work well with the kannel

gateway and it should work correctly with other gateways

Chapter 6 Conclusion

44

62 Further Work

The possibilities of wireless push are interesting enough that it has to be worth to know if

the security and conformance problems will be solved in WAP push If they are solved

and the technique is refined then there should be nothing to stop the great number of

services that will follow in its footsteps Therefore there is further work that should be

done and the most interesting parts are in my opinion these

621 Security Aspect

One of the problems today is that the phones supporting push does not have the detailed

security settings that a technique like this needs Therefore it would be interesting to look

into the possibility to add these without confusing the user I suggest furthering looking

into usability aspects of security in WAP Push for short

622 GPS integration possibility

This will provide location dependent delivery of WAP push it will have great

applications in telematic and ecommerce advertising

623 Conformance to Standards

An interesting project would be to examine if the main reason for the nonstandard

solutions in the existing WAP push software is the result of difficulties in

implementation Or if the main reason is that the manufacturers wants to provide

proprietary solutions A reason why one may want to know this is that if the problem is

depending on implementation problems then it might get better

45

Appendix A Abbreviations

CDMA Code Division Multiple Access

CO Cache Operation

DTD Document Type Definition

GSM Global System for Mobile

HTTP Hypertext Transfer Protocol

IP Internet Protocol

MSISDN Mobile Station International Subscriber Directory Number

OTA Over The Air

PAP Push Access Protocol

PushOTA Push Over The Air

PDA Personal Digital Assistant

P1 Push Initiator

PLMN Public Land Mobile Networks

PPG Push Proxy Gateway

SI Service Indication

SIA Session Initiation Application

SIR Session Initiation Request

SL Service Loading

SMPP Short Message Peer to Peer

SMS Short Message System

SMSC Short Message System Center

UCP Universal Computer Protocol

URI Uniform Resource Identifier

URL Uniform Resource Locator

UTC Universal Time Coordinated

WAP Wireless Application Protocol

WBXML WAP binary XML

WDP Wireless Datagram Protocol

WSP Wireless Session Protocol

WTLS Wireless Transport Layer Security

XML Extensible Mark-up Language

46

Appendix B Kannel gateway configurations

THIS IS A SAMPLE CONFIGURATION FOR KANNEL

group = core

admin-port = 13000

admin-password = admin

status-password = admin

admin-deny-ip =

admin-allow-ip = 127001172161455

log-file = tmpkannellog

log-level = 0

http-proxy-host = 172161411

http-proxy-port = 8080

http-proxy-exceptions = 127001

Smsbox related

smsbox-port = 13001

box-deny-ip =

box-allow-ip = 127001

bearerbox-host =localhost

Wapbox related

wapbox-port = 13002

udp-deny-ip =

udp-allow-ip = 127001

bearerbox-host =localhost

SMSC GSM

group = smsc

smsc = at

modemtype = auto

speed =9600

device = devttyS0

SMSC HTTP

group = smsc

smsc = http

system-type = kannel

port = 13016

connect-allow-ip = 127001

Appendix B

47

username = wappush

password = wappush

SMSBOX SETUP

group = smsbox

bearerbox-host = localhost

sendsms-port = 13013

sendsms-chars = 0123456789 +-

log-file = tmpsmsboxlog

log-level = 0

access-log = accesslog

white-list = 127001

black-list =

SEND-SMS USERS

group = sendsms-user

username = wappush

password = wappush

user-deny-ip =

user-allow-ip = 127001

PPG group

group = ppg

ppg-url = wappush

ppg-port = 8080

concurrent-pushes = 100

trusted-pi = true

users = 1024

service-name = ppg

ppg-smsbox-id = dlrbox

WAP PUSH USER

group = wap-push-user

wap-push-user = picom

ppg-username = wappush

ppg-password = wappush

allow-ip = localhost

48

Appendix C Selected Codes

Gateway Control Form

ltDOCTYPE HTML PUBLIC -W3CDTD HTML 32ENgt

lthtmlgt ltheadgt

lttitlegtGateway control formlttitlegt

ltheadgt

ltbody bgcolor=white text=black link=blue vlink=navy

alink=redgt

ltbase target=submitgt

ltscriptgt

function update_status()

if ( adminactionvalue == status )

adminaction = http + adminhostnamevalue +

+ adminportvalue + status +

adminstatusformatvalue

else

adminaction = http + adminhostnamevalue +

+ adminportvalue + + adminactionvalue

adminpasswordvalue = adminpasswordvalue

actiongovalue = GO GET +adminaction

ltscriptgt

lttable align=centergt

lttrgtltp align=centergtlth2gtGateway control

formlth2gtltpgtlttrgt

lttrgt lttdgtHostnamelttdgtlttdgtltinput type=text

name=adminhostname value=localhost

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPortlttdgtlttdgtltinput type=text

name=adminport value=13000

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPasswordlttdgtlttdgtltinput type=password

name=adminpassword value=

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtActionlttdgtlttdgtltselect name=adminaction

onChange=update_status()gt

ltoption value=statusgtStatusltoptiongt

ltoption value=suspendgtSuspendltoptiongt

ltoption value=isolategtIsolateltoptiongt

Appendix C

49

ltoption value=shutdowngtShutdownltoptiongt

ltoption value=resumegtResumeltoptiongt

ltselectgtlttdgt lttrgt

lttrgt lttdgtStatus Formatlttdgtlttdgtltselect

name=adminstatusformat onChange=update_status()gt

ltoption value=gthtmlltoptiongtltoption

value=txtgttxtltoptiongtltoption

value=xmlgtxmlltoptiongtltselectgtlttdgt lttrgt

ltform name=admin method=get

action=httplocalhost13000status

encoding=applicationx-www-formgt

ltinput type=hidden name=password value=gt

lttrgt

lttdgtGolttdgt

ltformgt

lttdgtltinput type=submit value=go name=actiongo

onClick=documentadminsubmit()gtlttdgt

lttrgt

lttablegt

ltbodygt

lthtmlgt

Push Initiator Class

import javanetURL

import javanetHttpURLConnection

import javaio

Class implements a simple push initiator It can be

used to create and send messages to push proxy

gateway (ppg)

public final class PushInitiator

xml version

private final static String XML_VERSION = ltxml

version=10gt

Push Access Protocol (PAP) document type

private final static String PAP_DOCTYPE =

Appendix C

50

ltDOCTYPE pap PUBLIC -WAPFORUMDTD PAP 10EN

httpwwwwapforumorgDTDpap_10dtd gt

content type of the push request multipart body

private final static String CONTENT_TYPE =

multipartrelated boundary=multipart-boundary

type=applicationxml

Service Indication (SI) document type

private static final String SI_DOCTYPE = ltDOCTYPE si

PUBLIC -WAPFORUMDTD SI 10EN +

httpwwwwapforumorgDTDsidtdgt

private static int pushId = 0

PPG url where the pap message is to be sent

private final URL ppgUrl

some push proxy gateways may also require the

authentication of the push initiator

For instance the push initiator may be required to

send an HTTP authorization header in each request

private final String authorization

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

public PushInitiator(URL ppgUrl) thisppgUrl =

ppgUrl

authorization = null

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

param authorization a ltcodegtStringltcodegt value

public PushInitiator(URL ppgUrl String authorization)

thisppgUrl = ppgUrl

Appendix C

51

thisauthorization = authorization

Systemoutprintln(Push Initiator created ppgUrl =

+ ppgUrl)

ltcodegtsendPushMessageltcodegt sends push message to

ppg

param clientAddress a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param message a ltcodegtStringltcodegt value

param mimeType a ltcodegtStringltcodegt value

exception Exception if an error occurs

public void sendPushMessage(String clientAddress

String addressTypeString message String mimeType)

throws Exception

HttpURLConnection http =

(HttpURLConnection)ppgUrlopenConnection()

String ppgServer = ppgUrlgetHost()

httpsetDoInput(true)

httpsetRequestProperty(Content-Type CONTENT_TYPE)

if(authorization = null)

if(authorizationtrim()equals())

httpsetRequestProperty(Authorization

authorization)

httpsetDoOutput(true)

PrintWriter out = new PrintWriter(new

BufferedOutputStream(httpgetOutputStream()))

outprintln(--multipart-boundary)

outprintln(Content-type applicationxml)

outprintln()

outprintln(createPapMessage(clientAddress

addressTypeppgServer genPushId() null))

outprintln()

outprintln(--multipart-boundary)

outprintln(Content-type + mimeType)

outprintln()

outprintln(message)

outprintln()

outprintln(--multipart-boundary--)

outflush()

outclose()

httpconnect()

Appendix C

52

finally read and debug the response received from

PPG

try

debugResponse(http)

catch (Exception e)

Systemerrprintln(Error in receiving the

response)

ltcodegtcreatePapMessageltcodegt creates a Push Access

Protocoltype message

param address a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param ppgServer a ltcodegtStringltcodegt value

param pushId a ltcodegtStringltcodegt value

param notificationTo a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createPapMessage(String address

String addressType String ppgServer String pushId

String notificationTo)

return XML_VERSION + n + PAP_DOCTYPE + n +

ltpap product-name=Mobile Zoo Push

Initiatorgtn +

ltpush-message push-id= + pushId +

(notificationTo = null request-notification-

to= + notificationTo ) + gtn +

ltaddress address-value=WAPPUSH= + address +

TYPE= + addressType +

+ ppgServer + gtn +

ltpush-messagegtnltpapgt

ltcodegtcreateSiMessageltcodegt creates a service

indication type message

param url a ltcodegtStringltcodegt value

param created a ltcodegtStringltcodegt value

param expires a ltcodegtStringltcodegt value

Appendix C

53

param message a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createSiMessage(String url

String sid String created String expires String

action String message)

return XML_VERSION + SI_DOCTYPE +

ltsigtn +

ltindication href= + url + +

(sid = null si-id= + sid + ) +

created = null created= + created +

) +

(action = null action= + action +

) +

(expires = null expires= + expires +

) + gt +

message +

ltindicationgtnltsigt

Debug response

param http a ltcodegtHttpURLConnectionltcodegt value

exception Exception if an error occurs

private void debugResponse(HttpURLConnection http)

throws Exception

Systemoutprintln(httpgetResponseMessage())

String headerName

int i=0

while((headerName = httpgetHeaderFieldKey(i++)) =

null)

Systemoutprintln(headerName + +

httpgetHeaderField(headerName))

Systemoutprintln()

InputStreamReader in = new InputStreamReader(new

BufferedInputStream(httpgetInputStream()))

int c

Appendix C

54

while((c = inread()) = -1)

Systemoutprint((char)c)

Systemoutprintln()

ltcodegtgenPushIdltcodegt generates an unique push id

return a ltcodegtStringltcodegt value

private String genPushId()

pushId = 100000

return SystemcurrentTimeMillis() + + pushId++

55

References

[1] Microsoft ldquoGetting Mobile Using WML and WAP to Display Web Sites on

Mobile Devicesrdquo

URL msdnmicrosoftcomen-uslibraryaa140117(office10)aspx accessed

on April 10 2008

[2] DALE BULBROOK ldquoWAPA Beginnerrsquos Guiderdquo OsborneMcGraw-Hill 2001

[3] WAP Forum Wireless Application Protocol Architecture Specification Access on

Jan 12 2008 Available

httpwww1wapforumorgtechdocumentsWAP-210-WAPArch-2006 07 12-apdf

[4] WAP Forum Push Architectural Overview access on (2008 February 3) Available

httpwww1wapforumorgtechdocumentsWAP-250-PushArchOverview-2007 04

03-apdf

[5] Service indication PDF access on 62008 Available

httpwwww3orgTRhtml401structlinkshtml

[6] WAP Push Technology (openwave) PDF access on (2008 April) Available

URL httpwwwopenwavorg

[7] Web site (httpwwwwapforumorgwhatcopyrighthtm) access on May 2008

[8] ldquoWAP Push Proxy Gateway Specificationrdquo WAP Forum access on 16-August-

2007URI httpwwwwapforumorgPDF

[9] WAP Forum Access on (2008 MAY 31) WAP Service Indication Specification

Available httpwww1wapforumorgtechdocumentsWAP-167-ServiceInd-200507

31-apdf

  • odc_fpwmlandwap_topic3
  • N100E3
  • 21
  • 5

Chapter 2 Basic Concepts

9

the session is idle The WSP lifecycle is therefore not tied to the underlying transport

layer

WSP is a binary version of HTTP which includes both headers and data Binary

encoding is used to minimize the protocol overhead and to simplify decoding The header

is used to define content type character set encoding languages etc in an extensible

manner WSP supports two types of data transfers push and pull Pull transfer is used

when the client is sending a request and the server is sending a response In the push

mechanism the server pushes data to a client without prior request from the client

This can be done in three different ways Confirmed data can be pushed within an

existing session or non-confirmed data pushes can be done within or without an existing

session

223 Transaction Layer Wireless Transaction Protocol

The wireless transaction protocol WTP is defined to provide the services necessary for

sending requests responses and information WTP runs on top of a datagram service and

optionally a security service To ensure safe connection on top of the datagram layer the

WTP layer performs retransmissions sends acknowledgements and removes duplicated

messages In order to improve the connection efficiency WTP has no explicit connection

or teardown phases The layer also performs segmentation and reassembly to reduce the

number of packets sent

WTP has been defined as a transaction protocol that is suitable for mobile stations and

operates efficiently over wireless datagram networks Some benefits of using WTP are

that it improves reliability over datagram services improves efficiency over connection-

oriented services and that it is message oriented and designed for requestresponse

applications

The wireless transaction protocol is divided into three transaction services It can send

unreliable messages with no result message reliable messages with no result message or

reliable messages with exactly one result message

Chapter 2 Basic Concepts

10

Unreliable Messages With No Result Message

This service provides an unreliable datagram service The service can be used by

applications which occasionally want to send a datagram within an existing session

using WTP No acknowledgement or retransmission is done in this service

Reliable Messages With No Result Message

This service provides a reliable datagram service The service can be used by

applications that want to use a reliable push service The receiver acknowledges the

message and if the original sender receives no acknowledgement the message is

retransmitted

Reliable Messages With One Reliable Result Message

This service provides the basic invokeresponse transaction The receiver acknowledges

the message and if the original sender receives no acknowledgement the message is

retransmitted To confirm the reception of the acknowledgement the original sender

sends an acknowledgement to the receiver The three transactions are shown in next

figure

message message

acknowledge

message

confirm

Unreliable invoke

message with no

result message

Reliable invoke

message with no

result message

Reliable invoke

message with one

reliable result

message

a) b) c)

acknowledge

Figure 22 the three mode of transaction

Chapter 2 Basic Concepts

11

2231 Concatenation and Separation

To reduce the overhead caused by the datagram headers it is desirable to reduce the

number of packets sent over the air In order to reduce the number of messages several

protocol data units can be put into one single datagram This procedure is called the

concatenation procedure The reverse procedure is called the separation procedure [5]

Concatenation can be done when several packets are transported from the same sender to

the same receiver Concatenation can be done at any time The last acknowledgement can

be concatenated with the invoke message of the next transaction [5]

2232 Segmentation and Reassembly

If a packet is lager than the bearers largest capability the message can be segmented and

send in several packets To increase the communication efficiency message groups can be

acknowledged in groups [5]

To decrease the number of packets sent when a communication error occurs the receiver

can request one or multiple lost packets within a group of messages This is done instead

of resending the entire message which could mean that successfully received packets

have to be resent [5]

224 Security Layer Wireless Transport Layer Security

An Optional layer it is responsible for providing security data integrity and

authentication between two communicating applications The WTLS is optimized for low

bandwidth bearer networks with relatively long latency The WTLS is similar to the

Internet transport layer security TLS but has some new features such as datagram

support optimized handshake and dynamic key refreshing [5]

WTLS has been design to function on both connection-oriented and datagram transport

protocols The security layer acts above the transport layer

Chapter 2 Basic Concepts

12

2241 Service Primitives

WTLS uses primitives to ensure security The primitives are used to

Initiate a secure connection

Perform public-key authentication or key exchange with the client

Change into connection state when the handshake has been done

Terminate the connection

Inform the other end about warning level alerts

Request by the server that the client should initiate a new handshake

225 Transport Layer Wireless Datagram Protocol

The wireless datagram layer is a datagram service used by the upper layers WDP is

designed to communicate over different bearer services and especially for wireless

telecommunication networks [6] It Consists of

bull Source and destination address and port

bull Optionally fragmentation

It maps to UDP for IP bearer and moves single packets to and from the phone

226 WDP and IP

In networks with IP as the routing protocol UDP is used instead of WDP IP provides

segmentation and reassemble in a connection-less datagram service UDP provides port

based addressing and other necessary functions Thereby no additional functions are

required by a WDP layer [7]

227 Bearer Interfaces

WAP supports dial-up networking using IP and Point-to-Point Protocol (PPP) as the

bearer interface underneath WDP It also supports Short Message System (SMS) and

General Packet Radio System (GPRS) SMS passes text and binary data between digital

Chapter 2 Basic Concepts

13

phones GPRS is a relatively new technology that implements faster always-on

connections for wireless devices GPRS actually runs on top of IP [7]

As had been learned above WAP is quite similar to web figure 23 provide a brief

comparison between them

WAP

Bearer

WDP Dtatgram

WTLS security

WTP Transaction

WSP Session

WAE

WML and

WMLScript

Web

IP

TCP UDP

TLS-SSL

HTTP

HTML

JavaScript

VBscript

Figure 23 Web vs WAP

Chapter 2 Basic Concepts

14

23 SMS overview

SMS stands for Short Message Service It is a technology that enables the sending and

receiving of messages between mobile phones SMS first appeared in Europe in 1992 It

was included in the GSM (Global System for Mobile Communications) standards right at

the beginning Later it was ported to wireless technologies like CDMA and TDMA The

GSM and SMS standards were originally developed by ETSI ETSI is the abbreviation

for European Telecommunications Standards Institute Now the 3GPP (Third Generation

Partnership Project) is responsible for the development and maintenance of the GSM and

SMS standards [8]

SMS has two operational mode textual mode and binary mode which will allow sending

other data beside pure text

24 Push overview

WAP push provides a standard means to send data to a mobile subscriber without an

explicit request from the subscriber at the time the data is delivered In the normal

clientserver model a client requests a service or information from a server which then

responds by transmitting information to the client This is known as ldquopullrdquo technology

The client pulls information from the server The World Wide Web is the best example of

pull technology where a user enters a URL (the request) which is sent to a server and

the server answers by sending a Web page (the response) to the user (Figure 24 a)

Although WAP push is also based on the clientserver model it provides a means to send

data to the subscriber without an explicit request from the client at the time of delivery

(Figure 24 b)

With push functionality users are able to get information without having to request that

information In many cases it is important for the user to get the information as soon as it

is available Push communications can be used for sending stock quotes traffic reports

and news

Chapter 2 Basic Concepts

15

a) WAP pull model

b) WAP push model

Figure 24 Pull vs Push

24 WAP Push framework

A push operation starts when a server called the push initiator transmits a push messages

to a WAP client Since the push initiator located on the Internet does not use the same

protocol as the WAP client a translating gateway is needed The push initiator contacts

the push proxy gateway via the push access protocol and the Internet protocol The push

proxy gateway translates the information and forwards the pushed content to the WAP

device via the push over the air protocol (figure 25) [9]

Chapter 2 Basic Concepts

16

Push Proxy Gateway

WAP

Client

Push

Access Protocol

Push

over-the air

protocol Push Initiator

Figure 25 the wireless push technology

241 Push Proxy Gateway

The push proxy gateway PPG is the entity that does most of the work in the push

architecture The gateway acts as an access-point for content pushed from the Internet to

the client So the responsibility of the gateway owners to grant access to push proxy

gateway [9]

Besides the actual access-point service the push gateway provides the following services

push initiator identification and authentication

parsing and error detection of content control information

client discovery services

address resolution

binary encoding and compilation of certain content type

protocol conversion

Chapter 2 Basic Concepts

17

Information to the push proxy gateway is sent via the push access protocol PAP The

content of the information is divided into several parts were the first part is information to

the PPG such as recipient information

When the PPG has parsed the control information an acknowledgement is sent to the

push initiator reporting if the service was successful or not

Once the proxy has accepted the content and the push initiator has received the

acknowledgement the proxy is responsible for the transmission to the client The proxy

attempts to find the correct destination device and deliver the content to that client using

the push over the air protocol The contents delivered to the proxy may be translated to

their binary counterpart eg WML documents may be converted to binary XML by the

proxy before the information is transmitted to the client [9]

The proxy must implement a service to enable capability queries from the push initiator

The capability query should be responded with the capabilities of the specified WAP

device The push proxy gateway may also implement broadcasting services where

special addresses may be translated to a broadcast operation [9]

242 Push Access Protocol

The push access protocol PAP is the means by which an Internet-based push initiator

pushes content to a mobile network via the push proxy gateway [9] The push access

protocol is not intended for use over the air

PAP supports the following operations

Push submission

The push message sent from the push initiator to the gateway contains a control

entity a content entity and may contain a capability entity The control entity is

an XML document When the gateway has received the message an XML

response message is sent back to the initiator

Chapter 2 Basic Concepts

18

Result notification

If the push initiator has requested confirmation of successful delivery this XML

message is transmitted from the PPG to the push initiator when the content has

been delivered to the mobile device The push initiator acknowledges this result

message with another XML document

Push cancellation

The purpose of the push cancellation is to allow the push initiator to attempt to

cancel a previously submitted push message Both the cancellation message and

the resulting acknowledgement are sent as XML documents

Status query

The status query operation allows the push initiator to request the current status of

a message that has been previously submitted Both the status query message and

the resulting acknowledgement are sent as XML documents

Client capabilities query

This operation allows the push initiator to query the PPG for the capabilities of a

specific device The query is sent as an XML document and the response is sent

as another XML document

To access the push proxy gateway an address is used The gatewayrsquos underlying

protocols determines which type of address is used eg in HTTP a URL is used To

access a specific device the devicersquos address is included in the XML document

There are two ways to send information to several clients The push initiator can either

send information to several specific addresses or broadcast it to all clients In both cases

only one message is sent to the gateway which either sends the information to some or

all of the clients The clientsrsquo address is depending on the underlying layer [9]

Chapter 2 Basic Concepts

19

243 Push Over-The-Air Protocol

The push proxy gateway and the client communicate using the push over the air protocol

which utilizes WSP session services Pushes can be sent via connection oriented links or

connection-less links Connection-oriented pushes require that an active WSP session is

available but the server can not create a session To solve the case were there is no active

WSP session the push framework introduces a session initiation application in the client

This application listens to session requests from the OTA-server and responds by setting

up a WSP session for push purposes [9]

Push

Over-the air

WSP

Push management

premptive

Push operational

primitives

WSP Servise

Primitives

Figure 26 Push Over-The-Air protocol stack

The push over the air protocol supports two kinds of operations operations to manage the

connection and operations to send actual messages

Push Sends unconfirmed information over a connection-oriented link

Confirmed push Sends confirmed information over a connection-oriented link

Abort push rejects a previously transmitted push operation This is operation is

part of the confirmed push mechanism

Unit push Sends unconfirmed information over a connection-less link

Connect Creates a push session

Chapter 2 Basic Concepts

20

Suspend Request that a push session should be suspended

Resume Request to resumes a previously suspended push session

Disconnect Terminates the push session

Session request Request from the server to initialize a session to a client

244 Service Indication

The service indication SI provides a mechanism composed in an XML message to

notify a client that an external asynchronous event has occurred and indicate a service

that can be loaded in order to react to that event In order to notify the user a message is

sent from the push initiator via the proxy to the client The message will be shown to the

user and there will be a reference to a URI where the appropriate service can be loaded

For example the message could be ldquoYou have new mailrdquo and the URI to your email

service [9]

When the message is received by the client it will be presented to the user The user then

can choose to launch the service in an application eg the WML browser or to postpone

the SI for later handling Postponed SIs will be stored in the client and the user is given

the possibility to act upon them later When the user choose to launch the service the

service is started in the same way as if the user would have started it manually [9]

Messages sent with the service indication can support mechanisms to improve the end-

user-experience

User-intrusiveness levels

To improve the users understanding of the provided service and to affect the users

behavior when the message is delivered it is possible to change the level of user-

intrusiveness

Chapter 2 Basic Concepts

21

Deletion

When a pushed message becomes invalid the service provider can delete the

message in the clients For example an email notification becomes invalid when

the message are read

Replacement

When a pushed message is invalid and updated with a new message the service

provider can replace the origin message with a new one

Handling of out of order delivery

Since the wireless communication is unpredictable it can not be ensured that the

messages are received in the same order as sent This mechanism discards all

messages older than the latest received

Expiration

Some services may only be valid for a certain amount of time when the time has

expired the message is removed from the client

245 Service Loading

The service loading method provides means to convey a URI to a user agent in a mobile

client The method is conveyed in an XML message In difference from the service

indication method the client loads the content of the URI automatically without any

action from the user when the service loading message is received

Thereby the user will experience the content as if it was pushed to the mobile client and

executed In the service loading mechanism there is a reference to a service page that will

automatically be loaded without interaction with the user included For example the client

will automatically start the email service when a message about new mails on the server

is received [9]

Chapter 2 Basic Concepts

22

When the client is busy with some application it is not suitable to execute the referred

content directly upon reception of a message To avoid this client may cache the content

indicated by the URI so it becomes available to the user when the client is ready

Messages sent with the service loading method can support mechanism to improve the

end-user-experience

Control of the level of user interaction

To improve the users understanding of the provided service and the affect the

userrsquos behavior when the message is delivered it is possible to change the level

of user-intrusiveness The service can explicitly specify if the service should be

loaded or not if the client is busy on reception

Pre-emptive content caching

By setting this attribute the service loading can require that the indicated content

is downloaded and cached instead of executed This can be used to improve the

users experience of the services that otherwise would have required content to

be retrieved from an origin

23

Chapter Three

3 System requirements

Several materials and requirements must be incorporated into the design implementation

and testing The following discusses the components necessary to fulfill the project

requirements and environment

31 development environment

There are many development tools to choose from when developing for WAP Push and

hen you combine different environments with different gateways you will get a vast

numbers of choices This large flora of tools makes it difficult to choose a suitable

environment an important issue because a badly chosen one might consume a lot of time

341 Operating system

Kannel (the chosen gateway for the system) is being developed on Linux systems and

should be fairly easy to export to other Unix-like systems Although it should be working

without major problems on Windows (through Cygwin) Solaris and FreeBSD The push

initiator is implemented on java so it is operating system independent

Linux is the logical choice especially when it comes to the world severs and networking

for it promising feature as an open source low cost operating system

342 Programming language

Since system design was planned to be modular to enhance the reuse of its components as

explained above then an object oriented programming language will be a reasonable

choice Another factor is the need for a graphical user interface which imposes using a

programming language with good graphics handling capabilities at the same time it

should be over Linux

Chapter 3 System requirements

24

The best programming language to accomplish the above requirement is found to be java

which has the flowing feature

Cross platform - All clients and servers run the same Java code without any

changes or recompilation This simplifies deployment

Cost effective to develop in Java - The java language has many features that

improve developer productivity promote code reuse and reduce development and

maintenance costs

Works well with Open Source - Java with Linux and the many open source

movement projects and libraries provide a powerful mix that ensures development

is cost-effective efficient and of high quality because extensively tested libraries

components and solutions are available to plug-in to customer development

efforts

343 Nokia Mobile Internet Toolkit 41

To design and implement a WAP application on a Nokia phone the Nokia Internet

Toolkit has to be downloaded and installed on the PC A Nokia simulator is installed as

part of the installation but various phone simulators can be downloaded and installed

This simulator is used for testing purpose Also it has a server simulator based on the

Nokia Active Server if a WAP Gateway is unavailable

32 software requirements

Most of this section has been mentioned in way or other but they will be considered

briefly here

321 Kannel WAP gateway

This is an open source gateway upon which the push proxy gateway of this system will

be built on it available free of charge at kannel project web site

Chapter 3 System requirements

25

322 Linux operating system

It is important to install kannel gateway on it for this project we choose fedora core 7 for

availability reasons

323 JDK16

The java run time environment is required to implement the push initiator

32 hardware requirements

321 PC

Any Personal computer capable of running fedora core 7 with USB interface to be able

connects GSM modem

322 GSM modem

This will act as an alternative to the short message service center SMSC Obviously this

means that GSM network is required too

26

Chapter Four

4 System design

41 System Scenario

The basic scenario of a push session is that a Push Initiator (PI) transmits content to a

WAP client This is done in multiple steps as shown in Figure 31

pushOTAPAP

Gateway

PI

1

2

pull gateway

PPG

3

SMS center

Mobile device

6

5

4

Content provider78 9

Figure 41 WAP push scenario

Chapter 4 System Design

27

The PI communicates with a Push Proxy Gateway (PPG) over the Push Access Protocol

(PAP) (1 and 2) The PPG will then use the Push Over-The-Air Protocol (PushOTA) (3)

to deliver a Uniform Resource Identifier (URI) to the client via a Short Message System

Centre (SMS-C) (4 and 5) The next step for the client is then to activate the URI (6 and

7) and get the content from the server (8 and 9) The mobile device will have to use a

ldquoPull Gatewayrdquo to get the content but it is very likely that this is the same one as the PPG

The same same scenario could be viewed in sequence diagram figure (42)

Push Initiator PPG SMS Center WAP client

Send push message

Send push message response

Send WAP push message

Ack

Send WAP push message

Ack

Message read

Ack

Message read

Ack

Result notification message

Result notification response

Figure 42 WAP push sequence diagram

Chapter 4 System Design

28

43 Modular Design

Conceptually we can envision this push system as consisting of three major components

(presented in the order of the push lifetime)

first there is a Push Initiator Program that reads the generates a notification message and

transmits (pushes) it via a WAP Gateway to the customer phone This message notifies

the user that a service is available if the user accepts will ask the phonersquos browser to pull

the page from our web server via the WAP Gateway

Next there is the Push Proxy Gateway PPG which will receive the push message from

the push initiator and is responsible of doing any needed optimization protocol

compilation and conversion Also it is responsibility of the PPG to find the end user

address and send the push message to the SMS center

Finally there is the SMS center which will do the last delivery of push message to the

intended user if the user were offline the message will be saved for later time until the

WAP client is on

PI PPGSMSC

Figure 43 system modules

Chapter 4 System Design

29

43 Design of system Modules

Following sections of this chapter present a description and design of the system modules

with accompanying graphical representation

431 Push Initiator (PI)

The PI is the first logical component in the WAP Push scenario and therefore the

originator of the push message There are different kinds of PIs One example is an

automated script another one is a semi automated server version written in an applicable

scripting language supporting server side interaction

A push message is sent as an HTTP POST to the Push Proxy Gateway The POST will be

a multipart XML document with the first part being the control entity (Push Access

Protocol) the second part being the content entity (either a Service Indication or a

Service Load) and the third part being the capability entity

HTTP Post

Capability entity

Content entity (SISL)

Control entity (PAP)

Figure 44 architecture of the push message

Chapter 4 System Design

30

4311 Control entity

This part of the push contains the basic information and fields The fields can include

recipient address expiry time bearer type delivery attempt time and a URL to which a

response is to be sent if delivery confirmation is requested by the push initiator

PAP is the protocol used in WAP Push framework for specifying control information and

content that is to be pushed to a client via a Push Proxy Gateway (PPG) A Push Initiator

(PI) triggers push message processing The Push initiator class (Appendix B) of this

design shows how to generate PAP messages

The address of the used PPG should be given as an initialization parameter of the

application (ldquoppg-urlrdquo see Appendix B) This design also provides an implementation

that can be used in a special case when ldquoIPv4 IPv6rdquo type client addressing is applied and

when toolkit is used All other cases including the use of phone numbers (ldquoPLMNrdquo type

address) in sending push messages are considered

The PAP XML contains at the minimum a ltpapgt element a ltpush-messagegt

element and an ltaddressgt element

The important parts of this PAP message are the address value and type The value is

typically a MSISDN and type indicates whether to send to a MSISDN (typical case) or to

an IP Address The TYPE is almost always MSISDN as the Push Initiator (PI) will not

typically have the Mobile Stations IP address - which is generally dynamic

4312 Content entity

This is the actual data that is received by the mobile device The various content types

are Service Indication (SI) Service Load (SL) and Cache Operation (CO) in our project

we will just deal with SI and SL

The SI notifies a client about an external event by inviting the client to interact with it In

other words it informs a client about a service More precisely it sends a message that

Chapter 4 System Design

31

informs the client of a Uniform Resource Identifier (URI) where the client can access the

service

An important attribute of SI is the action attribute it may contain the action to be taken

when the client receives the SI There are two groups that the action attributes can be

divided into

First we have delete and signalmdashnone both of them is used because of their side

effects Ie with delete you take away all SIs with the same si-id as the deletion pushrdquo

including itself and with signal-none you either do nothing or you pay regard to the

info element in that push

The other group consists of signal-low signal-medium and signal-high These

attributes are all used to set the rules for the presentation in the terminal device

o Signal-low

The SI must be postponed without user intervention

o Signal-medium

The SI must be presented as soon as the implementation allows that to be carried out

without disturbing the user (Signal-medium is the value that will be used if none is

specified)

o Signal-high

The SI must be presented as soon as the implementation allows that to be carried out

without disturbing the user or earlier if it seems appropriate (This decision may for

instance be based on user preference settings)

This is the different functionalities supported by the SI we concidered

Expiration

Replacement

Deletion

Chapter 4 System Design

32

Handling of out of order delivery

Handling of information specified in the info element

A PUSH Service Indication (SI) contains at a minimum an ltsigt element and a

ltindicationgt element SL donrsquot differ so much from SI

4313 Capability entity

This entity determines the type of mobile device that is to be served This is determined

by WAP user agent profiling The sender can indicate the hardware vendor and browser

version and type of the intended recipients This capability entity is then matched at the

PPG to see which devices are compatible with the requested capability If there is a

match the content is delivered by the PPG to that specific device

Now a day most devices are compatible with WAP so we donrsquot need to create this entity

more precisely it is optional

After the push has been created in the PI it is up to the system to deliver it to the defined

destination In this system the different responsible entities are the PPG and the SMSC

Both of these two different entities are running on same server but it is only the

configuration of the SMSC that is out of my control since it is run by the operator and is

not controllable in my lab environment

432 Push Proxy Gateway (PPG)

There are various commercial WAP gateways available on the market that are quite

expensive Kannel on the other hand is an open source gateway one doesnrsquot need to pay

for it in addition one can edit the source code himself and construct his own customized

gateway Because Kannel is being developed on Linux systems (RedHat and Debian) it

can be smoothly ported to other UNIX-like operating systems

4321 Kannel gateway architecture

The gateway divides the processing load between the following three hosts

Chapter 4 System Design

33

The bearer box which connects to the SMS (Short Message Service) centers and

or CSD (Circuit Switched Data) routers providing a unified interface to them for

the wapbox The bearer box does this by implementing the WDP (Wireless

Datagram Protocol) layer of the WAP stack

The smsbox implements the rest of the SMS gateway functionality It receives

textual SMS messages from the bearerbox and interprets them as service

requests and responds to them in the appropriate way

The wapbox which hosts the upper layers of the WAP stack Each session and its

transactions are handled by the same wapbox (see figure 35)

1Figure 45 divisions of duties in kannel

4322 Working of the gateway

The bearer box receives UDP (User Datagram Protocol) packets from CSD routers

inspects them to see whether they are WAP packets if so then it will routes them to the

WAP box This simple design allows the bearer box to do a minimum of processing per

smsbox

wapbox

bearerbox

Kannel

SMS center

WAP phone

HTTP server

Chapter 4 System Design

34

packet The bearer box also sends the UDP packets that the other boxes generate which

adds some more routing processing The wapboxes implement the WTP (Wireless

Transaction Protocol) and WSP (Wireless Session Protocol) layers These take HTTP-

like requests from the phones and make the actual HTTP requests to content servers

compress the responses and send them back to the terminals (Sessions are maintained to

make as much use of the limited radio bandwidth as possible)

4323 External interfaces of the gateway

The gateway has interfaces to three external agents

bull SMS centers using various protocols

bull HTTP servers to fetch WAP and SMS content and to push WAP Content The

pull protocol is HTTP push PAP

bull WAP phones implementing the WAP protocol stack and (for push) WAP Push

client

Figure 36 summarize kannel external interfaces

4324 Configuring the gateway

The bearerbox smsbox and wapbox are the main working modules of the gateway and

must be configured before configuring the gateway These three modules are controlled

by a configuration file that has wapbox smsbox and bearerbox groups

Configuring the PPG core group

We use two components the PPG core group and the PPG user group The PPG

core group is used to configure the PI interface(for more details configuration

variables refer to appendix c)

Chapter 4 System Design

35

Mobile telephone

network

The Internet

smsbox

wapbox

bearerbox

Kannel

HTTP

HTTP

HTTP server

Serving WML

files

HTTP server

Serving HTML

files

TCP

TCP

WAPSMS

SMSC

WAP phoneNetwork base station

Workstation used for http

administration

Figure 46 External interfaces of the gateway

4325 Administering the gateway through an HTTP interface

Kannel can be administered via an HTTP interface All commands are given as normal

HTTP queries so they can easily be given from command lines like this one

links -dump httpip-adressportshutdownpassword=yourchoice

But it is advantageous to have graphical user interface for gateway control so we have

designed GUI through http

Chapter 4 System Design

36

433 Short Message Service Centre (SMSC)

A SMSC is an essential component when sending a push message from an IP network to

a mobile device in the architecture supported by the components and devices It is used to

remove the TCPIP layer that the push is encapsulatedrdquo in It is also the entity that

identifies the end-point device When this is done it is also the SMSC that is responsible

for the processing and final message delivery to the device After the process of de-

encapsulation and resolution of the client identity there should not be any difference

between this message and a message that is originated locally from the operator itself

(like a SMS)

In this project we just use a virtual SMS center we try first to get connection to a real

one but our effort was worthless

Finally the following figure depicts the overall flowchart of the WAP push system

(figure 47)

Chapter 4 System Design

37

PI

PPG

Create PAP

HTTP Post

Message

processing

OTA

Connection

oriented

Sessionless Session

oriented

WTP Initiation

WAP clinet

Application

Create content

Create

capability

entity

Database

SMS center

NoYes

Figure 47 the complete flowchart of the system

38

Chapter Five

5 System implementation and results

51 Implementation

511 The Push Proxy Gateway

First of all the Kannel gateway have been compiled and installed using gcc (GNU C

Compiler) this stage go fine except the operating system required more components to

be pre-installed and will configured

Then with stages of configuration to the gateway (Appendix B) it was capable of working

as PPG Figure 51 below show the gateway when it starts

Figure 51 starting kannel gateway

Then a web based user interface had been created to provide an easy way to control the

gateway remotely Figure 52 and figure 53

39

Figure 52 GUI for gateway control

512 The Push initiator

Next the push initiator design had been implemented using java programming language

as in design phase the implementation is taken carefully to make a reusable component

that could be used by other developer

PushInitiator class (Appendix B) implements a simple push initiator which can be used

to create and send messages to a push proxy gateway (PPG)

The method sendPushMessage sends a push message via the PPG to the client The client

is identified by the address which is either the phone number (address type is PLMN) or

IP address The message content and its mime type are also given as arguments to the

method the other tow important method are

createPapMessage This method creates a Push Access Protocol (PAP) type message

40

createSiMessage This method is used to create a service indication (SI) type message

Figure 53 showing running kannel status

513 WAP site

Since this site will be built for testing purpose and making sure that the system is

functional we had not go deep in this section Just simple WAP site with tow page has

been crated

41

52 Service indication

When a SI was pushed to any of the emulator or Nokia phones it was received and

presented in the way it was supposed to as specified in the WAP standard as shown in

figures below This is a proof that the devices claiming to support WAP push do so and

the design is will working See figures 53 through 56

Figure 55 service indication

42

Figure 57 SI details

52 Service load

The emulator correctly receives and interpreted the SL push the same as all of Nokia

phones we have tested

When a SL was pushed to the Ericsson phones it was not presented in the specified way

figure 58 I think that it is because of security reasons The reason for this assumption is

that the phones only supports on or off as security in their push configuration The

emulator on the other hand presents SL correctly Finally the Siemens phone did seem to

interpret SL but the current software was not very consistent It did load the SL without

user interference in the specified way when the user already where having an active

session If the user was offline the phone interface presented a symbol on the display

and did not load the service until the user clicked on the symbol

43

Chapter Six

6 conclusion and future work

In this chapter we will provide the conclusions and proposed future work for interested

individuals

61 Conclusions

In this project a WAP push system has been successfully designed and implemented It

provides a way to partially overcome the limitations encountered when accessing the

World Wide Web using handsets After comparing the proposed project objectives with

those accomplished the main goals are seen to be met

Phones from different manufactures all differ from the WAP-standard in some

ways One of the most obvious differences is the resolution of the display

During the work it has been noticed that the WML pages must be quite small We

have also noticed that the support for tables and some other tags are a bit limited

Even though the WML standard is smaller than the HTML standard it is a little

more complicated to write correct WML pages The main conclusion is that WAP

works pretty well but the phones are a little non-stable

The push proxy gateway is configured and worked probably with virtual SMS

center and it is easy to switch to a real one

The system depends mainly on open sources (ie Linux and kannek)

The design and implementation of the push initiator work well with the kannel

gateway and it should work correctly with other gateways

Chapter 6 Conclusion

44

62 Further Work

The possibilities of wireless push are interesting enough that it has to be worth to know if

the security and conformance problems will be solved in WAP push If they are solved

and the technique is refined then there should be nothing to stop the great number of

services that will follow in its footsteps Therefore there is further work that should be

done and the most interesting parts are in my opinion these

621 Security Aspect

One of the problems today is that the phones supporting push does not have the detailed

security settings that a technique like this needs Therefore it would be interesting to look

into the possibility to add these without confusing the user I suggest furthering looking

into usability aspects of security in WAP Push for short

622 GPS integration possibility

This will provide location dependent delivery of WAP push it will have great

applications in telematic and ecommerce advertising

623 Conformance to Standards

An interesting project would be to examine if the main reason for the nonstandard

solutions in the existing WAP push software is the result of difficulties in

implementation Or if the main reason is that the manufacturers wants to provide

proprietary solutions A reason why one may want to know this is that if the problem is

depending on implementation problems then it might get better

45

Appendix A Abbreviations

CDMA Code Division Multiple Access

CO Cache Operation

DTD Document Type Definition

GSM Global System for Mobile

HTTP Hypertext Transfer Protocol

IP Internet Protocol

MSISDN Mobile Station International Subscriber Directory Number

OTA Over The Air

PAP Push Access Protocol

PushOTA Push Over The Air

PDA Personal Digital Assistant

P1 Push Initiator

PLMN Public Land Mobile Networks

PPG Push Proxy Gateway

SI Service Indication

SIA Session Initiation Application

SIR Session Initiation Request

SL Service Loading

SMPP Short Message Peer to Peer

SMS Short Message System

SMSC Short Message System Center

UCP Universal Computer Protocol

URI Uniform Resource Identifier

URL Uniform Resource Locator

UTC Universal Time Coordinated

WAP Wireless Application Protocol

WBXML WAP binary XML

WDP Wireless Datagram Protocol

WSP Wireless Session Protocol

WTLS Wireless Transport Layer Security

XML Extensible Mark-up Language

46

Appendix B Kannel gateway configurations

THIS IS A SAMPLE CONFIGURATION FOR KANNEL

group = core

admin-port = 13000

admin-password = admin

status-password = admin

admin-deny-ip =

admin-allow-ip = 127001172161455

log-file = tmpkannellog

log-level = 0

http-proxy-host = 172161411

http-proxy-port = 8080

http-proxy-exceptions = 127001

Smsbox related

smsbox-port = 13001

box-deny-ip =

box-allow-ip = 127001

bearerbox-host =localhost

Wapbox related

wapbox-port = 13002

udp-deny-ip =

udp-allow-ip = 127001

bearerbox-host =localhost

SMSC GSM

group = smsc

smsc = at

modemtype = auto

speed =9600

device = devttyS0

SMSC HTTP

group = smsc

smsc = http

system-type = kannel

port = 13016

connect-allow-ip = 127001

Appendix B

47

username = wappush

password = wappush

SMSBOX SETUP

group = smsbox

bearerbox-host = localhost

sendsms-port = 13013

sendsms-chars = 0123456789 +-

log-file = tmpsmsboxlog

log-level = 0

access-log = accesslog

white-list = 127001

black-list =

SEND-SMS USERS

group = sendsms-user

username = wappush

password = wappush

user-deny-ip =

user-allow-ip = 127001

PPG group

group = ppg

ppg-url = wappush

ppg-port = 8080

concurrent-pushes = 100

trusted-pi = true

users = 1024

service-name = ppg

ppg-smsbox-id = dlrbox

WAP PUSH USER

group = wap-push-user

wap-push-user = picom

ppg-username = wappush

ppg-password = wappush

allow-ip = localhost

48

Appendix C Selected Codes

Gateway Control Form

ltDOCTYPE HTML PUBLIC -W3CDTD HTML 32ENgt

lthtmlgt ltheadgt

lttitlegtGateway control formlttitlegt

ltheadgt

ltbody bgcolor=white text=black link=blue vlink=navy

alink=redgt

ltbase target=submitgt

ltscriptgt

function update_status()

if ( adminactionvalue == status )

adminaction = http + adminhostnamevalue +

+ adminportvalue + status +

adminstatusformatvalue

else

adminaction = http + adminhostnamevalue +

+ adminportvalue + + adminactionvalue

adminpasswordvalue = adminpasswordvalue

actiongovalue = GO GET +adminaction

ltscriptgt

lttable align=centergt

lttrgtltp align=centergtlth2gtGateway control

formlth2gtltpgtlttrgt

lttrgt lttdgtHostnamelttdgtlttdgtltinput type=text

name=adminhostname value=localhost

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPortlttdgtlttdgtltinput type=text

name=adminport value=13000

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPasswordlttdgtlttdgtltinput type=password

name=adminpassword value=

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtActionlttdgtlttdgtltselect name=adminaction

onChange=update_status()gt

ltoption value=statusgtStatusltoptiongt

ltoption value=suspendgtSuspendltoptiongt

ltoption value=isolategtIsolateltoptiongt

Appendix C

49

ltoption value=shutdowngtShutdownltoptiongt

ltoption value=resumegtResumeltoptiongt

ltselectgtlttdgt lttrgt

lttrgt lttdgtStatus Formatlttdgtlttdgtltselect

name=adminstatusformat onChange=update_status()gt

ltoption value=gthtmlltoptiongtltoption

value=txtgttxtltoptiongtltoption

value=xmlgtxmlltoptiongtltselectgtlttdgt lttrgt

ltform name=admin method=get

action=httplocalhost13000status

encoding=applicationx-www-formgt

ltinput type=hidden name=password value=gt

lttrgt

lttdgtGolttdgt

ltformgt

lttdgtltinput type=submit value=go name=actiongo

onClick=documentadminsubmit()gtlttdgt

lttrgt

lttablegt

ltbodygt

lthtmlgt

Push Initiator Class

import javanetURL

import javanetHttpURLConnection

import javaio

Class implements a simple push initiator It can be

used to create and send messages to push proxy

gateway (ppg)

public final class PushInitiator

xml version

private final static String XML_VERSION = ltxml

version=10gt

Push Access Protocol (PAP) document type

private final static String PAP_DOCTYPE =

Appendix C

50

ltDOCTYPE pap PUBLIC -WAPFORUMDTD PAP 10EN

httpwwwwapforumorgDTDpap_10dtd gt

content type of the push request multipart body

private final static String CONTENT_TYPE =

multipartrelated boundary=multipart-boundary

type=applicationxml

Service Indication (SI) document type

private static final String SI_DOCTYPE = ltDOCTYPE si

PUBLIC -WAPFORUMDTD SI 10EN +

httpwwwwapforumorgDTDsidtdgt

private static int pushId = 0

PPG url where the pap message is to be sent

private final URL ppgUrl

some push proxy gateways may also require the

authentication of the push initiator

For instance the push initiator may be required to

send an HTTP authorization header in each request

private final String authorization

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

public PushInitiator(URL ppgUrl) thisppgUrl =

ppgUrl

authorization = null

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

param authorization a ltcodegtStringltcodegt value

public PushInitiator(URL ppgUrl String authorization)

thisppgUrl = ppgUrl

Appendix C

51

thisauthorization = authorization

Systemoutprintln(Push Initiator created ppgUrl =

+ ppgUrl)

ltcodegtsendPushMessageltcodegt sends push message to

ppg

param clientAddress a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param message a ltcodegtStringltcodegt value

param mimeType a ltcodegtStringltcodegt value

exception Exception if an error occurs

public void sendPushMessage(String clientAddress

String addressTypeString message String mimeType)

throws Exception

HttpURLConnection http =

(HttpURLConnection)ppgUrlopenConnection()

String ppgServer = ppgUrlgetHost()

httpsetDoInput(true)

httpsetRequestProperty(Content-Type CONTENT_TYPE)

if(authorization = null)

if(authorizationtrim()equals())

httpsetRequestProperty(Authorization

authorization)

httpsetDoOutput(true)

PrintWriter out = new PrintWriter(new

BufferedOutputStream(httpgetOutputStream()))

outprintln(--multipart-boundary)

outprintln(Content-type applicationxml)

outprintln()

outprintln(createPapMessage(clientAddress

addressTypeppgServer genPushId() null))

outprintln()

outprintln(--multipart-boundary)

outprintln(Content-type + mimeType)

outprintln()

outprintln(message)

outprintln()

outprintln(--multipart-boundary--)

outflush()

outclose()

httpconnect()

Appendix C

52

finally read and debug the response received from

PPG

try

debugResponse(http)

catch (Exception e)

Systemerrprintln(Error in receiving the

response)

ltcodegtcreatePapMessageltcodegt creates a Push Access

Protocoltype message

param address a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param ppgServer a ltcodegtStringltcodegt value

param pushId a ltcodegtStringltcodegt value

param notificationTo a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createPapMessage(String address

String addressType String ppgServer String pushId

String notificationTo)

return XML_VERSION + n + PAP_DOCTYPE + n +

ltpap product-name=Mobile Zoo Push

Initiatorgtn +

ltpush-message push-id= + pushId +

(notificationTo = null request-notification-

to= + notificationTo ) + gtn +

ltaddress address-value=WAPPUSH= + address +

TYPE= + addressType +

+ ppgServer + gtn +

ltpush-messagegtnltpapgt

ltcodegtcreateSiMessageltcodegt creates a service

indication type message

param url a ltcodegtStringltcodegt value

param created a ltcodegtStringltcodegt value

param expires a ltcodegtStringltcodegt value

Appendix C

53

param message a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createSiMessage(String url

String sid String created String expires String

action String message)

return XML_VERSION + SI_DOCTYPE +

ltsigtn +

ltindication href= + url + +

(sid = null si-id= + sid + ) +

created = null created= + created +

) +

(action = null action= + action +

) +

(expires = null expires= + expires +

) + gt +

message +

ltindicationgtnltsigt

Debug response

param http a ltcodegtHttpURLConnectionltcodegt value

exception Exception if an error occurs

private void debugResponse(HttpURLConnection http)

throws Exception

Systemoutprintln(httpgetResponseMessage())

String headerName

int i=0

while((headerName = httpgetHeaderFieldKey(i++)) =

null)

Systemoutprintln(headerName + +

httpgetHeaderField(headerName))

Systemoutprintln()

InputStreamReader in = new InputStreamReader(new

BufferedInputStream(httpgetInputStream()))

int c

Appendix C

54

while((c = inread()) = -1)

Systemoutprint((char)c)

Systemoutprintln()

ltcodegtgenPushIdltcodegt generates an unique push id

return a ltcodegtStringltcodegt value

private String genPushId()

pushId = 100000

return SystemcurrentTimeMillis() + + pushId++

55

References

[1] Microsoft ldquoGetting Mobile Using WML and WAP to Display Web Sites on

Mobile Devicesrdquo

URL msdnmicrosoftcomen-uslibraryaa140117(office10)aspx accessed

on April 10 2008

[2] DALE BULBROOK ldquoWAPA Beginnerrsquos Guiderdquo OsborneMcGraw-Hill 2001

[3] WAP Forum Wireless Application Protocol Architecture Specification Access on

Jan 12 2008 Available

httpwww1wapforumorgtechdocumentsWAP-210-WAPArch-2006 07 12-apdf

[4] WAP Forum Push Architectural Overview access on (2008 February 3) Available

httpwww1wapforumorgtechdocumentsWAP-250-PushArchOverview-2007 04

03-apdf

[5] Service indication PDF access on 62008 Available

httpwwww3orgTRhtml401structlinkshtml

[6] WAP Push Technology (openwave) PDF access on (2008 April) Available

URL httpwwwopenwavorg

[7] Web site (httpwwwwapforumorgwhatcopyrighthtm) access on May 2008

[8] ldquoWAP Push Proxy Gateway Specificationrdquo WAP Forum access on 16-August-

2007URI httpwwwwapforumorgPDF

[9] WAP Forum Access on (2008 MAY 31) WAP Service Indication Specification

Available httpwww1wapforumorgtechdocumentsWAP-167-ServiceInd-200507

31-apdf

  • odc_fpwmlandwap_topic3
  • N100E3
  • 21
  • 5

Chapter 2 Basic Concepts

10

Unreliable Messages With No Result Message

This service provides an unreliable datagram service The service can be used by

applications which occasionally want to send a datagram within an existing session

using WTP No acknowledgement or retransmission is done in this service

Reliable Messages With No Result Message

This service provides a reliable datagram service The service can be used by

applications that want to use a reliable push service The receiver acknowledges the

message and if the original sender receives no acknowledgement the message is

retransmitted

Reliable Messages With One Reliable Result Message

This service provides the basic invokeresponse transaction The receiver acknowledges

the message and if the original sender receives no acknowledgement the message is

retransmitted To confirm the reception of the acknowledgement the original sender

sends an acknowledgement to the receiver The three transactions are shown in next

figure

message message

acknowledge

message

confirm

Unreliable invoke

message with no

result message

Reliable invoke

message with no

result message

Reliable invoke

message with one

reliable result

message

a) b) c)

acknowledge

Figure 22 the three mode of transaction

Chapter 2 Basic Concepts

11

2231 Concatenation and Separation

To reduce the overhead caused by the datagram headers it is desirable to reduce the

number of packets sent over the air In order to reduce the number of messages several

protocol data units can be put into one single datagram This procedure is called the

concatenation procedure The reverse procedure is called the separation procedure [5]

Concatenation can be done when several packets are transported from the same sender to

the same receiver Concatenation can be done at any time The last acknowledgement can

be concatenated with the invoke message of the next transaction [5]

2232 Segmentation and Reassembly

If a packet is lager than the bearers largest capability the message can be segmented and

send in several packets To increase the communication efficiency message groups can be

acknowledged in groups [5]

To decrease the number of packets sent when a communication error occurs the receiver

can request one or multiple lost packets within a group of messages This is done instead

of resending the entire message which could mean that successfully received packets

have to be resent [5]

224 Security Layer Wireless Transport Layer Security

An Optional layer it is responsible for providing security data integrity and

authentication between two communicating applications The WTLS is optimized for low

bandwidth bearer networks with relatively long latency The WTLS is similar to the

Internet transport layer security TLS but has some new features such as datagram

support optimized handshake and dynamic key refreshing [5]

WTLS has been design to function on both connection-oriented and datagram transport

protocols The security layer acts above the transport layer

Chapter 2 Basic Concepts

12

2241 Service Primitives

WTLS uses primitives to ensure security The primitives are used to

Initiate a secure connection

Perform public-key authentication or key exchange with the client

Change into connection state when the handshake has been done

Terminate the connection

Inform the other end about warning level alerts

Request by the server that the client should initiate a new handshake

225 Transport Layer Wireless Datagram Protocol

The wireless datagram layer is a datagram service used by the upper layers WDP is

designed to communicate over different bearer services and especially for wireless

telecommunication networks [6] It Consists of

bull Source and destination address and port

bull Optionally fragmentation

It maps to UDP for IP bearer and moves single packets to and from the phone

226 WDP and IP

In networks with IP as the routing protocol UDP is used instead of WDP IP provides

segmentation and reassemble in a connection-less datagram service UDP provides port

based addressing and other necessary functions Thereby no additional functions are

required by a WDP layer [7]

227 Bearer Interfaces

WAP supports dial-up networking using IP and Point-to-Point Protocol (PPP) as the

bearer interface underneath WDP It also supports Short Message System (SMS) and

General Packet Radio System (GPRS) SMS passes text and binary data between digital

Chapter 2 Basic Concepts

13

phones GPRS is a relatively new technology that implements faster always-on

connections for wireless devices GPRS actually runs on top of IP [7]

As had been learned above WAP is quite similar to web figure 23 provide a brief

comparison between them

WAP

Bearer

WDP Dtatgram

WTLS security

WTP Transaction

WSP Session

WAE

WML and

WMLScript

Web

IP

TCP UDP

TLS-SSL

HTTP

HTML

JavaScript

VBscript

Figure 23 Web vs WAP

Chapter 2 Basic Concepts

14

23 SMS overview

SMS stands for Short Message Service It is a technology that enables the sending and

receiving of messages between mobile phones SMS first appeared in Europe in 1992 It

was included in the GSM (Global System for Mobile Communications) standards right at

the beginning Later it was ported to wireless technologies like CDMA and TDMA The

GSM and SMS standards were originally developed by ETSI ETSI is the abbreviation

for European Telecommunications Standards Institute Now the 3GPP (Third Generation

Partnership Project) is responsible for the development and maintenance of the GSM and

SMS standards [8]

SMS has two operational mode textual mode and binary mode which will allow sending

other data beside pure text

24 Push overview

WAP push provides a standard means to send data to a mobile subscriber without an

explicit request from the subscriber at the time the data is delivered In the normal

clientserver model a client requests a service or information from a server which then

responds by transmitting information to the client This is known as ldquopullrdquo technology

The client pulls information from the server The World Wide Web is the best example of

pull technology where a user enters a URL (the request) which is sent to a server and

the server answers by sending a Web page (the response) to the user (Figure 24 a)

Although WAP push is also based on the clientserver model it provides a means to send

data to the subscriber without an explicit request from the client at the time of delivery

(Figure 24 b)

With push functionality users are able to get information without having to request that

information In many cases it is important for the user to get the information as soon as it

is available Push communications can be used for sending stock quotes traffic reports

and news

Chapter 2 Basic Concepts

15

a) WAP pull model

b) WAP push model

Figure 24 Pull vs Push

24 WAP Push framework

A push operation starts when a server called the push initiator transmits a push messages

to a WAP client Since the push initiator located on the Internet does not use the same

protocol as the WAP client a translating gateway is needed The push initiator contacts

the push proxy gateway via the push access protocol and the Internet protocol The push

proxy gateway translates the information and forwards the pushed content to the WAP

device via the push over the air protocol (figure 25) [9]

Chapter 2 Basic Concepts

16

Push Proxy Gateway

WAP

Client

Push

Access Protocol

Push

over-the air

protocol Push Initiator

Figure 25 the wireless push technology

241 Push Proxy Gateway

The push proxy gateway PPG is the entity that does most of the work in the push

architecture The gateway acts as an access-point for content pushed from the Internet to

the client So the responsibility of the gateway owners to grant access to push proxy

gateway [9]

Besides the actual access-point service the push gateway provides the following services

push initiator identification and authentication

parsing and error detection of content control information

client discovery services

address resolution

binary encoding and compilation of certain content type

protocol conversion

Chapter 2 Basic Concepts

17

Information to the push proxy gateway is sent via the push access protocol PAP The

content of the information is divided into several parts were the first part is information to

the PPG such as recipient information

When the PPG has parsed the control information an acknowledgement is sent to the

push initiator reporting if the service was successful or not

Once the proxy has accepted the content and the push initiator has received the

acknowledgement the proxy is responsible for the transmission to the client The proxy

attempts to find the correct destination device and deliver the content to that client using

the push over the air protocol The contents delivered to the proxy may be translated to

their binary counterpart eg WML documents may be converted to binary XML by the

proxy before the information is transmitted to the client [9]

The proxy must implement a service to enable capability queries from the push initiator

The capability query should be responded with the capabilities of the specified WAP

device The push proxy gateway may also implement broadcasting services where

special addresses may be translated to a broadcast operation [9]

242 Push Access Protocol

The push access protocol PAP is the means by which an Internet-based push initiator

pushes content to a mobile network via the push proxy gateway [9] The push access

protocol is not intended for use over the air

PAP supports the following operations

Push submission

The push message sent from the push initiator to the gateway contains a control

entity a content entity and may contain a capability entity The control entity is

an XML document When the gateway has received the message an XML

response message is sent back to the initiator

Chapter 2 Basic Concepts

18

Result notification

If the push initiator has requested confirmation of successful delivery this XML

message is transmitted from the PPG to the push initiator when the content has

been delivered to the mobile device The push initiator acknowledges this result

message with another XML document

Push cancellation

The purpose of the push cancellation is to allow the push initiator to attempt to

cancel a previously submitted push message Both the cancellation message and

the resulting acknowledgement are sent as XML documents

Status query

The status query operation allows the push initiator to request the current status of

a message that has been previously submitted Both the status query message and

the resulting acknowledgement are sent as XML documents

Client capabilities query

This operation allows the push initiator to query the PPG for the capabilities of a

specific device The query is sent as an XML document and the response is sent

as another XML document

To access the push proxy gateway an address is used The gatewayrsquos underlying

protocols determines which type of address is used eg in HTTP a URL is used To

access a specific device the devicersquos address is included in the XML document

There are two ways to send information to several clients The push initiator can either

send information to several specific addresses or broadcast it to all clients In both cases

only one message is sent to the gateway which either sends the information to some or

all of the clients The clientsrsquo address is depending on the underlying layer [9]

Chapter 2 Basic Concepts

19

243 Push Over-The-Air Protocol

The push proxy gateway and the client communicate using the push over the air protocol

which utilizes WSP session services Pushes can be sent via connection oriented links or

connection-less links Connection-oriented pushes require that an active WSP session is

available but the server can not create a session To solve the case were there is no active

WSP session the push framework introduces a session initiation application in the client

This application listens to session requests from the OTA-server and responds by setting

up a WSP session for push purposes [9]

Push

Over-the air

WSP

Push management

premptive

Push operational

primitives

WSP Servise

Primitives

Figure 26 Push Over-The-Air protocol stack

The push over the air protocol supports two kinds of operations operations to manage the

connection and operations to send actual messages

Push Sends unconfirmed information over a connection-oriented link

Confirmed push Sends confirmed information over a connection-oriented link

Abort push rejects a previously transmitted push operation This is operation is

part of the confirmed push mechanism

Unit push Sends unconfirmed information over a connection-less link

Connect Creates a push session

Chapter 2 Basic Concepts

20

Suspend Request that a push session should be suspended

Resume Request to resumes a previously suspended push session

Disconnect Terminates the push session

Session request Request from the server to initialize a session to a client

244 Service Indication

The service indication SI provides a mechanism composed in an XML message to

notify a client that an external asynchronous event has occurred and indicate a service

that can be loaded in order to react to that event In order to notify the user a message is

sent from the push initiator via the proxy to the client The message will be shown to the

user and there will be a reference to a URI where the appropriate service can be loaded

For example the message could be ldquoYou have new mailrdquo and the URI to your email

service [9]

When the message is received by the client it will be presented to the user The user then

can choose to launch the service in an application eg the WML browser or to postpone

the SI for later handling Postponed SIs will be stored in the client and the user is given

the possibility to act upon them later When the user choose to launch the service the

service is started in the same way as if the user would have started it manually [9]

Messages sent with the service indication can support mechanisms to improve the end-

user-experience

User-intrusiveness levels

To improve the users understanding of the provided service and to affect the users

behavior when the message is delivered it is possible to change the level of user-

intrusiveness

Chapter 2 Basic Concepts

21

Deletion

When a pushed message becomes invalid the service provider can delete the

message in the clients For example an email notification becomes invalid when

the message are read

Replacement

When a pushed message is invalid and updated with a new message the service

provider can replace the origin message with a new one

Handling of out of order delivery

Since the wireless communication is unpredictable it can not be ensured that the

messages are received in the same order as sent This mechanism discards all

messages older than the latest received

Expiration

Some services may only be valid for a certain amount of time when the time has

expired the message is removed from the client

245 Service Loading

The service loading method provides means to convey a URI to a user agent in a mobile

client The method is conveyed in an XML message In difference from the service

indication method the client loads the content of the URI automatically without any

action from the user when the service loading message is received

Thereby the user will experience the content as if it was pushed to the mobile client and

executed In the service loading mechanism there is a reference to a service page that will

automatically be loaded without interaction with the user included For example the client

will automatically start the email service when a message about new mails on the server

is received [9]

Chapter 2 Basic Concepts

22

When the client is busy with some application it is not suitable to execute the referred

content directly upon reception of a message To avoid this client may cache the content

indicated by the URI so it becomes available to the user when the client is ready

Messages sent with the service loading method can support mechanism to improve the

end-user-experience

Control of the level of user interaction

To improve the users understanding of the provided service and the affect the

userrsquos behavior when the message is delivered it is possible to change the level

of user-intrusiveness The service can explicitly specify if the service should be

loaded or not if the client is busy on reception

Pre-emptive content caching

By setting this attribute the service loading can require that the indicated content

is downloaded and cached instead of executed This can be used to improve the

users experience of the services that otherwise would have required content to

be retrieved from an origin

23

Chapter Three

3 System requirements

Several materials and requirements must be incorporated into the design implementation

and testing The following discusses the components necessary to fulfill the project

requirements and environment

31 development environment

There are many development tools to choose from when developing for WAP Push and

hen you combine different environments with different gateways you will get a vast

numbers of choices This large flora of tools makes it difficult to choose a suitable

environment an important issue because a badly chosen one might consume a lot of time

341 Operating system

Kannel (the chosen gateway for the system) is being developed on Linux systems and

should be fairly easy to export to other Unix-like systems Although it should be working

without major problems on Windows (through Cygwin) Solaris and FreeBSD The push

initiator is implemented on java so it is operating system independent

Linux is the logical choice especially when it comes to the world severs and networking

for it promising feature as an open source low cost operating system

342 Programming language

Since system design was planned to be modular to enhance the reuse of its components as

explained above then an object oriented programming language will be a reasonable

choice Another factor is the need for a graphical user interface which imposes using a

programming language with good graphics handling capabilities at the same time it

should be over Linux

Chapter 3 System requirements

24

The best programming language to accomplish the above requirement is found to be java

which has the flowing feature

Cross platform - All clients and servers run the same Java code without any

changes or recompilation This simplifies deployment

Cost effective to develop in Java - The java language has many features that

improve developer productivity promote code reuse and reduce development and

maintenance costs

Works well with Open Source - Java with Linux and the many open source

movement projects and libraries provide a powerful mix that ensures development

is cost-effective efficient and of high quality because extensively tested libraries

components and solutions are available to plug-in to customer development

efforts

343 Nokia Mobile Internet Toolkit 41

To design and implement a WAP application on a Nokia phone the Nokia Internet

Toolkit has to be downloaded and installed on the PC A Nokia simulator is installed as

part of the installation but various phone simulators can be downloaded and installed

This simulator is used for testing purpose Also it has a server simulator based on the

Nokia Active Server if a WAP Gateway is unavailable

32 software requirements

Most of this section has been mentioned in way or other but they will be considered

briefly here

321 Kannel WAP gateway

This is an open source gateway upon which the push proxy gateway of this system will

be built on it available free of charge at kannel project web site

Chapter 3 System requirements

25

322 Linux operating system

It is important to install kannel gateway on it for this project we choose fedora core 7 for

availability reasons

323 JDK16

The java run time environment is required to implement the push initiator

32 hardware requirements

321 PC

Any Personal computer capable of running fedora core 7 with USB interface to be able

connects GSM modem

322 GSM modem

This will act as an alternative to the short message service center SMSC Obviously this

means that GSM network is required too

26

Chapter Four

4 System design

41 System Scenario

The basic scenario of a push session is that a Push Initiator (PI) transmits content to a

WAP client This is done in multiple steps as shown in Figure 31

pushOTAPAP

Gateway

PI

1

2

pull gateway

PPG

3

SMS center

Mobile device

6

5

4

Content provider78 9

Figure 41 WAP push scenario

Chapter 4 System Design

27

The PI communicates with a Push Proxy Gateway (PPG) over the Push Access Protocol

(PAP) (1 and 2) The PPG will then use the Push Over-The-Air Protocol (PushOTA) (3)

to deliver a Uniform Resource Identifier (URI) to the client via a Short Message System

Centre (SMS-C) (4 and 5) The next step for the client is then to activate the URI (6 and

7) and get the content from the server (8 and 9) The mobile device will have to use a

ldquoPull Gatewayrdquo to get the content but it is very likely that this is the same one as the PPG

The same same scenario could be viewed in sequence diagram figure (42)

Push Initiator PPG SMS Center WAP client

Send push message

Send push message response

Send WAP push message

Ack

Send WAP push message

Ack

Message read

Ack

Message read

Ack

Result notification message

Result notification response

Figure 42 WAP push sequence diagram

Chapter 4 System Design

28

43 Modular Design

Conceptually we can envision this push system as consisting of three major components

(presented in the order of the push lifetime)

first there is a Push Initiator Program that reads the generates a notification message and

transmits (pushes) it via a WAP Gateway to the customer phone This message notifies

the user that a service is available if the user accepts will ask the phonersquos browser to pull

the page from our web server via the WAP Gateway

Next there is the Push Proxy Gateway PPG which will receive the push message from

the push initiator and is responsible of doing any needed optimization protocol

compilation and conversion Also it is responsibility of the PPG to find the end user

address and send the push message to the SMS center

Finally there is the SMS center which will do the last delivery of push message to the

intended user if the user were offline the message will be saved for later time until the

WAP client is on

PI PPGSMSC

Figure 43 system modules

Chapter 4 System Design

29

43 Design of system Modules

Following sections of this chapter present a description and design of the system modules

with accompanying graphical representation

431 Push Initiator (PI)

The PI is the first logical component in the WAP Push scenario and therefore the

originator of the push message There are different kinds of PIs One example is an

automated script another one is a semi automated server version written in an applicable

scripting language supporting server side interaction

A push message is sent as an HTTP POST to the Push Proxy Gateway The POST will be

a multipart XML document with the first part being the control entity (Push Access

Protocol) the second part being the content entity (either a Service Indication or a

Service Load) and the third part being the capability entity

HTTP Post

Capability entity

Content entity (SISL)

Control entity (PAP)

Figure 44 architecture of the push message

Chapter 4 System Design

30

4311 Control entity

This part of the push contains the basic information and fields The fields can include

recipient address expiry time bearer type delivery attempt time and a URL to which a

response is to be sent if delivery confirmation is requested by the push initiator

PAP is the protocol used in WAP Push framework for specifying control information and

content that is to be pushed to a client via a Push Proxy Gateway (PPG) A Push Initiator

(PI) triggers push message processing The Push initiator class (Appendix B) of this

design shows how to generate PAP messages

The address of the used PPG should be given as an initialization parameter of the

application (ldquoppg-urlrdquo see Appendix B) This design also provides an implementation

that can be used in a special case when ldquoIPv4 IPv6rdquo type client addressing is applied and

when toolkit is used All other cases including the use of phone numbers (ldquoPLMNrdquo type

address) in sending push messages are considered

The PAP XML contains at the minimum a ltpapgt element a ltpush-messagegt

element and an ltaddressgt element

The important parts of this PAP message are the address value and type The value is

typically a MSISDN and type indicates whether to send to a MSISDN (typical case) or to

an IP Address The TYPE is almost always MSISDN as the Push Initiator (PI) will not

typically have the Mobile Stations IP address - which is generally dynamic

4312 Content entity

This is the actual data that is received by the mobile device The various content types

are Service Indication (SI) Service Load (SL) and Cache Operation (CO) in our project

we will just deal with SI and SL

The SI notifies a client about an external event by inviting the client to interact with it In

other words it informs a client about a service More precisely it sends a message that

Chapter 4 System Design

31

informs the client of a Uniform Resource Identifier (URI) where the client can access the

service

An important attribute of SI is the action attribute it may contain the action to be taken

when the client receives the SI There are two groups that the action attributes can be

divided into

First we have delete and signalmdashnone both of them is used because of their side

effects Ie with delete you take away all SIs with the same si-id as the deletion pushrdquo

including itself and with signal-none you either do nothing or you pay regard to the

info element in that push

The other group consists of signal-low signal-medium and signal-high These

attributes are all used to set the rules for the presentation in the terminal device

o Signal-low

The SI must be postponed without user intervention

o Signal-medium

The SI must be presented as soon as the implementation allows that to be carried out

without disturbing the user (Signal-medium is the value that will be used if none is

specified)

o Signal-high

The SI must be presented as soon as the implementation allows that to be carried out

without disturbing the user or earlier if it seems appropriate (This decision may for

instance be based on user preference settings)

This is the different functionalities supported by the SI we concidered

Expiration

Replacement

Deletion

Chapter 4 System Design

32

Handling of out of order delivery

Handling of information specified in the info element

A PUSH Service Indication (SI) contains at a minimum an ltsigt element and a

ltindicationgt element SL donrsquot differ so much from SI

4313 Capability entity

This entity determines the type of mobile device that is to be served This is determined

by WAP user agent profiling The sender can indicate the hardware vendor and browser

version and type of the intended recipients This capability entity is then matched at the

PPG to see which devices are compatible with the requested capability If there is a

match the content is delivered by the PPG to that specific device

Now a day most devices are compatible with WAP so we donrsquot need to create this entity

more precisely it is optional

After the push has been created in the PI it is up to the system to deliver it to the defined

destination In this system the different responsible entities are the PPG and the SMSC

Both of these two different entities are running on same server but it is only the

configuration of the SMSC that is out of my control since it is run by the operator and is

not controllable in my lab environment

432 Push Proxy Gateway (PPG)

There are various commercial WAP gateways available on the market that are quite

expensive Kannel on the other hand is an open source gateway one doesnrsquot need to pay

for it in addition one can edit the source code himself and construct his own customized

gateway Because Kannel is being developed on Linux systems (RedHat and Debian) it

can be smoothly ported to other UNIX-like operating systems

4321 Kannel gateway architecture

The gateway divides the processing load between the following three hosts

Chapter 4 System Design

33

The bearer box which connects to the SMS (Short Message Service) centers and

or CSD (Circuit Switched Data) routers providing a unified interface to them for

the wapbox The bearer box does this by implementing the WDP (Wireless

Datagram Protocol) layer of the WAP stack

The smsbox implements the rest of the SMS gateway functionality It receives

textual SMS messages from the bearerbox and interprets them as service

requests and responds to them in the appropriate way

The wapbox which hosts the upper layers of the WAP stack Each session and its

transactions are handled by the same wapbox (see figure 35)

1Figure 45 divisions of duties in kannel

4322 Working of the gateway

The bearer box receives UDP (User Datagram Protocol) packets from CSD routers

inspects them to see whether they are WAP packets if so then it will routes them to the

WAP box This simple design allows the bearer box to do a minimum of processing per

smsbox

wapbox

bearerbox

Kannel

SMS center

WAP phone

HTTP server

Chapter 4 System Design

34

packet The bearer box also sends the UDP packets that the other boxes generate which

adds some more routing processing The wapboxes implement the WTP (Wireless

Transaction Protocol) and WSP (Wireless Session Protocol) layers These take HTTP-

like requests from the phones and make the actual HTTP requests to content servers

compress the responses and send them back to the terminals (Sessions are maintained to

make as much use of the limited radio bandwidth as possible)

4323 External interfaces of the gateway

The gateway has interfaces to three external agents

bull SMS centers using various protocols

bull HTTP servers to fetch WAP and SMS content and to push WAP Content The

pull protocol is HTTP push PAP

bull WAP phones implementing the WAP protocol stack and (for push) WAP Push

client

Figure 36 summarize kannel external interfaces

4324 Configuring the gateway

The bearerbox smsbox and wapbox are the main working modules of the gateway and

must be configured before configuring the gateway These three modules are controlled

by a configuration file that has wapbox smsbox and bearerbox groups

Configuring the PPG core group

We use two components the PPG core group and the PPG user group The PPG

core group is used to configure the PI interface(for more details configuration

variables refer to appendix c)

Chapter 4 System Design

35

Mobile telephone

network

The Internet

smsbox

wapbox

bearerbox

Kannel

HTTP

HTTP

HTTP server

Serving WML

files

HTTP server

Serving HTML

files

TCP

TCP

WAPSMS

SMSC

WAP phoneNetwork base station

Workstation used for http

administration

Figure 46 External interfaces of the gateway

4325 Administering the gateway through an HTTP interface

Kannel can be administered via an HTTP interface All commands are given as normal

HTTP queries so they can easily be given from command lines like this one

links -dump httpip-adressportshutdownpassword=yourchoice

But it is advantageous to have graphical user interface for gateway control so we have

designed GUI through http

Chapter 4 System Design

36

433 Short Message Service Centre (SMSC)

A SMSC is an essential component when sending a push message from an IP network to

a mobile device in the architecture supported by the components and devices It is used to

remove the TCPIP layer that the push is encapsulatedrdquo in It is also the entity that

identifies the end-point device When this is done it is also the SMSC that is responsible

for the processing and final message delivery to the device After the process of de-

encapsulation and resolution of the client identity there should not be any difference

between this message and a message that is originated locally from the operator itself

(like a SMS)

In this project we just use a virtual SMS center we try first to get connection to a real

one but our effort was worthless

Finally the following figure depicts the overall flowchart of the WAP push system

(figure 47)

Chapter 4 System Design

37

PI

PPG

Create PAP

HTTP Post

Message

processing

OTA

Connection

oriented

Sessionless Session

oriented

WTP Initiation

WAP clinet

Application

Create content

Create

capability

entity

Database

SMS center

NoYes

Figure 47 the complete flowchart of the system

38

Chapter Five

5 System implementation and results

51 Implementation

511 The Push Proxy Gateway

First of all the Kannel gateway have been compiled and installed using gcc (GNU C

Compiler) this stage go fine except the operating system required more components to

be pre-installed and will configured

Then with stages of configuration to the gateway (Appendix B) it was capable of working

as PPG Figure 51 below show the gateway when it starts

Figure 51 starting kannel gateway

Then a web based user interface had been created to provide an easy way to control the

gateway remotely Figure 52 and figure 53

39

Figure 52 GUI for gateway control

512 The Push initiator

Next the push initiator design had been implemented using java programming language

as in design phase the implementation is taken carefully to make a reusable component

that could be used by other developer

PushInitiator class (Appendix B) implements a simple push initiator which can be used

to create and send messages to a push proxy gateway (PPG)

The method sendPushMessage sends a push message via the PPG to the client The client

is identified by the address which is either the phone number (address type is PLMN) or

IP address The message content and its mime type are also given as arguments to the

method the other tow important method are

createPapMessage This method creates a Push Access Protocol (PAP) type message

40

createSiMessage This method is used to create a service indication (SI) type message

Figure 53 showing running kannel status

513 WAP site

Since this site will be built for testing purpose and making sure that the system is

functional we had not go deep in this section Just simple WAP site with tow page has

been crated

41

52 Service indication

When a SI was pushed to any of the emulator or Nokia phones it was received and

presented in the way it was supposed to as specified in the WAP standard as shown in

figures below This is a proof that the devices claiming to support WAP push do so and

the design is will working See figures 53 through 56

Figure 55 service indication

42

Figure 57 SI details

52 Service load

The emulator correctly receives and interpreted the SL push the same as all of Nokia

phones we have tested

When a SL was pushed to the Ericsson phones it was not presented in the specified way

figure 58 I think that it is because of security reasons The reason for this assumption is

that the phones only supports on or off as security in their push configuration The

emulator on the other hand presents SL correctly Finally the Siemens phone did seem to

interpret SL but the current software was not very consistent It did load the SL without

user interference in the specified way when the user already where having an active

session If the user was offline the phone interface presented a symbol on the display

and did not load the service until the user clicked on the symbol

43

Chapter Six

6 conclusion and future work

In this chapter we will provide the conclusions and proposed future work for interested

individuals

61 Conclusions

In this project a WAP push system has been successfully designed and implemented It

provides a way to partially overcome the limitations encountered when accessing the

World Wide Web using handsets After comparing the proposed project objectives with

those accomplished the main goals are seen to be met

Phones from different manufactures all differ from the WAP-standard in some

ways One of the most obvious differences is the resolution of the display

During the work it has been noticed that the WML pages must be quite small We

have also noticed that the support for tables and some other tags are a bit limited

Even though the WML standard is smaller than the HTML standard it is a little

more complicated to write correct WML pages The main conclusion is that WAP

works pretty well but the phones are a little non-stable

The push proxy gateway is configured and worked probably with virtual SMS

center and it is easy to switch to a real one

The system depends mainly on open sources (ie Linux and kannek)

The design and implementation of the push initiator work well with the kannel

gateway and it should work correctly with other gateways

Chapter 6 Conclusion

44

62 Further Work

The possibilities of wireless push are interesting enough that it has to be worth to know if

the security and conformance problems will be solved in WAP push If they are solved

and the technique is refined then there should be nothing to stop the great number of

services that will follow in its footsteps Therefore there is further work that should be

done and the most interesting parts are in my opinion these

621 Security Aspect

One of the problems today is that the phones supporting push does not have the detailed

security settings that a technique like this needs Therefore it would be interesting to look

into the possibility to add these without confusing the user I suggest furthering looking

into usability aspects of security in WAP Push for short

622 GPS integration possibility

This will provide location dependent delivery of WAP push it will have great

applications in telematic and ecommerce advertising

623 Conformance to Standards

An interesting project would be to examine if the main reason for the nonstandard

solutions in the existing WAP push software is the result of difficulties in

implementation Or if the main reason is that the manufacturers wants to provide

proprietary solutions A reason why one may want to know this is that if the problem is

depending on implementation problems then it might get better

45

Appendix A Abbreviations

CDMA Code Division Multiple Access

CO Cache Operation

DTD Document Type Definition

GSM Global System for Mobile

HTTP Hypertext Transfer Protocol

IP Internet Protocol

MSISDN Mobile Station International Subscriber Directory Number

OTA Over The Air

PAP Push Access Protocol

PushOTA Push Over The Air

PDA Personal Digital Assistant

P1 Push Initiator

PLMN Public Land Mobile Networks

PPG Push Proxy Gateway

SI Service Indication

SIA Session Initiation Application

SIR Session Initiation Request

SL Service Loading

SMPP Short Message Peer to Peer

SMS Short Message System

SMSC Short Message System Center

UCP Universal Computer Protocol

URI Uniform Resource Identifier

URL Uniform Resource Locator

UTC Universal Time Coordinated

WAP Wireless Application Protocol

WBXML WAP binary XML

WDP Wireless Datagram Protocol

WSP Wireless Session Protocol

WTLS Wireless Transport Layer Security

XML Extensible Mark-up Language

46

Appendix B Kannel gateway configurations

THIS IS A SAMPLE CONFIGURATION FOR KANNEL

group = core

admin-port = 13000

admin-password = admin

status-password = admin

admin-deny-ip =

admin-allow-ip = 127001172161455

log-file = tmpkannellog

log-level = 0

http-proxy-host = 172161411

http-proxy-port = 8080

http-proxy-exceptions = 127001

Smsbox related

smsbox-port = 13001

box-deny-ip =

box-allow-ip = 127001

bearerbox-host =localhost

Wapbox related

wapbox-port = 13002

udp-deny-ip =

udp-allow-ip = 127001

bearerbox-host =localhost

SMSC GSM

group = smsc

smsc = at

modemtype = auto

speed =9600

device = devttyS0

SMSC HTTP

group = smsc

smsc = http

system-type = kannel

port = 13016

connect-allow-ip = 127001

Appendix B

47

username = wappush

password = wappush

SMSBOX SETUP

group = smsbox

bearerbox-host = localhost

sendsms-port = 13013

sendsms-chars = 0123456789 +-

log-file = tmpsmsboxlog

log-level = 0

access-log = accesslog

white-list = 127001

black-list =

SEND-SMS USERS

group = sendsms-user

username = wappush

password = wappush

user-deny-ip =

user-allow-ip = 127001

PPG group

group = ppg

ppg-url = wappush

ppg-port = 8080

concurrent-pushes = 100

trusted-pi = true

users = 1024

service-name = ppg

ppg-smsbox-id = dlrbox

WAP PUSH USER

group = wap-push-user

wap-push-user = picom

ppg-username = wappush

ppg-password = wappush

allow-ip = localhost

48

Appendix C Selected Codes

Gateway Control Form

ltDOCTYPE HTML PUBLIC -W3CDTD HTML 32ENgt

lthtmlgt ltheadgt

lttitlegtGateway control formlttitlegt

ltheadgt

ltbody bgcolor=white text=black link=blue vlink=navy

alink=redgt

ltbase target=submitgt

ltscriptgt

function update_status()

if ( adminactionvalue == status )

adminaction = http + adminhostnamevalue +

+ adminportvalue + status +

adminstatusformatvalue

else

adminaction = http + adminhostnamevalue +

+ adminportvalue + + adminactionvalue

adminpasswordvalue = adminpasswordvalue

actiongovalue = GO GET +adminaction

ltscriptgt

lttable align=centergt

lttrgtltp align=centergtlth2gtGateway control

formlth2gtltpgtlttrgt

lttrgt lttdgtHostnamelttdgtlttdgtltinput type=text

name=adminhostname value=localhost

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPortlttdgtlttdgtltinput type=text

name=adminport value=13000

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPasswordlttdgtlttdgtltinput type=password

name=adminpassword value=

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtActionlttdgtlttdgtltselect name=adminaction

onChange=update_status()gt

ltoption value=statusgtStatusltoptiongt

ltoption value=suspendgtSuspendltoptiongt

ltoption value=isolategtIsolateltoptiongt

Appendix C

49

ltoption value=shutdowngtShutdownltoptiongt

ltoption value=resumegtResumeltoptiongt

ltselectgtlttdgt lttrgt

lttrgt lttdgtStatus Formatlttdgtlttdgtltselect

name=adminstatusformat onChange=update_status()gt

ltoption value=gthtmlltoptiongtltoption

value=txtgttxtltoptiongtltoption

value=xmlgtxmlltoptiongtltselectgtlttdgt lttrgt

ltform name=admin method=get

action=httplocalhost13000status

encoding=applicationx-www-formgt

ltinput type=hidden name=password value=gt

lttrgt

lttdgtGolttdgt

ltformgt

lttdgtltinput type=submit value=go name=actiongo

onClick=documentadminsubmit()gtlttdgt

lttrgt

lttablegt

ltbodygt

lthtmlgt

Push Initiator Class

import javanetURL

import javanetHttpURLConnection

import javaio

Class implements a simple push initiator It can be

used to create and send messages to push proxy

gateway (ppg)

public final class PushInitiator

xml version

private final static String XML_VERSION = ltxml

version=10gt

Push Access Protocol (PAP) document type

private final static String PAP_DOCTYPE =

Appendix C

50

ltDOCTYPE pap PUBLIC -WAPFORUMDTD PAP 10EN

httpwwwwapforumorgDTDpap_10dtd gt

content type of the push request multipart body

private final static String CONTENT_TYPE =

multipartrelated boundary=multipart-boundary

type=applicationxml

Service Indication (SI) document type

private static final String SI_DOCTYPE = ltDOCTYPE si

PUBLIC -WAPFORUMDTD SI 10EN +

httpwwwwapforumorgDTDsidtdgt

private static int pushId = 0

PPG url where the pap message is to be sent

private final URL ppgUrl

some push proxy gateways may also require the

authentication of the push initiator

For instance the push initiator may be required to

send an HTTP authorization header in each request

private final String authorization

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

public PushInitiator(URL ppgUrl) thisppgUrl =

ppgUrl

authorization = null

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

param authorization a ltcodegtStringltcodegt value

public PushInitiator(URL ppgUrl String authorization)

thisppgUrl = ppgUrl

Appendix C

51

thisauthorization = authorization

Systemoutprintln(Push Initiator created ppgUrl =

+ ppgUrl)

ltcodegtsendPushMessageltcodegt sends push message to

ppg

param clientAddress a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param message a ltcodegtStringltcodegt value

param mimeType a ltcodegtStringltcodegt value

exception Exception if an error occurs

public void sendPushMessage(String clientAddress

String addressTypeString message String mimeType)

throws Exception

HttpURLConnection http =

(HttpURLConnection)ppgUrlopenConnection()

String ppgServer = ppgUrlgetHost()

httpsetDoInput(true)

httpsetRequestProperty(Content-Type CONTENT_TYPE)

if(authorization = null)

if(authorizationtrim()equals())

httpsetRequestProperty(Authorization

authorization)

httpsetDoOutput(true)

PrintWriter out = new PrintWriter(new

BufferedOutputStream(httpgetOutputStream()))

outprintln(--multipart-boundary)

outprintln(Content-type applicationxml)

outprintln()

outprintln(createPapMessage(clientAddress

addressTypeppgServer genPushId() null))

outprintln()

outprintln(--multipart-boundary)

outprintln(Content-type + mimeType)

outprintln()

outprintln(message)

outprintln()

outprintln(--multipart-boundary--)

outflush()

outclose()

httpconnect()

Appendix C

52

finally read and debug the response received from

PPG

try

debugResponse(http)

catch (Exception e)

Systemerrprintln(Error in receiving the

response)

ltcodegtcreatePapMessageltcodegt creates a Push Access

Protocoltype message

param address a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param ppgServer a ltcodegtStringltcodegt value

param pushId a ltcodegtStringltcodegt value

param notificationTo a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createPapMessage(String address

String addressType String ppgServer String pushId

String notificationTo)

return XML_VERSION + n + PAP_DOCTYPE + n +

ltpap product-name=Mobile Zoo Push

Initiatorgtn +

ltpush-message push-id= + pushId +

(notificationTo = null request-notification-

to= + notificationTo ) + gtn +

ltaddress address-value=WAPPUSH= + address +

TYPE= + addressType +

+ ppgServer + gtn +

ltpush-messagegtnltpapgt

ltcodegtcreateSiMessageltcodegt creates a service

indication type message

param url a ltcodegtStringltcodegt value

param created a ltcodegtStringltcodegt value

param expires a ltcodegtStringltcodegt value

Appendix C

53

param message a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createSiMessage(String url

String sid String created String expires String

action String message)

return XML_VERSION + SI_DOCTYPE +

ltsigtn +

ltindication href= + url + +

(sid = null si-id= + sid + ) +

created = null created= + created +

) +

(action = null action= + action +

) +

(expires = null expires= + expires +

) + gt +

message +

ltindicationgtnltsigt

Debug response

param http a ltcodegtHttpURLConnectionltcodegt value

exception Exception if an error occurs

private void debugResponse(HttpURLConnection http)

throws Exception

Systemoutprintln(httpgetResponseMessage())

String headerName

int i=0

while((headerName = httpgetHeaderFieldKey(i++)) =

null)

Systemoutprintln(headerName + +

httpgetHeaderField(headerName))

Systemoutprintln()

InputStreamReader in = new InputStreamReader(new

BufferedInputStream(httpgetInputStream()))

int c

Appendix C

54

while((c = inread()) = -1)

Systemoutprint((char)c)

Systemoutprintln()

ltcodegtgenPushIdltcodegt generates an unique push id

return a ltcodegtStringltcodegt value

private String genPushId()

pushId = 100000

return SystemcurrentTimeMillis() + + pushId++

55

References

[1] Microsoft ldquoGetting Mobile Using WML and WAP to Display Web Sites on

Mobile Devicesrdquo

URL msdnmicrosoftcomen-uslibraryaa140117(office10)aspx accessed

on April 10 2008

[2] DALE BULBROOK ldquoWAPA Beginnerrsquos Guiderdquo OsborneMcGraw-Hill 2001

[3] WAP Forum Wireless Application Protocol Architecture Specification Access on

Jan 12 2008 Available

httpwww1wapforumorgtechdocumentsWAP-210-WAPArch-2006 07 12-apdf

[4] WAP Forum Push Architectural Overview access on (2008 February 3) Available

httpwww1wapforumorgtechdocumentsWAP-250-PushArchOverview-2007 04

03-apdf

[5] Service indication PDF access on 62008 Available

httpwwww3orgTRhtml401structlinkshtml

[6] WAP Push Technology (openwave) PDF access on (2008 April) Available

URL httpwwwopenwavorg

[7] Web site (httpwwwwapforumorgwhatcopyrighthtm) access on May 2008

[8] ldquoWAP Push Proxy Gateway Specificationrdquo WAP Forum access on 16-August-

2007URI httpwwwwapforumorgPDF

[9] WAP Forum Access on (2008 MAY 31) WAP Service Indication Specification

Available httpwww1wapforumorgtechdocumentsWAP-167-ServiceInd-200507

31-apdf

  • odc_fpwmlandwap_topic3
  • N100E3
  • 21
  • 5

Chapter 2 Basic Concepts

11

2231 Concatenation and Separation

To reduce the overhead caused by the datagram headers it is desirable to reduce the

number of packets sent over the air In order to reduce the number of messages several

protocol data units can be put into one single datagram This procedure is called the

concatenation procedure The reverse procedure is called the separation procedure [5]

Concatenation can be done when several packets are transported from the same sender to

the same receiver Concatenation can be done at any time The last acknowledgement can

be concatenated with the invoke message of the next transaction [5]

2232 Segmentation and Reassembly

If a packet is lager than the bearers largest capability the message can be segmented and

send in several packets To increase the communication efficiency message groups can be

acknowledged in groups [5]

To decrease the number of packets sent when a communication error occurs the receiver

can request one or multiple lost packets within a group of messages This is done instead

of resending the entire message which could mean that successfully received packets

have to be resent [5]

224 Security Layer Wireless Transport Layer Security

An Optional layer it is responsible for providing security data integrity and

authentication between two communicating applications The WTLS is optimized for low

bandwidth bearer networks with relatively long latency The WTLS is similar to the

Internet transport layer security TLS but has some new features such as datagram

support optimized handshake and dynamic key refreshing [5]

WTLS has been design to function on both connection-oriented and datagram transport

protocols The security layer acts above the transport layer

Chapter 2 Basic Concepts

12

2241 Service Primitives

WTLS uses primitives to ensure security The primitives are used to

Initiate a secure connection

Perform public-key authentication or key exchange with the client

Change into connection state when the handshake has been done

Terminate the connection

Inform the other end about warning level alerts

Request by the server that the client should initiate a new handshake

225 Transport Layer Wireless Datagram Protocol

The wireless datagram layer is a datagram service used by the upper layers WDP is

designed to communicate over different bearer services and especially for wireless

telecommunication networks [6] It Consists of

bull Source and destination address and port

bull Optionally fragmentation

It maps to UDP for IP bearer and moves single packets to and from the phone

226 WDP and IP

In networks with IP as the routing protocol UDP is used instead of WDP IP provides

segmentation and reassemble in a connection-less datagram service UDP provides port

based addressing and other necessary functions Thereby no additional functions are

required by a WDP layer [7]

227 Bearer Interfaces

WAP supports dial-up networking using IP and Point-to-Point Protocol (PPP) as the

bearer interface underneath WDP It also supports Short Message System (SMS) and

General Packet Radio System (GPRS) SMS passes text and binary data between digital

Chapter 2 Basic Concepts

13

phones GPRS is a relatively new technology that implements faster always-on

connections for wireless devices GPRS actually runs on top of IP [7]

As had been learned above WAP is quite similar to web figure 23 provide a brief

comparison between them

WAP

Bearer

WDP Dtatgram

WTLS security

WTP Transaction

WSP Session

WAE

WML and

WMLScript

Web

IP

TCP UDP

TLS-SSL

HTTP

HTML

JavaScript

VBscript

Figure 23 Web vs WAP

Chapter 2 Basic Concepts

14

23 SMS overview

SMS stands for Short Message Service It is a technology that enables the sending and

receiving of messages between mobile phones SMS first appeared in Europe in 1992 It

was included in the GSM (Global System for Mobile Communications) standards right at

the beginning Later it was ported to wireless technologies like CDMA and TDMA The

GSM and SMS standards were originally developed by ETSI ETSI is the abbreviation

for European Telecommunications Standards Institute Now the 3GPP (Third Generation

Partnership Project) is responsible for the development and maintenance of the GSM and

SMS standards [8]

SMS has two operational mode textual mode and binary mode which will allow sending

other data beside pure text

24 Push overview

WAP push provides a standard means to send data to a mobile subscriber without an

explicit request from the subscriber at the time the data is delivered In the normal

clientserver model a client requests a service or information from a server which then

responds by transmitting information to the client This is known as ldquopullrdquo technology

The client pulls information from the server The World Wide Web is the best example of

pull technology where a user enters a URL (the request) which is sent to a server and

the server answers by sending a Web page (the response) to the user (Figure 24 a)

Although WAP push is also based on the clientserver model it provides a means to send

data to the subscriber without an explicit request from the client at the time of delivery

(Figure 24 b)

With push functionality users are able to get information without having to request that

information In many cases it is important for the user to get the information as soon as it

is available Push communications can be used for sending stock quotes traffic reports

and news

Chapter 2 Basic Concepts

15

a) WAP pull model

b) WAP push model

Figure 24 Pull vs Push

24 WAP Push framework

A push operation starts when a server called the push initiator transmits a push messages

to a WAP client Since the push initiator located on the Internet does not use the same

protocol as the WAP client a translating gateway is needed The push initiator contacts

the push proxy gateway via the push access protocol and the Internet protocol The push

proxy gateway translates the information and forwards the pushed content to the WAP

device via the push over the air protocol (figure 25) [9]

Chapter 2 Basic Concepts

16

Push Proxy Gateway

WAP

Client

Push

Access Protocol

Push

over-the air

protocol Push Initiator

Figure 25 the wireless push technology

241 Push Proxy Gateway

The push proxy gateway PPG is the entity that does most of the work in the push

architecture The gateway acts as an access-point for content pushed from the Internet to

the client So the responsibility of the gateway owners to grant access to push proxy

gateway [9]

Besides the actual access-point service the push gateway provides the following services

push initiator identification and authentication

parsing and error detection of content control information

client discovery services

address resolution

binary encoding and compilation of certain content type

protocol conversion

Chapter 2 Basic Concepts

17

Information to the push proxy gateway is sent via the push access protocol PAP The

content of the information is divided into several parts were the first part is information to

the PPG such as recipient information

When the PPG has parsed the control information an acknowledgement is sent to the

push initiator reporting if the service was successful or not

Once the proxy has accepted the content and the push initiator has received the

acknowledgement the proxy is responsible for the transmission to the client The proxy

attempts to find the correct destination device and deliver the content to that client using

the push over the air protocol The contents delivered to the proxy may be translated to

their binary counterpart eg WML documents may be converted to binary XML by the

proxy before the information is transmitted to the client [9]

The proxy must implement a service to enable capability queries from the push initiator

The capability query should be responded with the capabilities of the specified WAP

device The push proxy gateway may also implement broadcasting services where

special addresses may be translated to a broadcast operation [9]

242 Push Access Protocol

The push access protocol PAP is the means by which an Internet-based push initiator

pushes content to a mobile network via the push proxy gateway [9] The push access

protocol is not intended for use over the air

PAP supports the following operations

Push submission

The push message sent from the push initiator to the gateway contains a control

entity a content entity and may contain a capability entity The control entity is

an XML document When the gateway has received the message an XML

response message is sent back to the initiator

Chapter 2 Basic Concepts

18

Result notification

If the push initiator has requested confirmation of successful delivery this XML

message is transmitted from the PPG to the push initiator when the content has

been delivered to the mobile device The push initiator acknowledges this result

message with another XML document

Push cancellation

The purpose of the push cancellation is to allow the push initiator to attempt to

cancel a previously submitted push message Both the cancellation message and

the resulting acknowledgement are sent as XML documents

Status query

The status query operation allows the push initiator to request the current status of

a message that has been previously submitted Both the status query message and

the resulting acknowledgement are sent as XML documents

Client capabilities query

This operation allows the push initiator to query the PPG for the capabilities of a

specific device The query is sent as an XML document and the response is sent

as another XML document

To access the push proxy gateway an address is used The gatewayrsquos underlying

protocols determines which type of address is used eg in HTTP a URL is used To

access a specific device the devicersquos address is included in the XML document

There are two ways to send information to several clients The push initiator can either

send information to several specific addresses or broadcast it to all clients In both cases

only one message is sent to the gateway which either sends the information to some or

all of the clients The clientsrsquo address is depending on the underlying layer [9]

Chapter 2 Basic Concepts

19

243 Push Over-The-Air Protocol

The push proxy gateway and the client communicate using the push over the air protocol

which utilizes WSP session services Pushes can be sent via connection oriented links or

connection-less links Connection-oriented pushes require that an active WSP session is

available but the server can not create a session To solve the case were there is no active

WSP session the push framework introduces a session initiation application in the client

This application listens to session requests from the OTA-server and responds by setting

up a WSP session for push purposes [9]

Push

Over-the air

WSP

Push management

premptive

Push operational

primitives

WSP Servise

Primitives

Figure 26 Push Over-The-Air protocol stack

The push over the air protocol supports two kinds of operations operations to manage the

connection and operations to send actual messages

Push Sends unconfirmed information over a connection-oriented link

Confirmed push Sends confirmed information over a connection-oriented link

Abort push rejects a previously transmitted push operation This is operation is

part of the confirmed push mechanism

Unit push Sends unconfirmed information over a connection-less link

Connect Creates a push session

Chapter 2 Basic Concepts

20

Suspend Request that a push session should be suspended

Resume Request to resumes a previously suspended push session

Disconnect Terminates the push session

Session request Request from the server to initialize a session to a client

244 Service Indication

The service indication SI provides a mechanism composed in an XML message to

notify a client that an external asynchronous event has occurred and indicate a service

that can be loaded in order to react to that event In order to notify the user a message is

sent from the push initiator via the proxy to the client The message will be shown to the

user and there will be a reference to a URI where the appropriate service can be loaded

For example the message could be ldquoYou have new mailrdquo and the URI to your email

service [9]

When the message is received by the client it will be presented to the user The user then

can choose to launch the service in an application eg the WML browser or to postpone

the SI for later handling Postponed SIs will be stored in the client and the user is given

the possibility to act upon them later When the user choose to launch the service the

service is started in the same way as if the user would have started it manually [9]

Messages sent with the service indication can support mechanisms to improve the end-

user-experience

User-intrusiveness levels

To improve the users understanding of the provided service and to affect the users

behavior when the message is delivered it is possible to change the level of user-

intrusiveness

Chapter 2 Basic Concepts

21

Deletion

When a pushed message becomes invalid the service provider can delete the

message in the clients For example an email notification becomes invalid when

the message are read

Replacement

When a pushed message is invalid and updated with a new message the service

provider can replace the origin message with a new one

Handling of out of order delivery

Since the wireless communication is unpredictable it can not be ensured that the

messages are received in the same order as sent This mechanism discards all

messages older than the latest received

Expiration

Some services may only be valid for a certain amount of time when the time has

expired the message is removed from the client

245 Service Loading

The service loading method provides means to convey a URI to a user agent in a mobile

client The method is conveyed in an XML message In difference from the service

indication method the client loads the content of the URI automatically without any

action from the user when the service loading message is received

Thereby the user will experience the content as if it was pushed to the mobile client and

executed In the service loading mechanism there is a reference to a service page that will

automatically be loaded without interaction with the user included For example the client

will automatically start the email service when a message about new mails on the server

is received [9]

Chapter 2 Basic Concepts

22

When the client is busy with some application it is not suitable to execute the referred

content directly upon reception of a message To avoid this client may cache the content

indicated by the URI so it becomes available to the user when the client is ready

Messages sent with the service loading method can support mechanism to improve the

end-user-experience

Control of the level of user interaction

To improve the users understanding of the provided service and the affect the

userrsquos behavior when the message is delivered it is possible to change the level

of user-intrusiveness The service can explicitly specify if the service should be

loaded or not if the client is busy on reception

Pre-emptive content caching

By setting this attribute the service loading can require that the indicated content

is downloaded and cached instead of executed This can be used to improve the

users experience of the services that otherwise would have required content to

be retrieved from an origin

23

Chapter Three

3 System requirements

Several materials and requirements must be incorporated into the design implementation

and testing The following discusses the components necessary to fulfill the project

requirements and environment

31 development environment

There are many development tools to choose from when developing for WAP Push and

hen you combine different environments with different gateways you will get a vast

numbers of choices This large flora of tools makes it difficult to choose a suitable

environment an important issue because a badly chosen one might consume a lot of time

341 Operating system

Kannel (the chosen gateway for the system) is being developed on Linux systems and

should be fairly easy to export to other Unix-like systems Although it should be working

without major problems on Windows (through Cygwin) Solaris and FreeBSD The push

initiator is implemented on java so it is operating system independent

Linux is the logical choice especially when it comes to the world severs and networking

for it promising feature as an open source low cost operating system

342 Programming language

Since system design was planned to be modular to enhance the reuse of its components as

explained above then an object oriented programming language will be a reasonable

choice Another factor is the need for a graphical user interface which imposes using a

programming language with good graphics handling capabilities at the same time it

should be over Linux

Chapter 3 System requirements

24

The best programming language to accomplish the above requirement is found to be java

which has the flowing feature

Cross platform - All clients and servers run the same Java code without any

changes or recompilation This simplifies deployment

Cost effective to develop in Java - The java language has many features that

improve developer productivity promote code reuse and reduce development and

maintenance costs

Works well with Open Source - Java with Linux and the many open source

movement projects and libraries provide a powerful mix that ensures development

is cost-effective efficient and of high quality because extensively tested libraries

components and solutions are available to plug-in to customer development

efforts

343 Nokia Mobile Internet Toolkit 41

To design and implement a WAP application on a Nokia phone the Nokia Internet

Toolkit has to be downloaded and installed on the PC A Nokia simulator is installed as

part of the installation but various phone simulators can be downloaded and installed

This simulator is used for testing purpose Also it has a server simulator based on the

Nokia Active Server if a WAP Gateway is unavailable

32 software requirements

Most of this section has been mentioned in way or other but they will be considered

briefly here

321 Kannel WAP gateway

This is an open source gateway upon which the push proxy gateway of this system will

be built on it available free of charge at kannel project web site

Chapter 3 System requirements

25

322 Linux operating system

It is important to install kannel gateway on it for this project we choose fedora core 7 for

availability reasons

323 JDK16

The java run time environment is required to implement the push initiator

32 hardware requirements

321 PC

Any Personal computer capable of running fedora core 7 with USB interface to be able

connects GSM modem

322 GSM modem

This will act as an alternative to the short message service center SMSC Obviously this

means that GSM network is required too

26

Chapter Four

4 System design

41 System Scenario

The basic scenario of a push session is that a Push Initiator (PI) transmits content to a

WAP client This is done in multiple steps as shown in Figure 31

pushOTAPAP

Gateway

PI

1

2

pull gateway

PPG

3

SMS center

Mobile device

6

5

4

Content provider78 9

Figure 41 WAP push scenario

Chapter 4 System Design

27

The PI communicates with a Push Proxy Gateway (PPG) over the Push Access Protocol

(PAP) (1 and 2) The PPG will then use the Push Over-The-Air Protocol (PushOTA) (3)

to deliver a Uniform Resource Identifier (URI) to the client via a Short Message System

Centre (SMS-C) (4 and 5) The next step for the client is then to activate the URI (6 and

7) and get the content from the server (8 and 9) The mobile device will have to use a

ldquoPull Gatewayrdquo to get the content but it is very likely that this is the same one as the PPG

The same same scenario could be viewed in sequence diagram figure (42)

Push Initiator PPG SMS Center WAP client

Send push message

Send push message response

Send WAP push message

Ack

Send WAP push message

Ack

Message read

Ack

Message read

Ack

Result notification message

Result notification response

Figure 42 WAP push sequence diagram

Chapter 4 System Design

28

43 Modular Design

Conceptually we can envision this push system as consisting of three major components

(presented in the order of the push lifetime)

first there is a Push Initiator Program that reads the generates a notification message and

transmits (pushes) it via a WAP Gateway to the customer phone This message notifies

the user that a service is available if the user accepts will ask the phonersquos browser to pull

the page from our web server via the WAP Gateway

Next there is the Push Proxy Gateway PPG which will receive the push message from

the push initiator and is responsible of doing any needed optimization protocol

compilation and conversion Also it is responsibility of the PPG to find the end user

address and send the push message to the SMS center

Finally there is the SMS center which will do the last delivery of push message to the

intended user if the user were offline the message will be saved for later time until the

WAP client is on

PI PPGSMSC

Figure 43 system modules

Chapter 4 System Design

29

43 Design of system Modules

Following sections of this chapter present a description and design of the system modules

with accompanying graphical representation

431 Push Initiator (PI)

The PI is the first logical component in the WAP Push scenario and therefore the

originator of the push message There are different kinds of PIs One example is an

automated script another one is a semi automated server version written in an applicable

scripting language supporting server side interaction

A push message is sent as an HTTP POST to the Push Proxy Gateway The POST will be

a multipart XML document with the first part being the control entity (Push Access

Protocol) the second part being the content entity (either a Service Indication or a

Service Load) and the third part being the capability entity

HTTP Post

Capability entity

Content entity (SISL)

Control entity (PAP)

Figure 44 architecture of the push message

Chapter 4 System Design

30

4311 Control entity

This part of the push contains the basic information and fields The fields can include

recipient address expiry time bearer type delivery attempt time and a URL to which a

response is to be sent if delivery confirmation is requested by the push initiator

PAP is the protocol used in WAP Push framework for specifying control information and

content that is to be pushed to a client via a Push Proxy Gateway (PPG) A Push Initiator

(PI) triggers push message processing The Push initiator class (Appendix B) of this

design shows how to generate PAP messages

The address of the used PPG should be given as an initialization parameter of the

application (ldquoppg-urlrdquo see Appendix B) This design also provides an implementation

that can be used in a special case when ldquoIPv4 IPv6rdquo type client addressing is applied and

when toolkit is used All other cases including the use of phone numbers (ldquoPLMNrdquo type

address) in sending push messages are considered

The PAP XML contains at the minimum a ltpapgt element a ltpush-messagegt

element and an ltaddressgt element

The important parts of this PAP message are the address value and type The value is

typically a MSISDN and type indicates whether to send to a MSISDN (typical case) or to

an IP Address The TYPE is almost always MSISDN as the Push Initiator (PI) will not

typically have the Mobile Stations IP address - which is generally dynamic

4312 Content entity

This is the actual data that is received by the mobile device The various content types

are Service Indication (SI) Service Load (SL) and Cache Operation (CO) in our project

we will just deal with SI and SL

The SI notifies a client about an external event by inviting the client to interact with it In

other words it informs a client about a service More precisely it sends a message that

Chapter 4 System Design

31

informs the client of a Uniform Resource Identifier (URI) where the client can access the

service

An important attribute of SI is the action attribute it may contain the action to be taken

when the client receives the SI There are two groups that the action attributes can be

divided into

First we have delete and signalmdashnone both of them is used because of their side

effects Ie with delete you take away all SIs with the same si-id as the deletion pushrdquo

including itself and with signal-none you either do nothing or you pay regard to the

info element in that push

The other group consists of signal-low signal-medium and signal-high These

attributes are all used to set the rules for the presentation in the terminal device

o Signal-low

The SI must be postponed without user intervention

o Signal-medium

The SI must be presented as soon as the implementation allows that to be carried out

without disturbing the user (Signal-medium is the value that will be used if none is

specified)

o Signal-high

The SI must be presented as soon as the implementation allows that to be carried out

without disturbing the user or earlier if it seems appropriate (This decision may for

instance be based on user preference settings)

This is the different functionalities supported by the SI we concidered

Expiration

Replacement

Deletion

Chapter 4 System Design

32

Handling of out of order delivery

Handling of information specified in the info element

A PUSH Service Indication (SI) contains at a minimum an ltsigt element and a

ltindicationgt element SL donrsquot differ so much from SI

4313 Capability entity

This entity determines the type of mobile device that is to be served This is determined

by WAP user agent profiling The sender can indicate the hardware vendor and browser

version and type of the intended recipients This capability entity is then matched at the

PPG to see which devices are compatible with the requested capability If there is a

match the content is delivered by the PPG to that specific device

Now a day most devices are compatible with WAP so we donrsquot need to create this entity

more precisely it is optional

After the push has been created in the PI it is up to the system to deliver it to the defined

destination In this system the different responsible entities are the PPG and the SMSC

Both of these two different entities are running on same server but it is only the

configuration of the SMSC that is out of my control since it is run by the operator and is

not controllable in my lab environment

432 Push Proxy Gateway (PPG)

There are various commercial WAP gateways available on the market that are quite

expensive Kannel on the other hand is an open source gateway one doesnrsquot need to pay

for it in addition one can edit the source code himself and construct his own customized

gateway Because Kannel is being developed on Linux systems (RedHat and Debian) it

can be smoothly ported to other UNIX-like operating systems

4321 Kannel gateway architecture

The gateway divides the processing load between the following three hosts

Chapter 4 System Design

33

The bearer box which connects to the SMS (Short Message Service) centers and

or CSD (Circuit Switched Data) routers providing a unified interface to them for

the wapbox The bearer box does this by implementing the WDP (Wireless

Datagram Protocol) layer of the WAP stack

The smsbox implements the rest of the SMS gateway functionality It receives

textual SMS messages from the bearerbox and interprets them as service

requests and responds to them in the appropriate way

The wapbox which hosts the upper layers of the WAP stack Each session and its

transactions are handled by the same wapbox (see figure 35)

1Figure 45 divisions of duties in kannel

4322 Working of the gateway

The bearer box receives UDP (User Datagram Protocol) packets from CSD routers

inspects them to see whether they are WAP packets if so then it will routes them to the

WAP box This simple design allows the bearer box to do a minimum of processing per

smsbox

wapbox

bearerbox

Kannel

SMS center

WAP phone

HTTP server

Chapter 4 System Design

34

packet The bearer box also sends the UDP packets that the other boxes generate which

adds some more routing processing The wapboxes implement the WTP (Wireless

Transaction Protocol) and WSP (Wireless Session Protocol) layers These take HTTP-

like requests from the phones and make the actual HTTP requests to content servers

compress the responses and send them back to the terminals (Sessions are maintained to

make as much use of the limited radio bandwidth as possible)

4323 External interfaces of the gateway

The gateway has interfaces to three external agents

bull SMS centers using various protocols

bull HTTP servers to fetch WAP and SMS content and to push WAP Content The

pull protocol is HTTP push PAP

bull WAP phones implementing the WAP protocol stack and (for push) WAP Push

client

Figure 36 summarize kannel external interfaces

4324 Configuring the gateway

The bearerbox smsbox and wapbox are the main working modules of the gateway and

must be configured before configuring the gateway These three modules are controlled

by a configuration file that has wapbox smsbox and bearerbox groups

Configuring the PPG core group

We use two components the PPG core group and the PPG user group The PPG

core group is used to configure the PI interface(for more details configuration

variables refer to appendix c)

Chapter 4 System Design

35

Mobile telephone

network

The Internet

smsbox

wapbox

bearerbox

Kannel

HTTP

HTTP

HTTP server

Serving WML

files

HTTP server

Serving HTML

files

TCP

TCP

WAPSMS

SMSC

WAP phoneNetwork base station

Workstation used for http

administration

Figure 46 External interfaces of the gateway

4325 Administering the gateway through an HTTP interface

Kannel can be administered via an HTTP interface All commands are given as normal

HTTP queries so they can easily be given from command lines like this one

links -dump httpip-adressportshutdownpassword=yourchoice

But it is advantageous to have graphical user interface for gateway control so we have

designed GUI through http

Chapter 4 System Design

36

433 Short Message Service Centre (SMSC)

A SMSC is an essential component when sending a push message from an IP network to

a mobile device in the architecture supported by the components and devices It is used to

remove the TCPIP layer that the push is encapsulatedrdquo in It is also the entity that

identifies the end-point device When this is done it is also the SMSC that is responsible

for the processing and final message delivery to the device After the process of de-

encapsulation and resolution of the client identity there should not be any difference

between this message and a message that is originated locally from the operator itself

(like a SMS)

In this project we just use a virtual SMS center we try first to get connection to a real

one but our effort was worthless

Finally the following figure depicts the overall flowchart of the WAP push system

(figure 47)

Chapter 4 System Design

37

PI

PPG

Create PAP

HTTP Post

Message

processing

OTA

Connection

oriented

Sessionless Session

oriented

WTP Initiation

WAP clinet

Application

Create content

Create

capability

entity

Database

SMS center

NoYes

Figure 47 the complete flowchart of the system

38

Chapter Five

5 System implementation and results

51 Implementation

511 The Push Proxy Gateway

First of all the Kannel gateway have been compiled and installed using gcc (GNU C

Compiler) this stage go fine except the operating system required more components to

be pre-installed and will configured

Then with stages of configuration to the gateway (Appendix B) it was capable of working

as PPG Figure 51 below show the gateway when it starts

Figure 51 starting kannel gateway

Then a web based user interface had been created to provide an easy way to control the

gateway remotely Figure 52 and figure 53

39

Figure 52 GUI for gateway control

512 The Push initiator

Next the push initiator design had been implemented using java programming language

as in design phase the implementation is taken carefully to make a reusable component

that could be used by other developer

PushInitiator class (Appendix B) implements a simple push initiator which can be used

to create and send messages to a push proxy gateway (PPG)

The method sendPushMessage sends a push message via the PPG to the client The client

is identified by the address which is either the phone number (address type is PLMN) or

IP address The message content and its mime type are also given as arguments to the

method the other tow important method are

createPapMessage This method creates a Push Access Protocol (PAP) type message

40

createSiMessage This method is used to create a service indication (SI) type message

Figure 53 showing running kannel status

513 WAP site

Since this site will be built for testing purpose and making sure that the system is

functional we had not go deep in this section Just simple WAP site with tow page has

been crated

41

52 Service indication

When a SI was pushed to any of the emulator or Nokia phones it was received and

presented in the way it was supposed to as specified in the WAP standard as shown in

figures below This is a proof that the devices claiming to support WAP push do so and

the design is will working See figures 53 through 56

Figure 55 service indication

42

Figure 57 SI details

52 Service load

The emulator correctly receives and interpreted the SL push the same as all of Nokia

phones we have tested

When a SL was pushed to the Ericsson phones it was not presented in the specified way

figure 58 I think that it is because of security reasons The reason for this assumption is

that the phones only supports on or off as security in their push configuration The

emulator on the other hand presents SL correctly Finally the Siemens phone did seem to

interpret SL but the current software was not very consistent It did load the SL without

user interference in the specified way when the user already where having an active

session If the user was offline the phone interface presented a symbol on the display

and did not load the service until the user clicked on the symbol

43

Chapter Six

6 conclusion and future work

In this chapter we will provide the conclusions and proposed future work for interested

individuals

61 Conclusions

In this project a WAP push system has been successfully designed and implemented It

provides a way to partially overcome the limitations encountered when accessing the

World Wide Web using handsets After comparing the proposed project objectives with

those accomplished the main goals are seen to be met

Phones from different manufactures all differ from the WAP-standard in some

ways One of the most obvious differences is the resolution of the display

During the work it has been noticed that the WML pages must be quite small We

have also noticed that the support for tables and some other tags are a bit limited

Even though the WML standard is smaller than the HTML standard it is a little

more complicated to write correct WML pages The main conclusion is that WAP

works pretty well but the phones are a little non-stable

The push proxy gateway is configured and worked probably with virtual SMS

center and it is easy to switch to a real one

The system depends mainly on open sources (ie Linux and kannek)

The design and implementation of the push initiator work well with the kannel

gateway and it should work correctly with other gateways

Chapter 6 Conclusion

44

62 Further Work

The possibilities of wireless push are interesting enough that it has to be worth to know if

the security and conformance problems will be solved in WAP push If they are solved

and the technique is refined then there should be nothing to stop the great number of

services that will follow in its footsteps Therefore there is further work that should be

done and the most interesting parts are in my opinion these

621 Security Aspect

One of the problems today is that the phones supporting push does not have the detailed

security settings that a technique like this needs Therefore it would be interesting to look

into the possibility to add these without confusing the user I suggest furthering looking

into usability aspects of security in WAP Push for short

622 GPS integration possibility

This will provide location dependent delivery of WAP push it will have great

applications in telematic and ecommerce advertising

623 Conformance to Standards

An interesting project would be to examine if the main reason for the nonstandard

solutions in the existing WAP push software is the result of difficulties in

implementation Or if the main reason is that the manufacturers wants to provide

proprietary solutions A reason why one may want to know this is that if the problem is

depending on implementation problems then it might get better

45

Appendix A Abbreviations

CDMA Code Division Multiple Access

CO Cache Operation

DTD Document Type Definition

GSM Global System for Mobile

HTTP Hypertext Transfer Protocol

IP Internet Protocol

MSISDN Mobile Station International Subscriber Directory Number

OTA Over The Air

PAP Push Access Protocol

PushOTA Push Over The Air

PDA Personal Digital Assistant

P1 Push Initiator

PLMN Public Land Mobile Networks

PPG Push Proxy Gateway

SI Service Indication

SIA Session Initiation Application

SIR Session Initiation Request

SL Service Loading

SMPP Short Message Peer to Peer

SMS Short Message System

SMSC Short Message System Center

UCP Universal Computer Protocol

URI Uniform Resource Identifier

URL Uniform Resource Locator

UTC Universal Time Coordinated

WAP Wireless Application Protocol

WBXML WAP binary XML

WDP Wireless Datagram Protocol

WSP Wireless Session Protocol

WTLS Wireless Transport Layer Security

XML Extensible Mark-up Language

46

Appendix B Kannel gateway configurations

THIS IS A SAMPLE CONFIGURATION FOR KANNEL

group = core

admin-port = 13000

admin-password = admin

status-password = admin

admin-deny-ip =

admin-allow-ip = 127001172161455

log-file = tmpkannellog

log-level = 0

http-proxy-host = 172161411

http-proxy-port = 8080

http-proxy-exceptions = 127001

Smsbox related

smsbox-port = 13001

box-deny-ip =

box-allow-ip = 127001

bearerbox-host =localhost

Wapbox related

wapbox-port = 13002

udp-deny-ip =

udp-allow-ip = 127001

bearerbox-host =localhost

SMSC GSM

group = smsc

smsc = at

modemtype = auto

speed =9600

device = devttyS0

SMSC HTTP

group = smsc

smsc = http

system-type = kannel

port = 13016

connect-allow-ip = 127001

Appendix B

47

username = wappush

password = wappush

SMSBOX SETUP

group = smsbox

bearerbox-host = localhost

sendsms-port = 13013

sendsms-chars = 0123456789 +-

log-file = tmpsmsboxlog

log-level = 0

access-log = accesslog

white-list = 127001

black-list =

SEND-SMS USERS

group = sendsms-user

username = wappush

password = wappush

user-deny-ip =

user-allow-ip = 127001

PPG group

group = ppg

ppg-url = wappush

ppg-port = 8080

concurrent-pushes = 100

trusted-pi = true

users = 1024

service-name = ppg

ppg-smsbox-id = dlrbox

WAP PUSH USER

group = wap-push-user

wap-push-user = picom

ppg-username = wappush

ppg-password = wappush

allow-ip = localhost

48

Appendix C Selected Codes

Gateway Control Form

ltDOCTYPE HTML PUBLIC -W3CDTD HTML 32ENgt

lthtmlgt ltheadgt

lttitlegtGateway control formlttitlegt

ltheadgt

ltbody bgcolor=white text=black link=blue vlink=navy

alink=redgt

ltbase target=submitgt

ltscriptgt

function update_status()

if ( adminactionvalue == status )

adminaction = http + adminhostnamevalue +

+ adminportvalue + status +

adminstatusformatvalue

else

adminaction = http + adminhostnamevalue +

+ adminportvalue + + adminactionvalue

adminpasswordvalue = adminpasswordvalue

actiongovalue = GO GET +adminaction

ltscriptgt

lttable align=centergt

lttrgtltp align=centergtlth2gtGateway control

formlth2gtltpgtlttrgt

lttrgt lttdgtHostnamelttdgtlttdgtltinput type=text

name=adminhostname value=localhost

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPortlttdgtlttdgtltinput type=text

name=adminport value=13000

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPasswordlttdgtlttdgtltinput type=password

name=adminpassword value=

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtActionlttdgtlttdgtltselect name=adminaction

onChange=update_status()gt

ltoption value=statusgtStatusltoptiongt

ltoption value=suspendgtSuspendltoptiongt

ltoption value=isolategtIsolateltoptiongt

Appendix C

49

ltoption value=shutdowngtShutdownltoptiongt

ltoption value=resumegtResumeltoptiongt

ltselectgtlttdgt lttrgt

lttrgt lttdgtStatus Formatlttdgtlttdgtltselect

name=adminstatusformat onChange=update_status()gt

ltoption value=gthtmlltoptiongtltoption

value=txtgttxtltoptiongtltoption

value=xmlgtxmlltoptiongtltselectgtlttdgt lttrgt

ltform name=admin method=get

action=httplocalhost13000status

encoding=applicationx-www-formgt

ltinput type=hidden name=password value=gt

lttrgt

lttdgtGolttdgt

ltformgt

lttdgtltinput type=submit value=go name=actiongo

onClick=documentadminsubmit()gtlttdgt

lttrgt

lttablegt

ltbodygt

lthtmlgt

Push Initiator Class

import javanetURL

import javanetHttpURLConnection

import javaio

Class implements a simple push initiator It can be

used to create and send messages to push proxy

gateway (ppg)

public final class PushInitiator

xml version

private final static String XML_VERSION = ltxml

version=10gt

Push Access Protocol (PAP) document type

private final static String PAP_DOCTYPE =

Appendix C

50

ltDOCTYPE pap PUBLIC -WAPFORUMDTD PAP 10EN

httpwwwwapforumorgDTDpap_10dtd gt

content type of the push request multipart body

private final static String CONTENT_TYPE =

multipartrelated boundary=multipart-boundary

type=applicationxml

Service Indication (SI) document type

private static final String SI_DOCTYPE = ltDOCTYPE si

PUBLIC -WAPFORUMDTD SI 10EN +

httpwwwwapforumorgDTDsidtdgt

private static int pushId = 0

PPG url where the pap message is to be sent

private final URL ppgUrl

some push proxy gateways may also require the

authentication of the push initiator

For instance the push initiator may be required to

send an HTTP authorization header in each request

private final String authorization

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

public PushInitiator(URL ppgUrl) thisppgUrl =

ppgUrl

authorization = null

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

param authorization a ltcodegtStringltcodegt value

public PushInitiator(URL ppgUrl String authorization)

thisppgUrl = ppgUrl

Appendix C

51

thisauthorization = authorization

Systemoutprintln(Push Initiator created ppgUrl =

+ ppgUrl)

ltcodegtsendPushMessageltcodegt sends push message to

ppg

param clientAddress a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param message a ltcodegtStringltcodegt value

param mimeType a ltcodegtStringltcodegt value

exception Exception if an error occurs

public void sendPushMessage(String clientAddress

String addressTypeString message String mimeType)

throws Exception

HttpURLConnection http =

(HttpURLConnection)ppgUrlopenConnection()

String ppgServer = ppgUrlgetHost()

httpsetDoInput(true)

httpsetRequestProperty(Content-Type CONTENT_TYPE)

if(authorization = null)

if(authorizationtrim()equals())

httpsetRequestProperty(Authorization

authorization)

httpsetDoOutput(true)

PrintWriter out = new PrintWriter(new

BufferedOutputStream(httpgetOutputStream()))

outprintln(--multipart-boundary)

outprintln(Content-type applicationxml)

outprintln()

outprintln(createPapMessage(clientAddress

addressTypeppgServer genPushId() null))

outprintln()

outprintln(--multipart-boundary)

outprintln(Content-type + mimeType)

outprintln()

outprintln(message)

outprintln()

outprintln(--multipart-boundary--)

outflush()

outclose()

httpconnect()

Appendix C

52

finally read and debug the response received from

PPG

try

debugResponse(http)

catch (Exception e)

Systemerrprintln(Error in receiving the

response)

ltcodegtcreatePapMessageltcodegt creates a Push Access

Protocoltype message

param address a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param ppgServer a ltcodegtStringltcodegt value

param pushId a ltcodegtStringltcodegt value

param notificationTo a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createPapMessage(String address

String addressType String ppgServer String pushId

String notificationTo)

return XML_VERSION + n + PAP_DOCTYPE + n +

ltpap product-name=Mobile Zoo Push

Initiatorgtn +

ltpush-message push-id= + pushId +

(notificationTo = null request-notification-

to= + notificationTo ) + gtn +

ltaddress address-value=WAPPUSH= + address +

TYPE= + addressType +

+ ppgServer + gtn +

ltpush-messagegtnltpapgt

ltcodegtcreateSiMessageltcodegt creates a service

indication type message

param url a ltcodegtStringltcodegt value

param created a ltcodegtStringltcodegt value

param expires a ltcodegtStringltcodegt value

Appendix C

53

param message a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createSiMessage(String url

String sid String created String expires String

action String message)

return XML_VERSION + SI_DOCTYPE +

ltsigtn +

ltindication href= + url + +

(sid = null si-id= + sid + ) +

created = null created= + created +

) +

(action = null action= + action +

) +

(expires = null expires= + expires +

) + gt +

message +

ltindicationgtnltsigt

Debug response

param http a ltcodegtHttpURLConnectionltcodegt value

exception Exception if an error occurs

private void debugResponse(HttpURLConnection http)

throws Exception

Systemoutprintln(httpgetResponseMessage())

String headerName

int i=0

while((headerName = httpgetHeaderFieldKey(i++)) =

null)

Systemoutprintln(headerName + +

httpgetHeaderField(headerName))

Systemoutprintln()

InputStreamReader in = new InputStreamReader(new

BufferedInputStream(httpgetInputStream()))

int c

Appendix C

54

while((c = inread()) = -1)

Systemoutprint((char)c)

Systemoutprintln()

ltcodegtgenPushIdltcodegt generates an unique push id

return a ltcodegtStringltcodegt value

private String genPushId()

pushId = 100000

return SystemcurrentTimeMillis() + + pushId++

55

References

[1] Microsoft ldquoGetting Mobile Using WML and WAP to Display Web Sites on

Mobile Devicesrdquo

URL msdnmicrosoftcomen-uslibraryaa140117(office10)aspx accessed

on April 10 2008

[2] DALE BULBROOK ldquoWAPA Beginnerrsquos Guiderdquo OsborneMcGraw-Hill 2001

[3] WAP Forum Wireless Application Protocol Architecture Specification Access on

Jan 12 2008 Available

httpwww1wapforumorgtechdocumentsWAP-210-WAPArch-2006 07 12-apdf

[4] WAP Forum Push Architectural Overview access on (2008 February 3) Available

httpwww1wapforumorgtechdocumentsWAP-250-PushArchOverview-2007 04

03-apdf

[5] Service indication PDF access on 62008 Available

httpwwww3orgTRhtml401structlinkshtml

[6] WAP Push Technology (openwave) PDF access on (2008 April) Available

URL httpwwwopenwavorg

[7] Web site (httpwwwwapforumorgwhatcopyrighthtm) access on May 2008

[8] ldquoWAP Push Proxy Gateway Specificationrdquo WAP Forum access on 16-August-

2007URI httpwwwwapforumorgPDF

[9] WAP Forum Access on (2008 MAY 31) WAP Service Indication Specification

Available httpwww1wapforumorgtechdocumentsWAP-167-ServiceInd-200507

31-apdf

  • odc_fpwmlandwap_topic3
  • N100E3
  • 21
  • 5

Chapter 2 Basic Concepts

12

2241 Service Primitives

WTLS uses primitives to ensure security The primitives are used to

Initiate a secure connection

Perform public-key authentication or key exchange with the client

Change into connection state when the handshake has been done

Terminate the connection

Inform the other end about warning level alerts

Request by the server that the client should initiate a new handshake

225 Transport Layer Wireless Datagram Protocol

The wireless datagram layer is a datagram service used by the upper layers WDP is

designed to communicate over different bearer services and especially for wireless

telecommunication networks [6] It Consists of

bull Source and destination address and port

bull Optionally fragmentation

It maps to UDP for IP bearer and moves single packets to and from the phone

226 WDP and IP

In networks with IP as the routing protocol UDP is used instead of WDP IP provides

segmentation and reassemble in a connection-less datagram service UDP provides port

based addressing and other necessary functions Thereby no additional functions are

required by a WDP layer [7]

227 Bearer Interfaces

WAP supports dial-up networking using IP and Point-to-Point Protocol (PPP) as the

bearer interface underneath WDP It also supports Short Message System (SMS) and

General Packet Radio System (GPRS) SMS passes text and binary data between digital

Chapter 2 Basic Concepts

13

phones GPRS is a relatively new technology that implements faster always-on

connections for wireless devices GPRS actually runs on top of IP [7]

As had been learned above WAP is quite similar to web figure 23 provide a brief

comparison between them

WAP

Bearer

WDP Dtatgram

WTLS security

WTP Transaction

WSP Session

WAE

WML and

WMLScript

Web

IP

TCP UDP

TLS-SSL

HTTP

HTML

JavaScript

VBscript

Figure 23 Web vs WAP

Chapter 2 Basic Concepts

14

23 SMS overview

SMS stands for Short Message Service It is a technology that enables the sending and

receiving of messages between mobile phones SMS first appeared in Europe in 1992 It

was included in the GSM (Global System for Mobile Communications) standards right at

the beginning Later it was ported to wireless technologies like CDMA and TDMA The

GSM and SMS standards were originally developed by ETSI ETSI is the abbreviation

for European Telecommunications Standards Institute Now the 3GPP (Third Generation

Partnership Project) is responsible for the development and maintenance of the GSM and

SMS standards [8]

SMS has two operational mode textual mode and binary mode which will allow sending

other data beside pure text

24 Push overview

WAP push provides a standard means to send data to a mobile subscriber without an

explicit request from the subscriber at the time the data is delivered In the normal

clientserver model a client requests a service or information from a server which then

responds by transmitting information to the client This is known as ldquopullrdquo technology

The client pulls information from the server The World Wide Web is the best example of

pull technology where a user enters a URL (the request) which is sent to a server and

the server answers by sending a Web page (the response) to the user (Figure 24 a)

Although WAP push is also based on the clientserver model it provides a means to send

data to the subscriber without an explicit request from the client at the time of delivery

(Figure 24 b)

With push functionality users are able to get information without having to request that

information In many cases it is important for the user to get the information as soon as it

is available Push communications can be used for sending stock quotes traffic reports

and news

Chapter 2 Basic Concepts

15

a) WAP pull model

b) WAP push model

Figure 24 Pull vs Push

24 WAP Push framework

A push operation starts when a server called the push initiator transmits a push messages

to a WAP client Since the push initiator located on the Internet does not use the same

protocol as the WAP client a translating gateway is needed The push initiator contacts

the push proxy gateway via the push access protocol and the Internet protocol The push

proxy gateway translates the information and forwards the pushed content to the WAP

device via the push over the air protocol (figure 25) [9]

Chapter 2 Basic Concepts

16

Push Proxy Gateway

WAP

Client

Push

Access Protocol

Push

over-the air

protocol Push Initiator

Figure 25 the wireless push technology

241 Push Proxy Gateway

The push proxy gateway PPG is the entity that does most of the work in the push

architecture The gateway acts as an access-point for content pushed from the Internet to

the client So the responsibility of the gateway owners to grant access to push proxy

gateway [9]

Besides the actual access-point service the push gateway provides the following services

push initiator identification and authentication

parsing and error detection of content control information

client discovery services

address resolution

binary encoding and compilation of certain content type

protocol conversion

Chapter 2 Basic Concepts

17

Information to the push proxy gateway is sent via the push access protocol PAP The

content of the information is divided into several parts were the first part is information to

the PPG such as recipient information

When the PPG has parsed the control information an acknowledgement is sent to the

push initiator reporting if the service was successful or not

Once the proxy has accepted the content and the push initiator has received the

acknowledgement the proxy is responsible for the transmission to the client The proxy

attempts to find the correct destination device and deliver the content to that client using

the push over the air protocol The contents delivered to the proxy may be translated to

their binary counterpart eg WML documents may be converted to binary XML by the

proxy before the information is transmitted to the client [9]

The proxy must implement a service to enable capability queries from the push initiator

The capability query should be responded with the capabilities of the specified WAP

device The push proxy gateway may also implement broadcasting services where

special addresses may be translated to a broadcast operation [9]

242 Push Access Protocol

The push access protocol PAP is the means by which an Internet-based push initiator

pushes content to a mobile network via the push proxy gateway [9] The push access

protocol is not intended for use over the air

PAP supports the following operations

Push submission

The push message sent from the push initiator to the gateway contains a control

entity a content entity and may contain a capability entity The control entity is

an XML document When the gateway has received the message an XML

response message is sent back to the initiator

Chapter 2 Basic Concepts

18

Result notification

If the push initiator has requested confirmation of successful delivery this XML

message is transmitted from the PPG to the push initiator when the content has

been delivered to the mobile device The push initiator acknowledges this result

message with another XML document

Push cancellation

The purpose of the push cancellation is to allow the push initiator to attempt to

cancel a previously submitted push message Both the cancellation message and

the resulting acknowledgement are sent as XML documents

Status query

The status query operation allows the push initiator to request the current status of

a message that has been previously submitted Both the status query message and

the resulting acknowledgement are sent as XML documents

Client capabilities query

This operation allows the push initiator to query the PPG for the capabilities of a

specific device The query is sent as an XML document and the response is sent

as another XML document

To access the push proxy gateway an address is used The gatewayrsquos underlying

protocols determines which type of address is used eg in HTTP a URL is used To

access a specific device the devicersquos address is included in the XML document

There are two ways to send information to several clients The push initiator can either

send information to several specific addresses or broadcast it to all clients In both cases

only one message is sent to the gateway which either sends the information to some or

all of the clients The clientsrsquo address is depending on the underlying layer [9]

Chapter 2 Basic Concepts

19

243 Push Over-The-Air Protocol

The push proxy gateway and the client communicate using the push over the air protocol

which utilizes WSP session services Pushes can be sent via connection oriented links or

connection-less links Connection-oriented pushes require that an active WSP session is

available but the server can not create a session To solve the case were there is no active

WSP session the push framework introduces a session initiation application in the client

This application listens to session requests from the OTA-server and responds by setting

up a WSP session for push purposes [9]

Push

Over-the air

WSP

Push management

premptive

Push operational

primitives

WSP Servise

Primitives

Figure 26 Push Over-The-Air protocol stack

The push over the air protocol supports two kinds of operations operations to manage the

connection and operations to send actual messages

Push Sends unconfirmed information over a connection-oriented link

Confirmed push Sends confirmed information over a connection-oriented link

Abort push rejects a previously transmitted push operation This is operation is

part of the confirmed push mechanism

Unit push Sends unconfirmed information over a connection-less link

Connect Creates a push session

Chapter 2 Basic Concepts

20

Suspend Request that a push session should be suspended

Resume Request to resumes a previously suspended push session

Disconnect Terminates the push session

Session request Request from the server to initialize a session to a client

244 Service Indication

The service indication SI provides a mechanism composed in an XML message to

notify a client that an external asynchronous event has occurred and indicate a service

that can be loaded in order to react to that event In order to notify the user a message is

sent from the push initiator via the proxy to the client The message will be shown to the

user and there will be a reference to a URI where the appropriate service can be loaded

For example the message could be ldquoYou have new mailrdquo and the URI to your email

service [9]

When the message is received by the client it will be presented to the user The user then

can choose to launch the service in an application eg the WML browser or to postpone

the SI for later handling Postponed SIs will be stored in the client and the user is given

the possibility to act upon them later When the user choose to launch the service the

service is started in the same way as if the user would have started it manually [9]

Messages sent with the service indication can support mechanisms to improve the end-

user-experience

User-intrusiveness levels

To improve the users understanding of the provided service and to affect the users

behavior when the message is delivered it is possible to change the level of user-

intrusiveness

Chapter 2 Basic Concepts

21

Deletion

When a pushed message becomes invalid the service provider can delete the

message in the clients For example an email notification becomes invalid when

the message are read

Replacement

When a pushed message is invalid and updated with a new message the service

provider can replace the origin message with a new one

Handling of out of order delivery

Since the wireless communication is unpredictable it can not be ensured that the

messages are received in the same order as sent This mechanism discards all

messages older than the latest received

Expiration

Some services may only be valid for a certain amount of time when the time has

expired the message is removed from the client

245 Service Loading

The service loading method provides means to convey a URI to a user agent in a mobile

client The method is conveyed in an XML message In difference from the service

indication method the client loads the content of the URI automatically without any

action from the user when the service loading message is received

Thereby the user will experience the content as if it was pushed to the mobile client and

executed In the service loading mechanism there is a reference to a service page that will

automatically be loaded without interaction with the user included For example the client

will automatically start the email service when a message about new mails on the server

is received [9]

Chapter 2 Basic Concepts

22

When the client is busy with some application it is not suitable to execute the referred

content directly upon reception of a message To avoid this client may cache the content

indicated by the URI so it becomes available to the user when the client is ready

Messages sent with the service loading method can support mechanism to improve the

end-user-experience

Control of the level of user interaction

To improve the users understanding of the provided service and the affect the

userrsquos behavior when the message is delivered it is possible to change the level

of user-intrusiveness The service can explicitly specify if the service should be

loaded or not if the client is busy on reception

Pre-emptive content caching

By setting this attribute the service loading can require that the indicated content

is downloaded and cached instead of executed This can be used to improve the

users experience of the services that otherwise would have required content to

be retrieved from an origin

23

Chapter Three

3 System requirements

Several materials and requirements must be incorporated into the design implementation

and testing The following discusses the components necessary to fulfill the project

requirements and environment

31 development environment

There are many development tools to choose from when developing for WAP Push and

hen you combine different environments with different gateways you will get a vast

numbers of choices This large flora of tools makes it difficult to choose a suitable

environment an important issue because a badly chosen one might consume a lot of time

341 Operating system

Kannel (the chosen gateway for the system) is being developed on Linux systems and

should be fairly easy to export to other Unix-like systems Although it should be working

without major problems on Windows (through Cygwin) Solaris and FreeBSD The push

initiator is implemented on java so it is operating system independent

Linux is the logical choice especially when it comes to the world severs and networking

for it promising feature as an open source low cost operating system

342 Programming language

Since system design was planned to be modular to enhance the reuse of its components as

explained above then an object oriented programming language will be a reasonable

choice Another factor is the need for a graphical user interface which imposes using a

programming language with good graphics handling capabilities at the same time it

should be over Linux

Chapter 3 System requirements

24

The best programming language to accomplish the above requirement is found to be java

which has the flowing feature

Cross platform - All clients and servers run the same Java code without any

changes or recompilation This simplifies deployment

Cost effective to develop in Java - The java language has many features that

improve developer productivity promote code reuse and reduce development and

maintenance costs

Works well with Open Source - Java with Linux and the many open source

movement projects and libraries provide a powerful mix that ensures development

is cost-effective efficient and of high quality because extensively tested libraries

components and solutions are available to plug-in to customer development

efforts

343 Nokia Mobile Internet Toolkit 41

To design and implement a WAP application on a Nokia phone the Nokia Internet

Toolkit has to be downloaded and installed on the PC A Nokia simulator is installed as

part of the installation but various phone simulators can be downloaded and installed

This simulator is used for testing purpose Also it has a server simulator based on the

Nokia Active Server if a WAP Gateway is unavailable

32 software requirements

Most of this section has been mentioned in way or other but they will be considered

briefly here

321 Kannel WAP gateway

This is an open source gateway upon which the push proxy gateway of this system will

be built on it available free of charge at kannel project web site

Chapter 3 System requirements

25

322 Linux operating system

It is important to install kannel gateway on it for this project we choose fedora core 7 for

availability reasons

323 JDK16

The java run time environment is required to implement the push initiator

32 hardware requirements

321 PC

Any Personal computer capable of running fedora core 7 with USB interface to be able

connects GSM modem

322 GSM modem

This will act as an alternative to the short message service center SMSC Obviously this

means that GSM network is required too

26

Chapter Four

4 System design

41 System Scenario

The basic scenario of a push session is that a Push Initiator (PI) transmits content to a

WAP client This is done in multiple steps as shown in Figure 31

pushOTAPAP

Gateway

PI

1

2

pull gateway

PPG

3

SMS center

Mobile device

6

5

4

Content provider78 9

Figure 41 WAP push scenario

Chapter 4 System Design

27

The PI communicates with a Push Proxy Gateway (PPG) over the Push Access Protocol

(PAP) (1 and 2) The PPG will then use the Push Over-The-Air Protocol (PushOTA) (3)

to deliver a Uniform Resource Identifier (URI) to the client via a Short Message System

Centre (SMS-C) (4 and 5) The next step for the client is then to activate the URI (6 and

7) and get the content from the server (8 and 9) The mobile device will have to use a

ldquoPull Gatewayrdquo to get the content but it is very likely that this is the same one as the PPG

The same same scenario could be viewed in sequence diagram figure (42)

Push Initiator PPG SMS Center WAP client

Send push message

Send push message response

Send WAP push message

Ack

Send WAP push message

Ack

Message read

Ack

Message read

Ack

Result notification message

Result notification response

Figure 42 WAP push sequence diagram

Chapter 4 System Design

28

43 Modular Design

Conceptually we can envision this push system as consisting of three major components

(presented in the order of the push lifetime)

first there is a Push Initiator Program that reads the generates a notification message and

transmits (pushes) it via a WAP Gateway to the customer phone This message notifies

the user that a service is available if the user accepts will ask the phonersquos browser to pull

the page from our web server via the WAP Gateway

Next there is the Push Proxy Gateway PPG which will receive the push message from

the push initiator and is responsible of doing any needed optimization protocol

compilation and conversion Also it is responsibility of the PPG to find the end user

address and send the push message to the SMS center

Finally there is the SMS center which will do the last delivery of push message to the

intended user if the user were offline the message will be saved for later time until the

WAP client is on

PI PPGSMSC

Figure 43 system modules

Chapter 4 System Design

29

43 Design of system Modules

Following sections of this chapter present a description and design of the system modules

with accompanying graphical representation

431 Push Initiator (PI)

The PI is the first logical component in the WAP Push scenario and therefore the

originator of the push message There are different kinds of PIs One example is an

automated script another one is a semi automated server version written in an applicable

scripting language supporting server side interaction

A push message is sent as an HTTP POST to the Push Proxy Gateway The POST will be

a multipart XML document with the first part being the control entity (Push Access

Protocol) the second part being the content entity (either a Service Indication or a

Service Load) and the third part being the capability entity

HTTP Post

Capability entity

Content entity (SISL)

Control entity (PAP)

Figure 44 architecture of the push message

Chapter 4 System Design

30

4311 Control entity

This part of the push contains the basic information and fields The fields can include

recipient address expiry time bearer type delivery attempt time and a URL to which a

response is to be sent if delivery confirmation is requested by the push initiator

PAP is the protocol used in WAP Push framework for specifying control information and

content that is to be pushed to a client via a Push Proxy Gateway (PPG) A Push Initiator

(PI) triggers push message processing The Push initiator class (Appendix B) of this

design shows how to generate PAP messages

The address of the used PPG should be given as an initialization parameter of the

application (ldquoppg-urlrdquo see Appendix B) This design also provides an implementation

that can be used in a special case when ldquoIPv4 IPv6rdquo type client addressing is applied and

when toolkit is used All other cases including the use of phone numbers (ldquoPLMNrdquo type

address) in sending push messages are considered

The PAP XML contains at the minimum a ltpapgt element a ltpush-messagegt

element and an ltaddressgt element

The important parts of this PAP message are the address value and type The value is

typically a MSISDN and type indicates whether to send to a MSISDN (typical case) or to

an IP Address The TYPE is almost always MSISDN as the Push Initiator (PI) will not

typically have the Mobile Stations IP address - which is generally dynamic

4312 Content entity

This is the actual data that is received by the mobile device The various content types

are Service Indication (SI) Service Load (SL) and Cache Operation (CO) in our project

we will just deal with SI and SL

The SI notifies a client about an external event by inviting the client to interact with it In

other words it informs a client about a service More precisely it sends a message that

Chapter 4 System Design

31

informs the client of a Uniform Resource Identifier (URI) where the client can access the

service

An important attribute of SI is the action attribute it may contain the action to be taken

when the client receives the SI There are two groups that the action attributes can be

divided into

First we have delete and signalmdashnone both of them is used because of their side

effects Ie with delete you take away all SIs with the same si-id as the deletion pushrdquo

including itself and with signal-none you either do nothing or you pay regard to the

info element in that push

The other group consists of signal-low signal-medium and signal-high These

attributes are all used to set the rules for the presentation in the terminal device

o Signal-low

The SI must be postponed without user intervention

o Signal-medium

The SI must be presented as soon as the implementation allows that to be carried out

without disturbing the user (Signal-medium is the value that will be used if none is

specified)

o Signal-high

The SI must be presented as soon as the implementation allows that to be carried out

without disturbing the user or earlier if it seems appropriate (This decision may for

instance be based on user preference settings)

This is the different functionalities supported by the SI we concidered

Expiration

Replacement

Deletion

Chapter 4 System Design

32

Handling of out of order delivery

Handling of information specified in the info element

A PUSH Service Indication (SI) contains at a minimum an ltsigt element and a

ltindicationgt element SL donrsquot differ so much from SI

4313 Capability entity

This entity determines the type of mobile device that is to be served This is determined

by WAP user agent profiling The sender can indicate the hardware vendor and browser

version and type of the intended recipients This capability entity is then matched at the

PPG to see which devices are compatible with the requested capability If there is a

match the content is delivered by the PPG to that specific device

Now a day most devices are compatible with WAP so we donrsquot need to create this entity

more precisely it is optional

After the push has been created in the PI it is up to the system to deliver it to the defined

destination In this system the different responsible entities are the PPG and the SMSC

Both of these two different entities are running on same server but it is only the

configuration of the SMSC that is out of my control since it is run by the operator and is

not controllable in my lab environment

432 Push Proxy Gateway (PPG)

There are various commercial WAP gateways available on the market that are quite

expensive Kannel on the other hand is an open source gateway one doesnrsquot need to pay

for it in addition one can edit the source code himself and construct his own customized

gateway Because Kannel is being developed on Linux systems (RedHat and Debian) it

can be smoothly ported to other UNIX-like operating systems

4321 Kannel gateway architecture

The gateway divides the processing load between the following three hosts

Chapter 4 System Design

33

The bearer box which connects to the SMS (Short Message Service) centers and

or CSD (Circuit Switched Data) routers providing a unified interface to them for

the wapbox The bearer box does this by implementing the WDP (Wireless

Datagram Protocol) layer of the WAP stack

The smsbox implements the rest of the SMS gateway functionality It receives

textual SMS messages from the bearerbox and interprets them as service

requests and responds to them in the appropriate way

The wapbox which hosts the upper layers of the WAP stack Each session and its

transactions are handled by the same wapbox (see figure 35)

1Figure 45 divisions of duties in kannel

4322 Working of the gateway

The bearer box receives UDP (User Datagram Protocol) packets from CSD routers

inspects them to see whether they are WAP packets if so then it will routes them to the

WAP box This simple design allows the bearer box to do a minimum of processing per

smsbox

wapbox

bearerbox

Kannel

SMS center

WAP phone

HTTP server

Chapter 4 System Design

34

packet The bearer box also sends the UDP packets that the other boxes generate which

adds some more routing processing The wapboxes implement the WTP (Wireless

Transaction Protocol) and WSP (Wireless Session Protocol) layers These take HTTP-

like requests from the phones and make the actual HTTP requests to content servers

compress the responses and send them back to the terminals (Sessions are maintained to

make as much use of the limited radio bandwidth as possible)

4323 External interfaces of the gateway

The gateway has interfaces to three external agents

bull SMS centers using various protocols

bull HTTP servers to fetch WAP and SMS content and to push WAP Content The

pull protocol is HTTP push PAP

bull WAP phones implementing the WAP protocol stack and (for push) WAP Push

client

Figure 36 summarize kannel external interfaces

4324 Configuring the gateway

The bearerbox smsbox and wapbox are the main working modules of the gateway and

must be configured before configuring the gateway These three modules are controlled

by a configuration file that has wapbox smsbox and bearerbox groups

Configuring the PPG core group

We use two components the PPG core group and the PPG user group The PPG

core group is used to configure the PI interface(for more details configuration

variables refer to appendix c)

Chapter 4 System Design

35

Mobile telephone

network

The Internet

smsbox

wapbox

bearerbox

Kannel

HTTP

HTTP

HTTP server

Serving WML

files

HTTP server

Serving HTML

files

TCP

TCP

WAPSMS

SMSC

WAP phoneNetwork base station

Workstation used for http

administration

Figure 46 External interfaces of the gateway

4325 Administering the gateway through an HTTP interface

Kannel can be administered via an HTTP interface All commands are given as normal

HTTP queries so they can easily be given from command lines like this one

links -dump httpip-adressportshutdownpassword=yourchoice

But it is advantageous to have graphical user interface for gateway control so we have

designed GUI through http

Chapter 4 System Design

36

433 Short Message Service Centre (SMSC)

A SMSC is an essential component when sending a push message from an IP network to

a mobile device in the architecture supported by the components and devices It is used to

remove the TCPIP layer that the push is encapsulatedrdquo in It is also the entity that

identifies the end-point device When this is done it is also the SMSC that is responsible

for the processing and final message delivery to the device After the process of de-

encapsulation and resolution of the client identity there should not be any difference

between this message and a message that is originated locally from the operator itself

(like a SMS)

In this project we just use a virtual SMS center we try first to get connection to a real

one but our effort was worthless

Finally the following figure depicts the overall flowchart of the WAP push system

(figure 47)

Chapter 4 System Design

37

PI

PPG

Create PAP

HTTP Post

Message

processing

OTA

Connection

oriented

Sessionless Session

oriented

WTP Initiation

WAP clinet

Application

Create content

Create

capability

entity

Database

SMS center

NoYes

Figure 47 the complete flowchart of the system

38

Chapter Five

5 System implementation and results

51 Implementation

511 The Push Proxy Gateway

First of all the Kannel gateway have been compiled and installed using gcc (GNU C

Compiler) this stage go fine except the operating system required more components to

be pre-installed and will configured

Then with stages of configuration to the gateway (Appendix B) it was capable of working

as PPG Figure 51 below show the gateway when it starts

Figure 51 starting kannel gateway

Then a web based user interface had been created to provide an easy way to control the

gateway remotely Figure 52 and figure 53

39

Figure 52 GUI for gateway control

512 The Push initiator

Next the push initiator design had been implemented using java programming language

as in design phase the implementation is taken carefully to make a reusable component

that could be used by other developer

PushInitiator class (Appendix B) implements a simple push initiator which can be used

to create and send messages to a push proxy gateway (PPG)

The method sendPushMessage sends a push message via the PPG to the client The client

is identified by the address which is either the phone number (address type is PLMN) or

IP address The message content and its mime type are also given as arguments to the

method the other tow important method are

createPapMessage This method creates a Push Access Protocol (PAP) type message

40

createSiMessage This method is used to create a service indication (SI) type message

Figure 53 showing running kannel status

513 WAP site

Since this site will be built for testing purpose and making sure that the system is

functional we had not go deep in this section Just simple WAP site with tow page has

been crated

41

52 Service indication

When a SI was pushed to any of the emulator or Nokia phones it was received and

presented in the way it was supposed to as specified in the WAP standard as shown in

figures below This is a proof that the devices claiming to support WAP push do so and

the design is will working See figures 53 through 56

Figure 55 service indication

42

Figure 57 SI details

52 Service load

The emulator correctly receives and interpreted the SL push the same as all of Nokia

phones we have tested

When a SL was pushed to the Ericsson phones it was not presented in the specified way

figure 58 I think that it is because of security reasons The reason for this assumption is

that the phones only supports on or off as security in their push configuration The

emulator on the other hand presents SL correctly Finally the Siemens phone did seem to

interpret SL but the current software was not very consistent It did load the SL without

user interference in the specified way when the user already where having an active

session If the user was offline the phone interface presented a symbol on the display

and did not load the service until the user clicked on the symbol

43

Chapter Six

6 conclusion and future work

In this chapter we will provide the conclusions and proposed future work for interested

individuals

61 Conclusions

In this project a WAP push system has been successfully designed and implemented It

provides a way to partially overcome the limitations encountered when accessing the

World Wide Web using handsets After comparing the proposed project objectives with

those accomplished the main goals are seen to be met

Phones from different manufactures all differ from the WAP-standard in some

ways One of the most obvious differences is the resolution of the display

During the work it has been noticed that the WML pages must be quite small We

have also noticed that the support for tables and some other tags are a bit limited

Even though the WML standard is smaller than the HTML standard it is a little

more complicated to write correct WML pages The main conclusion is that WAP

works pretty well but the phones are a little non-stable

The push proxy gateway is configured and worked probably with virtual SMS

center and it is easy to switch to a real one

The system depends mainly on open sources (ie Linux and kannek)

The design and implementation of the push initiator work well with the kannel

gateway and it should work correctly with other gateways

Chapter 6 Conclusion

44

62 Further Work

The possibilities of wireless push are interesting enough that it has to be worth to know if

the security and conformance problems will be solved in WAP push If they are solved

and the technique is refined then there should be nothing to stop the great number of

services that will follow in its footsteps Therefore there is further work that should be

done and the most interesting parts are in my opinion these

621 Security Aspect

One of the problems today is that the phones supporting push does not have the detailed

security settings that a technique like this needs Therefore it would be interesting to look

into the possibility to add these without confusing the user I suggest furthering looking

into usability aspects of security in WAP Push for short

622 GPS integration possibility

This will provide location dependent delivery of WAP push it will have great

applications in telematic and ecommerce advertising

623 Conformance to Standards

An interesting project would be to examine if the main reason for the nonstandard

solutions in the existing WAP push software is the result of difficulties in

implementation Or if the main reason is that the manufacturers wants to provide

proprietary solutions A reason why one may want to know this is that if the problem is

depending on implementation problems then it might get better

45

Appendix A Abbreviations

CDMA Code Division Multiple Access

CO Cache Operation

DTD Document Type Definition

GSM Global System for Mobile

HTTP Hypertext Transfer Protocol

IP Internet Protocol

MSISDN Mobile Station International Subscriber Directory Number

OTA Over The Air

PAP Push Access Protocol

PushOTA Push Over The Air

PDA Personal Digital Assistant

P1 Push Initiator

PLMN Public Land Mobile Networks

PPG Push Proxy Gateway

SI Service Indication

SIA Session Initiation Application

SIR Session Initiation Request

SL Service Loading

SMPP Short Message Peer to Peer

SMS Short Message System

SMSC Short Message System Center

UCP Universal Computer Protocol

URI Uniform Resource Identifier

URL Uniform Resource Locator

UTC Universal Time Coordinated

WAP Wireless Application Protocol

WBXML WAP binary XML

WDP Wireless Datagram Protocol

WSP Wireless Session Protocol

WTLS Wireless Transport Layer Security

XML Extensible Mark-up Language

46

Appendix B Kannel gateway configurations

THIS IS A SAMPLE CONFIGURATION FOR KANNEL

group = core

admin-port = 13000

admin-password = admin

status-password = admin

admin-deny-ip =

admin-allow-ip = 127001172161455

log-file = tmpkannellog

log-level = 0

http-proxy-host = 172161411

http-proxy-port = 8080

http-proxy-exceptions = 127001

Smsbox related

smsbox-port = 13001

box-deny-ip =

box-allow-ip = 127001

bearerbox-host =localhost

Wapbox related

wapbox-port = 13002

udp-deny-ip =

udp-allow-ip = 127001

bearerbox-host =localhost

SMSC GSM

group = smsc

smsc = at

modemtype = auto

speed =9600

device = devttyS0

SMSC HTTP

group = smsc

smsc = http

system-type = kannel

port = 13016

connect-allow-ip = 127001

Appendix B

47

username = wappush

password = wappush

SMSBOX SETUP

group = smsbox

bearerbox-host = localhost

sendsms-port = 13013

sendsms-chars = 0123456789 +-

log-file = tmpsmsboxlog

log-level = 0

access-log = accesslog

white-list = 127001

black-list =

SEND-SMS USERS

group = sendsms-user

username = wappush

password = wappush

user-deny-ip =

user-allow-ip = 127001

PPG group

group = ppg

ppg-url = wappush

ppg-port = 8080

concurrent-pushes = 100

trusted-pi = true

users = 1024

service-name = ppg

ppg-smsbox-id = dlrbox

WAP PUSH USER

group = wap-push-user

wap-push-user = picom

ppg-username = wappush

ppg-password = wappush

allow-ip = localhost

48

Appendix C Selected Codes

Gateway Control Form

ltDOCTYPE HTML PUBLIC -W3CDTD HTML 32ENgt

lthtmlgt ltheadgt

lttitlegtGateway control formlttitlegt

ltheadgt

ltbody bgcolor=white text=black link=blue vlink=navy

alink=redgt

ltbase target=submitgt

ltscriptgt

function update_status()

if ( adminactionvalue == status )

adminaction = http + adminhostnamevalue +

+ adminportvalue + status +

adminstatusformatvalue

else

adminaction = http + adminhostnamevalue +

+ adminportvalue + + adminactionvalue

adminpasswordvalue = adminpasswordvalue

actiongovalue = GO GET +adminaction

ltscriptgt

lttable align=centergt

lttrgtltp align=centergtlth2gtGateway control

formlth2gtltpgtlttrgt

lttrgt lttdgtHostnamelttdgtlttdgtltinput type=text

name=adminhostname value=localhost

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPortlttdgtlttdgtltinput type=text

name=adminport value=13000

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPasswordlttdgtlttdgtltinput type=password

name=adminpassword value=

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtActionlttdgtlttdgtltselect name=adminaction

onChange=update_status()gt

ltoption value=statusgtStatusltoptiongt

ltoption value=suspendgtSuspendltoptiongt

ltoption value=isolategtIsolateltoptiongt

Appendix C

49

ltoption value=shutdowngtShutdownltoptiongt

ltoption value=resumegtResumeltoptiongt

ltselectgtlttdgt lttrgt

lttrgt lttdgtStatus Formatlttdgtlttdgtltselect

name=adminstatusformat onChange=update_status()gt

ltoption value=gthtmlltoptiongtltoption

value=txtgttxtltoptiongtltoption

value=xmlgtxmlltoptiongtltselectgtlttdgt lttrgt

ltform name=admin method=get

action=httplocalhost13000status

encoding=applicationx-www-formgt

ltinput type=hidden name=password value=gt

lttrgt

lttdgtGolttdgt

ltformgt

lttdgtltinput type=submit value=go name=actiongo

onClick=documentadminsubmit()gtlttdgt

lttrgt

lttablegt

ltbodygt

lthtmlgt

Push Initiator Class

import javanetURL

import javanetHttpURLConnection

import javaio

Class implements a simple push initiator It can be

used to create and send messages to push proxy

gateway (ppg)

public final class PushInitiator

xml version

private final static String XML_VERSION = ltxml

version=10gt

Push Access Protocol (PAP) document type

private final static String PAP_DOCTYPE =

Appendix C

50

ltDOCTYPE pap PUBLIC -WAPFORUMDTD PAP 10EN

httpwwwwapforumorgDTDpap_10dtd gt

content type of the push request multipart body

private final static String CONTENT_TYPE =

multipartrelated boundary=multipart-boundary

type=applicationxml

Service Indication (SI) document type

private static final String SI_DOCTYPE = ltDOCTYPE si

PUBLIC -WAPFORUMDTD SI 10EN +

httpwwwwapforumorgDTDsidtdgt

private static int pushId = 0

PPG url where the pap message is to be sent

private final URL ppgUrl

some push proxy gateways may also require the

authentication of the push initiator

For instance the push initiator may be required to

send an HTTP authorization header in each request

private final String authorization

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

public PushInitiator(URL ppgUrl) thisppgUrl =

ppgUrl

authorization = null

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

param authorization a ltcodegtStringltcodegt value

public PushInitiator(URL ppgUrl String authorization)

thisppgUrl = ppgUrl

Appendix C

51

thisauthorization = authorization

Systemoutprintln(Push Initiator created ppgUrl =

+ ppgUrl)

ltcodegtsendPushMessageltcodegt sends push message to

ppg

param clientAddress a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param message a ltcodegtStringltcodegt value

param mimeType a ltcodegtStringltcodegt value

exception Exception if an error occurs

public void sendPushMessage(String clientAddress

String addressTypeString message String mimeType)

throws Exception

HttpURLConnection http =

(HttpURLConnection)ppgUrlopenConnection()

String ppgServer = ppgUrlgetHost()

httpsetDoInput(true)

httpsetRequestProperty(Content-Type CONTENT_TYPE)

if(authorization = null)

if(authorizationtrim()equals())

httpsetRequestProperty(Authorization

authorization)

httpsetDoOutput(true)

PrintWriter out = new PrintWriter(new

BufferedOutputStream(httpgetOutputStream()))

outprintln(--multipart-boundary)

outprintln(Content-type applicationxml)

outprintln()

outprintln(createPapMessage(clientAddress

addressTypeppgServer genPushId() null))

outprintln()

outprintln(--multipart-boundary)

outprintln(Content-type + mimeType)

outprintln()

outprintln(message)

outprintln()

outprintln(--multipart-boundary--)

outflush()

outclose()

httpconnect()

Appendix C

52

finally read and debug the response received from

PPG

try

debugResponse(http)

catch (Exception e)

Systemerrprintln(Error in receiving the

response)

ltcodegtcreatePapMessageltcodegt creates a Push Access

Protocoltype message

param address a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param ppgServer a ltcodegtStringltcodegt value

param pushId a ltcodegtStringltcodegt value

param notificationTo a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createPapMessage(String address

String addressType String ppgServer String pushId

String notificationTo)

return XML_VERSION + n + PAP_DOCTYPE + n +

ltpap product-name=Mobile Zoo Push

Initiatorgtn +

ltpush-message push-id= + pushId +

(notificationTo = null request-notification-

to= + notificationTo ) + gtn +

ltaddress address-value=WAPPUSH= + address +

TYPE= + addressType +

+ ppgServer + gtn +

ltpush-messagegtnltpapgt

ltcodegtcreateSiMessageltcodegt creates a service

indication type message

param url a ltcodegtStringltcodegt value

param created a ltcodegtStringltcodegt value

param expires a ltcodegtStringltcodegt value

Appendix C

53

param message a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createSiMessage(String url

String sid String created String expires String

action String message)

return XML_VERSION + SI_DOCTYPE +

ltsigtn +

ltindication href= + url + +

(sid = null si-id= + sid + ) +

created = null created= + created +

) +

(action = null action= + action +

) +

(expires = null expires= + expires +

) + gt +

message +

ltindicationgtnltsigt

Debug response

param http a ltcodegtHttpURLConnectionltcodegt value

exception Exception if an error occurs

private void debugResponse(HttpURLConnection http)

throws Exception

Systemoutprintln(httpgetResponseMessage())

String headerName

int i=0

while((headerName = httpgetHeaderFieldKey(i++)) =

null)

Systemoutprintln(headerName + +

httpgetHeaderField(headerName))

Systemoutprintln()

InputStreamReader in = new InputStreamReader(new

BufferedInputStream(httpgetInputStream()))

int c

Appendix C

54

while((c = inread()) = -1)

Systemoutprint((char)c)

Systemoutprintln()

ltcodegtgenPushIdltcodegt generates an unique push id

return a ltcodegtStringltcodegt value

private String genPushId()

pushId = 100000

return SystemcurrentTimeMillis() + + pushId++

55

References

[1] Microsoft ldquoGetting Mobile Using WML and WAP to Display Web Sites on

Mobile Devicesrdquo

URL msdnmicrosoftcomen-uslibraryaa140117(office10)aspx accessed

on April 10 2008

[2] DALE BULBROOK ldquoWAPA Beginnerrsquos Guiderdquo OsborneMcGraw-Hill 2001

[3] WAP Forum Wireless Application Protocol Architecture Specification Access on

Jan 12 2008 Available

httpwww1wapforumorgtechdocumentsWAP-210-WAPArch-2006 07 12-apdf

[4] WAP Forum Push Architectural Overview access on (2008 February 3) Available

httpwww1wapforumorgtechdocumentsWAP-250-PushArchOverview-2007 04

03-apdf

[5] Service indication PDF access on 62008 Available

httpwwww3orgTRhtml401structlinkshtml

[6] WAP Push Technology (openwave) PDF access on (2008 April) Available

URL httpwwwopenwavorg

[7] Web site (httpwwwwapforumorgwhatcopyrighthtm) access on May 2008

[8] ldquoWAP Push Proxy Gateway Specificationrdquo WAP Forum access on 16-August-

2007URI httpwwwwapforumorgPDF

[9] WAP Forum Access on (2008 MAY 31) WAP Service Indication Specification

Available httpwww1wapforumorgtechdocumentsWAP-167-ServiceInd-200507

31-apdf

  • odc_fpwmlandwap_topic3
  • N100E3
  • 21
  • 5

Chapter 2 Basic Concepts

13

phones GPRS is a relatively new technology that implements faster always-on

connections for wireless devices GPRS actually runs on top of IP [7]

As had been learned above WAP is quite similar to web figure 23 provide a brief

comparison between them

WAP

Bearer

WDP Dtatgram

WTLS security

WTP Transaction

WSP Session

WAE

WML and

WMLScript

Web

IP

TCP UDP

TLS-SSL

HTTP

HTML

JavaScript

VBscript

Figure 23 Web vs WAP

Chapter 2 Basic Concepts

14

23 SMS overview

SMS stands for Short Message Service It is a technology that enables the sending and

receiving of messages between mobile phones SMS first appeared in Europe in 1992 It

was included in the GSM (Global System for Mobile Communications) standards right at

the beginning Later it was ported to wireless technologies like CDMA and TDMA The

GSM and SMS standards were originally developed by ETSI ETSI is the abbreviation

for European Telecommunications Standards Institute Now the 3GPP (Third Generation

Partnership Project) is responsible for the development and maintenance of the GSM and

SMS standards [8]

SMS has two operational mode textual mode and binary mode which will allow sending

other data beside pure text

24 Push overview

WAP push provides a standard means to send data to a mobile subscriber without an

explicit request from the subscriber at the time the data is delivered In the normal

clientserver model a client requests a service or information from a server which then

responds by transmitting information to the client This is known as ldquopullrdquo technology

The client pulls information from the server The World Wide Web is the best example of

pull technology where a user enters a URL (the request) which is sent to a server and

the server answers by sending a Web page (the response) to the user (Figure 24 a)

Although WAP push is also based on the clientserver model it provides a means to send

data to the subscriber without an explicit request from the client at the time of delivery

(Figure 24 b)

With push functionality users are able to get information without having to request that

information In many cases it is important for the user to get the information as soon as it

is available Push communications can be used for sending stock quotes traffic reports

and news

Chapter 2 Basic Concepts

15

a) WAP pull model

b) WAP push model

Figure 24 Pull vs Push

24 WAP Push framework

A push operation starts when a server called the push initiator transmits a push messages

to a WAP client Since the push initiator located on the Internet does not use the same

protocol as the WAP client a translating gateway is needed The push initiator contacts

the push proxy gateway via the push access protocol and the Internet protocol The push

proxy gateway translates the information and forwards the pushed content to the WAP

device via the push over the air protocol (figure 25) [9]

Chapter 2 Basic Concepts

16

Push Proxy Gateway

WAP

Client

Push

Access Protocol

Push

over-the air

protocol Push Initiator

Figure 25 the wireless push technology

241 Push Proxy Gateway

The push proxy gateway PPG is the entity that does most of the work in the push

architecture The gateway acts as an access-point for content pushed from the Internet to

the client So the responsibility of the gateway owners to grant access to push proxy

gateway [9]

Besides the actual access-point service the push gateway provides the following services

push initiator identification and authentication

parsing and error detection of content control information

client discovery services

address resolution

binary encoding and compilation of certain content type

protocol conversion

Chapter 2 Basic Concepts

17

Information to the push proxy gateway is sent via the push access protocol PAP The

content of the information is divided into several parts were the first part is information to

the PPG such as recipient information

When the PPG has parsed the control information an acknowledgement is sent to the

push initiator reporting if the service was successful or not

Once the proxy has accepted the content and the push initiator has received the

acknowledgement the proxy is responsible for the transmission to the client The proxy

attempts to find the correct destination device and deliver the content to that client using

the push over the air protocol The contents delivered to the proxy may be translated to

their binary counterpart eg WML documents may be converted to binary XML by the

proxy before the information is transmitted to the client [9]

The proxy must implement a service to enable capability queries from the push initiator

The capability query should be responded with the capabilities of the specified WAP

device The push proxy gateway may also implement broadcasting services where

special addresses may be translated to a broadcast operation [9]

242 Push Access Protocol

The push access protocol PAP is the means by which an Internet-based push initiator

pushes content to a mobile network via the push proxy gateway [9] The push access

protocol is not intended for use over the air

PAP supports the following operations

Push submission

The push message sent from the push initiator to the gateway contains a control

entity a content entity and may contain a capability entity The control entity is

an XML document When the gateway has received the message an XML

response message is sent back to the initiator

Chapter 2 Basic Concepts

18

Result notification

If the push initiator has requested confirmation of successful delivery this XML

message is transmitted from the PPG to the push initiator when the content has

been delivered to the mobile device The push initiator acknowledges this result

message with another XML document

Push cancellation

The purpose of the push cancellation is to allow the push initiator to attempt to

cancel a previously submitted push message Both the cancellation message and

the resulting acknowledgement are sent as XML documents

Status query

The status query operation allows the push initiator to request the current status of

a message that has been previously submitted Both the status query message and

the resulting acknowledgement are sent as XML documents

Client capabilities query

This operation allows the push initiator to query the PPG for the capabilities of a

specific device The query is sent as an XML document and the response is sent

as another XML document

To access the push proxy gateway an address is used The gatewayrsquos underlying

protocols determines which type of address is used eg in HTTP a URL is used To

access a specific device the devicersquos address is included in the XML document

There are two ways to send information to several clients The push initiator can either

send information to several specific addresses or broadcast it to all clients In both cases

only one message is sent to the gateway which either sends the information to some or

all of the clients The clientsrsquo address is depending on the underlying layer [9]

Chapter 2 Basic Concepts

19

243 Push Over-The-Air Protocol

The push proxy gateway and the client communicate using the push over the air protocol

which utilizes WSP session services Pushes can be sent via connection oriented links or

connection-less links Connection-oriented pushes require that an active WSP session is

available but the server can not create a session To solve the case were there is no active

WSP session the push framework introduces a session initiation application in the client

This application listens to session requests from the OTA-server and responds by setting

up a WSP session for push purposes [9]

Push

Over-the air

WSP

Push management

premptive

Push operational

primitives

WSP Servise

Primitives

Figure 26 Push Over-The-Air protocol stack

The push over the air protocol supports two kinds of operations operations to manage the

connection and operations to send actual messages

Push Sends unconfirmed information over a connection-oriented link

Confirmed push Sends confirmed information over a connection-oriented link

Abort push rejects a previously transmitted push operation This is operation is

part of the confirmed push mechanism

Unit push Sends unconfirmed information over a connection-less link

Connect Creates a push session

Chapter 2 Basic Concepts

20

Suspend Request that a push session should be suspended

Resume Request to resumes a previously suspended push session

Disconnect Terminates the push session

Session request Request from the server to initialize a session to a client

244 Service Indication

The service indication SI provides a mechanism composed in an XML message to

notify a client that an external asynchronous event has occurred and indicate a service

that can be loaded in order to react to that event In order to notify the user a message is

sent from the push initiator via the proxy to the client The message will be shown to the

user and there will be a reference to a URI where the appropriate service can be loaded

For example the message could be ldquoYou have new mailrdquo and the URI to your email

service [9]

When the message is received by the client it will be presented to the user The user then

can choose to launch the service in an application eg the WML browser or to postpone

the SI for later handling Postponed SIs will be stored in the client and the user is given

the possibility to act upon them later When the user choose to launch the service the

service is started in the same way as if the user would have started it manually [9]

Messages sent with the service indication can support mechanisms to improve the end-

user-experience

User-intrusiveness levels

To improve the users understanding of the provided service and to affect the users

behavior when the message is delivered it is possible to change the level of user-

intrusiveness

Chapter 2 Basic Concepts

21

Deletion

When a pushed message becomes invalid the service provider can delete the

message in the clients For example an email notification becomes invalid when

the message are read

Replacement

When a pushed message is invalid and updated with a new message the service

provider can replace the origin message with a new one

Handling of out of order delivery

Since the wireless communication is unpredictable it can not be ensured that the

messages are received in the same order as sent This mechanism discards all

messages older than the latest received

Expiration

Some services may only be valid for a certain amount of time when the time has

expired the message is removed from the client

245 Service Loading

The service loading method provides means to convey a URI to a user agent in a mobile

client The method is conveyed in an XML message In difference from the service

indication method the client loads the content of the URI automatically without any

action from the user when the service loading message is received

Thereby the user will experience the content as if it was pushed to the mobile client and

executed In the service loading mechanism there is a reference to a service page that will

automatically be loaded without interaction with the user included For example the client

will automatically start the email service when a message about new mails on the server

is received [9]

Chapter 2 Basic Concepts

22

When the client is busy with some application it is not suitable to execute the referred

content directly upon reception of a message To avoid this client may cache the content

indicated by the URI so it becomes available to the user when the client is ready

Messages sent with the service loading method can support mechanism to improve the

end-user-experience

Control of the level of user interaction

To improve the users understanding of the provided service and the affect the

userrsquos behavior when the message is delivered it is possible to change the level

of user-intrusiveness The service can explicitly specify if the service should be

loaded or not if the client is busy on reception

Pre-emptive content caching

By setting this attribute the service loading can require that the indicated content

is downloaded and cached instead of executed This can be used to improve the

users experience of the services that otherwise would have required content to

be retrieved from an origin

23

Chapter Three

3 System requirements

Several materials and requirements must be incorporated into the design implementation

and testing The following discusses the components necessary to fulfill the project

requirements and environment

31 development environment

There are many development tools to choose from when developing for WAP Push and

hen you combine different environments with different gateways you will get a vast

numbers of choices This large flora of tools makes it difficult to choose a suitable

environment an important issue because a badly chosen one might consume a lot of time

341 Operating system

Kannel (the chosen gateway for the system) is being developed on Linux systems and

should be fairly easy to export to other Unix-like systems Although it should be working

without major problems on Windows (through Cygwin) Solaris and FreeBSD The push

initiator is implemented on java so it is operating system independent

Linux is the logical choice especially when it comes to the world severs and networking

for it promising feature as an open source low cost operating system

342 Programming language

Since system design was planned to be modular to enhance the reuse of its components as

explained above then an object oriented programming language will be a reasonable

choice Another factor is the need for a graphical user interface which imposes using a

programming language with good graphics handling capabilities at the same time it

should be over Linux

Chapter 3 System requirements

24

The best programming language to accomplish the above requirement is found to be java

which has the flowing feature

Cross platform - All clients and servers run the same Java code without any

changes or recompilation This simplifies deployment

Cost effective to develop in Java - The java language has many features that

improve developer productivity promote code reuse and reduce development and

maintenance costs

Works well with Open Source - Java with Linux and the many open source

movement projects and libraries provide a powerful mix that ensures development

is cost-effective efficient and of high quality because extensively tested libraries

components and solutions are available to plug-in to customer development

efforts

343 Nokia Mobile Internet Toolkit 41

To design and implement a WAP application on a Nokia phone the Nokia Internet

Toolkit has to be downloaded and installed on the PC A Nokia simulator is installed as

part of the installation but various phone simulators can be downloaded and installed

This simulator is used for testing purpose Also it has a server simulator based on the

Nokia Active Server if a WAP Gateway is unavailable

32 software requirements

Most of this section has been mentioned in way or other but they will be considered

briefly here

321 Kannel WAP gateway

This is an open source gateway upon which the push proxy gateway of this system will

be built on it available free of charge at kannel project web site

Chapter 3 System requirements

25

322 Linux operating system

It is important to install kannel gateway on it for this project we choose fedora core 7 for

availability reasons

323 JDK16

The java run time environment is required to implement the push initiator

32 hardware requirements

321 PC

Any Personal computer capable of running fedora core 7 with USB interface to be able

connects GSM modem

322 GSM modem

This will act as an alternative to the short message service center SMSC Obviously this

means that GSM network is required too

26

Chapter Four

4 System design

41 System Scenario

The basic scenario of a push session is that a Push Initiator (PI) transmits content to a

WAP client This is done in multiple steps as shown in Figure 31

pushOTAPAP

Gateway

PI

1

2

pull gateway

PPG

3

SMS center

Mobile device

6

5

4

Content provider78 9

Figure 41 WAP push scenario

Chapter 4 System Design

27

The PI communicates with a Push Proxy Gateway (PPG) over the Push Access Protocol

(PAP) (1 and 2) The PPG will then use the Push Over-The-Air Protocol (PushOTA) (3)

to deliver a Uniform Resource Identifier (URI) to the client via a Short Message System

Centre (SMS-C) (4 and 5) The next step for the client is then to activate the URI (6 and

7) and get the content from the server (8 and 9) The mobile device will have to use a

ldquoPull Gatewayrdquo to get the content but it is very likely that this is the same one as the PPG

The same same scenario could be viewed in sequence diagram figure (42)

Push Initiator PPG SMS Center WAP client

Send push message

Send push message response

Send WAP push message

Ack

Send WAP push message

Ack

Message read

Ack

Message read

Ack

Result notification message

Result notification response

Figure 42 WAP push sequence diagram

Chapter 4 System Design

28

43 Modular Design

Conceptually we can envision this push system as consisting of three major components

(presented in the order of the push lifetime)

first there is a Push Initiator Program that reads the generates a notification message and

transmits (pushes) it via a WAP Gateway to the customer phone This message notifies

the user that a service is available if the user accepts will ask the phonersquos browser to pull

the page from our web server via the WAP Gateway

Next there is the Push Proxy Gateway PPG which will receive the push message from

the push initiator and is responsible of doing any needed optimization protocol

compilation and conversion Also it is responsibility of the PPG to find the end user

address and send the push message to the SMS center

Finally there is the SMS center which will do the last delivery of push message to the

intended user if the user were offline the message will be saved for later time until the

WAP client is on

PI PPGSMSC

Figure 43 system modules

Chapter 4 System Design

29

43 Design of system Modules

Following sections of this chapter present a description and design of the system modules

with accompanying graphical representation

431 Push Initiator (PI)

The PI is the first logical component in the WAP Push scenario and therefore the

originator of the push message There are different kinds of PIs One example is an

automated script another one is a semi automated server version written in an applicable

scripting language supporting server side interaction

A push message is sent as an HTTP POST to the Push Proxy Gateway The POST will be

a multipart XML document with the first part being the control entity (Push Access

Protocol) the second part being the content entity (either a Service Indication or a

Service Load) and the third part being the capability entity

HTTP Post

Capability entity

Content entity (SISL)

Control entity (PAP)

Figure 44 architecture of the push message

Chapter 4 System Design

30

4311 Control entity

This part of the push contains the basic information and fields The fields can include

recipient address expiry time bearer type delivery attempt time and a URL to which a

response is to be sent if delivery confirmation is requested by the push initiator

PAP is the protocol used in WAP Push framework for specifying control information and

content that is to be pushed to a client via a Push Proxy Gateway (PPG) A Push Initiator

(PI) triggers push message processing The Push initiator class (Appendix B) of this

design shows how to generate PAP messages

The address of the used PPG should be given as an initialization parameter of the

application (ldquoppg-urlrdquo see Appendix B) This design also provides an implementation

that can be used in a special case when ldquoIPv4 IPv6rdquo type client addressing is applied and

when toolkit is used All other cases including the use of phone numbers (ldquoPLMNrdquo type

address) in sending push messages are considered

The PAP XML contains at the minimum a ltpapgt element a ltpush-messagegt

element and an ltaddressgt element

The important parts of this PAP message are the address value and type The value is

typically a MSISDN and type indicates whether to send to a MSISDN (typical case) or to

an IP Address The TYPE is almost always MSISDN as the Push Initiator (PI) will not

typically have the Mobile Stations IP address - which is generally dynamic

4312 Content entity

This is the actual data that is received by the mobile device The various content types

are Service Indication (SI) Service Load (SL) and Cache Operation (CO) in our project

we will just deal with SI and SL

The SI notifies a client about an external event by inviting the client to interact with it In

other words it informs a client about a service More precisely it sends a message that

Chapter 4 System Design

31

informs the client of a Uniform Resource Identifier (URI) where the client can access the

service

An important attribute of SI is the action attribute it may contain the action to be taken

when the client receives the SI There are two groups that the action attributes can be

divided into

First we have delete and signalmdashnone both of them is used because of their side

effects Ie with delete you take away all SIs with the same si-id as the deletion pushrdquo

including itself and with signal-none you either do nothing or you pay regard to the

info element in that push

The other group consists of signal-low signal-medium and signal-high These

attributes are all used to set the rules for the presentation in the terminal device

o Signal-low

The SI must be postponed without user intervention

o Signal-medium

The SI must be presented as soon as the implementation allows that to be carried out

without disturbing the user (Signal-medium is the value that will be used if none is

specified)

o Signal-high

The SI must be presented as soon as the implementation allows that to be carried out

without disturbing the user or earlier if it seems appropriate (This decision may for

instance be based on user preference settings)

This is the different functionalities supported by the SI we concidered

Expiration

Replacement

Deletion

Chapter 4 System Design

32

Handling of out of order delivery

Handling of information specified in the info element

A PUSH Service Indication (SI) contains at a minimum an ltsigt element and a

ltindicationgt element SL donrsquot differ so much from SI

4313 Capability entity

This entity determines the type of mobile device that is to be served This is determined

by WAP user agent profiling The sender can indicate the hardware vendor and browser

version and type of the intended recipients This capability entity is then matched at the

PPG to see which devices are compatible with the requested capability If there is a

match the content is delivered by the PPG to that specific device

Now a day most devices are compatible with WAP so we donrsquot need to create this entity

more precisely it is optional

After the push has been created in the PI it is up to the system to deliver it to the defined

destination In this system the different responsible entities are the PPG and the SMSC

Both of these two different entities are running on same server but it is only the

configuration of the SMSC that is out of my control since it is run by the operator and is

not controllable in my lab environment

432 Push Proxy Gateway (PPG)

There are various commercial WAP gateways available on the market that are quite

expensive Kannel on the other hand is an open source gateway one doesnrsquot need to pay

for it in addition one can edit the source code himself and construct his own customized

gateway Because Kannel is being developed on Linux systems (RedHat and Debian) it

can be smoothly ported to other UNIX-like operating systems

4321 Kannel gateway architecture

The gateway divides the processing load between the following three hosts

Chapter 4 System Design

33

The bearer box which connects to the SMS (Short Message Service) centers and

or CSD (Circuit Switched Data) routers providing a unified interface to them for

the wapbox The bearer box does this by implementing the WDP (Wireless

Datagram Protocol) layer of the WAP stack

The smsbox implements the rest of the SMS gateway functionality It receives

textual SMS messages from the bearerbox and interprets them as service

requests and responds to them in the appropriate way

The wapbox which hosts the upper layers of the WAP stack Each session and its

transactions are handled by the same wapbox (see figure 35)

1Figure 45 divisions of duties in kannel

4322 Working of the gateway

The bearer box receives UDP (User Datagram Protocol) packets from CSD routers

inspects them to see whether they are WAP packets if so then it will routes them to the

WAP box This simple design allows the bearer box to do a minimum of processing per

smsbox

wapbox

bearerbox

Kannel

SMS center

WAP phone

HTTP server

Chapter 4 System Design

34

packet The bearer box also sends the UDP packets that the other boxes generate which

adds some more routing processing The wapboxes implement the WTP (Wireless

Transaction Protocol) and WSP (Wireless Session Protocol) layers These take HTTP-

like requests from the phones and make the actual HTTP requests to content servers

compress the responses and send them back to the terminals (Sessions are maintained to

make as much use of the limited radio bandwidth as possible)

4323 External interfaces of the gateway

The gateway has interfaces to three external agents

bull SMS centers using various protocols

bull HTTP servers to fetch WAP and SMS content and to push WAP Content The

pull protocol is HTTP push PAP

bull WAP phones implementing the WAP protocol stack and (for push) WAP Push

client

Figure 36 summarize kannel external interfaces

4324 Configuring the gateway

The bearerbox smsbox and wapbox are the main working modules of the gateway and

must be configured before configuring the gateway These three modules are controlled

by a configuration file that has wapbox smsbox and bearerbox groups

Configuring the PPG core group

We use two components the PPG core group and the PPG user group The PPG

core group is used to configure the PI interface(for more details configuration

variables refer to appendix c)

Chapter 4 System Design

35

Mobile telephone

network

The Internet

smsbox

wapbox

bearerbox

Kannel

HTTP

HTTP

HTTP server

Serving WML

files

HTTP server

Serving HTML

files

TCP

TCP

WAPSMS

SMSC

WAP phoneNetwork base station

Workstation used for http

administration

Figure 46 External interfaces of the gateway

4325 Administering the gateway through an HTTP interface

Kannel can be administered via an HTTP interface All commands are given as normal

HTTP queries so they can easily be given from command lines like this one

links -dump httpip-adressportshutdownpassword=yourchoice

But it is advantageous to have graphical user interface for gateway control so we have

designed GUI through http

Chapter 4 System Design

36

433 Short Message Service Centre (SMSC)

A SMSC is an essential component when sending a push message from an IP network to

a mobile device in the architecture supported by the components and devices It is used to

remove the TCPIP layer that the push is encapsulatedrdquo in It is also the entity that

identifies the end-point device When this is done it is also the SMSC that is responsible

for the processing and final message delivery to the device After the process of de-

encapsulation and resolution of the client identity there should not be any difference

between this message and a message that is originated locally from the operator itself

(like a SMS)

In this project we just use a virtual SMS center we try first to get connection to a real

one but our effort was worthless

Finally the following figure depicts the overall flowchart of the WAP push system

(figure 47)

Chapter 4 System Design

37

PI

PPG

Create PAP

HTTP Post

Message

processing

OTA

Connection

oriented

Sessionless Session

oriented

WTP Initiation

WAP clinet

Application

Create content

Create

capability

entity

Database

SMS center

NoYes

Figure 47 the complete flowchart of the system

38

Chapter Five

5 System implementation and results

51 Implementation

511 The Push Proxy Gateway

First of all the Kannel gateway have been compiled and installed using gcc (GNU C

Compiler) this stage go fine except the operating system required more components to

be pre-installed and will configured

Then with stages of configuration to the gateway (Appendix B) it was capable of working

as PPG Figure 51 below show the gateway when it starts

Figure 51 starting kannel gateway

Then a web based user interface had been created to provide an easy way to control the

gateway remotely Figure 52 and figure 53

39

Figure 52 GUI for gateway control

512 The Push initiator

Next the push initiator design had been implemented using java programming language

as in design phase the implementation is taken carefully to make a reusable component

that could be used by other developer

PushInitiator class (Appendix B) implements a simple push initiator which can be used

to create and send messages to a push proxy gateway (PPG)

The method sendPushMessage sends a push message via the PPG to the client The client

is identified by the address which is either the phone number (address type is PLMN) or

IP address The message content and its mime type are also given as arguments to the

method the other tow important method are

createPapMessage This method creates a Push Access Protocol (PAP) type message

40

createSiMessage This method is used to create a service indication (SI) type message

Figure 53 showing running kannel status

513 WAP site

Since this site will be built for testing purpose and making sure that the system is

functional we had not go deep in this section Just simple WAP site with tow page has

been crated

41

52 Service indication

When a SI was pushed to any of the emulator or Nokia phones it was received and

presented in the way it was supposed to as specified in the WAP standard as shown in

figures below This is a proof that the devices claiming to support WAP push do so and

the design is will working See figures 53 through 56

Figure 55 service indication

42

Figure 57 SI details

52 Service load

The emulator correctly receives and interpreted the SL push the same as all of Nokia

phones we have tested

When a SL was pushed to the Ericsson phones it was not presented in the specified way

figure 58 I think that it is because of security reasons The reason for this assumption is

that the phones only supports on or off as security in their push configuration The

emulator on the other hand presents SL correctly Finally the Siemens phone did seem to

interpret SL but the current software was not very consistent It did load the SL without

user interference in the specified way when the user already where having an active

session If the user was offline the phone interface presented a symbol on the display

and did not load the service until the user clicked on the symbol

43

Chapter Six

6 conclusion and future work

In this chapter we will provide the conclusions and proposed future work for interested

individuals

61 Conclusions

In this project a WAP push system has been successfully designed and implemented It

provides a way to partially overcome the limitations encountered when accessing the

World Wide Web using handsets After comparing the proposed project objectives with

those accomplished the main goals are seen to be met

Phones from different manufactures all differ from the WAP-standard in some

ways One of the most obvious differences is the resolution of the display

During the work it has been noticed that the WML pages must be quite small We

have also noticed that the support for tables and some other tags are a bit limited

Even though the WML standard is smaller than the HTML standard it is a little

more complicated to write correct WML pages The main conclusion is that WAP

works pretty well but the phones are a little non-stable

The push proxy gateway is configured and worked probably with virtual SMS

center and it is easy to switch to a real one

The system depends mainly on open sources (ie Linux and kannek)

The design and implementation of the push initiator work well with the kannel

gateway and it should work correctly with other gateways

Chapter 6 Conclusion

44

62 Further Work

The possibilities of wireless push are interesting enough that it has to be worth to know if

the security and conformance problems will be solved in WAP push If they are solved

and the technique is refined then there should be nothing to stop the great number of

services that will follow in its footsteps Therefore there is further work that should be

done and the most interesting parts are in my opinion these

621 Security Aspect

One of the problems today is that the phones supporting push does not have the detailed

security settings that a technique like this needs Therefore it would be interesting to look

into the possibility to add these without confusing the user I suggest furthering looking

into usability aspects of security in WAP Push for short

622 GPS integration possibility

This will provide location dependent delivery of WAP push it will have great

applications in telematic and ecommerce advertising

623 Conformance to Standards

An interesting project would be to examine if the main reason for the nonstandard

solutions in the existing WAP push software is the result of difficulties in

implementation Or if the main reason is that the manufacturers wants to provide

proprietary solutions A reason why one may want to know this is that if the problem is

depending on implementation problems then it might get better

45

Appendix A Abbreviations

CDMA Code Division Multiple Access

CO Cache Operation

DTD Document Type Definition

GSM Global System for Mobile

HTTP Hypertext Transfer Protocol

IP Internet Protocol

MSISDN Mobile Station International Subscriber Directory Number

OTA Over The Air

PAP Push Access Protocol

PushOTA Push Over The Air

PDA Personal Digital Assistant

P1 Push Initiator

PLMN Public Land Mobile Networks

PPG Push Proxy Gateway

SI Service Indication

SIA Session Initiation Application

SIR Session Initiation Request

SL Service Loading

SMPP Short Message Peer to Peer

SMS Short Message System

SMSC Short Message System Center

UCP Universal Computer Protocol

URI Uniform Resource Identifier

URL Uniform Resource Locator

UTC Universal Time Coordinated

WAP Wireless Application Protocol

WBXML WAP binary XML

WDP Wireless Datagram Protocol

WSP Wireless Session Protocol

WTLS Wireless Transport Layer Security

XML Extensible Mark-up Language

46

Appendix B Kannel gateway configurations

THIS IS A SAMPLE CONFIGURATION FOR KANNEL

group = core

admin-port = 13000

admin-password = admin

status-password = admin

admin-deny-ip =

admin-allow-ip = 127001172161455

log-file = tmpkannellog

log-level = 0

http-proxy-host = 172161411

http-proxy-port = 8080

http-proxy-exceptions = 127001

Smsbox related

smsbox-port = 13001

box-deny-ip =

box-allow-ip = 127001

bearerbox-host =localhost

Wapbox related

wapbox-port = 13002

udp-deny-ip =

udp-allow-ip = 127001

bearerbox-host =localhost

SMSC GSM

group = smsc

smsc = at

modemtype = auto

speed =9600

device = devttyS0

SMSC HTTP

group = smsc

smsc = http

system-type = kannel

port = 13016

connect-allow-ip = 127001

Appendix B

47

username = wappush

password = wappush

SMSBOX SETUP

group = smsbox

bearerbox-host = localhost

sendsms-port = 13013

sendsms-chars = 0123456789 +-

log-file = tmpsmsboxlog

log-level = 0

access-log = accesslog

white-list = 127001

black-list =

SEND-SMS USERS

group = sendsms-user

username = wappush

password = wappush

user-deny-ip =

user-allow-ip = 127001

PPG group

group = ppg

ppg-url = wappush

ppg-port = 8080

concurrent-pushes = 100

trusted-pi = true

users = 1024

service-name = ppg

ppg-smsbox-id = dlrbox

WAP PUSH USER

group = wap-push-user

wap-push-user = picom

ppg-username = wappush

ppg-password = wappush

allow-ip = localhost

48

Appendix C Selected Codes

Gateway Control Form

ltDOCTYPE HTML PUBLIC -W3CDTD HTML 32ENgt

lthtmlgt ltheadgt

lttitlegtGateway control formlttitlegt

ltheadgt

ltbody bgcolor=white text=black link=blue vlink=navy

alink=redgt

ltbase target=submitgt

ltscriptgt

function update_status()

if ( adminactionvalue == status )

adminaction = http + adminhostnamevalue +

+ adminportvalue + status +

adminstatusformatvalue

else

adminaction = http + adminhostnamevalue +

+ adminportvalue + + adminactionvalue

adminpasswordvalue = adminpasswordvalue

actiongovalue = GO GET +adminaction

ltscriptgt

lttable align=centergt

lttrgtltp align=centergtlth2gtGateway control

formlth2gtltpgtlttrgt

lttrgt lttdgtHostnamelttdgtlttdgtltinput type=text

name=adminhostname value=localhost

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPortlttdgtlttdgtltinput type=text

name=adminport value=13000

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPasswordlttdgtlttdgtltinput type=password

name=adminpassword value=

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtActionlttdgtlttdgtltselect name=adminaction

onChange=update_status()gt

ltoption value=statusgtStatusltoptiongt

ltoption value=suspendgtSuspendltoptiongt

ltoption value=isolategtIsolateltoptiongt

Appendix C

49

ltoption value=shutdowngtShutdownltoptiongt

ltoption value=resumegtResumeltoptiongt

ltselectgtlttdgt lttrgt

lttrgt lttdgtStatus Formatlttdgtlttdgtltselect

name=adminstatusformat onChange=update_status()gt

ltoption value=gthtmlltoptiongtltoption

value=txtgttxtltoptiongtltoption

value=xmlgtxmlltoptiongtltselectgtlttdgt lttrgt

ltform name=admin method=get

action=httplocalhost13000status

encoding=applicationx-www-formgt

ltinput type=hidden name=password value=gt

lttrgt

lttdgtGolttdgt

ltformgt

lttdgtltinput type=submit value=go name=actiongo

onClick=documentadminsubmit()gtlttdgt

lttrgt

lttablegt

ltbodygt

lthtmlgt

Push Initiator Class

import javanetURL

import javanetHttpURLConnection

import javaio

Class implements a simple push initiator It can be

used to create and send messages to push proxy

gateway (ppg)

public final class PushInitiator

xml version

private final static String XML_VERSION = ltxml

version=10gt

Push Access Protocol (PAP) document type

private final static String PAP_DOCTYPE =

Appendix C

50

ltDOCTYPE pap PUBLIC -WAPFORUMDTD PAP 10EN

httpwwwwapforumorgDTDpap_10dtd gt

content type of the push request multipart body

private final static String CONTENT_TYPE =

multipartrelated boundary=multipart-boundary

type=applicationxml

Service Indication (SI) document type

private static final String SI_DOCTYPE = ltDOCTYPE si

PUBLIC -WAPFORUMDTD SI 10EN +

httpwwwwapforumorgDTDsidtdgt

private static int pushId = 0

PPG url where the pap message is to be sent

private final URL ppgUrl

some push proxy gateways may also require the

authentication of the push initiator

For instance the push initiator may be required to

send an HTTP authorization header in each request

private final String authorization

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

public PushInitiator(URL ppgUrl) thisppgUrl =

ppgUrl

authorization = null

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

param authorization a ltcodegtStringltcodegt value

public PushInitiator(URL ppgUrl String authorization)

thisppgUrl = ppgUrl

Appendix C

51

thisauthorization = authorization

Systemoutprintln(Push Initiator created ppgUrl =

+ ppgUrl)

ltcodegtsendPushMessageltcodegt sends push message to

ppg

param clientAddress a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param message a ltcodegtStringltcodegt value

param mimeType a ltcodegtStringltcodegt value

exception Exception if an error occurs

public void sendPushMessage(String clientAddress

String addressTypeString message String mimeType)

throws Exception

HttpURLConnection http =

(HttpURLConnection)ppgUrlopenConnection()

String ppgServer = ppgUrlgetHost()

httpsetDoInput(true)

httpsetRequestProperty(Content-Type CONTENT_TYPE)

if(authorization = null)

if(authorizationtrim()equals())

httpsetRequestProperty(Authorization

authorization)

httpsetDoOutput(true)

PrintWriter out = new PrintWriter(new

BufferedOutputStream(httpgetOutputStream()))

outprintln(--multipart-boundary)

outprintln(Content-type applicationxml)

outprintln()

outprintln(createPapMessage(clientAddress

addressTypeppgServer genPushId() null))

outprintln()

outprintln(--multipart-boundary)

outprintln(Content-type + mimeType)

outprintln()

outprintln(message)

outprintln()

outprintln(--multipart-boundary--)

outflush()

outclose()

httpconnect()

Appendix C

52

finally read and debug the response received from

PPG

try

debugResponse(http)

catch (Exception e)

Systemerrprintln(Error in receiving the

response)

ltcodegtcreatePapMessageltcodegt creates a Push Access

Protocoltype message

param address a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param ppgServer a ltcodegtStringltcodegt value

param pushId a ltcodegtStringltcodegt value

param notificationTo a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createPapMessage(String address

String addressType String ppgServer String pushId

String notificationTo)

return XML_VERSION + n + PAP_DOCTYPE + n +

ltpap product-name=Mobile Zoo Push

Initiatorgtn +

ltpush-message push-id= + pushId +

(notificationTo = null request-notification-

to= + notificationTo ) + gtn +

ltaddress address-value=WAPPUSH= + address +

TYPE= + addressType +

+ ppgServer + gtn +

ltpush-messagegtnltpapgt

ltcodegtcreateSiMessageltcodegt creates a service

indication type message

param url a ltcodegtStringltcodegt value

param created a ltcodegtStringltcodegt value

param expires a ltcodegtStringltcodegt value

Appendix C

53

param message a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createSiMessage(String url

String sid String created String expires String

action String message)

return XML_VERSION + SI_DOCTYPE +

ltsigtn +

ltindication href= + url + +

(sid = null si-id= + sid + ) +

created = null created= + created +

) +

(action = null action= + action +

) +

(expires = null expires= + expires +

) + gt +

message +

ltindicationgtnltsigt

Debug response

param http a ltcodegtHttpURLConnectionltcodegt value

exception Exception if an error occurs

private void debugResponse(HttpURLConnection http)

throws Exception

Systemoutprintln(httpgetResponseMessage())

String headerName

int i=0

while((headerName = httpgetHeaderFieldKey(i++)) =

null)

Systemoutprintln(headerName + +

httpgetHeaderField(headerName))

Systemoutprintln()

InputStreamReader in = new InputStreamReader(new

BufferedInputStream(httpgetInputStream()))

int c

Appendix C

54

while((c = inread()) = -1)

Systemoutprint((char)c)

Systemoutprintln()

ltcodegtgenPushIdltcodegt generates an unique push id

return a ltcodegtStringltcodegt value

private String genPushId()

pushId = 100000

return SystemcurrentTimeMillis() + + pushId++

55

References

[1] Microsoft ldquoGetting Mobile Using WML and WAP to Display Web Sites on

Mobile Devicesrdquo

URL msdnmicrosoftcomen-uslibraryaa140117(office10)aspx accessed

on April 10 2008

[2] DALE BULBROOK ldquoWAPA Beginnerrsquos Guiderdquo OsborneMcGraw-Hill 2001

[3] WAP Forum Wireless Application Protocol Architecture Specification Access on

Jan 12 2008 Available

httpwww1wapforumorgtechdocumentsWAP-210-WAPArch-2006 07 12-apdf

[4] WAP Forum Push Architectural Overview access on (2008 February 3) Available

httpwww1wapforumorgtechdocumentsWAP-250-PushArchOverview-2007 04

03-apdf

[5] Service indication PDF access on 62008 Available

httpwwww3orgTRhtml401structlinkshtml

[6] WAP Push Technology (openwave) PDF access on (2008 April) Available

URL httpwwwopenwavorg

[7] Web site (httpwwwwapforumorgwhatcopyrighthtm) access on May 2008

[8] ldquoWAP Push Proxy Gateway Specificationrdquo WAP Forum access on 16-August-

2007URI httpwwwwapforumorgPDF

[9] WAP Forum Access on (2008 MAY 31) WAP Service Indication Specification

Available httpwww1wapforumorgtechdocumentsWAP-167-ServiceInd-200507

31-apdf

  • odc_fpwmlandwap_topic3
  • N100E3
  • 21
  • 5

Chapter 2 Basic Concepts

14

23 SMS overview

SMS stands for Short Message Service It is a technology that enables the sending and

receiving of messages between mobile phones SMS first appeared in Europe in 1992 It

was included in the GSM (Global System for Mobile Communications) standards right at

the beginning Later it was ported to wireless technologies like CDMA and TDMA The

GSM and SMS standards were originally developed by ETSI ETSI is the abbreviation

for European Telecommunications Standards Institute Now the 3GPP (Third Generation

Partnership Project) is responsible for the development and maintenance of the GSM and

SMS standards [8]

SMS has two operational mode textual mode and binary mode which will allow sending

other data beside pure text

24 Push overview

WAP push provides a standard means to send data to a mobile subscriber without an

explicit request from the subscriber at the time the data is delivered In the normal

clientserver model a client requests a service or information from a server which then

responds by transmitting information to the client This is known as ldquopullrdquo technology

The client pulls information from the server The World Wide Web is the best example of

pull technology where a user enters a URL (the request) which is sent to a server and

the server answers by sending a Web page (the response) to the user (Figure 24 a)

Although WAP push is also based on the clientserver model it provides a means to send

data to the subscriber without an explicit request from the client at the time of delivery

(Figure 24 b)

With push functionality users are able to get information without having to request that

information In many cases it is important for the user to get the information as soon as it

is available Push communications can be used for sending stock quotes traffic reports

and news

Chapter 2 Basic Concepts

15

a) WAP pull model

b) WAP push model

Figure 24 Pull vs Push

24 WAP Push framework

A push operation starts when a server called the push initiator transmits a push messages

to a WAP client Since the push initiator located on the Internet does not use the same

protocol as the WAP client a translating gateway is needed The push initiator contacts

the push proxy gateway via the push access protocol and the Internet protocol The push

proxy gateway translates the information and forwards the pushed content to the WAP

device via the push over the air protocol (figure 25) [9]

Chapter 2 Basic Concepts

16

Push Proxy Gateway

WAP

Client

Push

Access Protocol

Push

over-the air

protocol Push Initiator

Figure 25 the wireless push technology

241 Push Proxy Gateway

The push proxy gateway PPG is the entity that does most of the work in the push

architecture The gateway acts as an access-point for content pushed from the Internet to

the client So the responsibility of the gateway owners to grant access to push proxy

gateway [9]

Besides the actual access-point service the push gateway provides the following services

push initiator identification and authentication

parsing and error detection of content control information

client discovery services

address resolution

binary encoding and compilation of certain content type

protocol conversion

Chapter 2 Basic Concepts

17

Information to the push proxy gateway is sent via the push access protocol PAP The

content of the information is divided into several parts were the first part is information to

the PPG such as recipient information

When the PPG has parsed the control information an acknowledgement is sent to the

push initiator reporting if the service was successful or not

Once the proxy has accepted the content and the push initiator has received the

acknowledgement the proxy is responsible for the transmission to the client The proxy

attempts to find the correct destination device and deliver the content to that client using

the push over the air protocol The contents delivered to the proxy may be translated to

their binary counterpart eg WML documents may be converted to binary XML by the

proxy before the information is transmitted to the client [9]

The proxy must implement a service to enable capability queries from the push initiator

The capability query should be responded with the capabilities of the specified WAP

device The push proxy gateway may also implement broadcasting services where

special addresses may be translated to a broadcast operation [9]

242 Push Access Protocol

The push access protocol PAP is the means by which an Internet-based push initiator

pushes content to a mobile network via the push proxy gateway [9] The push access

protocol is not intended for use over the air

PAP supports the following operations

Push submission

The push message sent from the push initiator to the gateway contains a control

entity a content entity and may contain a capability entity The control entity is

an XML document When the gateway has received the message an XML

response message is sent back to the initiator

Chapter 2 Basic Concepts

18

Result notification

If the push initiator has requested confirmation of successful delivery this XML

message is transmitted from the PPG to the push initiator when the content has

been delivered to the mobile device The push initiator acknowledges this result

message with another XML document

Push cancellation

The purpose of the push cancellation is to allow the push initiator to attempt to

cancel a previously submitted push message Both the cancellation message and

the resulting acknowledgement are sent as XML documents

Status query

The status query operation allows the push initiator to request the current status of

a message that has been previously submitted Both the status query message and

the resulting acknowledgement are sent as XML documents

Client capabilities query

This operation allows the push initiator to query the PPG for the capabilities of a

specific device The query is sent as an XML document and the response is sent

as another XML document

To access the push proxy gateway an address is used The gatewayrsquos underlying

protocols determines which type of address is used eg in HTTP a URL is used To

access a specific device the devicersquos address is included in the XML document

There are two ways to send information to several clients The push initiator can either

send information to several specific addresses or broadcast it to all clients In both cases

only one message is sent to the gateway which either sends the information to some or

all of the clients The clientsrsquo address is depending on the underlying layer [9]

Chapter 2 Basic Concepts

19

243 Push Over-The-Air Protocol

The push proxy gateway and the client communicate using the push over the air protocol

which utilizes WSP session services Pushes can be sent via connection oriented links or

connection-less links Connection-oriented pushes require that an active WSP session is

available but the server can not create a session To solve the case were there is no active

WSP session the push framework introduces a session initiation application in the client

This application listens to session requests from the OTA-server and responds by setting

up a WSP session for push purposes [9]

Push

Over-the air

WSP

Push management

premptive

Push operational

primitives

WSP Servise

Primitives

Figure 26 Push Over-The-Air protocol stack

The push over the air protocol supports two kinds of operations operations to manage the

connection and operations to send actual messages

Push Sends unconfirmed information over a connection-oriented link

Confirmed push Sends confirmed information over a connection-oriented link

Abort push rejects a previously transmitted push operation This is operation is

part of the confirmed push mechanism

Unit push Sends unconfirmed information over a connection-less link

Connect Creates a push session

Chapter 2 Basic Concepts

20

Suspend Request that a push session should be suspended

Resume Request to resumes a previously suspended push session

Disconnect Terminates the push session

Session request Request from the server to initialize a session to a client

244 Service Indication

The service indication SI provides a mechanism composed in an XML message to

notify a client that an external asynchronous event has occurred and indicate a service

that can be loaded in order to react to that event In order to notify the user a message is

sent from the push initiator via the proxy to the client The message will be shown to the

user and there will be a reference to a URI where the appropriate service can be loaded

For example the message could be ldquoYou have new mailrdquo and the URI to your email

service [9]

When the message is received by the client it will be presented to the user The user then

can choose to launch the service in an application eg the WML browser or to postpone

the SI for later handling Postponed SIs will be stored in the client and the user is given

the possibility to act upon them later When the user choose to launch the service the

service is started in the same way as if the user would have started it manually [9]

Messages sent with the service indication can support mechanisms to improve the end-

user-experience

User-intrusiveness levels

To improve the users understanding of the provided service and to affect the users

behavior when the message is delivered it is possible to change the level of user-

intrusiveness

Chapter 2 Basic Concepts

21

Deletion

When a pushed message becomes invalid the service provider can delete the

message in the clients For example an email notification becomes invalid when

the message are read

Replacement

When a pushed message is invalid and updated with a new message the service

provider can replace the origin message with a new one

Handling of out of order delivery

Since the wireless communication is unpredictable it can not be ensured that the

messages are received in the same order as sent This mechanism discards all

messages older than the latest received

Expiration

Some services may only be valid for a certain amount of time when the time has

expired the message is removed from the client

245 Service Loading

The service loading method provides means to convey a URI to a user agent in a mobile

client The method is conveyed in an XML message In difference from the service

indication method the client loads the content of the URI automatically without any

action from the user when the service loading message is received

Thereby the user will experience the content as if it was pushed to the mobile client and

executed In the service loading mechanism there is a reference to a service page that will

automatically be loaded without interaction with the user included For example the client

will automatically start the email service when a message about new mails on the server

is received [9]

Chapter 2 Basic Concepts

22

When the client is busy with some application it is not suitable to execute the referred

content directly upon reception of a message To avoid this client may cache the content

indicated by the URI so it becomes available to the user when the client is ready

Messages sent with the service loading method can support mechanism to improve the

end-user-experience

Control of the level of user interaction

To improve the users understanding of the provided service and the affect the

userrsquos behavior when the message is delivered it is possible to change the level

of user-intrusiveness The service can explicitly specify if the service should be

loaded or not if the client is busy on reception

Pre-emptive content caching

By setting this attribute the service loading can require that the indicated content

is downloaded and cached instead of executed This can be used to improve the

users experience of the services that otherwise would have required content to

be retrieved from an origin

23

Chapter Three

3 System requirements

Several materials and requirements must be incorporated into the design implementation

and testing The following discusses the components necessary to fulfill the project

requirements and environment

31 development environment

There are many development tools to choose from when developing for WAP Push and

hen you combine different environments with different gateways you will get a vast

numbers of choices This large flora of tools makes it difficult to choose a suitable

environment an important issue because a badly chosen one might consume a lot of time

341 Operating system

Kannel (the chosen gateway for the system) is being developed on Linux systems and

should be fairly easy to export to other Unix-like systems Although it should be working

without major problems on Windows (through Cygwin) Solaris and FreeBSD The push

initiator is implemented on java so it is operating system independent

Linux is the logical choice especially when it comes to the world severs and networking

for it promising feature as an open source low cost operating system

342 Programming language

Since system design was planned to be modular to enhance the reuse of its components as

explained above then an object oriented programming language will be a reasonable

choice Another factor is the need for a graphical user interface which imposes using a

programming language with good graphics handling capabilities at the same time it

should be over Linux

Chapter 3 System requirements

24

The best programming language to accomplish the above requirement is found to be java

which has the flowing feature

Cross platform - All clients and servers run the same Java code without any

changes or recompilation This simplifies deployment

Cost effective to develop in Java - The java language has many features that

improve developer productivity promote code reuse and reduce development and

maintenance costs

Works well with Open Source - Java with Linux and the many open source

movement projects and libraries provide a powerful mix that ensures development

is cost-effective efficient and of high quality because extensively tested libraries

components and solutions are available to plug-in to customer development

efforts

343 Nokia Mobile Internet Toolkit 41

To design and implement a WAP application on a Nokia phone the Nokia Internet

Toolkit has to be downloaded and installed on the PC A Nokia simulator is installed as

part of the installation but various phone simulators can be downloaded and installed

This simulator is used for testing purpose Also it has a server simulator based on the

Nokia Active Server if a WAP Gateway is unavailable

32 software requirements

Most of this section has been mentioned in way or other but they will be considered

briefly here

321 Kannel WAP gateway

This is an open source gateway upon which the push proxy gateway of this system will

be built on it available free of charge at kannel project web site

Chapter 3 System requirements

25

322 Linux operating system

It is important to install kannel gateway on it for this project we choose fedora core 7 for

availability reasons

323 JDK16

The java run time environment is required to implement the push initiator

32 hardware requirements

321 PC

Any Personal computer capable of running fedora core 7 with USB interface to be able

connects GSM modem

322 GSM modem

This will act as an alternative to the short message service center SMSC Obviously this

means that GSM network is required too

26

Chapter Four

4 System design

41 System Scenario

The basic scenario of a push session is that a Push Initiator (PI) transmits content to a

WAP client This is done in multiple steps as shown in Figure 31

pushOTAPAP

Gateway

PI

1

2

pull gateway

PPG

3

SMS center

Mobile device

6

5

4

Content provider78 9

Figure 41 WAP push scenario

Chapter 4 System Design

27

The PI communicates with a Push Proxy Gateway (PPG) over the Push Access Protocol

(PAP) (1 and 2) The PPG will then use the Push Over-The-Air Protocol (PushOTA) (3)

to deliver a Uniform Resource Identifier (URI) to the client via a Short Message System

Centre (SMS-C) (4 and 5) The next step for the client is then to activate the URI (6 and

7) and get the content from the server (8 and 9) The mobile device will have to use a

ldquoPull Gatewayrdquo to get the content but it is very likely that this is the same one as the PPG

The same same scenario could be viewed in sequence diagram figure (42)

Push Initiator PPG SMS Center WAP client

Send push message

Send push message response

Send WAP push message

Ack

Send WAP push message

Ack

Message read

Ack

Message read

Ack

Result notification message

Result notification response

Figure 42 WAP push sequence diagram

Chapter 4 System Design

28

43 Modular Design

Conceptually we can envision this push system as consisting of three major components

(presented in the order of the push lifetime)

first there is a Push Initiator Program that reads the generates a notification message and

transmits (pushes) it via a WAP Gateway to the customer phone This message notifies

the user that a service is available if the user accepts will ask the phonersquos browser to pull

the page from our web server via the WAP Gateway

Next there is the Push Proxy Gateway PPG which will receive the push message from

the push initiator and is responsible of doing any needed optimization protocol

compilation and conversion Also it is responsibility of the PPG to find the end user

address and send the push message to the SMS center

Finally there is the SMS center which will do the last delivery of push message to the

intended user if the user were offline the message will be saved for later time until the

WAP client is on

PI PPGSMSC

Figure 43 system modules

Chapter 4 System Design

29

43 Design of system Modules

Following sections of this chapter present a description and design of the system modules

with accompanying graphical representation

431 Push Initiator (PI)

The PI is the first logical component in the WAP Push scenario and therefore the

originator of the push message There are different kinds of PIs One example is an

automated script another one is a semi automated server version written in an applicable

scripting language supporting server side interaction

A push message is sent as an HTTP POST to the Push Proxy Gateway The POST will be

a multipart XML document with the first part being the control entity (Push Access

Protocol) the second part being the content entity (either a Service Indication or a

Service Load) and the third part being the capability entity

HTTP Post

Capability entity

Content entity (SISL)

Control entity (PAP)

Figure 44 architecture of the push message

Chapter 4 System Design

30

4311 Control entity

This part of the push contains the basic information and fields The fields can include

recipient address expiry time bearer type delivery attempt time and a URL to which a

response is to be sent if delivery confirmation is requested by the push initiator

PAP is the protocol used in WAP Push framework for specifying control information and

content that is to be pushed to a client via a Push Proxy Gateway (PPG) A Push Initiator

(PI) triggers push message processing The Push initiator class (Appendix B) of this

design shows how to generate PAP messages

The address of the used PPG should be given as an initialization parameter of the

application (ldquoppg-urlrdquo see Appendix B) This design also provides an implementation

that can be used in a special case when ldquoIPv4 IPv6rdquo type client addressing is applied and

when toolkit is used All other cases including the use of phone numbers (ldquoPLMNrdquo type

address) in sending push messages are considered

The PAP XML contains at the minimum a ltpapgt element a ltpush-messagegt

element and an ltaddressgt element

The important parts of this PAP message are the address value and type The value is

typically a MSISDN and type indicates whether to send to a MSISDN (typical case) or to

an IP Address The TYPE is almost always MSISDN as the Push Initiator (PI) will not

typically have the Mobile Stations IP address - which is generally dynamic

4312 Content entity

This is the actual data that is received by the mobile device The various content types

are Service Indication (SI) Service Load (SL) and Cache Operation (CO) in our project

we will just deal with SI and SL

The SI notifies a client about an external event by inviting the client to interact with it In

other words it informs a client about a service More precisely it sends a message that

Chapter 4 System Design

31

informs the client of a Uniform Resource Identifier (URI) where the client can access the

service

An important attribute of SI is the action attribute it may contain the action to be taken

when the client receives the SI There are two groups that the action attributes can be

divided into

First we have delete and signalmdashnone both of them is used because of their side

effects Ie with delete you take away all SIs with the same si-id as the deletion pushrdquo

including itself and with signal-none you either do nothing or you pay regard to the

info element in that push

The other group consists of signal-low signal-medium and signal-high These

attributes are all used to set the rules for the presentation in the terminal device

o Signal-low

The SI must be postponed without user intervention

o Signal-medium

The SI must be presented as soon as the implementation allows that to be carried out

without disturbing the user (Signal-medium is the value that will be used if none is

specified)

o Signal-high

The SI must be presented as soon as the implementation allows that to be carried out

without disturbing the user or earlier if it seems appropriate (This decision may for

instance be based on user preference settings)

This is the different functionalities supported by the SI we concidered

Expiration

Replacement

Deletion

Chapter 4 System Design

32

Handling of out of order delivery

Handling of information specified in the info element

A PUSH Service Indication (SI) contains at a minimum an ltsigt element and a

ltindicationgt element SL donrsquot differ so much from SI

4313 Capability entity

This entity determines the type of mobile device that is to be served This is determined

by WAP user agent profiling The sender can indicate the hardware vendor and browser

version and type of the intended recipients This capability entity is then matched at the

PPG to see which devices are compatible with the requested capability If there is a

match the content is delivered by the PPG to that specific device

Now a day most devices are compatible with WAP so we donrsquot need to create this entity

more precisely it is optional

After the push has been created in the PI it is up to the system to deliver it to the defined

destination In this system the different responsible entities are the PPG and the SMSC

Both of these two different entities are running on same server but it is only the

configuration of the SMSC that is out of my control since it is run by the operator and is

not controllable in my lab environment

432 Push Proxy Gateway (PPG)

There are various commercial WAP gateways available on the market that are quite

expensive Kannel on the other hand is an open source gateway one doesnrsquot need to pay

for it in addition one can edit the source code himself and construct his own customized

gateway Because Kannel is being developed on Linux systems (RedHat and Debian) it

can be smoothly ported to other UNIX-like operating systems

4321 Kannel gateway architecture

The gateway divides the processing load between the following three hosts

Chapter 4 System Design

33

The bearer box which connects to the SMS (Short Message Service) centers and

or CSD (Circuit Switched Data) routers providing a unified interface to them for

the wapbox The bearer box does this by implementing the WDP (Wireless

Datagram Protocol) layer of the WAP stack

The smsbox implements the rest of the SMS gateway functionality It receives

textual SMS messages from the bearerbox and interprets them as service

requests and responds to them in the appropriate way

The wapbox which hosts the upper layers of the WAP stack Each session and its

transactions are handled by the same wapbox (see figure 35)

1Figure 45 divisions of duties in kannel

4322 Working of the gateway

The bearer box receives UDP (User Datagram Protocol) packets from CSD routers

inspects them to see whether they are WAP packets if so then it will routes them to the

WAP box This simple design allows the bearer box to do a minimum of processing per

smsbox

wapbox

bearerbox

Kannel

SMS center

WAP phone

HTTP server

Chapter 4 System Design

34

packet The bearer box also sends the UDP packets that the other boxes generate which

adds some more routing processing The wapboxes implement the WTP (Wireless

Transaction Protocol) and WSP (Wireless Session Protocol) layers These take HTTP-

like requests from the phones and make the actual HTTP requests to content servers

compress the responses and send them back to the terminals (Sessions are maintained to

make as much use of the limited radio bandwidth as possible)

4323 External interfaces of the gateway

The gateway has interfaces to three external agents

bull SMS centers using various protocols

bull HTTP servers to fetch WAP and SMS content and to push WAP Content The

pull protocol is HTTP push PAP

bull WAP phones implementing the WAP protocol stack and (for push) WAP Push

client

Figure 36 summarize kannel external interfaces

4324 Configuring the gateway

The bearerbox smsbox and wapbox are the main working modules of the gateway and

must be configured before configuring the gateway These three modules are controlled

by a configuration file that has wapbox smsbox and bearerbox groups

Configuring the PPG core group

We use two components the PPG core group and the PPG user group The PPG

core group is used to configure the PI interface(for more details configuration

variables refer to appendix c)

Chapter 4 System Design

35

Mobile telephone

network

The Internet

smsbox

wapbox

bearerbox

Kannel

HTTP

HTTP

HTTP server

Serving WML

files

HTTP server

Serving HTML

files

TCP

TCP

WAPSMS

SMSC

WAP phoneNetwork base station

Workstation used for http

administration

Figure 46 External interfaces of the gateway

4325 Administering the gateway through an HTTP interface

Kannel can be administered via an HTTP interface All commands are given as normal

HTTP queries so they can easily be given from command lines like this one

links -dump httpip-adressportshutdownpassword=yourchoice

But it is advantageous to have graphical user interface for gateway control so we have

designed GUI through http

Chapter 4 System Design

36

433 Short Message Service Centre (SMSC)

A SMSC is an essential component when sending a push message from an IP network to

a mobile device in the architecture supported by the components and devices It is used to

remove the TCPIP layer that the push is encapsulatedrdquo in It is also the entity that

identifies the end-point device When this is done it is also the SMSC that is responsible

for the processing and final message delivery to the device After the process of de-

encapsulation and resolution of the client identity there should not be any difference

between this message and a message that is originated locally from the operator itself

(like a SMS)

In this project we just use a virtual SMS center we try first to get connection to a real

one but our effort was worthless

Finally the following figure depicts the overall flowchart of the WAP push system

(figure 47)

Chapter 4 System Design

37

PI

PPG

Create PAP

HTTP Post

Message

processing

OTA

Connection

oriented

Sessionless Session

oriented

WTP Initiation

WAP clinet

Application

Create content

Create

capability

entity

Database

SMS center

NoYes

Figure 47 the complete flowchart of the system

38

Chapter Five

5 System implementation and results

51 Implementation

511 The Push Proxy Gateway

First of all the Kannel gateway have been compiled and installed using gcc (GNU C

Compiler) this stage go fine except the operating system required more components to

be pre-installed and will configured

Then with stages of configuration to the gateway (Appendix B) it was capable of working

as PPG Figure 51 below show the gateway when it starts

Figure 51 starting kannel gateway

Then a web based user interface had been created to provide an easy way to control the

gateway remotely Figure 52 and figure 53

39

Figure 52 GUI for gateway control

512 The Push initiator

Next the push initiator design had been implemented using java programming language

as in design phase the implementation is taken carefully to make a reusable component

that could be used by other developer

PushInitiator class (Appendix B) implements a simple push initiator which can be used

to create and send messages to a push proxy gateway (PPG)

The method sendPushMessage sends a push message via the PPG to the client The client

is identified by the address which is either the phone number (address type is PLMN) or

IP address The message content and its mime type are also given as arguments to the

method the other tow important method are

createPapMessage This method creates a Push Access Protocol (PAP) type message

40

createSiMessage This method is used to create a service indication (SI) type message

Figure 53 showing running kannel status

513 WAP site

Since this site will be built for testing purpose and making sure that the system is

functional we had not go deep in this section Just simple WAP site with tow page has

been crated

41

52 Service indication

When a SI was pushed to any of the emulator or Nokia phones it was received and

presented in the way it was supposed to as specified in the WAP standard as shown in

figures below This is a proof that the devices claiming to support WAP push do so and

the design is will working See figures 53 through 56

Figure 55 service indication

42

Figure 57 SI details

52 Service load

The emulator correctly receives and interpreted the SL push the same as all of Nokia

phones we have tested

When a SL was pushed to the Ericsson phones it was not presented in the specified way

figure 58 I think that it is because of security reasons The reason for this assumption is

that the phones only supports on or off as security in their push configuration The

emulator on the other hand presents SL correctly Finally the Siemens phone did seem to

interpret SL but the current software was not very consistent It did load the SL without

user interference in the specified way when the user already where having an active

session If the user was offline the phone interface presented a symbol on the display

and did not load the service until the user clicked on the symbol

43

Chapter Six

6 conclusion and future work

In this chapter we will provide the conclusions and proposed future work for interested

individuals

61 Conclusions

In this project a WAP push system has been successfully designed and implemented It

provides a way to partially overcome the limitations encountered when accessing the

World Wide Web using handsets After comparing the proposed project objectives with

those accomplished the main goals are seen to be met

Phones from different manufactures all differ from the WAP-standard in some

ways One of the most obvious differences is the resolution of the display

During the work it has been noticed that the WML pages must be quite small We

have also noticed that the support for tables and some other tags are a bit limited

Even though the WML standard is smaller than the HTML standard it is a little

more complicated to write correct WML pages The main conclusion is that WAP

works pretty well but the phones are a little non-stable

The push proxy gateway is configured and worked probably with virtual SMS

center and it is easy to switch to a real one

The system depends mainly on open sources (ie Linux and kannek)

The design and implementation of the push initiator work well with the kannel

gateway and it should work correctly with other gateways

Chapter 6 Conclusion

44

62 Further Work

The possibilities of wireless push are interesting enough that it has to be worth to know if

the security and conformance problems will be solved in WAP push If they are solved

and the technique is refined then there should be nothing to stop the great number of

services that will follow in its footsteps Therefore there is further work that should be

done and the most interesting parts are in my opinion these

621 Security Aspect

One of the problems today is that the phones supporting push does not have the detailed

security settings that a technique like this needs Therefore it would be interesting to look

into the possibility to add these without confusing the user I suggest furthering looking

into usability aspects of security in WAP Push for short

622 GPS integration possibility

This will provide location dependent delivery of WAP push it will have great

applications in telematic and ecommerce advertising

623 Conformance to Standards

An interesting project would be to examine if the main reason for the nonstandard

solutions in the existing WAP push software is the result of difficulties in

implementation Or if the main reason is that the manufacturers wants to provide

proprietary solutions A reason why one may want to know this is that if the problem is

depending on implementation problems then it might get better

45

Appendix A Abbreviations

CDMA Code Division Multiple Access

CO Cache Operation

DTD Document Type Definition

GSM Global System for Mobile

HTTP Hypertext Transfer Protocol

IP Internet Protocol

MSISDN Mobile Station International Subscriber Directory Number

OTA Over The Air

PAP Push Access Protocol

PushOTA Push Over The Air

PDA Personal Digital Assistant

P1 Push Initiator

PLMN Public Land Mobile Networks

PPG Push Proxy Gateway

SI Service Indication

SIA Session Initiation Application

SIR Session Initiation Request

SL Service Loading

SMPP Short Message Peer to Peer

SMS Short Message System

SMSC Short Message System Center

UCP Universal Computer Protocol

URI Uniform Resource Identifier

URL Uniform Resource Locator

UTC Universal Time Coordinated

WAP Wireless Application Protocol

WBXML WAP binary XML

WDP Wireless Datagram Protocol

WSP Wireless Session Protocol

WTLS Wireless Transport Layer Security

XML Extensible Mark-up Language

46

Appendix B Kannel gateway configurations

THIS IS A SAMPLE CONFIGURATION FOR KANNEL

group = core

admin-port = 13000

admin-password = admin

status-password = admin

admin-deny-ip =

admin-allow-ip = 127001172161455

log-file = tmpkannellog

log-level = 0

http-proxy-host = 172161411

http-proxy-port = 8080

http-proxy-exceptions = 127001

Smsbox related

smsbox-port = 13001

box-deny-ip =

box-allow-ip = 127001

bearerbox-host =localhost

Wapbox related

wapbox-port = 13002

udp-deny-ip =

udp-allow-ip = 127001

bearerbox-host =localhost

SMSC GSM

group = smsc

smsc = at

modemtype = auto

speed =9600

device = devttyS0

SMSC HTTP

group = smsc

smsc = http

system-type = kannel

port = 13016

connect-allow-ip = 127001

Appendix B

47

username = wappush

password = wappush

SMSBOX SETUP

group = smsbox

bearerbox-host = localhost

sendsms-port = 13013

sendsms-chars = 0123456789 +-

log-file = tmpsmsboxlog

log-level = 0

access-log = accesslog

white-list = 127001

black-list =

SEND-SMS USERS

group = sendsms-user

username = wappush

password = wappush

user-deny-ip =

user-allow-ip = 127001

PPG group

group = ppg

ppg-url = wappush

ppg-port = 8080

concurrent-pushes = 100

trusted-pi = true

users = 1024

service-name = ppg

ppg-smsbox-id = dlrbox

WAP PUSH USER

group = wap-push-user

wap-push-user = picom

ppg-username = wappush

ppg-password = wappush

allow-ip = localhost

48

Appendix C Selected Codes

Gateway Control Form

ltDOCTYPE HTML PUBLIC -W3CDTD HTML 32ENgt

lthtmlgt ltheadgt

lttitlegtGateway control formlttitlegt

ltheadgt

ltbody bgcolor=white text=black link=blue vlink=navy

alink=redgt

ltbase target=submitgt

ltscriptgt

function update_status()

if ( adminactionvalue == status )

adminaction = http + adminhostnamevalue +

+ adminportvalue + status +

adminstatusformatvalue

else

adminaction = http + adminhostnamevalue +

+ adminportvalue + + adminactionvalue

adminpasswordvalue = adminpasswordvalue

actiongovalue = GO GET +adminaction

ltscriptgt

lttable align=centergt

lttrgtltp align=centergtlth2gtGateway control

formlth2gtltpgtlttrgt

lttrgt lttdgtHostnamelttdgtlttdgtltinput type=text

name=adminhostname value=localhost

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPortlttdgtlttdgtltinput type=text

name=adminport value=13000

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPasswordlttdgtlttdgtltinput type=password

name=adminpassword value=

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtActionlttdgtlttdgtltselect name=adminaction

onChange=update_status()gt

ltoption value=statusgtStatusltoptiongt

ltoption value=suspendgtSuspendltoptiongt

ltoption value=isolategtIsolateltoptiongt

Appendix C

49

ltoption value=shutdowngtShutdownltoptiongt

ltoption value=resumegtResumeltoptiongt

ltselectgtlttdgt lttrgt

lttrgt lttdgtStatus Formatlttdgtlttdgtltselect

name=adminstatusformat onChange=update_status()gt

ltoption value=gthtmlltoptiongtltoption

value=txtgttxtltoptiongtltoption

value=xmlgtxmlltoptiongtltselectgtlttdgt lttrgt

ltform name=admin method=get

action=httplocalhost13000status

encoding=applicationx-www-formgt

ltinput type=hidden name=password value=gt

lttrgt

lttdgtGolttdgt

ltformgt

lttdgtltinput type=submit value=go name=actiongo

onClick=documentadminsubmit()gtlttdgt

lttrgt

lttablegt

ltbodygt

lthtmlgt

Push Initiator Class

import javanetURL

import javanetHttpURLConnection

import javaio

Class implements a simple push initiator It can be

used to create and send messages to push proxy

gateway (ppg)

public final class PushInitiator

xml version

private final static String XML_VERSION = ltxml

version=10gt

Push Access Protocol (PAP) document type

private final static String PAP_DOCTYPE =

Appendix C

50

ltDOCTYPE pap PUBLIC -WAPFORUMDTD PAP 10EN

httpwwwwapforumorgDTDpap_10dtd gt

content type of the push request multipart body

private final static String CONTENT_TYPE =

multipartrelated boundary=multipart-boundary

type=applicationxml

Service Indication (SI) document type

private static final String SI_DOCTYPE = ltDOCTYPE si

PUBLIC -WAPFORUMDTD SI 10EN +

httpwwwwapforumorgDTDsidtdgt

private static int pushId = 0

PPG url where the pap message is to be sent

private final URL ppgUrl

some push proxy gateways may also require the

authentication of the push initiator

For instance the push initiator may be required to

send an HTTP authorization header in each request

private final String authorization

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

public PushInitiator(URL ppgUrl) thisppgUrl =

ppgUrl

authorization = null

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

param authorization a ltcodegtStringltcodegt value

public PushInitiator(URL ppgUrl String authorization)

thisppgUrl = ppgUrl

Appendix C

51

thisauthorization = authorization

Systemoutprintln(Push Initiator created ppgUrl =

+ ppgUrl)

ltcodegtsendPushMessageltcodegt sends push message to

ppg

param clientAddress a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param message a ltcodegtStringltcodegt value

param mimeType a ltcodegtStringltcodegt value

exception Exception if an error occurs

public void sendPushMessage(String clientAddress

String addressTypeString message String mimeType)

throws Exception

HttpURLConnection http =

(HttpURLConnection)ppgUrlopenConnection()

String ppgServer = ppgUrlgetHost()

httpsetDoInput(true)

httpsetRequestProperty(Content-Type CONTENT_TYPE)

if(authorization = null)

if(authorizationtrim()equals())

httpsetRequestProperty(Authorization

authorization)

httpsetDoOutput(true)

PrintWriter out = new PrintWriter(new

BufferedOutputStream(httpgetOutputStream()))

outprintln(--multipart-boundary)

outprintln(Content-type applicationxml)

outprintln()

outprintln(createPapMessage(clientAddress

addressTypeppgServer genPushId() null))

outprintln()

outprintln(--multipart-boundary)

outprintln(Content-type + mimeType)

outprintln()

outprintln(message)

outprintln()

outprintln(--multipart-boundary--)

outflush()

outclose()

httpconnect()

Appendix C

52

finally read and debug the response received from

PPG

try

debugResponse(http)

catch (Exception e)

Systemerrprintln(Error in receiving the

response)

ltcodegtcreatePapMessageltcodegt creates a Push Access

Protocoltype message

param address a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param ppgServer a ltcodegtStringltcodegt value

param pushId a ltcodegtStringltcodegt value

param notificationTo a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createPapMessage(String address

String addressType String ppgServer String pushId

String notificationTo)

return XML_VERSION + n + PAP_DOCTYPE + n +

ltpap product-name=Mobile Zoo Push

Initiatorgtn +

ltpush-message push-id= + pushId +

(notificationTo = null request-notification-

to= + notificationTo ) + gtn +

ltaddress address-value=WAPPUSH= + address +

TYPE= + addressType +

+ ppgServer + gtn +

ltpush-messagegtnltpapgt

ltcodegtcreateSiMessageltcodegt creates a service

indication type message

param url a ltcodegtStringltcodegt value

param created a ltcodegtStringltcodegt value

param expires a ltcodegtStringltcodegt value

Appendix C

53

param message a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createSiMessage(String url

String sid String created String expires String

action String message)

return XML_VERSION + SI_DOCTYPE +

ltsigtn +

ltindication href= + url + +

(sid = null si-id= + sid + ) +

created = null created= + created +

) +

(action = null action= + action +

) +

(expires = null expires= + expires +

) + gt +

message +

ltindicationgtnltsigt

Debug response

param http a ltcodegtHttpURLConnectionltcodegt value

exception Exception if an error occurs

private void debugResponse(HttpURLConnection http)

throws Exception

Systemoutprintln(httpgetResponseMessage())

String headerName

int i=0

while((headerName = httpgetHeaderFieldKey(i++)) =

null)

Systemoutprintln(headerName + +

httpgetHeaderField(headerName))

Systemoutprintln()

InputStreamReader in = new InputStreamReader(new

BufferedInputStream(httpgetInputStream()))

int c

Appendix C

54

while((c = inread()) = -1)

Systemoutprint((char)c)

Systemoutprintln()

ltcodegtgenPushIdltcodegt generates an unique push id

return a ltcodegtStringltcodegt value

private String genPushId()

pushId = 100000

return SystemcurrentTimeMillis() + + pushId++

55

References

[1] Microsoft ldquoGetting Mobile Using WML and WAP to Display Web Sites on

Mobile Devicesrdquo

URL msdnmicrosoftcomen-uslibraryaa140117(office10)aspx accessed

on April 10 2008

[2] DALE BULBROOK ldquoWAPA Beginnerrsquos Guiderdquo OsborneMcGraw-Hill 2001

[3] WAP Forum Wireless Application Protocol Architecture Specification Access on

Jan 12 2008 Available

httpwww1wapforumorgtechdocumentsWAP-210-WAPArch-2006 07 12-apdf

[4] WAP Forum Push Architectural Overview access on (2008 February 3) Available

httpwww1wapforumorgtechdocumentsWAP-250-PushArchOverview-2007 04

03-apdf

[5] Service indication PDF access on 62008 Available

httpwwww3orgTRhtml401structlinkshtml

[6] WAP Push Technology (openwave) PDF access on (2008 April) Available

URL httpwwwopenwavorg

[7] Web site (httpwwwwapforumorgwhatcopyrighthtm) access on May 2008

[8] ldquoWAP Push Proxy Gateway Specificationrdquo WAP Forum access on 16-August-

2007URI httpwwwwapforumorgPDF

[9] WAP Forum Access on (2008 MAY 31) WAP Service Indication Specification

Available httpwww1wapforumorgtechdocumentsWAP-167-ServiceInd-200507

31-apdf

  • odc_fpwmlandwap_topic3
  • N100E3
  • 21
  • 5

Chapter 2 Basic Concepts

15

a) WAP pull model

b) WAP push model

Figure 24 Pull vs Push

24 WAP Push framework

A push operation starts when a server called the push initiator transmits a push messages

to a WAP client Since the push initiator located on the Internet does not use the same

protocol as the WAP client a translating gateway is needed The push initiator contacts

the push proxy gateway via the push access protocol and the Internet protocol The push

proxy gateway translates the information and forwards the pushed content to the WAP

device via the push over the air protocol (figure 25) [9]

Chapter 2 Basic Concepts

16

Push Proxy Gateway

WAP

Client

Push

Access Protocol

Push

over-the air

protocol Push Initiator

Figure 25 the wireless push technology

241 Push Proxy Gateway

The push proxy gateway PPG is the entity that does most of the work in the push

architecture The gateway acts as an access-point for content pushed from the Internet to

the client So the responsibility of the gateway owners to grant access to push proxy

gateway [9]

Besides the actual access-point service the push gateway provides the following services

push initiator identification and authentication

parsing and error detection of content control information

client discovery services

address resolution

binary encoding and compilation of certain content type

protocol conversion

Chapter 2 Basic Concepts

17

Information to the push proxy gateway is sent via the push access protocol PAP The

content of the information is divided into several parts were the first part is information to

the PPG such as recipient information

When the PPG has parsed the control information an acknowledgement is sent to the

push initiator reporting if the service was successful or not

Once the proxy has accepted the content and the push initiator has received the

acknowledgement the proxy is responsible for the transmission to the client The proxy

attempts to find the correct destination device and deliver the content to that client using

the push over the air protocol The contents delivered to the proxy may be translated to

their binary counterpart eg WML documents may be converted to binary XML by the

proxy before the information is transmitted to the client [9]

The proxy must implement a service to enable capability queries from the push initiator

The capability query should be responded with the capabilities of the specified WAP

device The push proxy gateway may also implement broadcasting services where

special addresses may be translated to a broadcast operation [9]

242 Push Access Protocol

The push access protocol PAP is the means by which an Internet-based push initiator

pushes content to a mobile network via the push proxy gateway [9] The push access

protocol is not intended for use over the air

PAP supports the following operations

Push submission

The push message sent from the push initiator to the gateway contains a control

entity a content entity and may contain a capability entity The control entity is

an XML document When the gateway has received the message an XML

response message is sent back to the initiator

Chapter 2 Basic Concepts

18

Result notification

If the push initiator has requested confirmation of successful delivery this XML

message is transmitted from the PPG to the push initiator when the content has

been delivered to the mobile device The push initiator acknowledges this result

message with another XML document

Push cancellation

The purpose of the push cancellation is to allow the push initiator to attempt to

cancel a previously submitted push message Both the cancellation message and

the resulting acknowledgement are sent as XML documents

Status query

The status query operation allows the push initiator to request the current status of

a message that has been previously submitted Both the status query message and

the resulting acknowledgement are sent as XML documents

Client capabilities query

This operation allows the push initiator to query the PPG for the capabilities of a

specific device The query is sent as an XML document and the response is sent

as another XML document

To access the push proxy gateway an address is used The gatewayrsquos underlying

protocols determines which type of address is used eg in HTTP a URL is used To

access a specific device the devicersquos address is included in the XML document

There are two ways to send information to several clients The push initiator can either

send information to several specific addresses or broadcast it to all clients In both cases

only one message is sent to the gateway which either sends the information to some or

all of the clients The clientsrsquo address is depending on the underlying layer [9]

Chapter 2 Basic Concepts

19

243 Push Over-The-Air Protocol

The push proxy gateway and the client communicate using the push over the air protocol

which utilizes WSP session services Pushes can be sent via connection oriented links or

connection-less links Connection-oriented pushes require that an active WSP session is

available but the server can not create a session To solve the case were there is no active

WSP session the push framework introduces a session initiation application in the client

This application listens to session requests from the OTA-server and responds by setting

up a WSP session for push purposes [9]

Push

Over-the air

WSP

Push management

premptive

Push operational

primitives

WSP Servise

Primitives

Figure 26 Push Over-The-Air protocol stack

The push over the air protocol supports two kinds of operations operations to manage the

connection and operations to send actual messages

Push Sends unconfirmed information over a connection-oriented link

Confirmed push Sends confirmed information over a connection-oriented link

Abort push rejects a previously transmitted push operation This is operation is

part of the confirmed push mechanism

Unit push Sends unconfirmed information over a connection-less link

Connect Creates a push session

Chapter 2 Basic Concepts

20

Suspend Request that a push session should be suspended

Resume Request to resumes a previously suspended push session

Disconnect Terminates the push session

Session request Request from the server to initialize a session to a client

244 Service Indication

The service indication SI provides a mechanism composed in an XML message to

notify a client that an external asynchronous event has occurred and indicate a service

that can be loaded in order to react to that event In order to notify the user a message is

sent from the push initiator via the proxy to the client The message will be shown to the

user and there will be a reference to a URI where the appropriate service can be loaded

For example the message could be ldquoYou have new mailrdquo and the URI to your email

service [9]

When the message is received by the client it will be presented to the user The user then

can choose to launch the service in an application eg the WML browser or to postpone

the SI for later handling Postponed SIs will be stored in the client and the user is given

the possibility to act upon them later When the user choose to launch the service the

service is started in the same way as if the user would have started it manually [9]

Messages sent with the service indication can support mechanisms to improve the end-

user-experience

User-intrusiveness levels

To improve the users understanding of the provided service and to affect the users

behavior when the message is delivered it is possible to change the level of user-

intrusiveness

Chapter 2 Basic Concepts

21

Deletion

When a pushed message becomes invalid the service provider can delete the

message in the clients For example an email notification becomes invalid when

the message are read

Replacement

When a pushed message is invalid and updated with a new message the service

provider can replace the origin message with a new one

Handling of out of order delivery

Since the wireless communication is unpredictable it can not be ensured that the

messages are received in the same order as sent This mechanism discards all

messages older than the latest received

Expiration

Some services may only be valid for a certain amount of time when the time has

expired the message is removed from the client

245 Service Loading

The service loading method provides means to convey a URI to a user agent in a mobile

client The method is conveyed in an XML message In difference from the service

indication method the client loads the content of the URI automatically without any

action from the user when the service loading message is received

Thereby the user will experience the content as if it was pushed to the mobile client and

executed In the service loading mechanism there is a reference to a service page that will

automatically be loaded without interaction with the user included For example the client

will automatically start the email service when a message about new mails on the server

is received [9]

Chapter 2 Basic Concepts

22

When the client is busy with some application it is not suitable to execute the referred

content directly upon reception of a message To avoid this client may cache the content

indicated by the URI so it becomes available to the user when the client is ready

Messages sent with the service loading method can support mechanism to improve the

end-user-experience

Control of the level of user interaction

To improve the users understanding of the provided service and the affect the

userrsquos behavior when the message is delivered it is possible to change the level

of user-intrusiveness The service can explicitly specify if the service should be

loaded or not if the client is busy on reception

Pre-emptive content caching

By setting this attribute the service loading can require that the indicated content

is downloaded and cached instead of executed This can be used to improve the

users experience of the services that otherwise would have required content to

be retrieved from an origin

23

Chapter Three

3 System requirements

Several materials and requirements must be incorporated into the design implementation

and testing The following discusses the components necessary to fulfill the project

requirements and environment

31 development environment

There are many development tools to choose from when developing for WAP Push and

hen you combine different environments with different gateways you will get a vast

numbers of choices This large flora of tools makes it difficult to choose a suitable

environment an important issue because a badly chosen one might consume a lot of time

341 Operating system

Kannel (the chosen gateway for the system) is being developed on Linux systems and

should be fairly easy to export to other Unix-like systems Although it should be working

without major problems on Windows (through Cygwin) Solaris and FreeBSD The push

initiator is implemented on java so it is operating system independent

Linux is the logical choice especially when it comes to the world severs and networking

for it promising feature as an open source low cost operating system

342 Programming language

Since system design was planned to be modular to enhance the reuse of its components as

explained above then an object oriented programming language will be a reasonable

choice Another factor is the need for a graphical user interface which imposes using a

programming language with good graphics handling capabilities at the same time it

should be over Linux

Chapter 3 System requirements

24

The best programming language to accomplish the above requirement is found to be java

which has the flowing feature

Cross platform - All clients and servers run the same Java code without any

changes or recompilation This simplifies deployment

Cost effective to develop in Java - The java language has many features that

improve developer productivity promote code reuse and reduce development and

maintenance costs

Works well with Open Source - Java with Linux and the many open source

movement projects and libraries provide a powerful mix that ensures development

is cost-effective efficient and of high quality because extensively tested libraries

components and solutions are available to plug-in to customer development

efforts

343 Nokia Mobile Internet Toolkit 41

To design and implement a WAP application on a Nokia phone the Nokia Internet

Toolkit has to be downloaded and installed on the PC A Nokia simulator is installed as

part of the installation but various phone simulators can be downloaded and installed

This simulator is used for testing purpose Also it has a server simulator based on the

Nokia Active Server if a WAP Gateway is unavailable

32 software requirements

Most of this section has been mentioned in way or other but they will be considered

briefly here

321 Kannel WAP gateway

This is an open source gateway upon which the push proxy gateway of this system will

be built on it available free of charge at kannel project web site

Chapter 3 System requirements

25

322 Linux operating system

It is important to install kannel gateway on it for this project we choose fedora core 7 for

availability reasons

323 JDK16

The java run time environment is required to implement the push initiator

32 hardware requirements

321 PC

Any Personal computer capable of running fedora core 7 with USB interface to be able

connects GSM modem

322 GSM modem

This will act as an alternative to the short message service center SMSC Obviously this

means that GSM network is required too

26

Chapter Four

4 System design

41 System Scenario

The basic scenario of a push session is that a Push Initiator (PI) transmits content to a

WAP client This is done in multiple steps as shown in Figure 31

pushOTAPAP

Gateway

PI

1

2

pull gateway

PPG

3

SMS center

Mobile device

6

5

4

Content provider78 9

Figure 41 WAP push scenario

Chapter 4 System Design

27

The PI communicates with a Push Proxy Gateway (PPG) over the Push Access Protocol

(PAP) (1 and 2) The PPG will then use the Push Over-The-Air Protocol (PushOTA) (3)

to deliver a Uniform Resource Identifier (URI) to the client via a Short Message System

Centre (SMS-C) (4 and 5) The next step for the client is then to activate the URI (6 and

7) and get the content from the server (8 and 9) The mobile device will have to use a

ldquoPull Gatewayrdquo to get the content but it is very likely that this is the same one as the PPG

The same same scenario could be viewed in sequence diagram figure (42)

Push Initiator PPG SMS Center WAP client

Send push message

Send push message response

Send WAP push message

Ack

Send WAP push message

Ack

Message read

Ack

Message read

Ack

Result notification message

Result notification response

Figure 42 WAP push sequence diagram

Chapter 4 System Design

28

43 Modular Design

Conceptually we can envision this push system as consisting of three major components

(presented in the order of the push lifetime)

first there is a Push Initiator Program that reads the generates a notification message and

transmits (pushes) it via a WAP Gateway to the customer phone This message notifies

the user that a service is available if the user accepts will ask the phonersquos browser to pull

the page from our web server via the WAP Gateway

Next there is the Push Proxy Gateway PPG which will receive the push message from

the push initiator and is responsible of doing any needed optimization protocol

compilation and conversion Also it is responsibility of the PPG to find the end user

address and send the push message to the SMS center

Finally there is the SMS center which will do the last delivery of push message to the

intended user if the user were offline the message will be saved for later time until the

WAP client is on

PI PPGSMSC

Figure 43 system modules

Chapter 4 System Design

29

43 Design of system Modules

Following sections of this chapter present a description and design of the system modules

with accompanying graphical representation

431 Push Initiator (PI)

The PI is the first logical component in the WAP Push scenario and therefore the

originator of the push message There are different kinds of PIs One example is an

automated script another one is a semi automated server version written in an applicable

scripting language supporting server side interaction

A push message is sent as an HTTP POST to the Push Proxy Gateway The POST will be

a multipart XML document with the first part being the control entity (Push Access

Protocol) the second part being the content entity (either a Service Indication or a

Service Load) and the third part being the capability entity

HTTP Post

Capability entity

Content entity (SISL)

Control entity (PAP)

Figure 44 architecture of the push message

Chapter 4 System Design

30

4311 Control entity

This part of the push contains the basic information and fields The fields can include

recipient address expiry time bearer type delivery attempt time and a URL to which a

response is to be sent if delivery confirmation is requested by the push initiator

PAP is the protocol used in WAP Push framework for specifying control information and

content that is to be pushed to a client via a Push Proxy Gateway (PPG) A Push Initiator

(PI) triggers push message processing The Push initiator class (Appendix B) of this

design shows how to generate PAP messages

The address of the used PPG should be given as an initialization parameter of the

application (ldquoppg-urlrdquo see Appendix B) This design also provides an implementation

that can be used in a special case when ldquoIPv4 IPv6rdquo type client addressing is applied and

when toolkit is used All other cases including the use of phone numbers (ldquoPLMNrdquo type

address) in sending push messages are considered

The PAP XML contains at the minimum a ltpapgt element a ltpush-messagegt

element and an ltaddressgt element

The important parts of this PAP message are the address value and type The value is

typically a MSISDN and type indicates whether to send to a MSISDN (typical case) or to

an IP Address The TYPE is almost always MSISDN as the Push Initiator (PI) will not

typically have the Mobile Stations IP address - which is generally dynamic

4312 Content entity

This is the actual data that is received by the mobile device The various content types

are Service Indication (SI) Service Load (SL) and Cache Operation (CO) in our project

we will just deal with SI and SL

The SI notifies a client about an external event by inviting the client to interact with it In

other words it informs a client about a service More precisely it sends a message that

Chapter 4 System Design

31

informs the client of a Uniform Resource Identifier (URI) where the client can access the

service

An important attribute of SI is the action attribute it may contain the action to be taken

when the client receives the SI There are two groups that the action attributes can be

divided into

First we have delete and signalmdashnone both of them is used because of their side

effects Ie with delete you take away all SIs with the same si-id as the deletion pushrdquo

including itself and with signal-none you either do nothing or you pay regard to the

info element in that push

The other group consists of signal-low signal-medium and signal-high These

attributes are all used to set the rules for the presentation in the terminal device

o Signal-low

The SI must be postponed without user intervention

o Signal-medium

The SI must be presented as soon as the implementation allows that to be carried out

without disturbing the user (Signal-medium is the value that will be used if none is

specified)

o Signal-high

The SI must be presented as soon as the implementation allows that to be carried out

without disturbing the user or earlier if it seems appropriate (This decision may for

instance be based on user preference settings)

This is the different functionalities supported by the SI we concidered

Expiration

Replacement

Deletion

Chapter 4 System Design

32

Handling of out of order delivery

Handling of information specified in the info element

A PUSH Service Indication (SI) contains at a minimum an ltsigt element and a

ltindicationgt element SL donrsquot differ so much from SI

4313 Capability entity

This entity determines the type of mobile device that is to be served This is determined

by WAP user agent profiling The sender can indicate the hardware vendor and browser

version and type of the intended recipients This capability entity is then matched at the

PPG to see which devices are compatible with the requested capability If there is a

match the content is delivered by the PPG to that specific device

Now a day most devices are compatible with WAP so we donrsquot need to create this entity

more precisely it is optional

After the push has been created in the PI it is up to the system to deliver it to the defined

destination In this system the different responsible entities are the PPG and the SMSC

Both of these two different entities are running on same server but it is only the

configuration of the SMSC that is out of my control since it is run by the operator and is

not controllable in my lab environment

432 Push Proxy Gateway (PPG)

There are various commercial WAP gateways available on the market that are quite

expensive Kannel on the other hand is an open source gateway one doesnrsquot need to pay

for it in addition one can edit the source code himself and construct his own customized

gateway Because Kannel is being developed on Linux systems (RedHat and Debian) it

can be smoothly ported to other UNIX-like operating systems

4321 Kannel gateway architecture

The gateway divides the processing load between the following three hosts

Chapter 4 System Design

33

The bearer box which connects to the SMS (Short Message Service) centers and

or CSD (Circuit Switched Data) routers providing a unified interface to them for

the wapbox The bearer box does this by implementing the WDP (Wireless

Datagram Protocol) layer of the WAP stack

The smsbox implements the rest of the SMS gateway functionality It receives

textual SMS messages from the bearerbox and interprets them as service

requests and responds to them in the appropriate way

The wapbox which hosts the upper layers of the WAP stack Each session and its

transactions are handled by the same wapbox (see figure 35)

1Figure 45 divisions of duties in kannel

4322 Working of the gateway

The bearer box receives UDP (User Datagram Protocol) packets from CSD routers

inspects them to see whether they are WAP packets if so then it will routes them to the

WAP box This simple design allows the bearer box to do a minimum of processing per

smsbox

wapbox

bearerbox

Kannel

SMS center

WAP phone

HTTP server

Chapter 4 System Design

34

packet The bearer box also sends the UDP packets that the other boxes generate which

adds some more routing processing The wapboxes implement the WTP (Wireless

Transaction Protocol) and WSP (Wireless Session Protocol) layers These take HTTP-

like requests from the phones and make the actual HTTP requests to content servers

compress the responses and send them back to the terminals (Sessions are maintained to

make as much use of the limited radio bandwidth as possible)

4323 External interfaces of the gateway

The gateway has interfaces to three external agents

bull SMS centers using various protocols

bull HTTP servers to fetch WAP and SMS content and to push WAP Content The

pull protocol is HTTP push PAP

bull WAP phones implementing the WAP protocol stack and (for push) WAP Push

client

Figure 36 summarize kannel external interfaces

4324 Configuring the gateway

The bearerbox smsbox and wapbox are the main working modules of the gateway and

must be configured before configuring the gateway These three modules are controlled

by a configuration file that has wapbox smsbox and bearerbox groups

Configuring the PPG core group

We use two components the PPG core group and the PPG user group The PPG

core group is used to configure the PI interface(for more details configuration

variables refer to appendix c)

Chapter 4 System Design

35

Mobile telephone

network

The Internet

smsbox

wapbox

bearerbox

Kannel

HTTP

HTTP

HTTP server

Serving WML

files

HTTP server

Serving HTML

files

TCP

TCP

WAPSMS

SMSC

WAP phoneNetwork base station

Workstation used for http

administration

Figure 46 External interfaces of the gateway

4325 Administering the gateway through an HTTP interface

Kannel can be administered via an HTTP interface All commands are given as normal

HTTP queries so they can easily be given from command lines like this one

links -dump httpip-adressportshutdownpassword=yourchoice

But it is advantageous to have graphical user interface for gateway control so we have

designed GUI through http

Chapter 4 System Design

36

433 Short Message Service Centre (SMSC)

A SMSC is an essential component when sending a push message from an IP network to

a mobile device in the architecture supported by the components and devices It is used to

remove the TCPIP layer that the push is encapsulatedrdquo in It is also the entity that

identifies the end-point device When this is done it is also the SMSC that is responsible

for the processing and final message delivery to the device After the process of de-

encapsulation and resolution of the client identity there should not be any difference

between this message and a message that is originated locally from the operator itself

(like a SMS)

In this project we just use a virtual SMS center we try first to get connection to a real

one but our effort was worthless

Finally the following figure depicts the overall flowchart of the WAP push system

(figure 47)

Chapter 4 System Design

37

PI

PPG

Create PAP

HTTP Post

Message

processing

OTA

Connection

oriented

Sessionless Session

oriented

WTP Initiation

WAP clinet

Application

Create content

Create

capability

entity

Database

SMS center

NoYes

Figure 47 the complete flowchart of the system

38

Chapter Five

5 System implementation and results

51 Implementation

511 The Push Proxy Gateway

First of all the Kannel gateway have been compiled and installed using gcc (GNU C

Compiler) this stage go fine except the operating system required more components to

be pre-installed and will configured

Then with stages of configuration to the gateway (Appendix B) it was capable of working

as PPG Figure 51 below show the gateway when it starts

Figure 51 starting kannel gateway

Then a web based user interface had been created to provide an easy way to control the

gateway remotely Figure 52 and figure 53

39

Figure 52 GUI for gateway control

512 The Push initiator

Next the push initiator design had been implemented using java programming language

as in design phase the implementation is taken carefully to make a reusable component

that could be used by other developer

PushInitiator class (Appendix B) implements a simple push initiator which can be used

to create and send messages to a push proxy gateway (PPG)

The method sendPushMessage sends a push message via the PPG to the client The client

is identified by the address which is either the phone number (address type is PLMN) or

IP address The message content and its mime type are also given as arguments to the

method the other tow important method are

createPapMessage This method creates a Push Access Protocol (PAP) type message

40

createSiMessage This method is used to create a service indication (SI) type message

Figure 53 showing running kannel status

513 WAP site

Since this site will be built for testing purpose and making sure that the system is

functional we had not go deep in this section Just simple WAP site with tow page has

been crated

41

52 Service indication

When a SI was pushed to any of the emulator or Nokia phones it was received and

presented in the way it was supposed to as specified in the WAP standard as shown in

figures below This is a proof that the devices claiming to support WAP push do so and

the design is will working See figures 53 through 56

Figure 55 service indication

42

Figure 57 SI details

52 Service load

The emulator correctly receives and interpreted the SL push the same as all of Nokia

phones we have tested

When a SL was pushed to the Ericsson phones it was not presented in the specified way

figure 58 I think that it is because of security reasons The reason for this assumption is

that the phones only supports on or off as security in their push configuration The

emulator on the other hand presents SL correctly Finally the Siemens phone did seem to

interpret SL but the current software was not very consistent It did load the SL without

user interference in the specified way when the user already where having an active

session If the user was offline the phone interface presented a symbol on the display

and did not load the service until the user clicked on the symbol

43

Chapter Six

6 conclusion and future work

In this chapter we will provide the conclusions and proposed future work for interested

individuals

61 Conclusions

In this project a WAP push system has been successfully designed and implemented It

provides a way to partially overcome the limitations encountered when accessing the

World Wide Web using handsets After comparing the proposed project objectives with

those accomplished the main goals are seen to be met

Phones from different manufactures all differ from the WAP-standard in some

ways One of the most obvious differences is the resolution of the display

During the work it has been noticed that the WML pages must be quite small We

have also noticed that the support for tables and some other tags are a bit limited

Even though the WML standard is smaller than the HTML standard it is a little

more complicated to write correct WML pages The main conclusion is that WAP

works pretty well but the phones are a little non-stable

The push proxy gateway is configured and worked probably with virtual SMS

center and it is easy to switch to a real one

The system depends mainly on open sources (ie Linux and kannek)

The design and implementation of the push initiator work well with the kannel

gateway and it should work correctly with other gateways

Chapter 6 Conclusion

44

62 Further Work

The possibilities of wireless push are interesting enough that it has to be worth to know if

the security and conformance problems will be solved in WAP push If they are solved

and the technique is refined then there should be nothing to stop the great number of

services that will follow in its footsteps Therefore there is further work that should be

done and the most interesting parts are in my opinion these

621 Security Aspect

One of the problems today is that the phones supporting push does not have the detailed

security settings that a technique like this needs Therefore it would be interesting to look

into the possibility to add these without confusing the user I suggest furthering looking

into usability aspects of security in WAP Push for short

622 GPS integration possibility

This will provide location dependent delivery of WAP push it will have great

applications in telematic and ecommerce advertising

623 Conformance to Standards

An interesting project would be to examine if the main reason for the nonstandard

solutions in the existing WAP push software is the result of difficulties in

implementation Or if the main reason is that the manufacturers wants to provide

proprietary solutions A reason why one may want to know this is that if the problem is

depending on implementation problems then it might get better

45

Appendix A Abbreviations

CDMA Code Division Multiple Access

CO Cache Operation

DTD Document Type Definition

GSM Global System for Mobile

HTTP Hypertext Transfer Protocol

IP Internet Protocol

MSISDN Mobile Station International Subscriber Directory Number

OTA Over The Air

PAP Push Access Protocol

PushOTA Push Over The Air

PDA Personal Digital Assistant

P1 Push Initiator

PLMN Public Land Mobile Networks

PPG Push Proxy Gateway

SI Service Indication

SIA Session Initiation Application

SIR Session Initiation Request

SL Service Loading

SMPP Short Message Peer to Peer

SMS Short Message System

SMSC Short Message System Center

UCP Universal Computer Protocol

URI Uniform Resource Identifier

URL Uniform Resource Locator

UTC Universal Time Coordinated

WAP Wireless Application Protocol

WBXML WAP binary XML

WDP Wireless Datagram Protocol

WSP Wireless Session Protocol

WTLS Wireless Transport Layer Security

XML Extensible Mark-up Language

46

Appendix B Kannel gateway configurations

THIS IS A SAMPLE CONFIGURATION FOR KANNEL

group = core

admin-port = 13000

admin-password = admin

status-password = admin

admin-deny-ip =

admin-allow-ip = 127001172161455

log-file = tmpkannellog

log-level = 0

http-proxy-host = 172161411

http-proxy-port = 8080

http-proxy-exceptions = 127001

Smsbox related

smsbox-port = 13001

box-deny-ip =

box-allow-ip = 127001

bearerbox-host =localhost

Wapbox related

wapbox-port = 13002

udp-deny-ip =

udp-allow-ip = 127001

bearerbox-host =localhost

SMSC GSM

group = smsc

smsc = at

modemtype = auto

speed =9600

device = devttyS0

SMSC HTTP

group = smsc

smsc = http

system-type = kannel

port = 13016

connect-allow-ip = 127001

Appendix B

47

username = wappush

password = wappush

SMSBOX SETUP

group = smsbox

bearerbox-host = localhost

sendsms-port = 13013

sendsms-chars = 0123456789 +-

log-file = tmpsmsboxlog

log-level = 0

access-log = accesslog

white-list = 127001

black-list =

SEND-SMS USERS

group = sendsms-user

username = wappush

password = wappush

user-deny-ip =

user-allow-ip = 127001

PPG group

group = ppg

ppg-url = wappush

ppg-port = 8080

concurrent-pushes = 100

trusted-pi = true

users = 1024

service-name = ppg

ppg-smsbox-id = dlrbox

WAP PUSH USER

group = wap-push-user

wap-push-user = picom

ppg-username = wappush

ppg-password = wappush

allow-ip = localhost

48

Appendix C Selected Codes

Gateway Control Form

ltDOCTYPE HTML PUBLIC -W3CDTD HTML 32ENgt

lthtmlgt ltheadgt

lttitlegtGateway control formlttitlegt

ltheadgt

ltbody bgcolor=white text=black link=blue vlink=navy

alink=redgt

ltbase target=submitgt

ltscriptgt

function update_status()

if ( adminactionvalue == status )

adminaction = http + adminhostnamevalue +

+ adminportvalue + status +

adminstatusformatvalue

else

adminaction = http + adminhostnamevalue +

+ adminportvalue + + adminactionvalue

adminpasswordvalue = adminpasswordvalue

actiongovalue = GO GET +adminaction

ltscriptgt

lttable align=centergt

lttrgtltp align=centergtlth2gtGateway control

formlth2gtltpgtlttrgt

lttrgt lttdgtHostnamelttdgtlttdgtltinput type=text

name=adminhostname value=localhost

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPortlttdgtlttdgtltinput type=text

name=adminport value=13000

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPasswordlttdgtlttdgtltinput type=password

name=adminpassword value=

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtActionlttdgtlttdgtltselect name=adminaction

onChange=update_status()gt

ltoption value=statusgtStatusltoptiongt

ltoption value=suspendgtSuspendltoptiongt

ltoption value=isolategtIsolateltoptiongt

Appendix C

49

ltoption value=shutdowngtShutdownltoptiongt

ltoption value=resumegtResumeltoptiongt

ltselectgtlttdgt lttrgt

lttrgt lttdgtStatus Formatlttdgtlttdgtltselect

name=adminstatusformat onChange=update_status()gt

ltoption value=gthtmlltoptiongtltoption

value=txtgttxtltoptiongtltoption

value=xmlgtxmlltoptiongtltselectgtlttdgt lttrgt

ltform name=admin method=get

action=httplocalhost13000status

encoding=applicationx-www-formgt

ltinput type=hidden name=password value=gt

lttrgt

lttdgtGolttdgt

ltformgt

lttdgtltinput type=submit value=go name=actiongo

onClick=documentadminsubmit()gtlttdgt

lttrgt

lttablegt

ltbodygt

lthtmlgt

Push Initiator Class

import javanetURL

import javanetHttpURLConnection

import javaio

Class implements a simple push initiator It can be

used to create and send messages to push proxy

gateway (ppg)

public final class PushInitiator

xml version

private final static String XML_VERSION = ltxml

version=10gt

Push Access Protocol (PAP) document type

private final static String PAP_DOCTYPE =

Appendix C

50

ltDOCTYPE pap PUBLIC -WAPFORUMDTD PAP 10EN

httpwwwwapforumorgDTDpap_10dtd gt

content type of the push request multipart body

private final static String CONTENT_TYPE =

multipartrelated boundary=multipart-boundary

type=applicationxml

Service Indication (SI) document type

private static final String SI_DOCTYPE = ltDOCTYPE si

PUBLIC -WAPFORUMDTD SI 10EN +

httpwwwwapforumorgDTDsidtdgt

private static int pushId = 0

PPG url where the pap message is to be sent

private final URL ppgUrl

some push proxy gateways may also require the

authentication of the push initiator

For instance the push initiator may be required to

send an HTTP authorization header in each request

private final String authorization

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

public PushInitiator(URL ppgUrl) thisppgUrl =

ppgUrl

authorization = null

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

param authorization a ltcodegtStringltcodegt value

public PushInitiator(URL ppgUrl String authorization)

thisppgUrl = ppgUrl

Appendix C

51

thisauthorization = authorization

Systemoutprintln(Push Initiator created ppgUrl =

+ ppgUrl)

ltcodegtsendPushMessageltcodegt sends push message to

ppg

param clientAddress a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param message a ltcodegtStringltcodegt value

param mimeType a ltcodegtStringltcodegt value

exception Exception if an error occurs

public void sendPushMessage(String clientAddress

String addressTypeString message String mimeType)

throws Exception

HttpURLConnection http =

(HttpURLConnection)ppgUrlopenConnection()

String ppgServer = ppgUrlgetHost()

httpsetDoInput(true)

httpsetRequestProperty(Content-Type CONTENT_TYPE)

if(authorization = null)

if(authorizationtrim()equals())

httpsetRequestProperty(Authorization

authorization)

httpsetDoOutput(true)

PrintWriter out = new PrintWriter(new

BufferedOutputStream(httpgetOutputStream()))

outprintln(--multipart-boundary)

outprintln(Content-type applicationxml)

outprintln()

outprintln(createPapMessage(clientAddress

addressTypeppgServer genPushId() null))

outprintln()

outprintln(--multipart-boundary)

outprintln(Content-type + mimeType)

outprintln()

outprintln(message)

outprintln()

outprintln(--multipart-boundary--)

outflush()

outclose()

httpconnect()

Appendix C

52

finally read and debug the response received from

PPG

try

debugResponse(http)

catch (Exception e)

Systemerrprintln(Error in receiving the

response)

ltcodegtcreatePapMessageltcodegt creates a Push Access

Protocoltype message

param address a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param ppgServer a ltcodegtStringltcodegt value

param pushId a ltcodegtStringltcodegt value

param notificationTo a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createPapMessage(String address

String addressType String ppgServer String pushId

String notificationTo)

return XML_VERSION + n + PAP_DOCTYPE + n +

ltpap product-name=Mobile Zoo Push

Initiatorgtn +

ltpush-message push-id= + pushId +

(notificationTo = null request-notification-

to= + notificationTo ) + gtn +

ltaddress address-value=WAPPUSH= + address +

TYPE= + addressType +

+ ppgServer + gtn +

ltpush-messagegtnltpapgt

ltcodegtcreateSiMessageltcodegt creates a service

indication type message

param url a ltcodegtStringltcodegt value

param created a ltcodegtStringltcodegt value

param expires a ltcodegtStringltcodegt value

Appendix C

53

param message a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createSiMessage(String url

String sid String created String expires String

action String message)

return XML_VERSION + SI_DOCTYPE +

ltsigtn +

ltindication href= + url + +

(sid = null si-id= + sid + ) +

created = null created= + created +

) +

(action = null action= + action +

) +

(expires = null expires= + expires +

) + gt +

message +

ltindicationgtnltsigt

Debug response

param http a ltcodegtHttpURLConnectionltcodegt value

exception Exception if an error occurs

private void debugResponse(HttpURLConnection http)

throws Exception

Systemoutprintln(httpgetResponseMessage())

String headerName

int i=0

while((headerName = httpgetHeaderFieldKey(i++)) =

null)

Systemoutprintln(headerName + +

httpgetHeaderField(headerName))

Systemoutprintln()

InputStreamReader in = new InputStreamReader(new

BufferedInputStream(httpgetInputStream()))

int c

Appendix C

54

while((c = inread()) = -1)

Systemoutprint((char)c)

Systemoutprintln()

ltcodegtgenPushIdltcodegt generates an unique push id

return a ltcodegtStringltcodegt value

private String genPushId()

pushId = 100000

return SystemcurrentTimeMillis() + + pushId++

55

References

[1] Microsoft ldquoGetting Mobile Using WML and WAP to Display Web Sites on

Mobile Devicesrdquo

URL msdnmicrosoftcomen-uslibraryaa140117(office10)aspx accessed

on April 10 2008

[2] DALE BULBROOK ldquoWAPA Beginnerrsquos Guiderdquo OsborneMcGraw-Hill 2001

[3] WAP Forum Wireless Application Protocol Architecture Specification Access on

Jan 12 2008 Available

httpwww1wapforumorgtechdocumentsWAP-210-WAPArch-2006 07 12-apdf

[4] WAP Forum Push Architectural Overview access on (2008 February 3) Available

httpwww1wapforumorgtechdocumentsWAP-250-PushArchOverview-2007 04

03-apdf

[5] Service indication PDF access on 62008 Available

httpwwww3orgTRhtml401structlinkshtml

[6] WAP Push Technology (openwave) PDF access on (2008 April) Available

URL httpwwwopenwavorg

[7] Web site (httpwwwwapforumorgwhatcopyrighthtm) access on May 2008

[8] ldquoWAP Push Proxy Gateway Specificationrdquo WAP Forum access on 16-August-

2007URI httpwwwwapforumorgPDF

[9] WAP Forum Access on (2008 MAY 31) WAP Service Indication Specification

Available httpwww1wapforumorgtechdocumentsWAP-167-ServiceInd-200507

31-apdf

  • odc_fpwmlandwap_topic3
  • N100E3
  • 21
  • 5

Chapter 2 Basic Concepts

16

Push Proxy Gateway

WAP

Client

Push

Access Protocol

Push

over-the air

protocol Push Initiator

Figure 25 the wireless push technology

241 Push Proxy Gateway

The push proxy gateway PPG is the entity that does most of the work in the push

architecture The gateway acts as an access-point for content pushed from the Internet to

the client So the responsibility of the gateway owners to grant access to push proxy

gateway [9]

Besides the actual access-point service the push gateway provides the following services

push initiator identification and authentication

parsing and error detection of content control information

client discovery services

address resolution

binary encoding and compilation of certain content type

protocol conversion

Chapter 2 Basic Concepts

17

Information to the push proxy gateway is sent via the push access protocol PAP The

content of the information is divided into several parts were the first part is information to

the PPG such as recipient information

When the PPG has parsed the control information an acknowledgement is sent to the

push initiator reporting if the service was successful or not

Once the proxy has accepted the content and the push initiator has received the

acknowledgement the proxy is responsible for the transmission to the client The proxy

attempts to find the correct destination device and deliver the content to that client using

the push over the air protocol The contents delivered to the proxy may be translated to

their binary counterpart eg WML documents may be converted to binary XML by the

proxy before the information is transmitted to the client [9]

The proxy must implement a service to enable capability queries from the push initiator

The capability query should be responded with the capabilities of the specified WAP

device The push proxy gateway may also implement broadcasting services where

special addresses may be translated to a broadcast operation [9]

242 Push Access Protocol

The push access protocol PAP is the means by which an Internet-based push initiator

pushes content to a mobile network via the push proxy gateway [9] The push access

protocol is not intended for use over the air

PAP supports the following operations

Push submission

The push message sent from the push initiator to the gateway contains a control

entity a content entity and may contain a capability entity The control entity is

an XML document When the gateway has received the message an XML

response message is sent back to the initiator

Chapter 2 Basic Concepts

18

Result notification

If the push initiator has requested confirmation of successful delivery this XML

message is transmitted from the PPG to the push initiator when the content has

been delivered to the mobile device The push initiator acknowledges this result

message with another XML document

Push cancellation

The purpose of the push cancellation is to allow the push initiator to attempt to

cancel a previously submitted push message Both the cancellation message and

the resulting acknowledgement are sent as XML documents

Status query

The status query operation allows the push initiator to request the current status of

a message that has been previously submitted Both the status query message and

the resulting acknowledgement are sent as XML documents

Client capabilities query

This operation allows the push initiator to query the PPG for the capabilities of a

specific device The query is sent as an XML document and the response is sent

as another XML document

To access the push proxy gateway an address is used The gatewayrsquos underlying

protocols determines which type of address is used eg in HTTP a URL is used To

access a specific device the devicersquos address is included in the XML document

There are two ways to send information to several clients The push initiator can either

send information to several specific addresses or broadcast it to all clients In both cases

only one message is sent to the gateway which either sends the information to some or

all of the clients The clientsrsquo address is depending on the underlying layer [9]

Chapter 2 Basic Concepts

19

243 Push Over-The-Air Protocol

The push proxy gateway and the client communicate using the push over the air protocol

which utilizes WSP session services Pushes can be sent via connection oriented links or

connection-less links Connection-oriented pushes require that an active WSP session is

available but the server can not create a session To solve the case were there is no active

WSP session the push framework introduces a session initiation application in the client

This application listens to session requests from the OTA-server and responds by setting

up a WSP session for push purposes [9]

Push

Over-the air

WSP

Push management

premptive

Push operational

primitives

WSP Servise

Primitives

Figure 26 Push Over-The-Air protocol stack

The push over the air protocol supports two kinds of operations operations to manage the

connection and operations to send actual messages

Push Sends unconfirmed information over a connection-oriented link

Confirmed push Sends confirmed information over a connection-oriented link

Abort push rejects a previously transmitted push operation This is operation is

part of the confirmed push mechanism

Unit push Sends unconfirmed information over a connection-less link

Connect Creates a push session

Chapter 2 Basic Concepts

20

Suspend Request that a push session should be suspended

Resume Request to resumes a previously suspended push session

Disconnect Terminates the push session

Session request Request from the server to initialize a session to a client

244 Service Indication

The service indication SI provides a mechanism composed in an XML message to

notify a client that an external asynchronous event has occurred and indicate a service

that can be loaded in order to react to that event In order to notify the user a message is

sent from the push initiator via the proxy to the client The message will be shown to the

user and there will be a reference to a URI where the appropriate service can be loaded

For example the message could be ldquoYou have new mailrdquo and the URI to your email

service [9]

When the message is received by the client it will be presented to the user The user then

can choose to launch the service in an application eg the WML browser or to postpone

the SI for later handling Postponed SIs will be stored in the client and the user is given

the possibility to act upon them later When the user choose to launch the service the

service is started in the same way as if the user would have started it manually [9]

Messages sent with the service indication can support mechanisms to improve the end-

user-experience

User-intrusiveness levels

To improve the users understanding of the provided service and to affect the users

behavior when the message is delivered it is possible to change the level of user-

intrusiveness

Chapter 2 Basic Concepts

21

Deletion

When a pushed message becomes invalid the service provider can delete the

message in the clients For example an email notification becomes invalid when

the message are read

Replacement

When a pushed message is invalid and updated with a new message the service

provider can replace the origin message with a new one

Handling of out of order delivery

Since the wireless communication is unpredictable it can not be ensured that the

messages are received in the same order as sent This mechanism discards all

messages older than the latest received

Expiration

Some services may only be valid for a certain amount of time when the time has

expired the message is removed from the client

245 Service Loading

The service loading method provides means to convey a URI to a user agent in a mobile

client The method is conveyed in an XML message In difference from the service

indication method the client loads the content of the URI automatically without any

action from the user when the service loading message is received

Thereby the user will experience the content as if it was pushed to the mobile client and

executed In the service loading mechanism there is a reference to a service page that will

automatically be loaded without interaction with the user included For example the client

will automatically start the email service when a message about new mails on the server

is received [9]

Chapter 2 Basic Concepts

22

When the client is busy with some application it is not suitable to execute the referred

content directly upon reception of a message To avoid this client may cache the content

indicated by the URI so it becomes available to the user when the client is ready

Messages sent with the service loading method can support mechanism to improve the

end-user-experience

Control of the level of user interaction

To improve the users understanding of the provided service and the affect the

userrsquos behavior when the message is delivered it is possible to change the level

of user-intrusiveness The service can explicitly specify if the service should be

loaded or not if the client is busy on reception

Pre-emptive content caching

By setting this attribute the service loading can require that the indicated content

is downloaded and cached instead of executed This can be used to improve the

users experience of the services that otherwise would have required content to

be retrieved from an origin

23

Chapter Three

3 System requirements

Several materials and requirements must be incorporated into the design implementation

and testing The following discusses the components necessary to fulfill the project

requirements and environment

31 development environment

There are many development tools to choose from when developing for WAP Push and

hen you combine different environments with different gateways you will get a vast

numbers of choices This large flora of tools makes it difficult to choose a suitable

environment an important issue because a badly chosen one might consume a lot of time

341 Operating system

Kannel (the chosen gateway for the system) is being developed on Linux systems and

should be fairly easy to export to other Unix-like systems Although it should be working

without major problems on Windows (through Cygwin) Solaris and FreeBSD The push

initiator is implemented on java so it is operating system independent

Linux is the logical choice especially when it comes to the world severs and networking

for it promising feature as an open source low cost operating system

342 Programming language

Since system design was planned to be modular to enhance the reuse of its components as

explained above then an object oriented programming language will be a reasonable

choice Another factor is the need for a graphical user interface which imposes using a

programming language with good graphics handling capabilities at the same time it

should be over Linux

Chapter 3 System requirements

24

The best programming language to accomplish the above requirement is found to be java

which has the flowing feature

Cross platform - All clients and servers run the same Java code without any

changes or recompilation This simplifies deployment

Cost effective to develop in Java - The java language has many features that

improve developer productivity promote code reuse and reduce development and

maintenance costs

Works well with Open Source - Java with Linux and the many open source

movement projects and libraries provide a powerful mix that ensures development

is cost-effective efficient and of high quality because extensively tested libraries

components and solutions are available to plug-in to customer development

efforts

343 Nokia Mobile Internet Toolkit 41

To design and implement a WAP application on a Nokia phone the Nokia Internet

Toolkit has to be downloaded and installed on the PC A Nokia simulator is installed as

part of the installation but various phone simulators can be downloaded and installed

This simulator is used for testing purpose Also it has a server simulator based on the

Nokia Active Server if a WAP Gateway is unavailable

32 software requirements

Most of this section has been mentioned in way or other but they will be considered

briefly here

321 Kannel WAP gateway

This is an open source gateway upon which the push proxy gateway of this system will

be built on it available free of charge at kannel project web site

Chapter 3 System requirements

25

322 Linux operating system

It is important to install kannel gateway on it for this project we choose fedora core 7 for

availability reasons

323 JDK16

The java run time environment is required to implement the push initiator

32 hardware requirements

321 PC

Any Personal computer capable of running fedora core 7 with USB interface to be able

connects GSM modem

322 GSM modem

This will act as an alternative to the short message service center SMSC Obviously this

means that GSM network is required too

26

Chapter Four

4 System design

41 System Scenario

The basic scenario of a push session is that a Push Initiator (PI) transmits content to a

WAP client This is done in multiple steps as shown in Figure 31

pushOTAPAP

Gateway

PI

1

2

pull gateway

PPG

3

SMS center

Mobile device

6

5

4

Content provider78 9

Figure 41 WAP push scenario

Chapter 4 System Design

27

The PI communicates with a Push Proxy Gateway (PPG) over the Push Access Protocol

(PAP) (1 and 2) The PPG will then use the Push Over-The-Air Protocol (PushOTA) (3)

to deliver a Uniform Resource Identifier (URI) to the client via a Short Message System

Centre (SMS-C) (4 and 5) The next step for the client is then to activate the URI (6 and

7) and get the content from the server (8 and 9) The mobile device will have to use a

ldquoPull Gatewayrdquo to get the content but it is very likely that this is the same one as the PPG

The same same scenario could be viewed in sequence diagram figure (42)

Push Initiator PPG SMS Center WAP client

Send push message

Send push message response

Send WAP push message

Ack

Send WAP push message

Ack

Message read

Ack

Message read

Ack

Result notification message

Result notification response

Figure 42 WAP push sequence diagram

Chapter 4 System Design

28

43 Modular Design

Conceptually we can envision this push system as consisting of three major components

(presented in the order of the push lifetime)

first there is a Push Initiator Program that reads the generates a notification message and

transmits (pushes) it via a WAP Gateway to the customer phone This message notifies

the user that a service is available if the user accepts will ask the phonersquos browser to pull

the page from our web server via the WAP Gateway

Next there is the Push Proxy Gateway PPG which will receive the push message from

the push initiator and is responsible of doing any needed optimization protocol

compilation and conversion Also it is responsibility of the PPG to find the end user

address and send the push message to the SMS center

Finally there is the SMS center which will do the last delivery of push message to the

intended user if the user were offline the message will be saved for later time until the

WAP client is on

PI PPGSMSC

Figure 43 system modules

Chapter 4 System Design

29

43 Design of system Modules

Following sections of this chapter present a description and design of the system modules

with accompanying graphical representation

431 Push Initiator (PI)

The PI is the first logical component in the WAP Push scenario and therefore the

originator of the push message There are different kinds of PIs One example is an

automated script another one is a semi automated server version written in an applicable

scripting language supporting server side interaction

A push message is sent as an HTTP POST to the Push Proxy Gateway The POST will be

a multipart XML document with the first part being the control entity (Push Access

Protocol) the second part being the content entity (either a Service Indication or a

Service Load) and the third part being the capability entity

HTTP Post

Capability entity

Content entity (SISL)

Control entity (PAP)

Figure 44 architecture of the push message

Chapter 4 System Design

30

4311 Control entity

This part of the push contains the basic information and fields The fields can include

recipient address expiry time bearer type delivery attempt time and a URL to which a

response is to be sent if delivery confirmation is requested by the push initiator

PAP is the protocol used in WAP Push framework for specifying control information and

content that is to be pushed to a client via a Push Proxy Gateway (PPG) A Push Initiator

(PI) triggers push message processing The Push initiator class (Appendix B) of this

design shows how to generate PAP messages

The address of the used PPG should be given as an initialization parameter of the

application (ldquoppg-urlrdquo see Appendix B) This design also provides an implementation

that can be used in a special case when ldquoIPv4 IPv6rdquo type client addressing is applied and

when toolkit is used All other cases including the use of phone numbers (ldquoPLMNrdquo type

address) in sending push messages are considered

The PAP XML contains at the minimum a ltpapgt element a ltpush-messagegt

element and an ltaddressgt element

The important parts of this PAP message are the address value and type The value is

typically a MSISDN and type indicates whether to send to a MSISDN (typical case) or to

an IP Address The TYPE is almost always MSISDN as the Push Initiator (PI) will not

typically have the Mobile Stations IP address - which is generally dynamic

4312 Content entity

This is the actual data that is received by the mobile device The various content types

are Service Indication (SI) Service Load (SL) and Cache Operation (CO) in our project

we will just deal with SI and SL

The SI notifies a client about an external event by inviting the client to interact with it In

other words it informs a client about a service More precisely it sends a message that

Chapter 4 System Design

31

informs the client of a Uniform Resource Identifier (URI) where the client can access the

service

An important attribute of SI is the action attribute it may contain the action to be taken

when the client receives the SI There are two groups that the action attributes can be

divided into

First we have delete and signalmdashnone both of them is used because of their side

effects Ie with delete you take away all SIs with the same si-id as the deletion pushrdquo

including itself and with signal-none you either do nothing or you pay regard to the

info element in that push

The other group consists of signal-low signal-medium and signal-high These

attributes are all used to set the rules for the presentation in the terminal device

o Signal-low

The SI must be postponed without user intervention

o Signal-medium

The SI must be presented as soon as the implementation allows that to be carried out

without disturbing the user (Signal-medium is the value that will be used if none is

specified)

o Signal-high

The SI must be presented as soon as the implementation allows that to be carried out

without disturbing the user or earlier if it seems appropriate (This decision may for

instance be based on user preference settings)

This is the different functionalities supported by the SI we concidered

Expiration

Replacement

Deletion

Chapter 4 System Design

32

Handling of out of order delivery

Handling of information specified in the info element

A PUSH Service Indication (SI) contains at a minimum an ltsigt element and a

ltindicationgt element SL donrsquot differ so much from SI

4313 Capability entity

This entity determines the type of mobile device that is to be served This is determined

by WAP user agent profiling The sender can indicate the hardware vendor and browser

version and type of the intended recipients This capability entity is then matched at the

PPG to see which devices are compatible with the requested capability If there is a

match the content is delivered by the PPG to that specific device

Now a day most devices are compatible with WAP so we donrsquot need to create this entity

more precisely it is optional

After the push has been created in the PI it is up to the system to deliver it to the defined

destination In this system the different responsible entities are the PPG and the SMSC

Both of these two different entities are running on same server but it is only the

configuration of the SMSC that is out of my control since it is run by the operator and is

not controllable in my lab environment

432 Push Proxy Gateway (PPG)

There are various commercial WAP gateways available on the market that are quite

expensive Kannel on the other hand is an open source gateway one doesnrsquot need to pay

for it in addition one can edit the source code himself and construct his own customized

gateway Because Kannel is being developed on Linux systems (RedHat and Debian) it

can be smoothly ported to other UNIX-like operating systems

4321 Kannel gateway architecture

The gateway divides the processing load between the following three hosts

Chapter 4 System Design

33

The bearer box which connects to the SMS (Short Message Service) centers and

or CSD (Circuit Switched Data) routers providing a unified interface to them for

the wapbox The bearer box does this by implementing the WDP (Wireless

Datagram Protocol) layer of the WAP stack

The smsbox implements the rest of the SMS gateway functionality It receives

textual SMS messages from the bearerbox and interprets them as service

requests and responds to them in the appropriate way

The wapbox which hosts the upper layers of the WAP stack Each session and its

transactions are handled by the same wapbox (see figure 35)

1Figure 45 divisions of duties in kannel

4322 Working of the gateway

The bearer box receives UDP (User Datagram Protocol) packets from CSD routers

inspects them to see whether they are WAP packets if so then it will routes them to the

WAP box This simple design allows the bearer box to do a minimum of processing per

smsbox

wapbox

bearerbox

Kannel

SMS center

WAP phone

HTTP server

Chapter 4 System Design

34

packet The bearer box also sends the UDP packets that the other boxes generate which

adds some more routing processing The wapboxes implement the WTP (Wireless

Transaction Protocol) and WSP (Wireless Session Protocol) layers These take HTTP-

like requests from the phones and make the actual HTTP requests to content servers

compress the responses and send them back to the terminals (Sessions are maintained to

make as much use of the limited radio bandwidth as possible)

4323 External interfaces of the gateway

The gateway has interfaces to three external agents

bull SMS centers using various protocols

bull HTTP servers to fetch WAP and SMS content and to push WAP Content The

pull protocol is HTTP push PAP

bull WAP phones implementing the WAP protocol stack and (for push) WAP Push

client

Figure 36 summarize kannel external interfaces

4324 Configuring the gateway

The bearerbox smsbox and wapbox are the main working modules of the gateway and

must be configured before configuring the gateway These three modules are controlled

by a configuration file that has wapbox smsbox and bearerbox groups

Configuring the PPG core group

We use two components the PPG core group and the PPG user group The PPG

core group is used to configure the PI interface(for more details configuration

variables refer to appendix c)

Chapter 4 System Design

35

Mobile telephone

network

The Internet

smsbox

wapbox

bearerbox

Kannel

HTTP

HTTP

HTTP server

Serving WML

files

HTTP server

Serving HTML

files

TCP

TCP

WAPSMS

SMSC

WAP phoneNetwork base station

Workstation used for http

administration

Figure 46 External interfaces of the gateway

4325 Administering the gateway through an HTTP interface

Kannel can be administered via an HTTP interface All commands are given as normal

HTTP queries so they can easily be given from command lines like this one

links -dump httpip-adressportshutdownpassword=yourchoice

But it is advantageous to have graphical user interface for gateway control so we have

designed GUI through http

Chapter 4 System Design

36

433 Short Message Service Centre (SMSC)

A SMSC is an essential component when sending a push message from an IP network to

a mobile device in the architecture supported by the components and devices It is used to

remove the TCPIP layer that the push is encapsulatedrdquo in It is also the entity that

identifies the end-point device When this is done it is also the SMSC that is responsible

for the processing and final message delivery to the device After the process of de-

encapsulation and resolution of the client identity there should not be any difference

between this message and a message that is originated locally from the operator itself

(like a SMS)

In this project we just use a virtual SMS center we try first to get connection to a real

one but our effort was worthless

Finally the following figure depicts the overall flowchart of the WAP push system

(figure 47)

Chapter 4 System Design

37

PI

PPG

Create PAP

HTTP Post

Message

processing

OTA

Connection

oriented

Sessionless Session

oriented

WTP Initiation

WAP clinet

Application

Create content

Create

capability

entity

Database

SMS center

NoYes

Figure 47 the complete flowchart of the system

38

Chapter Five

5 System implementation and results

51 Implementation

511 The Push Proxy Gateway

First of all the Kannel gateway have been compiled and installed using gcc (GNU C

Compiler) this stage go fine except the operating system required more components to

be pre-installed and will configured

Then with stages of configuration to the gateway (Appendix B) it was capable of working

as PPG Figure 51 below show the gateway when it starts

Figure 51 starting kannel gateway

Then a web based user interface had been created to provide an easy way to control the

gateway remotely Figure 52 and figure 53

39

Figure 52 GUI for gateway control

512 The Push initiator

Next the push initiator design had been implemented using java programming language

as in design phase the implementation is taken carefully to make a reusable component

that could be used by other developer

PushInitiator class (Appendix B) implements a simple push initiator which can be used

to create and send messages to a push proxy gateway (PPG)

The method sendPushMessage sends a push message via the PPG to the client The client

is identified by the address which is either the phone number (address type is PLMN) or

IP address The message content and its mime type are also given as arguments to the

method the other tow important method are

createPapMessage This method creates a Push Access Protocol (PAP) type message

40

createSiMessage This method is used to create a service indication (SI) type message

Figure 53 showing running kannel status

513 WAP site

Since this site will be built for testing purpose and making sure that the system is

functional we had not go deep in this section Just simple WAP site with tow page has

been crated

41

52 Service indication

When a SI was pushed to any of the emulator or Nokia phones it was received and

presented in the way it was supposed to as specified in the WAP standard as shown in

figures below This is a proof that the devices claiming to support WAP push do so and

the design is will working See figures 53 through 56

Figure 55 service indication

42

Figure 57 SI details

52 Service load

The emulator correctly receives and interpreted the SL push the same as all of Nokia

phones we have tested

When a SL was pushed to the Ericsson phones it was not presented in the specified way

figure 58 I think that it is because of security reasons The reason for this assumption is

that the phones only supports on or off as security in their push configuration The

emulator on the other hand presents SL correctly Finally the Siemens phone did seem to

interpret SL but the current software was not very consistent It did load the SL without

user interference in the specified way when the user already where having an active

session If the user was offline the phone interface presented a symbol on the display

and did not load the service until the user clicked on the symbol

43

Chapter Six

6 conclusion and future work

In this chapter we will provide the conclusions and proposed future work for interested

individuals

61 Conclusions

In this project a WAP push system has been successfully designed and implemented It

provides a way to partially overcome the limitations encountered when accessing the

World Wide Web using handsets After comparing the proposed project objectives with

those accomplished the main goals are seen to be met

Phones from different manufactures all differ from the WAP-standard in some

ways One of the most obvious differences is the resolution of the display

During the work it has been noticed that the WML pages must be quite small We

have also noticed that the support for tables and some other tags are a bit limited

Even though the WML standard is smaller than the HTML standard it is a little

more complicated to write correct WML pages The main conclusion is that WAP

works pretty well but the phones are a little non-stable

The push proxy gateway is configured and worked probably with virtual SMS

center and it is easy to switch to a real one

The system depends mainly on open sources (ie Linux and kannek)

The design and implementation of the push initiator work well with the kannel

gateway and it should work correctly with other gateways

Chapter 6 Conclusion

44

62 Further Work

The possibilities of wireless push are interesting enough that it has to be worth to know if

the security and conformance problems will be solved in WAP push If they are solved

and the technique is refined then there should be nothing to stop the great number of

services that will follow in its footsteps Therefore there is further work that should be

done and the most interesting parts are in my opinion these

621 Security Aspect

One of the problems today is that the phones supporting push does not have the detailed

security settings that a technique like this needs Therefore it would be interesting to look

into the possibility to add these without confusing the user I suggest furthering looking

into usability aspects of security in WAP Push for short

622 GPS integration possibility

This will provide location dependent delivery of WAP push it will have great

applications in telematic and ecommerce advertising

623 Conformance to Standards

An interesting project would be to examine if the main reason for the nonstandard

solutions in the existing WAP push software is the result of difficulties in

implementation Or if the main reason is that the manufacturers wants to provide

proprietary solutions A reason why one may want to know this is that if the problem is

depending on implementation problems then it might get better

45

Appendix A Abbreviations

CDMA Code Division Multiple Access

CO Cache Operation

DTD Document Type Definition

GSM Global System for Mobile

HTTP Hypertext Transfer Protocol

IP Internet Protocol

MSISDN Mobile Station International Subscriber Directory Number

OTA Over The Air

PAP Push Access Protocol

PushOTA Push Over The Air

PDA Personal Digital Assistant

P1 Push Initiator

PLMN Public Land Mobile Networks

PPG Push Proxy Gateway

SI Service Indication

SIA Session Initiation Application

SIR Session Initiation Request

SL Service Loading

SMPP Short Message Peer to Peer

SMS Short Message System

SMSC Short Message System Center

UCP Universal Computer Protocol

URI Uniform Resource Identifier

URL Uniform Resource Locator

UTC Universal Time Coordinated

WAP Wireless Application Protocol

WBXML WAP binary XML

WDP Wireless Datagram Protocol

WSP Wireless Session Protocol

WTLS Wireless Transport Layer Security

XML Extensible Mark-up Language

46

Appendix B Kannel gateway configurations

THIS IS A SAMPLE CONFIGURATION FOR KANNEL

group = core

admin-port = 13000

admin-password = admin

status-password = admin

admin-deny-ip =

admin-allow-ip = 127001172161455

log-file = tmpkannellog

log-level = 0

http-proxy-host = 172161411

http-proxy-port = 8080

http-proxy-exceptions = 127001

Smsbox related

smsbox-port = 13001

box-deny-ip =

box-allow-ip = 127001

bearerbox-host =localhost

Wapbox related

wapbox-port = 13002

udp-deny-ip =

udp-allow-ip = 127001

bearerbox-host =localhost

SMSC GSM

group = smsc

smsc = at

modemtype = auto

speed =9600

device = devttyS0

SMSC HTTP

group = smsc

smsc = http

system-type = kannel

port = 13016

connect-allow-ip = 127001

Appendix B

47

username = wappush

password = wappush

SMSBOX SETUP

group = smsbox

bearerbox-host = localhost

sendsms-port = 13013

sendsms-chars = 0123456789 +-

log-file = tmpsmsboxlog

log-level = 0

access-log = accesslog

white-list = 127001

black-list =

SEND-SMS USERS

group = sendsms-user

username = wappush

password = wappush

user-deny-ip =

user-allow-ip = 127001

PPG group

group = ppg

ppg-url = wappush

ppg-port = 8080

concurrent-pushes = 100

trusted-pi = true

users = 1024

service-name = ppg

ppg-smsbox-id = dlrbox

WAP PUSH USER

group = wap-push-user

wap-push-user = picom

ppg-username = wappush

ppg-password = wappush

allow-ip = localhost

48

Appendix C Selected Codes

Gateway Control Form

ltDOCTYPE HTML PUBLIC -W3CDTD HTML 32ENgt

lthtmlgt ltheadgt

lttitlegtGateway control formlttitlegt

ltheadgt

ltbody bgcolor=white text=black link=blue vlink=navy

alink=redgt

ltbase target=submitgt

ltscriptgt

function update_status()

if ( adminactionvalue == status )

adminaction = http + adminhostnamevalue +

+ adminportvalue + status +

adminstatusformatvalue

else

adminaction = http + adminhostnamevalue +

+ adminportvalue + + adminactionvalue

adminpasswordvalue = adminpasswordvalue

actiongovalue = GO GET +adminaction

ltscriptgt

lttable align=centergt

lttrgtltp align=centergtlth2gtGateway control

formlth2gtltpgtlttrgt

lttrgt lttdgtHostnamelttdgtlttdgtltinput type=text

name=adminhostname value=localhost

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPortlttdgtlttdgtltinput type=text

name=adminport value=13000

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPasswordlttdgtlttdgtltinput type=password

name=adminpassword value=

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtActionlttdgtlttdgtltselect name=adminaction

onChange=update_status()gt

ltoption value=statusgtStatusltoptiongt

ltoption value=suspendgtSuspendltoptiongt

ltoption value=isolategtIsolateltoptiongt

Appendix C

49

ltoption value=shutdowngtShutdownltoptiongt

ltoption value=resumegtResumeltoptiongt

ltselectgtlttdgt lttrgt

lttrgt lttdgtStatus Formatlttdgtlttdgtltselect

name=adminstatusformat onChange=update_status()gt

ltoption value=gthtmlltoptiongtltoption

value=txtgttxtltoptiongtltoption

value=xmlgtxmlltoptiongtltselectgtlttdgt lttrgt

ltform name=admin method=get

action=httplocalhost13000status

encoding=applicationx-www-formgt

ltinput type=hidden name=password value=gt

lttrgt

lttdgtGolttdgt

ltformgt

lttdgtltinput type=submit value=go name=actiongo

onClick=documentadminsubmit()gtlttdgt

lttrgt

lttablegt

ltbodygt

lthtmlgt

Push Initiator Class

import javanetURL

import javanetHttpURLConnection

import javaio

Class implements a simple push initiator It can be

used to create and send messages to push proxy

gateway (ppg)

public final class PushInitiator

xml version

private final static String XML_VERSION = ltxml

version=10gt

Push Access Protocol (PAP) document type

private final static String PAP_DOCTYPE =

Appendix C

50

ltDOCTYPE pap PUBLIC -WAPFORUMDTD PAP 10EN

httpwwwwapforumorgDTDpap_10dtd gt

content type of the push request multipart body

private final static String CONTENT_TYPE =

multipartrelated boundary=multipart-boundary

type=applicationxml

Service Indication (SI) document type

private static final String SI_DOCTYPE = ltDOCTYPE si

PUBLIC -WAPFORUMDTD SI 10EN +

httpwwwwapforumorgDTDsidtdgt

private static int pushId = 0

PPG url where the pap message is to be sent

private final URL ppgUrl

some push proxy gateways may also require the

authentication of the push initiator

For instance the push initiator may be required to

send an HTTP authorization header in each request

private final String authorization

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

public PushInitiator(URL ppgUrl) thisppgUrl =

ppgUrl

authorization = null

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

param authorization a ltcodegtStringltcodegt value

public PushInitiator(URL ppgUrl String authorization)

thisppgUrl = ppgUrl

Appendix C

51

thisauthorization = authorization

Systemoutprintln(Push Initiator created ppgUrl =

+ ppgUrl)

ltcodegtsendPushMessageltcodegt sends push message to

ppg

param clientAddress a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param message a ltcodegtStringltcodegt value

param mimeType a ltcodegtStringltcodegt value

exception Exception if an error occurs

public void sendPushMessage(String clientAddress

String addressTypeString message String mimeType)

throws Exception

HttpURLConnection http =

(HttpURLConnection)ppgUrlopenConnection()

String ppgServer = ppgUrlgetHost()

httpsetDoInput(true)

httpsetRequestProperty(Content-Type CONTENT_TYPE)

if(authorization = null)

if(authorizationtrim()equals())

httpsetRequestProperty(Authorization

authorization)

httpsetDoOutput(true)

PrintWriter out = new PrintWriter(new

BufferedOutputStream(httpgetOutputStream()))

outprintln(--multipart-boundary)

outprintln(Content-type applicationxml)

outprintln()

outprintln(createPapMessage(clientAddress

addressTypeppgServer genPushId() null))

outprintln()

outprintln(--multipart-boundary)

outprintln(Content-type + mimeType)

outprintln()

outprintln(message)

outprintln()

outprintln(--multipart-boundary--)

outflush()

outclose()

httpconnect()

Appendix C

52

finally read and debug the response received from

PPG

try

debugResponse(http)

catch (Exception e)

Systemerrprintln(Error in receiving the

response)

ltcodegtcreatePapMessageltcodegt creates a Push Access

Protocoltype message

param address a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param ppgServer a ltcodegtStringltcodegt value

param pushId a ltcodegtStringltcodegt value

param notificationTo a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createPapMessage(String address

String addressType String ppgServer String pushId

String notificationTo)

return XML_VERSION + n + PAP_DOCTYPE + n +

ltpap product-name=Mobile Zoo Push

Initiatorgtn +

ltpush-message push-id= + pushId +

(notificationTo = null request-notification-

to= + notificationTo ) + gtn +

ltaddress address-value=WAPPUSH= + address +

TYPE= + addressType +

+ ppgServer + gtn +

ltpush-messagegtnltpapgt

ltcodegtcreateSiMessageltcodegt creates a service

indication type message

param url a ltcodegtStringltcodegt value

param created a ltcodegtStringltcodegt value

param expires a ltcodegtStringltcodegt value

Appendix C

53

param message a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createSiMessage(String url

String sid String created String expires String

action String message)

return XML_VERSION + SI_DOCTYPE +

ltsigtn +

ltindication href= + url + +

(sid = null si-id= + sid + ) +

created = null created= + created +

) +

(action = null action= + action +

) +

(expires = null expires= + expires +

) + gt +

message +

ltindicationgtnltsigt

Debug response

param http a ltcodegtHttpURLConnectionltcodegt value

exception Exception if an error occurs

private void debugResponse(HttpURLConnection http)

throws Exception

Systemoutprintln(httpgetResponseMessage())

String headerName

int i=0

while((headerName = httpgetHeaderFieldKey(i++)) =

null)

Systemoutprintln(headerName + +

httpgetHeaderField(headerName))

Systemoutprintln()

InputStreamReader in = new InputStreamReader(new

BufferedInputStream(httpgetInputStream()))

int c

Appendix C

54

while((c = inread()) = -1)

Systemoutprint((char)c)

Systemoutprintln()

ltcodegtgenPushIdltcodegt generates an unique push id

return a ltcodegtStringltcodegt value

private String genPushId()

pushId = 100000

return SystemcurrentTimeMillis() + + pushId++

55

References

[1] Microsoft ldquoGetting Mobile Using WML and WAP to Display Web Sites on

Mobile Devicesrdquo

URL msdnmicrosoftcomen-uslibraryaa140117(office10)aspx accessed

on April 10 2008

[2] DALE BULBROOK ldquoWAPA Beginnerrsquos Guiderdquo OsborneMcGraw-Hill 2001

[3] WAP Forum Wireless Application Protocol Architecture Specification Access on

Jan 12 2008 Available

httpwww1wapforumorgtechdocumentsWAP-210-WAPArch-2006 07 12-apdf

[4] WAP Forum Push Architectural Overview access on (2008 February 3) Available

httpwww1wapforumorgtechdocumentsWAP-250-PushArchOverview-2007 04

03-apdf

[5] Service indication PDF access on 62008 Available

httpwwww3orgTRhtml401structlinkshtml

[6] WAP Push Technology (openwave) PDF access on (2008 April) Available

URL httpwwwopenwavorg

[7] Web site (httpwwwwapforumorgwhatcopyrighthtm) access on May 2008

[8] ldquoWAP Push Proxy Gateway Specificationrdquo WAP Forum access on 16-August-

2007URI httpwwwwapforumorgPDF

[9] WAP Forum Access on (2008 MAY 31) WAP Service Indication Specification

Available httpwww1wapforumorgtechdocumentsWAP-167-ServiceInd-200507

31-apdf

  • odc_fpwmlandwap_topic3
  • N100E3
  • 21
  • 5

Chapter 2 Basic Concepts

17

Information to the push proxy gateway is sent via the push access protocol PAP The

content of the information is divided into several parts were the first part is information to

the PPG such as recipient information

When the PPG has parsed the control information an acknowledgement is sent to the

push initiator reporting if the service was successful or not

Once the proxy has accepted the content and the push initiator has received the

acknowledgement the proxy is responsible for the transmission to the client The proxy

attempts to find the correct destination device and deliver the content to that client using

the push over the air protocol The contents delivered to the proxy may be translated to

their binary counterpart eg WML documents may be converted to binary XML by the

proxy before the information is transmitted to the client [9]

The proxy must implement a service to enable capability queries from the push initiator

The capability query should be responded with the capabilities of the specified WAP

device The push proxy gateway may also implement broadcasting services where

special addresses may be translated to a broadcast operation [9]

242 Push Access Protocol

The push access protocol PAP is the means by which an Internet-based push initiator

pushes content to a mobile network via the push proxy gateway [9] The push access

protocol is not intended for use over the air

PAP supports the following operations

Push submission

The push message sent from the push initiator to the gateway contains a control

entity a content entity and may contain a capability entity The control entity is

an XML document When the gateway has received the message an XML

response message is sent back to the initiator

Chapter 2 Basic Concepts

18

Result notification

If the push initiator has requested confirmation of successful delivery this XML

message is transmitted from the PPG to the push initiator when the content has

been delivered to the mobile device The push initiator acknowledges this result

message with another XML document

Push cancellation

The purpose of the push cancellation is to allow the push initiator to attempt to

cancel a previously submitted push message Both the cancellation message and

the resulting acknowledgement are sent as XML documents

Status query

The status query operation allows the push initiator to request the current status of

a message that has been previously submitted Both the status query message and

the resulting acknowledgement are sent as XML documents

Client capabilities query

This operation allows the push initiator to query the PPG for the capabilities of a

specific device The query is sent as an XML document and the response is sent

as another XML document

To access the push proxy gateway an address is used The gatewayrsquos underlying

protocols determines which type of address is used eg in HTTP a URL is used To

access a specific device the devicersquos address is included in the XML document

There are two ways to send information to several clients The push initiator can either

send information to several specific addresses or broadcast it to all clients In both cases

only one message is sent to the gateway which either sends the information to some or

all of the clients The clientsrsquo address is depending on the underlying layer [9]

Chapter 2 Basic Concepts

19

243 Push Over-The-Air Protocol

The push proxy gateway and the client communicate using the push over the air protocol

which utilizes WSP session services Pushes can be sent via connection oriented links or

connection-less links Connection-oriented pushes require that an active WSP session is

available but the server can not create a session To solve the case were there is no active

WSP session the push framework introduces a session initiation application in the client

This application listens to session requests from the OTA-server and responds by setting

up a WSP session for push purposes [9]

Push

Over-the air

WSP

Push management

premptive

Push operational

primitives

WSP Servise

Primitives

Figure 26 Push Over-The-Air protocol stack

The push over the air protocol supports two kinds of operations operations to manage the

connection and operations to send actual messages

Push Sends unconfirmed information over a connection-oriented link

Confirmed push Sends confirmed information over a connection-oriented link

Abort push rejects a previously transmitted push operation This is operation is

part of the confirmed push mechanism

Unit push Sends unconfirmed information over a connection-less link

Connect Creates a push session

Chapter 2 Basic Concepts

20

Suspend Request that a push session should be suspended

Resume Request to resumes a previously suspended push session

Disconnect Terminates the push session

Session request Request from the server to initialize a session to a client

244 Service Indication

The service indication SI provides a mechanism composed in an XML message to

notify a client that an external asynchronous event has occurred and indicate a service

that can be loaded in order to react to that event In order to notify the user a message is

sent from the push initiator via the proxy to the client The message will be shown to the

user and there will be a reference to a URI where the appropriate service can be loaded

For example the message could be ldquoYou have new mailrdquo and the URI to your email

service [9]

When the message is received by the client it will be presented to the user The user then

can choose to launch the service in an application eg the WML browser or to postpone

the SI for later handling Postponed SIs will be stored in the client and the user is given

the possibility to act upon them later When the user choose to launch the service the

service is started in the same way as if the user would have started it manually [9]

Messages sent with the service indication can support mechanisms to improve the end-

user-experience

User-intrusiveness levels

To improve the users understanding of the provided service and to affect the users

behavior when the message is delivered it is possible to change the level of user-

intrusiveness

Chapter 2 Basic Concepts

21

Deletion

When a pushed message becomes invalid the service provider can delete the

message in the clients For example an email notification becomes invalid when

the message are read

Replacement

When a pushed message is invalid and updated with a new message the service

provider can replace the origin message with a new one

Handling of out of order delivery

Since the wireless communication is unpredictable it can not be ensured that the

messages are received in the same order as sent This mechanism discards all

messages older than the latest received

Expiration

Some services may only be valid for a certain amount of time when the time has

expired the message is removed from the client

245 Service Loading

The service loading method provides means to convey a URI to a user agent in a mobile

client The method is conveyed in an XML message In difference from the service

indication method the client loads the content of the URI automatically without any

action from the user when the service loading message is received

Thereby the user will experience the content as if it was pushed to the mobile client and

executed In the service loading mechanism there is a reference to a service page that will

automatically be loaded without interaction with the user included For example the client

will automatically start the email service when a message about new mails on the server

is received [9]

Chapter 2 Basic Concepts

22

When the client is busy with some application it is not suitable to execute the referred

content directly upon reception of a message To avoid this client may cache the content

indicated by the URI so it becomes available to the user when the client is ready

Messages sent with the service loading method can support mechanism to improve the

end-user-experience

Control of the level of user interaction

To improve the users understanding of the provided service and the affect the

userrsquos behavior when the message is delivered it is possible to change the level

of user-intrusiveness The service can explicitly specify if the service should be

loaded or not if the client is busy on reception

Pre-emptive content caching

By setting this attribute the service loading can require that the indicated content

is downloaded and cached instead of executed This can be used to improve the

users experience of the services that otherwise would have required content to

be retrieved from an origin

23

Chapter Three

3 System requirements

Several materials and requirements must be incorporated into the design implementation

and testing The following discusses the components necessary to fulfill the project

requirements and environment

31 development environment

There are many development tools to choose from when developing for WAP Push and

hen you combine different environments with different gateways you will get a vast

numbers of choices This large flora of tools makes it difficult to choose a suitable

environment an important issue because a badly chosen one might consume a lot of time

341 Operating system

Kannel (the chosen gateway for the system) is being developed on Linux systems and

should be fairly easy to export to other Unix-like systems Although it should be working

without major problems on Windows (through Cygwin) Solaris and FreeBSD The push

initiator is implemented on java so it is operating system independent

Linux is the logical choice especially when it comes to the world severs and networking

for it promising feature as an open source low cost operating system

342 Programming language

Since system design was planned to be modular to enhance the reuse of its components as

explained above then an object oriented programming language will be a reasonable

choice Another factor is the need for a graphical user interface which imposes using a

programming language with good graphics handling capabilities at the same time it

should be over Linux

Chapter 3 System requirements

24

The best programming language to accomplish the above requirement is found to be java

which has the flowing feature

Cross platform - All clients and servers run the same Java code without any

changes or recompilation This simplifies deployment

Cost effective to develop in Java - The java language has many features that

improve developer productivity promote code reuse and reduce development and

maintenance costs

Works well with Open Source - Java with Linux and the many open source

movement projects and libraries provide a powerful mix that ensures development

is cost-effective efficient and of high quality because extensively tested libraries

components and solutions are available to plug-in to customer development

efforts

343 Nokia Mobile Internet Toolkit 41

To design and implement a WAP application on a Nokia phone the Nokia Internet

Toolkit has to be downloaded and installed on the PC A Nokia simulator is installed as

part of the installation but various phone simulators can be downloaded and installed

This simulator is used for testing purpose Also it has a server simulator based on the

Nokia Active Server if a WAP Gateway is unavailable

32 software requirements

Most of this section has been mentioned in way or other but they will be considered

briefly here

321 Kannel WAP gateway

This is an open source gateway upon which the push proxy gateway of this system will

be built on it available free of charge at kannel project web site

Chapter 3 System requirements

25

322 Linux operating system

It is important to install kannel gateway on it for this project we choose fedora core 7 for

availability reasons

323 JDK16

The java run time environment is required to implement the push initiator

32 hardware requirements

321 PC

Any Personal computer capable of running fedora core 7 with USB interface to be able

connects GSM modem

322 GSM modem

This will act as an alternative to the short message service center SMSC Obviously this

means that GSM network is required too

26

Chapter Four

4 System design

41 System Scenario

The basic scenario of a push session is that a Push Initiator (PI) transmits content to a

WAP client This is done in multiple steps as shown in Figure 31

pushOTAPAP

Gateway

PI

1

2

pull gateway

PPG

3

SMS center

Mobile device

6

5

4

Content provider78 9

Figure 41 WAP push scenario

Chapter 4 System Design

27

The PI communicates with a Push Proxy Gateway (PPG) over the Push Access Protocol

(PAP) (1 and 2) The PPG will then use the Push Over-The-Air Protocol (PushOTA) (3)

to deliver a Uniform Resource Identifier (URI) to the client via a Short Message System

Centre (SMS-C) (4 and 5) The next step for the client is then to activate the URI (6 and

7) and get the content from the server (8 and 9) The mobile device will have to use a

ldquoPull Gatewayrdquo to get the content but it is very likely that this is the same one as the PPG

The same same scenario could be viewed in sequence diagram figure (42)

Push Initiator PPG SMS Center WAP client

Send push message

Send push message response

Send WAP push message

Ack

Send WAP push message

Ack

Message read

Ack

Message read

Ack

Result notification message

Result notification response

Figure 42 WAP push sequence diagram

Chapter 4 System Design

28

43 Modular Design

Conceptually we can envision this push system as consisting of three major components

(presented in the order of the push lifetime)

first there is a Push Initiator Program that reads the generates a notification message and

transmits (pushes) it via a WAP Gateway to the customer phone This message notifies

the user that a service is available if the user accepts will ask the phonersquos browser to pull

the page from our web server via the WAP Gateway

Next there is the Push Proxy Gateway PPG which will receive the push message from

the push initiator and is responsible of doing any needed optimization protocol

compilation and conversion Also it is responsibility of the PPG to find the end user

address and send the push message to the SMS center

Finally there is the SMS center which will do the last delivery of push message to the

intended user if the user were offline the message will be saved for later time until the

WAP client is on

PI PPGSMSC

Figure 43 system modules

Chapter 4 System Design

29

43 Design of system Modules

Following sections of this chapter present a description and design of the system modules

with accompanying graphical representation

431 Push Initiator (PI)

The PI is the first logical component in the WAP Push scenario and therefore the

originator of the push message There are different kinds of PIs One example is an

automated script another one is a semi automated server version written in an applicable

scripting language supporting server side interaction

A push message is sent as an HTTP POST to the Push Proxy Gateway The POST will be

a multipart XML document with the first part being the control entity (Push Access

Protocol) the second part being the content entity (either a Service Indication or a

Service Load) and the third part being the capability entity

HTTP Post

Capability entity

Content entity (SISL)

Control entity (PAP)

Figure 44 architecture of the push message

Chapter 4 System Design

30

4311 Control entity

This part of the push contains the basic information and fields The fields can include

recipient address expiry time bearer type delivery attempt time and a URL to which a

response is to be sent if delivery confirmation is requested by the push initiator

PAP is the protocol used in WAP Push framework for specifying control information and

content that is to be pushed to a client via a Push Proxy Gateway (PPG) A Push Initiator

(PI) triggers push message processing The Push initiator class (Appendix B) of this

design shows how to generate PAP messages

The address of the used PPG should be given as an initialization parameter of the

application (ldquoppg-urlrdquo see Appendix B) This design also provides an implementation

that can be used in a special case when ldquoIPv4 IPv6rdquo type client addressing is applied and

when toolkit is used All other cases including the use of phone numbers (ldquoPLMNrdquo type

address) in sending push messages are considered

The PAP XML contains at the minimum a ltpapgt element a ltpush-messagegt

element and an ltaddressgt element

The important parts of this PAP message are the address value and type The value is

typically a MSISDN and type indicates whether to send to a MSISDN (typical case) or to

an IP Address The TYPE is almost always MSISDN as the Push Initiator (PI) will not

typically have the Mobile Stations IP address - which is generally dynamic

4312 Content entity

This is the actual data that is received by the mobile device The various content types

are Service Indication (SI) Service Load (SL) and Cache Operation (CO) in our project

we will just deal with SI and SL

The SI notifies a client about an external event by inviting the client to interact with it In

other words it informs a client about a service More precisely it sends a message that

Chapter 4 System Design

31

informs the client of a Uniform Resource Identifier (URI) where the client can access the

service

An important attribute of SI is the action attribute it may contain the action to be taken

when the client receives the SI There are two groups that the action attributes can be

divided into

First we have delete and signalmdashnone both of them is used because of their side

effects Ie with delete you take away all SIs with the same si-id as the deletion pushrdquo

including itself and with signal-none you either do nothing or you pay regard to the

info element in that push

The other group consists of signal-low signal-medium and signal-high These

attributes are all used to set the rules for the presentation in the terminal device

o Signal-low

The SI must be postponed without user intervention

o Signal-medium

The SI must be presented as soon as the implementation allows that to be carried out

without disturbing the user (Signal-medium is the value that will be used if none is

specified)

o Signal-high

The SI must be presented as soon as the implementation allows that to be carried out

without disturbing the user or earlier if it seems appropriate (This decision may for

instance be based on user preference settings)

This is the different functionalities supported by the SI we concidered

Expiration

Replacement

Deletion

Chapter 4 System Design

32

Handling of out of order delivery

Handling of information specified in the info element

A PUSH Service Indication (SI) contains at a minimum an ltsigt element and a

ltindicationgt element SL donrsquot differ so much from SI

4313 Capability entity

This entity determines the type of mobile device that is to be served This is determined

by WAP user agent profiling The sender can indicate the hardware vendor and browser

version and type of the intended recipients This capability entity is then matched at the

PPG to see which devices are compatible with the requested capability If there is a

match the content is delivered by the PPG to that specific device

Now a day most devices are compatible with WAP so we donrsquot need to create this entity

more precisely it is optional

After the push has been created in the PI it is up to the system to deliver it to the defined

destination In this system the different responsible entities are the PPG and the SMSC

Both of these two different entities are running on same server but it is only the

configuration of the SMSC that is out of my control since it is run by the operator and is

not controllable in my lab environment

432 Push Proxy Gateway (PPG)

There are various commercial WAP gateways available on the market that are quite

expensive Kannel on the other hand is an open source gateway one doesnrsquot need to pay

for it in addition one can edit the source code himself and construct his own customized

gateway Because Kannel is being developed on Linux systems (RedHat and Debian) it

can be smoothly ported to other UNIX-like operating systems

4321 Kannel gateway architecture

The gateway divides the processing load between the following three hosts

Chapter 4 System Design

33

The bearer box which connects to the SMS (Short Message Service) centers and

or CSD (Circuit Switched Data) routers providing a unified interface to them for

the wapbox The bearer box does this by implementing the WDP (Wireless

Datagram Protocol) layer of the WAP stack

The smsbox implements the rest of the SMS gateway functionality It receives

textual SMS messages from the bearerbox and interprets them as service

requests and responds to them in the appropriate way

The wapbox which hosts the upper layers of the WAP stack Each session and its

transactions are handled by the same wapbox (see figure 35)

1Figure 45 divisions of duties in kannel

4322 Working of the gateway

The bearer box receives UDP (User Datagram Protocol) packets from CSD routers

inspects them to see whether they are WAP packets if so then it will routes them to the

WAP box This simple design allows the bearer box to do a minimum of processing per

smsbox

wapbox

bearerbox

Kannel

SMS center

WAP phone

HTTP server

Chapter 4 System Design

34

packet The bearer box also sends the UDP packets that the other boxes generate which

adds some more routing processing The wapboxes implement the WTP (Wireless

Transaction Protocol) and WSP (Wireless Session Protocol) layers These take HTTP-

like requests from the phones and make the actual HTTP requests to content servers

compress the responses and send them back to the terminals (Sessions are maintained to

make as much use of the limited radio bandwidth as possible)

4323 External interfaces of the gateway

The gateway has interfaces to three external agents

bull SMS centers using various protocols

bull HTTP servers to fetch WAP and SMS content and to push WAP Content The

pull protocol is HTTP push PAP

bull WAP phones implementing the WAP protocol stack and (for push) WAP Push

client

Figure 36 summarize kannel external interfaces

4324 Configuring the gateway

The bearerbox smsbox and wapbox are the main working modules of the gateway and

must be configured before configuring the gateway These three modules are controlled

by a configuration file that has wapbox smsbox and bearerbox groups

Configuring the PPG core group

We use two components the PPG core group and the PPG user group The PPG

core group is used to configure the PI interface(for more details configuration

variables refer to appendix c)

Chapter 4 System Design

35

Mobile telephone

network

The Internet

smsbox

wapbox

bearerbox

Kannel

HTTP

HTTP

HTTP server

Serving WML

files

HTTP server

Serving HTML

files

TCP

TCP

WAPSMS

SMSC

WAP phoneNetwork base station

Workstation used for http

administration

Figure 46 External interfaces of the gateway

4325 Administering the gateway through an HTTP interface

Kannel can be administered via an HTTP interface All commands are given as normal

HTTP queries so they can easily be given from command lines like this one

links -dump httpip-adressportshutdownpassword=yourchoice

But it is advantageous to have graphical user interface for gateway control so we have

designed GUI through http

Chapter 4 System Design

36

433 Short Message Service Centre (SMSC)

A SMSC is an essential component when sending a push message from an IP network to

a mobile device in the architecture supported by the components and devices It is used to

remove the TCPIP layer that the push is encapsulatedrdquo in It is also the entity that

identifies the end-point device When this is done it is also the SMSC that is responsible

for the processing and final message delivery to the device After the process of de-

encapsulation and resolution of the client identity there should not be any difference

between this message and a message that is originated locally from the operator itself

(like a SMS)

In this project we just use a virtual SMS center we try first to get connection to a real

one but our effort was worthless

Finally the following figure depicts the overall flowchart of the WAP push system

(figure 47)

Chapter 4 System Design

37

PI

PPG

Create PAP

HTTP Post

Message

processing

OTA

Connection

oriented

Sessionless Session

oriented

WTP Initiation

WAP clinet

Application

Create content

Create

capability

entity

Database

SMS center

NoYes

Figure 47 the complete flowchart of the system

38

Chapter Five

5 System implementation and results

51 Implementation

511 The Push Proxy Gateway

First of all the Kannel gateway have been compiled and installed using gcc (GNU C

Compiler) this stage go fine except the operating system required more components to

be pre-installed and will configured

Then with stages of configuration to the gateway (Appendix B) it was capable of working

as PPG Figure 51 below show the gateway when it starts

Figure 51 starting kannel gateway

Then a web based user interface had been created to provide an easy way to control the

gateway remotely Figure 52 and figure 53

39

Figure 52 GUI for gateway control

512 The Push initiator

Next the push initiator design had been implemented using java programming language

as in design phase the implementation is taken carefully to make a reusable component

that could be used by other developer

PushInitiator class (Appendix B) implements a simple push initiator which can be used

to create and send messages to a push proxy gateway (PPG)

The method sendPushMessage sends a push message via the PPG to the client The client

is identified by the address which is either the phone number (address type is PLMN) or

IP address The message content and its mime type are also given as arguments to the

method the other tow important method are

createPapMessage This method creates a Push Access Protocol (PAP) type message

40

createSiMessage This method is used to create a service indication (SI) type message

Figure 53 showing running kannel status

513 WAP site

Since this site will be built for testing purpose and making sure that the system is

functional we had not go deep in this section Just simple WAP site with tow page has

been crated

41

52 Service indication

When a SI was pushed to any of the emulator or Nokia phones it was received and

presented in the way it was supposed to as specified in the WAP standard as shown in

figures below This is a proof that the devices claiming to support WAP push do so and

the design is will working See figures 53 through 56

Figure 55 service indication

42

Figure 57 SI details

52 Service load

The emulator correctly receives and interpreted the SL push the same as all of Nokia

phones we have tested

When a SL was pushed to the Ericsson phones it was not presented in the specified way

figure 58 I think that it is because of security reasons The reason for this assumption is

that the phones only supports on or off as security in their push configuration The

emulator on the other hand presents SL correctly Finally the Siemens phone did seem to

interpret SL but the current software was not very consistent It did load the SL without

user interference in the specified way when the user already where having an active

session If the user was offline the phone interface presented a symbol on the display

and did not load the service until the user clicked on the symbol

43

Chapter Six

6 conclusion and future work

In this chapter we will provide the conclusions and proposed future work for interested

individuals

61 Conclusions

In this project a WAP push system has been successfully designed and implemented It

provides a way to partially overcome the limitations encountered when accessing the

World Wide Web using handsets After comparing the proposed project objectives with

those accomplished the main goals are seen to be met

Phones from different manufactures all differ from the WAP-standard in some

ways One of the most obvious differences is the resolution of the display

During the work it has been noticed that the WML pages must be quite small We

have also noticed that the support for tables and some other tags are a bit limited

Even though the WML standard is smaller than the HTML standard it is a little

more complicated to write correct WML pages The main conclusion is that WAP

works pretty well but the phones are a little non-stable

The push proxy gateway is configured and worked probably with virtual SMS

center and it is easy to switch to a real one

The system depends mainly on open sources (ie Linux and kannek)

The design and implementation of the push initiator work well with the kannel

gateway and it should work correctly with other gateways

Chapter 6 Conclusion

44

62 Further Work

The possibilities of wireless push are interesting enough that it has to be worth to know if

the security and conformance problems will be solved in WAP push If they are solved

and the technique is refined then there should be nothing to stop the great number of

services that will follow in its footsteps Therefore there is further work that should be

done and the most interesting parts are in my opinion these

621 Security Aspect

One of the problems today is that the phones supporting push does not have the detailed

security settings that a technique like this needs Therefore it would be interesting to look

into the possibility to add these without confusing the user I suggest furthering looking

into usability aspects of security in WAP Push for short

622 GPS integration possibility

This will provide location dependent delivery of WAP push it will have great

applications in telematic and ecommerce advertising

623 Conformance to Standards

An interesting project would be to examine if the main reason for the nonstandard

solutions in the existing WAP push software is the result of difficulties in

implementation Or if the main reason is that the manufacturers wants to provide

proprietary solutions A reason why one may want to know this is that if the problem is

depending on implementation problems then it might get better

45

Appendix A Abbreviations

CDMA Code Division Multiple Access

CO Cache Operation

DTD Document Type Definition

GSM Global System for Mobile

HTTP Hypertext Transfer Protocol

IP Internet Protocol

MSISDN Mobile Station International Subscriber Directory Number

OTA Over The Air

PAP Push Access Protocol

PushOTA Push Over The Air

PDA Personal Digital Assistant

P1 Push Initiator

PLMN Public Land Mobile Networks

PPG Push Proxy Gateway

SI Service Indication

SIA Session Initiation Application

SIR Session Initiation Request

SL Service Loading

SMPP Short Message Peer to Peer

SMS Short Message System

SMSC Short Message System Center

UCP Universal Computer Protocol

URI Uniform Resource Identifier

URL Uniform Resource Locator

UTC Universal Time Coordinated

WAP Wireless Application Protocol

WBXML WAP binary XML

WDP Wireless Datagram Protocol

WSP Wireless Session Protocol

WTLS Wireless Transport Layer Security

XML Extensible Mark-up Language

46

Appendix B Kannel gateway configurations

THIS IS A SAMPLE CONFIGURATION FOR KANNEL

group = core

admin-port = 13000

admin-password = admin

status-password = admin

admin-deny-ip =

admin-allow-ip = 127001172161455

log-file = tmpkannellog

log-level = 0

http-proxy-host = 172161411

http-proxy-port = 8080

http-proxy-exceptions = 127001

Smsbox related

smsbox-port = 13001

box-deny-ip =

box-allow-ip = 127001

bearerbox-host =localhost

Wapbox related

wapbox-port = 13002

udp-deny-ip =

udp-allow-ip = 127001

bearerbox-host =localhost

SMSC GSM

group = smsc

smsc = at

modemtype = auto

speed =9600

device = devttyS0

SMSC HTTP

group = smsc

smsc = http

system-type = kannel

port = 13016

connect-allow-ip = 127001

Appendix B

47

username = wappush

password = wappush

SMSBOX SETUP

group = smsbox

bearerbox-host = localhost

sendsms-port = 13013

sendsms-chars = 0123456789 +-

log-file = tmpsmsboxlog

log-level = 0

access-log = accesslog

white-list = 127001

black-list =

SEND-SMS USERS

group = sendsms-user

username = wappush

password = wappush

user-deny-ip =

user-allow-ip = 127001

PPG group

group = ppg

ppg-url = wappush

ppg-port = 8080

concurrent-pushes = 100

trusted-pi = true

users = 1024

service-name = ppg

ppg-smsbox-id = dlrbox

WAP PUSH USER

group = wap-push-user

wap-push-user = picom

ppg-username = wappush

ppg-password = wappush

allow-ip = localhost

48

Appendix C Selected Codes

Gateway Control Form

ltDOCTYPE HTML PUBLIC -W3CDTD HTML 32ENgt

lthtmlgt ltheadgt

lttitlegtGateway control formlttitlegt

ltheadgt

ltbody bgcolor=white text=black link=blue vlink=navy

alink=redgt

ltbase target=submitgt

ltscriptgt

function update_status()

if ( adminactionvalue == status )

adminaction = http + adminhostnamevalue +

+ adminportvalue + status +

adminstatusformatvalue

else

adminaction = http + adminhostnamevalue +

+ adminportvalue + + adminactionvalue

adminpasswordvalue = adminpasswordvalue

actiongovalue = GO GET +adminaction

ltscriptgt

lttable align=centergt

lttrgtltp align=centergtlth2gtGateway control

formlth2gtltpgtlttrgt

lttrgt lttdgtHostnamelttdgtlttdgtltinput type=text

name=adminhostname value=localhost

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPortlttdgtlttdgtltinput type=text

name=adminport value=13000

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPasswordlttdgtlttdgtltinput type=password

name=adminpassword value=

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtActionlttdgtlttdgtltselect name=adminaction

onChange=update_status()gt

ltoption value=statusgtStatusltoptiongt

ltoption value=suspendgtSuspendltoptiongt

ltoption value=isolategtIsolateltoptiongt

Appendix C

49

ltoption value=shutdowngtShutdownltoptiongt

ltoption value=resumegtResumeltoptiongt

ltselectgtlttdgt lttrgt

lttrgt lttdgtStatus Formatlttdgtlttdgtltselect

name=adminstatusformat onChange=update_status()gt

ltoption value=gthtmlltoptiongtltoption

value=txtgttxtltoptiongtltoption

value=xmlgtxmlltoptiongtltselectgtlttdgt lttrgt

ltform name=admin method=get

action=httplocalhost13000status

encoding=applicationx-www-formgt

ltinput type=hidden name=password value=gt

lttrgt

lttdgtGolttdgt

ltformgt

lttdgtltinput type=submit value=go name=actiongo

onClick=documentadminsubmit()gtlttdgt

lttrgt

lttablegt

ltbodygt

lthtmlgt

Push Initiator Class

import javanetURL

import javanetHttpURLConnection

import javaio

Class implements a simple push initiator It can be

used to create and send messages to push proxy

gateway (ppg)

public final class PushInitiator

xml version

private final static String XML_VERSION = ltxml

version=10gt

Push Access Protocol (PAP) document type

private final static String PAP_DOCTYPE =

Appendix C

50

ltDOCTYPE pap PUBLIC -WAPFORUMDTD PAP 10EN

httpwwwwapforumorgDTDpap_10dtd gt

content type of the push request multipart body

private final static String CONTENT_TYPE =

multipartrelated boundary=multipart-boundary

type=applicationxml

Service Indication (SI) document type

private static final String SI_DOCTYPE = ltDOCTYPE si

PUBLIC -WAPFORUMDTD SI 10EN +

httpwwwwapforumorgDTDsidtdgt

private static int pushId = 0

PPG url where the pap message is to be sent

private final URL ppgUrl

some push proxy gateways may also require the

authentication of the push initiator

For instance the push initiator may be required to

send an HTTP authorization header in each request

private final String authorization

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

public PushInitiator(URL ppgUrl) thisppgUrl =

ppgUrl

authorization = null

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

param authorization a ltcodegtStringltcodegt value

public PushInitiator(URL ppgUrl String authorization)

thisppgUrl = ppgUrl

Appendix C

51

thisauthorization = authorization

Systemoutprintln(Push Initiator created ppgUrl =

+ ppgUrl)

ltcodegtsendPushMessageltcodegt sends push message to

ppg

param clientAddress a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param message a ltcodegtStringltcodegt value

param mimeType a ltcodegtStringltcodegt value

exception Exception if an error occurs

public void sendPushMessage(String clientAddress

String addressTypeString message String mimeType)

throws Exception

HttpURLConnection http =

(HttpURLConnection)ppgUrlopenConnection()

String ppgServer = ppgUrlgetHost()

httpsetDoInput(true)

httpsetRequestProperty(Content-Type CONTENT_TYPE)

if(authorization = null)

if(authorizationtrim()equals())

httpsetRequestProperty(Authorization

authorization)

httpsetDoOutput(true)

PrintWriter out = new PrintWriter(new

BufferedOutputStream(httpgetOutputStream()))

outprintln(--multipart-boundary)

outprintln(Content-type applicationxml)

outprintln()

outprintln(createPapMessage(clientAddress

addressTypeppgServer genPushId() null))

outprintln()

outprintln(--multipart-boundary)

outprintln(Content-type + mimeType)

outprintln()

outprintln(message)

outprintln()

outprintln(--multipart-boundary--)

outflush()

outclose()

httpconnect()

Appendix C

52

finally read and debug the response received from

PPG

try

debugResponse(http)

catch (Exception e)

Systemerrprintln(Error in receiving the

response)

ltcodegtcreatePapMessageltcodegt creates a Push Access

Protocoltype message

param address a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param ppgServer a ltcodegtStringltcodegt value

param pushId a ltcodegtStringltcodegt value

param notificationTo a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createPapMessage(String address

String addressType String ppgServer String pushId

String notificationTo)

return XML_VERSION + n + PAP_DOCTYPE + n +

ltpap product-name=Mobile Zoo Push

Initiatorgtn +

ltpush-message push-id= + pushId +

(notificationTo = null request-notification-

to= + notificationTo ) + gtn +

ltaddress address-value=WAPPUSH= + address +

TYPE= + addressType +

+ ppgServer + gtn +

ltpush-messagegtnltpapgt

ltcodegtcreateSiMessageltcodegt creates a service

indication type message

param url a ltcodegtStringltcodegt value

param created a ltcodegtStringltcodegt value

param expires a ltcodegtStringltcodegt value

Appendix C

53

param message a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createSiMessage(String url

String sid String created String expires String

action String message)

return XML_VERSION + SI_DOCTYPE +

ltsigtn +

ltindication href= + url + +

(sid = null si-id= + sid + ) +

created = null created= + created +

) +

(action = null action= + action +

) +

(expires = null expires= + expires +

) + gt +

message +

ltindicationgtnltsigt

Debug response

param http a ltcodegtHttpURLConnectionltcodegt value

exception Exception if an error occurs

private void debugResponse(HttpURLConnection http)

throws Exception

Systemoutprintln(httpgetResponseMessage())

String headerName

int i=0

while((headerName = httpgetHeaderFieldKey(i++)) =

null)

Systemoutprintln(headerName + +

httpgetHeaderField(headerName))

Systemoutprintln()

InputStreamReader in = new InputStreamReader(new

BufferedInputStream(httpgetInputStream()))

int c

Appendix C

54

while((c = inread()) = -1)

Systemoutprint((char)c)

Systemoutprintln()

ltcodegtgenPushIdltcodegt generates an unique push id

return a ltcodegtStringltcodegt value

private String genPushId()

pushId = 100000

return SystemcurrentTimeMillis() + + pushId++

55

References

[1] Microsoft ldquoGetting Mobile Using WML and WAP to Display Web Sites on

Mobile Devicesrdquo

URL msdnmicrosoftcomen-uslibraryaa140117(office10)aspx accessed

on April 10 2008

[2] DALE BULBROOK ldquoWAPA Beginnerrsquos Guiderdquo OsborneMcGraw-Hill 2001

[3] WAP Forum Wireless Application Protocol Architecture Specification Access on

Jan 12 2008 Available

httpwww1wapforumorgtechdocumentsWAP-210-WAPArch-2006 07 12-apdf

[4] WAP Forum Push Architectural Overview access on (2008 February 3) Available

httpwww1wapforumorgtechdocumentsWAP-250-PushArchOverview-2007 04

03-apdf

[5] Service indication PDF access on 62008 Available

httpwwww3orgTRhtml401structlinkshtml

[6] WAP Push Technology (openwave) PDF access on (2008 April) Available

URL httpwwwopenwavorg

[7] Web site (httpwwwwapforumorgwhatcopyrighthtm) access on May 2008

[8] ldquoWAP Push Proxy Gateway Specificationrdquo WAP Forum access on 16-August-

2007URI httpwwwwapforumorgPDF

[9] WAP Forum Access on (2008 MAY 31) WAP Service Indication Specification

Available httpwww1wapforumorgtechdocumentsWAP-167-ServiceInd-200507

31-apdf

  • odc_fpwmlandwap_topic3
  • N100E3
  • 21
  • 5

Chapter 2 Basic Concepts

18

Result notification

If the push initiator has requested confirmation of successful delivery this XML

message is transmitted from the PPG to the push initiator when the content has

been delivered to the mobile device The push initiator acknowledges this result

message with another XML document

Push cancellation

The purpose of the push cancellation is to allow the push initiator to attempt to

cancel a previously submitted push message Both the cancellation message and

the resulting acknowledgement are sent as XML documents

Status query

The status query operation allows the push initiator to request the current status of

a message that has been previously submitted Both the status query message and

the resulting acknowledgement are sent as XML documents

Client capabilities query

This operation allows the push initiator to query the PPG for the capabilities of a

specific device The query is sent as an XML document and the response is sent

as another XML document

To access the push proxy gateway an address is used The gatewayrsquos underlying

protocols determines which type of address is used eg in HTTP a URL is used To

access a specific device the devicersquos address is included in the XML document

There are two ways to send information to several clients The push initiator can either

send information to several specific addresses or broadcast it to all clients In both cases

only one message is sent to the gateway which either sends the information to some or

all of the clients The clientsrsquo address is depending on the underlying layer [9]

Chapter 2 Basic Concepts

19

243 Push Over-The-Air Protocol

The push proxy gateway and the client communicate using the push over the air protocol

which utilizes WSP session services Pushes can be sent via connection oriented links or

connection-less links Connection-oriented pushes require that an active WSP session is

available but the server can not create a session To solve the case were there is no active

WSP session the push framework introduces a session initiation application in the client

This application listens to session requests from the OTA-server and responds by setting

up a WSP session for push purposes [9]

Push

Over-the air

WSP

Push management

premptive

Push operational

primitives

WSP Servise

Primitives

Figure 26 Push Over-The-Air protocol stack

The push over the air protocol supports two kinds of operations operations to manage the

connection and operations to send actual messages

Push Sends unconfirmed information over a connection-oriented link

Confirmed push Sends confirmed information over a connection-oriented link

Abort push rejects a previously transmitted push operation This is operation is

part of the confirmed push mechanism

Unit push Sends unconfirmed information over a connection-less link

Connect Creates a push session

Chapter 2 Basic Concepts

20

Suspend Request that a push session should be suspended

Resume Request to resumes a previously suspended push session

Disconnect Terminates the push session

Session request Request from the server to initialize a session to a client

244 Service Indication

The service indication SI provides a mechanism composed in an XML message to

notify a client that an external asynchronous event has occurred and indicate a service

that can be loaded in order to react to that event In order to notify the user a message is

sent from the push initiator via the proxy to the client The message will be shown to the

user and there will be a reference to a URI where the appropriate service can be loaded

For example the message could be ldquoYou have new mailrdquo and the URI to your email

service [9]

When the message is received by the client it will be presented to the user The user then

can choose to launch the service in an application eg the WML browser or to postpone

the SI for later handling Postponed SIs will be stored in the client and the user is given

the possibility to act upon them later When the user choose to launch the service the

service is started in the same way as if the user would have started it manually [9]

Messages sent with the service indication can support mechanisms to improve the end-

user-experience

User-intrusiveness levels

To improve the users understanding of the provided service and to affect the users

behavior when the message is delivered it is possible to change the level of user-

intrusiveness

Chapter 2 Basic Concepts

21

Deletion

When a pushed message becomes invalid the service provider can delete the

message in the clients For example an email notification becomes invalid when

the message are read

Replacement

When a pushed message is invalid and updated with a new message the service

provider can replace the origin message with a new one

Handling of out of order delivery

Since the wireless communication is unpredictable it can not be ensured that the

messages are received in the same order as sent This mechanism discards all

messages older than the latest received

Expiration

Some services may only be valid for a certain amount of time when the time has

expired the message is removed from the client

245 Service Loading

The service loading method provides means to convey a URI to a user agent in a mobile

client The method is conveyed in an XML message In difference from the service

indication method the client loads the content of the URI automatically without any

action from the user when the service loading message is received

Thereby the user will experience the content as if it was pushed to the mobile client and

executed In the service loading mechanism there is a reference to a service page that will

automatically be loaded without interaction with the user included For example the client

will automatically start the email service when a message about new mails on the server

is received [9]

Chapter 2 Basic Concepts

22

When the client is busy with some application it is not suitable to execute the referred

content directly upon reception of a message To avoid this client may cache the content

indicated by the URI so it becomes available to the user when the client is ready

Messages sent with the service loading method can support mechanism to improve the

end-user-experience

Control of the level of user interaction

To improve the users understanding of the provided service and the affect the

userrsquos behavior when the message is delivered it is possible to change the level

of user-intrusiveness The service can explicitly specify if the service should be

loaded or not if the client is busy on reception

Pre-emptive content caching

By setting this attribute the service loading can require that the indicated content

is downloaded and cached instead of executed This can be used to improve the

users experience of the services that otherwise would have required content to

be retrieved from an origin

23

Chapter Three

3 System requirements

Several materials and requirements must be incorporated into the design implementation

and testing The following discusses the components necessary to fulfill the project

requirements and environment

31 development environment

There are many development tools to choose from when developing for WAP Push and

hen you combine different environments with different gateways you will get a vast

numbers of choices This large flora of tools makes it difficult to choose a suitable

environment an important issue because a badly chosen one might consume a lot of time

341 Operating system

Kannel (the chosen gateway for the system) is being developed on Linux systems and

should be fairly easy to export to other Unix-like systems Although it should be working

without major problems on Windows (through Cygwin) Solaris and FreeBSD The push

initiator is implemented on java so it is operating system independent

Linux is the logical choice especially when it comes to the world severs and networking

for it promising feature as an open source low cost operating system

342 Programming language

Since system design was planned to be modular to enhance the reuse of its components as

explained above then an object oriented programming language will be a reasonable

choice Another factor is the need for a graphical user interface which imposes using a

programming language with good graphics handling capabilities at the same time it

should be over Linux

Chapter 3 System requirements

24

The best programming language to accomplish the above requirement is found to be java

which has the flowing feature

Cross platform - All clients and servers run the same Java code without any

changes or recompilation This simplifies deployment

Cost effective to develop in Java - The java language has many features that

improve developer productivity promote code reuse and reduce development and

maintenance costs

Works well with Open Source - Java with Linux and the many open source

movement projects and libraries provide a powerful mix that ensures development

is cost-effective efficient and of high quality because extensively tested libraries

components and solutions are available to plug-in to customer development

efforts

343 Nokia Mobile Internet Toolkit 41

To design and implement a WAP application on a Nokia phone the Nokia Internet

Toolkit has to be downloaded and installed on the PC A Nokia simulator is installed as

part of the installation but various phone simulators can be downloaded and installed

This simulator is used for testing purpose Also it has a server simulator based on the

Nokia Active Server if a WAP Gateway is unavailable

32 software requirements

Most of this section has been mentioned in way or other but they will be considered

briefly here

321 Kannel WAP gateway

This is an open source gateway upon which the push proxy gateway of this system will

be built on it available free of charge at kannel project web site

Chapter 3 System requirements

25

322 Linux operating system

It is important to install kannel gateway on it for this project we choose fedora core 7 for

availability reasons

323 JDK16

The java run time environment is required to implement the push initiator

32 hardware requirements

321 PC

Any Personal computer capable of running fedora core 7 with USB interface to be able

connects GSM modem

322 GSM modem

This will act as an alternative to the short message service center SMSC Obviously this

means that GSM network is required too

26

Chapter Four

4 System design

41 System Scenario

The basic scenario of a push session is that a Push Initiator (PI) transmits content to a

WAP client This is done in multiple steps as shown in Figure 31

pushOTAPAP

Gateway

PI

1

2

pull gateway

PPG

3

SMS center

Mobile device

6

5

4

Content provider78 9

Figure 41 WAP push scenario

Chapter 4 System Design

27

The PI communicates with a Push Proxy Gateway (PPG) over the Push Access Protocol

(PAP) (1 and 2) The PPG will then use the Push Over-The-Air Protocol (PushOTA) (3)

to deliver a Uniform Resource Identifier (URI) to the client via a Short Message System

Centre (SMS-C) (4 and 5) The next step for the client is then to activate the URI (6 and

7) and get the content from the server (8 and 9) The mobile device will have to use a

ldquoPull Gatewayrdquo to get the content but it is very likely that this is the same one as the PPG

The same same scenario could be viewed in sequence diagram figure (42)

Push Initiator PPG SMS Center WAP client

Send push message

Send push message response

Send WAP push message

Ack

Send WAP push message

Ack

Message read

Ack

Message read

Ack

Result notification message

Result notification response

Figure 42 WAP push sequence diagram

Chapter 4 System Design

28

43 Modular Design

Conceptually we can envision this push system as consisting of three major components

(presented in the order of the push lifetime)

first there is a Push Initiator Program that reads the generates a notification message and

transmits (pushes) it via a WAP Gateway to the customer phone This message notifies

the user that a service is available if the user accepts will ask the phonersquos browser to pull

the page from our web server via the WAP Gateway

Next there is the Push Proxy Gateway PPG which will receive the push message from

the push initiator and is responsible of doing any needed optimization protocol

compilation and conversion Also it is responsibility of the PPG to find the end user

address and send the push message to the SMS center

Finally there is the SMS center which will do the last delivery of push message to the

intended user if the user were offline the message will be saved for later time until the

WAP client is on

PI PPGSMSC

Figure 43 system modules

Chapter 4 System Design

29

43 Design of system Modules

Following sections of this chapter present a description and design of the system modules

with accompanying graphical representation

431 Push Initiator (PI)

The PI is the first logical component in the WAP Push scenario and therefore the

originator of the push message There are different kinds of PIs One example is an

automated script another one is a semi automated server version written in an applicable

scripting language supporting server side interaction

A push message is sent as an HTTP POST to the Push Proxy Gateway The POST will be

a multipart XML document with the first part being the control entity (Push Access

Protocol) the second part being the content entity (either a Service Indication or a

Service Load) and the third part being the capability entity

HTTP Post

Capability entity

Content entity (SISL)

Control entity (PAP)

Figure 44 architecture of the push message

Chapter 4 System Design

30

4311 Control entity

This part of the push contains the basic information and fields The fields can include

recipient address expiry time bearer type delivery attempt time and a URL to which a

response is to be sent if delivery confirmation is requested by the push initiator

PAP is the protocol used in WAP Push framework for specifying control information and

content that is to be pushed to a client via a Push Proxy Gateway (PPG) A Push Initiator

(PI) triggers push message processing The Push initiator class (Appendix B) of this

design shows how to generate PAP messages

The address of the used PPG should be given as an initialization parameter of the

application (ldquoppg-urlrdquo see Appendix B) This design also provides an implementation

that can be used in a special case when ldquoIPv4 IPv6rdquo type client addressing is applied and

when toolkit is used All other cases including the use of phone numbers (ldquoPLMNrdquo type

address) in sending push messages are considered

The PAP XML contains at the minimum a ltpapgt element a ltpush-messagegt

element and an ltaddressgt element

The important parts of this PAP message are the address value and type The value is

typically a MSISDN and type indicates whether to send to a MSISDN (typical case) or to

an IP Address The TYPE is almost always MSISDN as the Push Initiator (PI) will not

typically have the Mobile Stations IP address - which is generally dynamic

4312 Content entity

This is the actual data that is received by the mobile device The various content types

are Service Indication (SI) Service Load (SL) and Cache Operation (CO) in our project

we will just deal with SI and SL

The SI notifies a client about an external event by inviting the client to interact with it In

other words it informs a client about a service More precisely it sends a message that

Chapter 4 System Design

31

informs the client of a Uniform Resource Identifier (URI) where the client can access the

service

An important attribute of SI is the action attribute it may contain the action to be taken

when the client receives the SI There are two groups that the action attributes can be

divided into

First we have delete and signalmdashnone both of them is used because of their side

effects Ie with delete you take away all SIs with the same si-id as the deletion pushrdquo

including itself and with signal-none you either do nothing or you pay regard to the

info element in that push

The other group consists of signal-low signal-medium and signal-high These

attributes are all used to set the rules for the presentation in the terminal device

o Signal-low

The SI must be postponed without user intervention

o Signal-medium

The SI must be presented as soon as the implementation allows that to be carried out

without disturbing the user (Signal-medium is the value that will be used if none is

specified)

o Signal-high

The SI must be presented as soon as the implementation allows that to be carried out

without disturbing the user or earlier if it seems appropriate (This decision may for

instance be based on user preference settings)

This is the different functionalities supported by the SI we concidered

Expiration

Replacement

Deletion

Chapter 4 System Design

32

Handling of out of order delivery

Handling of information specified in the info element

A PUSH Service Indication (SI) contains at a minimum an ltsigt element and a

ltindicationgt element SL donrsquot differ so much from SI

4313 Capability entity

This entity determines the type of mobile device that is to be served This is determined

by WAP user agent profiling The sender can indicate the hardware vendor and browser

version and type of the intended recipients This capability entity is then matched at the

PPG to see which devices are compatible with the requested capability If there is a

match the content is delivered by the PPG to that specific device

Now a day most devices are compatible with WAP so we donrsquot need to create this entity

more precisely it is optional

After the push has been created in the PI it is up to the system to deliver it to the defined

destination In this system the different responsible entities are the PPG and the SMSC

Both of these two different entities are running on same server but it is only the

configuration of the SMSC that is out of my control since it is run by the operator and is

not controllable in my lab environment

432 Push Proxy Gateway (PPG)

There are various commercial WAP gateways available on the market that are quite

expensive Kannel on the other hand is an open source gateway one doesnrsquot need to pay

for it in addition one can edit the source code himself and construct his own customized

gateway Because Kannel is being developed on Linux systems (RedHat and Debian) it

can be smoothly ported to other UNIX-like operating systems

4321 Kannel gateway architecture

The gateway divides the processing load between the following three hosts

Chapter 4 System Design

33

The bearer box which connects to the SMS (Short Message Service) centers and

or CSD (Circuit Switched Data) routers providing a unified interface to them for

the wapbox The bearer box does this by implementing the WDP (Wireless

Datagram Protocol) layer of the WAP stack

The smsbox implements the rest of the SMS gateway functionality It receives

textual SMS messages from the bearerbox and interprets them as service

requests and responds to them in the appropriate way

The wapbox which hosts the upper layers of the WAP stack Each session and its

transactions are handled by the same wapbox (see figure 35)

1Figure 45 divisions of duties in kannel

4322 Working of the gateway

The bearer box receives UDP (User Datagram Protocol) packets from CSD routers

inspects them to see whether they are WAP packets if so then it will routes them to the

WAP box This simple design allows the bearer box to do a minimum of processing per

smsbox

wapbox

bearerbox

Kannel

SMS center

WAP phone

HTTP server

Chapter 4 System Design

34

packet The bearer box also sends the UDP packets that the other boxes generate which

adds some more routing processing The wapboxes implement the WTP (Wireless

Transaction Protocol) and WSP (Wireless Session Protocol) layers These take HTTP-

like requests from the phones and make the actual HTTP requests to content servers

compress the responses and send them back to the terminals (Sessions are maintained to

make as much use of the limited radio bandwidth as possible)

4323 External interfaces of the gateway

The gateway has interfaces to three external agents

bull SMS centers using various protocols

bull HTTP servers to fetch WAP and SMS content and to push WAP Content The

pull protocol is HTTP push PAP

bull WAP phones implementing the WAP protocol stack and (for push) WAP Push

client

Figure 36 summarize kannel external interfaces

4324 Configuring the gateway

The bearerbox smsbox and wapbox are the main working modules of the gateway and

must be configured before configuring the gateway These three modules are controlled

by a configuration file that has wapbox smsbox and bearerbox groups

Configuring the PPG core group

We use two components the PPG core group and the PPG user group The PPG

core group is used to configure the PI interface(for more details configuration

variables refer to appendix c)

Chapter 4 System Design

35

Mobile telephone

network

The Internet

smsbox

wapbox

bearerbox

Kannel

HTTP

HTTP

HTTP server

Serving WML

files

HTTP server

Serving HTML

files

TCP

TCP

WAPSMS

SMSC

WAP phoneNetwork base station

Workstation used for http

administration

Figure 46 External interfaces of the gateway

4325 Administering the gateway through an HTTP interface

Kannel can be administered via an HTTP interface All commands are given as normal

HTTP queries so they can easily be given from command lines like this one

links -dump httpip-adressportshutdownpassword=yourchoice

But it is advantageous to have graphical user interface for gateway control so we have

designed GUI through http

Chapter 4 System Design

36

433 Short Message Service Centre (SMSC)

A SMSC is an essential component when sending a push message from an IP network to

a mobile device in the architecture supported by the components and devices It is used to

remove the TCPIP layer that the push is encapsulatedrdquo in It is also the entity that

identifies the end-point device When this is done it is also the SMSC that is responsible

for the processing and final message delivery to the device After the process of de-

encapsulation and resolution of the client identity there should not be any difference

between this message and a message that is originated locally from the operator itself

(like a SMS)

In this project we just use a virtual SMS center we try first to get connection to a real

one but our effort was worthless

Finally the following figure depicts the overall flowchart of the WAP push system

(figure 47)

Chapter 4 System Design

37

PI

PPG

Create PAP

HTTP Post

Message

processing

OTA

Connection

oriented

Sessionless Session

oriented

WTP Initiation

WAP clinet

Application

Create content

Create

capability

entity

Database

SMS center

NoYes

Figure 47 the complete flowchart of the system

38

Chapter Five

5 System implementation and results

51 Implementation

511 The Push Proxy Gateway

First of all the Kannel gateway have been compiled and installed using gcc (GNU C

Compiler) this stage go fine except the operating system required more components to

be pre-installed and will configured

Then with stages of configuration to the gateway (Appendix B) it was capable of working

as PPG Figure 51 below show the gateway when it starts

Figure 51 starting kannel gateway

Then a web based user interface had been created to provide an easy way to control the

gateway remotely Figure 52 and figure 53

39

Figure 52 GUI for gateway control

512 The Push initiator

Next the push initiator design had been implemented using java programming language

as in design phase the implementation is taken carefully to make a reusable component

that could be used by other developer

PushInitiator class (Appendix B) implements a simple push initiator which can be used

to create and send messages to a push proxy gateway (PPG)

The method sendPushMessage sends a push message via the PPG to the client The client

is identified by the address which is either the phone number (address type is PLMN) or

IP address The message content and its mime type are also given as arguments to the

method the other tow important method are

createPapMessage This method creates a Push Access Protocol (PAP) type message

40

createSiMessage This method is used to create a service indication (SI) type message

Figure 53 showing running kannel status

513 WAP site

Since this site will be built for testing purpose and making sure that the system is

functional we had not go deep in this section Just simple WAP site with tow page has

been crated

41

52 Service indication

When a SI was pushed to any of the emulator or Nokia phones it was received and

presented in the way it was supposed to as specified in the WAP standard as shown in

figures below This is a proof that the devices claiming to support WAP push do so and

the design is will working See figures 53 through 56

Figure 55 service indication

42

Figure 57 SI details

52 Service load

The emulator correctly receives and interpreted the SL push the same as all of Nokia

phones we have tested

When a SL was pushed to the Ericsson phones it was not presented in the specified way

figure 58 I think that it is because of security reasons The reason for this assumption is

that the phones only supports on or off as security in their push configuration The

emulator on the other hand presents SL correctly Finally the Siemens phone did seem to

interpret SL but the current software was not very consistent It did load the SL without

user interference in the specified way when the user already where having an active

session If the user was offline the phone interface presented a symbol on the display

and did not load the service until the user clicked on the symbol

43

Chapter Six

6 conclusion and future work

In this chapter we will provide the conclusions and proposed future work for interested

individuals

61 Conclusions

In this project a WAP push system has been successfully designed and implemented It

provides a way to partially overcome the limitations encountered when accessing the

World Wide Web using handsets After comparing the proposed project objectives with

those accomplished the main goals are seen to be met

Phones from different manufactures all differ from the WAP-standard in some

ways One of the most obvious differences is the resolution of the display

During the work it has been noticed that the WML pages must be quite small We

have also noticed that the support for tables and some other tags are a bit limited

Even though the WML standard is smaller than the HTML standard it is a little

more complicated to write correct WML pages The main conclusion is that WAP

works pretty well but the phones are a little non-stable

The push proxy gateway is configured and worked probably with virtual SMS

center and it is easy to switch to a real one

The system depends mainly on open sources (ie Linux and kannek)

The design and implementation of the push initiator work well with the kannel

gateway and it should work correctly with other gateways

Chapter 6 Conclusion

44

62 Further Work

The possibilities of wireless push are interesting enough that it has to be worth to know if

the security and conformance problems will be solved in WAP push If they are solved

and the technique is refined then there should be nothing to stop the great number of

services that will follow in its footsteps Therefore there is further work that should be

done and the most interesting parts are in my opinion these

621 Security Aspect

One of the problems today is that the phones supporting push does not have the detailed

security settings that a technique like this needs Therefore it would be interesting to look

into the possibility to add these without confusing the user I suggest furthering looking

into usability aspects of security in WAP Push for short

622 GPS integration possibility

This will provide location dependent delivery of WAP push it will have great

applications in telematic and ecommerce advertising

623 Conformance to Standards

An interesting project would be to examine if the main reason for the nonstandard

solutions in the existing WAP push software is the result of difficulties in

implementation Or if the main reason is that the manufacturers wants to provide

proprietary solutions A reason why one may want to know this is that if the problem is

depending on implementation problems then it might get better

45

Appendix A Abbreviations

CDMA Code Division Multiple Access

CO Cache Operation

DTD Document Type Definition

GSM Global System for Mobile

HTTP Hypertext Transfer Protocol

IP Internet Protocol

MSISDN Mobile Station International Subscriber Directory Number

OTA Over The Air

PAP Push Access Protocol

PushOTA Push Over The Air

PDA Personal Digital Assistant

P1 Push Initiator

PLMN Public Land Mobile Networks

PPG Push Proxy Gateway

SI Service Indication

SIA Session Initiation Application

SIR Session Initiation Request

SL Service Loading

SMPP Short Message Peer to Peer

SMS Short Message System

SMSC Short Message System Center

UCP Universal Computer Protocol

URI Uniform Resource Identifier

URL Uniform Resource Locator

UTC Universal Time Coordinated

WAP Wireless Application Protocol

WBXML WAP binary XML

WDP Wireless Datagram Protocol

WSP Wireless Session Protocol

WTLS Wireless Transport Layer Security

XML Extensible Mark-up Language

46

Appendix B Kannel gateway configurations

THIS IS A SAMPLE CONFIGURATION FOR KANNEL

group = core

admin-port = 13000

admin-password = admin

status-password = admin

admin-deny-ip =

admin-allow-ip = 127001172161455

log-file = tmpkannellog

log-level = 0

http-proxy-host = 172161411

http-proxy-port = 8080

http-proxy-exceptions = 127001

Smsbox related

smsbox-port = 13001

box-deny-ip =

box-allow-ip = 127001

bearerbox-host =localhost

Wapbox related

wapbox-port = 13002

udp-deny-ip =

udp-allow-ip = 127001

bearerbox-host =localhost

SMSC GSM

group = smsc

smsc = at

modemtype = auto

speed =9600

device = devttyS0

SMSC HTTP

group = smsc

smsc = http

system-type = kannel

port = 13016

connect-allow-ip = 127001

Appendix B

47

username = wappush

password = wappush

SMSBOX SETUP

group = smsbox

bearerbox-host = localhost

sendsms-port = 13013

sendsms-chars = 0123456789 +-

log-file = tmpsmsboxlog

log-level = 0

access-log = accesslog

white-list = 127001

black-list =

SEND-SMS USERS

group = sendsms-user

username = wappush

password = wappush

user-deny-ip =

user-allow-ip = 127001

PPG group

group = ppg

ppg-url = wappush

ppg-port = 8080

concurrent-pushes = 100

trusted-pi = true

users = 1024

service-name = ppg

ppg-smsbox-id = dlrbox

WAP PUSH USER

group = wap-push-user

wap-push-user = picom

ppg-username = wappush

ppg-password = wappush

allow-ip = localhost

48

Appendix C Selected Codes

Gateway Control Form

ltDOCTYPE HTML PUBLIC -W3CDTD HTML 32ENgt

lthtmlgt ltheadgt

lttitlegtGateway control formlttitlegt

ltheadgt

ltbody bgcolor=white text=black link=blue vlink=navy

alink=redgt

ltbase target=submitgt

ltscriptgt

function update_status()

if ( adminactionvalue == status )

adminaction = http + adminhostnamevalue +

+ adminportvalue + status +

adminstatusformatvalue

else

adminaction = http + adminhostnamevalue +

+ adminportvalue + + adminactionvalue

adminpasswordvalue = adminpasswordvalue

actiongovalue = GO GET +adminaction

ltscriptgt

lttable align=centergt

lttrgtltp align=centergtlth2gtGateway control

formlth2gtltpgtlttrgt

lttrgt lttdgtHostnamelttdgtlttdgtltinput type=text

name=adminhostname value=localhost

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPortlttdgtlttdgtltinput type=text

name=adminport value=13000

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPasswordlttdgtlttdgtltinput type=password

name=adminpassword value=

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtActionlttdgtlttdgtltselect name=adminaction

onChange=update_status()gt

ltoption value=statusgtStatusltoptiongt

ltoption value=suspendgtSuspendltoptiongt

ltoption value=isolategtIsolateltoptiongt

Appendix C

49

ltoption value=shutdowngtShutdownltoptiongt

ltoption value=resumegtResumeltoptiongt

ltselectgtlttdgt lttrgt

lttrgt lttdgtStatus Formatlttdgtlttdgtltselect

name=adminstatusformat onChange=update_status()gt

ltoption value=gthtmlltoptiongtltoption

value=txtgttxtltoptiongtltoption

value=xmlgtxmlltoptiongtltselectgtlttdgt lttrgt

ltform name=admin method=get

action=httplocalhost13000status

encoding=applicationx-www-formgt

ltinput type=hidden name=password value=gt

lttrgt

lttdgtGolttdgt

ltformgt

lttdgtltinput type=submit value=go name=actiongo

onClick=documentadminsubmit()gtlttdgt

lttrgt

lttablegt

ltbodygt

lthtmlgt

Push Initiator Class

import javanetURL

import javanetHttpURLConnection

import javaio

Class implements a simple push initiator It can be

used to create and send messages to push proxy

gateway (ppg)

public final class PushInitiator

xml version

private final static String XML_VERSION = ltxml

version=10gt

Push Access Protocol (PAP) document type

private final static String PAP_DOCTYPE =

Appendix C

50

ltDOCTYPE pap PUBLIC -WAPFORUMDTD PAP 10EN

httpwwwwapforumorgDTDpap_10dtd gt

content type of the push request multipart body

private final static String CONTENT_TYPE =

multipartrelated boundary=multipart-boundary

type=applicationxml

Service Indication (SI) document type

private static final String SI_DOCTYPE = ltDOCTYPE si

PUBLIC -WAPFORUMDTD SI 10EN +

httpwwwwapforumorgDTDsidtdgt

private static int pushId = 0

PPG url where the pap message is to be sent

private final URL ppgUrl

some push proxy gateways may also require the

authentication of the push initiator

For instance the push initiator may be required to

send an HTTP authorization header in each request

private final String authorization

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

public PushInitiator(URL ppgUrl) thisppgUrl =

ppgUrl

authorization = null

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

param authorization a ltcodegtStringltcodegt value

public PushInitiator(URL ppgUrl String authorization)

thisppgUrl = ppgUrl

Appendix C

51

thisauthorization = authorization

Systemoutprintln(Push Initiator created ppgUrl =

+ ppgUrl)

ltcodegtsendPushMessageltcodegt sends push message to

ppg

param clientAddress a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param message a ltcodegtStringltcodegt value

param mimeType a ltcodegtStringltcodegt value

exception Exception if an error occurs

public void sendPushMessage(String clientAddress

String addressTypeString message String mimeType)

throws Exception

HttpURLConnection http =

(HttpURLConnection)ppgUrlopenConnection()

String ppgServer = ppgUrlgetHost()

httpsetDoInput(true)

httpsetRequestProperty(Content-Type CONTENT_TYPE)

if(authorization = null)

if(authorizationtrim()equals())

httpsetRequestProperty(Authorization

authorization)

httpsetDoOutput(true)

PrintWriter out = new PrintWriter(new

BufferedOutputStream(httpgetOutputStream()))

outprintln(--multipart-boundary)

outprintln(Content-type applicationxml)

outprintln()

outprintln(createPapMessage(clientAddress

addressTypeppgServer genPushId() null))

outprintln()

outprintln(--multipart-boundary)

outprintln(Content-type + mimeType)

outprintln()

outprintln(message)

outprintln()

outprintln(--multipart-boundary--)

outflush()

outclose()

httpconnect()

Appendix C

52

finally read and debug the response received from

PPG

try

debugResponse(http)

catch (Exception e)

Systemerrprintln(Error in receiving the

response)

ltcodegtcreatePapMessageltcodegt creates a Push Access

Protocoltype message

param address a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param ppgServer a ltcodegtStringltcodegt value

param pushId a ltcodegtStringltcodegt value

param notificationTo a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createPapMessage(String address

String addressType String ppgServer String pushId

String notificationTo)

return XML_VERSION + n + PAP_DOCTYPE + n +

ltpap product-name=Mobile Zoo Push

Initiatorgtn +

ltpush-message push-id= + pushId +

(notificationTo = null request-notification-

to= + notificationTo ) + gtn +

ltaddress address-value=WAPPUSH= + address +

TYPE= + addressType +

+ ppgServer + gtn +

ltpush-messagegtnltpapgt

ltcodegtcreateSiMessageltcodegt creates a service

indication type message

param url a ltcodegtStringltcodegt value

param created a ltcodegtStringltcodegt value

param expires a ltcodegtStringltcodegt value

Appendix C

53

param message a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createSiMessage(String url

String sid String created String expires String

action String message)

return XML_VERSION + SI_DOCTYPE +

ltsigtn +

ltindication href= + url + +

(sid = null si-id= + sid + ) +

created = null created= + created +

) +

(action = null action= + action +

) +

(expires = null expires= + expires +

) + gt +

message +

ltindicationgtnltsigt

Debug response

param http a ltcodegtHttpURLConnectionltcodegt value

exception Exception if an error occurs

private void debugResponse(HttpURLConnection http)

throws Exception

Systemoutprintln(httpgetResponseMessage())

String headerName

int i=0

while((headerName = httpgetHeaderFieldKey(i++)) =

null)

Systemoutprintln(headerName + +

httpgetHeaderField(headerName))

Systemoutprintln()

InputStreamReader in = new InputStreamReader(new

BufferedInputStream(httpgetInputStream()))

int c

Appendix C

54

while((c = inread()) = -1)

Systemoutprint((char)c)

Systemoutprintln()

ltcodegtgenPushIdltcodegt generates an unique push id

return a ltcodegtStringltcodegt value

private String genPushId()

pushId = 100000

return SystemcurrentTimeMillis() + + pushId++

55

References

[1] Microsoft ldquoGetting Mobile Using WML and WAP to Display Web Sites on

Mobile Devicesrdquo

URL msdnmicrosoftcomen-uslibraryaa140117(office10)aspx accessed

on April 10 2008

[2] DALE BULBROOK ldquoWAPA Beginnerrsquos Guiderdquo OsborneMcGraw-Hill 2001

[3] WAP Forum Wireless Application Protocol Architecture Specification Access on

Jan 12 2008 Available

httpwww1wapforumorgtechdocumentsWAP-210-WAPArch-2006 07 12-apdf

[4] WAP Forum Push Architectural Overview access on (2008 February 3) Available

httpwww1wapforumorgtechdocumentsWAP-250-PushArchOverview-2007 04

03-apdf

[5] Service indication PDF access on 62008 Available

httpwwww3orgTRhtml401structlinkshtml

[6] WAP Push Technology (openwave) PDF access on (2008 April) Available

URL httpwwwopenwavorg

[7] Web site (httpwwwwapforumorgwhatcopyrighthtm) access on May 2008

[8] ldquoWAP Push Proxy Gateway Specificationrdquo WAP Forum access on 16-August-

2007URI httpwwwwapforumorgPDF

[9] WAP Forum Access on (2008 MAY 31) WAP Service Indication Specification

Available httpwww1wapforumorgtechdocumentsWAP-167-ServiceInd-200507

31-apdf

  • odc_fpwmlandwap_topic3
  • N100E3
  • 21
  • 5

Chapter 2 Basic Concepts

19

243 Push Over-The-Air Protocol

The push proxy gateway and the client communicate using the push over the air protocol

which utilizes WSP session services Pushes can be sent via connection oriented links or

connection-less links Connection-oriented pushes require that an active WSP session is

available but the server can not create a session To solve the case were there is no active

WSP session the push framework introduces a session initiation application in the client

This application listens to session requests from the OTA-server and responds by setting

up a WSP session for push purposes [9]

Push

Over-the air

WSP

Push management

premptive

Push operational

primitives

WSP Servise

Primitives

Figure 26 Push Over-The-Air protocol stack

The push over the air protocol supports two kinds of operations operations to manage the

connection and operations to send actual messages

Push Sends unconfirmed information over a connection-oriented link

Confirmed push Sends confirmed information over a connection-oriented link

Abort push rejects a previously transmitted push operation This is operation is

part of the confirmed push mechanism

Unit push Sends unconfirmed information over a connection-less link

Connect Creates a push session

Chapter 2 Basic Concepts

20

Suspend Request that a push session should be suspended

Resume Request to resumes a previously suspended push session

Disconnect Terminates the push session

Session request Request from the server to initialize a session to a client

244 Service Indication

The service indication SI provides a mechanism composed in an XML message to

notify a client that an external asynchronous event has occurred and indicate a service

that can be loaded in order to react to that event In order to notify the user a message is

sent from the push initiator via the proxy to the client The message will be shown to the

user and there will be a reference to a URI where the appropriate service can be loaded

For example the message could be ldquoYou have new mailrdquo and the URI to your email

service [9]

When the message is received by the client it will be presented to the user The user then

can choose to launch the service in an application eg the WML browser or to postpone

the SI for later handling Postponed SIs will be stored in the client and the user is given

the possibility to act upon them later When the user choose to launch the service the

service is started in the same way as if the user would have started it manually [9]

Messages sent with the service indication can support mechanisms to improve the end-

user-experience

User-intrusiveness levels

To improve the users understanding of the provided service and to affect the users

behavior when the message is delivered it is possible to change the level of user-

intrusiveness

Chapter 2 Basic Concepts

21

Deletion

When a pushed message becomes invalid the service provider can delete the

message in the clients For example an email notification becomes invalid when

the message are read

Replacement

When a pushed message is invalid and updated with a new message the service

provider can replace the origin message with a new one

Handling of out of order delivery

Since the wireless communication is unpredictable it can not be ensured that the

messages are received in the same order as sent This mechanism discards all

messages older than the latest received

Expiration

Some services may only be valid for a certain amount of time when the time has

expired the message is removed from the client

245 Service Loading

The service loading method provides means to convey a URI to a user agent in a mobile

client The method is conveyed in an XML message In difference from the service

indication method the client loads the content of the URI automatically without any

action from the user when the service loading message is received

Thereby the user will experience the content as if it was pushed to the mobile client and

executed In the service loading mechanism there is a reference to a service page that will

automatically be loaded without interaction with the user included For example the client

will automatically start the email service when a message about new mails on the server

is received [9]

Chapter 2 Basic Concepts

22

When the client is busy with some application it is not suitable to execute the referred

content directly upon reception of a message To avoid this client may cache the content

indicated by the URI so it becomes available to the user when the client is ready

Messages sent with the service loading method can support mechanism to improve the

end-user-experience

Control of the level of user interaction

To improve the users understanding of the provided service and the affect the

userrsquos behavior when the message is delivered it is possible to change the level

of user-intrusiveness The service can explicitly specify if the service should be

loaded or not if the client is busy on reception

Pre-emptive content caching

By setting this attribute the service loading can require that the indicated content

is downloaded and cached instead of executed This can be used to improve the

users experience of the services that otherwise would have required content to

be retrieved from an origin

23

Chapter Three

3 System requirements

Several materials and requirements must be incorporated into the design implementation

and testing The following discusses the components necessary to fulfill the project

requirements and environment

31 development environment

There are many development tools to choose from when developing for WAP Push and

hen you combine different environments with different gateways you will get a vast

numbers of choices This large flora of tools makes it difficult to choose a suitable

environment an important issue because a badly chosen one might consume a lot of time

341 Operating system

Kannel (the chosen gateway for the system) is being developed on Linux systems and

should be fairly easy to export to other Unix-like systems Although it should be working

without major problems on Windows (through Cygwin) Solaris and FreeBSD The push

initiator is implemented on java so it is operating system independent

Linux is the logical choice especially when it comes to the world severs and networking

for it promising feature as an open source low cost operating system

342 Programming language

Since system design was planned to be modular to enhance the reuse of its components as

explained above then an object oriented programming language will be a reasonable

choice Another factor is the need for a graphical user interface which imposes using a

programming language with good graphics handling capabilities at the same time it

should be over Linux

Chapter 3 System requirements

24

The best programming language to accomplish the above requirement is found to be java

which has the flowing feature

Cross platform - All clients and servers run the same Java code without any

changes or recompilation This simplifies deployment

Cost effective to develop in Java - The java language has many features that

improve developer productivity promote code reuse and reduce development and

maintenance costs

Works well with Open Source - Java with Linux and the many open source

movement projects and libraries provide a powerful mix that ensures development

is cost-effective efficient and of high quality because extensively tested libraries

components and solutions are available to plug-in to customer development

efforts

343 Nokia Mobile Internet Toolkit 41

To design and implement a WAP application on a Nokia phone the Nokia Internet

Toolkit has to be downloaded and installed on the PC A Nokia simulator is installed as

part of the installation but various phone simulators can be downloaded and installed

This simulator is used for testing purpose Also it has a server simulator based on the

Nokia Active Server if a WAP Gateway is unavailable

32 software requirements

Most of this section has been mentioned in way or other but they will be considered

briefly here

321 Kannel WAP gateway

This is an open source gateway upon which the push proxy gateway of this system will

be built on it available free of charge at kannel project web site

Chapter 3 System requirements

25

322 Linux operating system

It is important to install kannel gateway on it for this project we choose fedora core 7 for

availability reasons

323 JDK16

The java run time environment is required to implement the push initiator

32 hardware requirements

321 PC

Any Personal computer capable of running fedora core 7 with USB interface to be able

connects GSM modem

322 GSM modem

This will act as an alternative to the short message service center SMSC Obviously this

means that GSM network is required too

26

Chapter Four

4 System design

41 System Scenario

The basic scenario of a push session is that a Push Initiator (PI) transmits content to a

WAP client This is done in multiple steps as shown in Figure 31

pushOTAPAP

Gateway

PI

1

2

pull gateway

PPG

3

SMS center

Mobile device

6

5

4

Content provider78 9

Figure 41 WAP push scenario

Chapter 4 System Design

27

The PI communicates with a Push Proxy Gateway (PPG) over the Push Access Protocol

(PAP) (1 and 2) The PPG will then use the Push Over-The-Air Protocol (PushOTA) (3)

to deliver a Uniform Resource Identifier (URI) to the client via a Short Message System

Centre (SMS-C) (4 and 5) The next step for the client is then to activate the URI (6 and

7) and get the content from the server (8 and 9) The mobile device will have to use a

ldquoPull Gatewayrdquo to get the content but it is very likely that this is the same one as the PPG

The same same scenario could be viewed in sequence diagram figure (42)

Push Initiator PPG SMS Center WAP client

Send push message

Send push message response

Send WAP push message

Ack

Send WAP push message

Ack

Message read

Ack

Message read

Ack

Result notification message

Result notification response

Figure 42 WAP push sequence diagram

Chapter 4 System Design

28

43 Modular Design

Conceptually we can envision this push system as consisting of three major components

(presented in the order of the push lifetime)

first there is a Push Initiator Program that reads the generates a notification message and

transmits (pushes) it via a WAP Gateway to the customer phone This message notifies

the user that a service is available if the user accepts will ask the phonersquos browser to pull

the page from our web server via the WAP Gateway

Next there is the Push Proxy Gateway PPG which will receive the push message from

the push initiator and is responsible of doing any needed optimization protocol

compilation and conversion Also it is responsibility of the PPG to find the end user

address and send the push message to the SMS center

Finally there is the SMS center which will do the last delivery of push message to the

intended user if the user were offline the message will be saved for later time until the

WAP client is on

PI PPGSMSC

Figure 43 system modules

Chapter 4 System Design

29

43 Design of system Modules

Following sections of this chapter present a description and design of the system modules

with accompanying graphical representation

431 Push Initiator (PI)

The PI is the first logical component in the WAP Push scenario and therefore the

originator of the push message There are different kinds of PIs One example is an

automated script another one is a semi automated server version written in an applicable

scripting language supporting server side interaction

A push message is sent as an HTTP POST to the Push Proxy Gateway The POST will be

a multipart XML document with the first part being the control entity (Push Access

Protocol) the second part being the content entity (either a Service Indication or a

Service Load) and the third part being the capability entity

HTTP Post

Capability entity

Content entity (SISL)

Control entity (PAP)

Figure 44 architecture of the push message

Chapter 4 System Design

30

4311 Control entity

This part of the push contains the basic information and fields The fields can include

recipient address expiry time bearer type delivery attempt time and a URL to which a

response is to be sent if delivery confirmation is requested by the push initiator

PAP is the protocol used in WAP Push framework for specifying control information and

content that is to be pushed to a client via a Push Proxy Gateway (PPG) A Push Initiator

(PI) triggers push message processing The Push initiator class (Appendix B) of this

design shows how to generate PAP messages

The address of the used PPG should be given as an initialization parameter of the

application (ldquoppg-urlrdquo see Appendix B) This design also provides an implementation

that can be used in a special case when ldquoIPv4 IPv6rdquo type client addressing is applied and

when toolkit is used All other cases including the use of phone numbers (ldquoPLMNrdquo type

address) in sending push messages are considered

The PAP XML contains at the minimum a ltpapgt element a ltpush-messagegt

element and an ltaddressgt element

The important parts of this PAP message are the address value and type The value is

typically a MSISDN and type indicates whether to send to a MSISDN (typical case) or to

an IP Address The TYPE is almost always MSISDN as the Push Initiator (PI) will not

typically have the Mobile Stations IP address - which is generally dynamic

4312 Content entity

This is the actual data that is received by the mobile device The various content types

are Service Indication (SI) Service Load (SL) and Cache Operation (CO) in our project

we will just deal with SI and SL

The SI notifies a client about an external event by inviting the client to interact with it In

other words it informs a client about a service More precisely it sends a message that

Chapter 4 System Design

31

informs the client of a Uniform Resource Identifier (URI) where the client can access the

service

An important attribute of SI is the action attribute it may contain the action to be taken

when the client receives the SI There are two groups that the action attributes can be

divided into

First we have delete and signalmdashnone both of them is used because of their side

effects Ie with delete you take away all SIs with the same si-id as the deletion pushrdquo

including itself and with signal-none you either do nothing or you pay regard to the

info element in that push

The other group consists of signal-low signal-medium and signal-high These

attributes are all used to set the rules for the presentation in the terminal device

o Signal-low

The SI must be postponed without user intervention

o Signal-medium

The SI must be presented as soon as the implementation allows that to be carried out

without disturbing the user (Signal-medium is the value that will be used if none is

specified)

o Signal-high

The SI must be presented as soon as the implementation allows that to be carried out

without disturbing the user or earlier if it seems appropriate (This decision may for

instance be based on user preference settings)

This is the different functionalities supported by the SI we concidered

Expiration

Replacement

Deletion

Chapter 4 System Design

32

Handling of out of order delivery

Handling of information specified in the info element

A PUSH Service Indication (SI) contains at a minimum an ltsigt element and a

ltindicationgt element SL donrsquot differ so much from SI

4313 Capability entity

This entity determines the type of mobile device that is to be served This is determined

by WAP user agent profiling The sender can indicate the hardware vendor and browser

version and type of the intended recipients This capability entity is then matched at the

PPG to see which devices are compatible with the requested capability If there is a

match the content is delivered by the PPG to that specific device

Now a day most devices are compatible with WAP so we donrsquot need to create this entity

more precisely it is optional

After the push has been created in the PI it is up to the system to deliver it to the defined

destination In this system the different responsible entities are the PPG and the SMSC

Both of these two different entities are running on same server but it is only the

configuration of the SMSC that is out of my control since it is run by the operator and is

not controllable in my lab environment

432 Push Proxy Gateway (PPG)

There are various commercial WAP gateways available on the market that are quite

expensive Kannel on the other hand is an open source gateway one doesnrsquot need to pay

for it in addition one can edit the source code himself and construct his own customized

gateway Because Kannel is being developed on Linux systems (RedHat and Debian) it

can be smoothly ported to other UNIX-like operating systems

4321 Kannel gateway architecture

The gateway divides the processing load between the following three hosts

Chapter 4 System Design

33

The bearer box which connects to the SMS (Short Message Service) centers and

or CSD (Circuit Switched Data) routers providing a unified interface to them for

the wapbox The bearer box does this by implementing the WDP (Wireless

Datagram Protocol) layer of the WAP stack

The smsbox implements the rest of the SMS gateway functionality It receives

textual SMS messages from the bearerbox and interprets them as service

requests and responds to them in the appropriate way

The wapbox which hosts the upper layers of the WAP stack Each session and its

transactions are handled by the same wapbox (see figure 35)

1Figure 45 divisions of duties in kannel

4322 Working of the gateway

The bearer box receives UDP (User Datagram Protocol) packets from CSD routers

inspects them to see whether they are WAP packets if so then it will routes them to the

WAP box This simple design allows the bearer box to do a minimum of processing per

smsbox

wapbox

bearerbox

Kannel

SMS center

WAP phone

HTTP server

Chapter 4 System Design

34

packet The bearer box also sends the UDP packets that the other boxes generate which

adds some more routing processing The wapboxes implement the WTP (Wireless

Transaction Protocol) and WSP (Wireless Session Protocol) layers These take HTTP-

like requests from the phones and make the actual HTTP requests to content servers

compress the responses and send them back to the terminals (Sessions are maintained to

make as much use of the limited radio bandwidth as possible)

4323 External interfaces of the gateway

The gateway has interfaces to three external agents

bull SMS centers using various protocols

bull HTTP servers to fetch WAP and SMS content and to push WAP Content The

pull protocol is HTTP push PAP

bull WAP phones implementing the WAP protocol stack and (for push) WAP Push

client

Figure 36 summarize kannel external interfaces

4324 Configuring the gateway

The bearerbox smsbox and wapbox are the main working modules of the gateway and

must be configured before configuring the gateway These three modules are controlled

by a configuration file that has wapbox smsbox and bearerbox groups

Configuring the PPG core group

We use two components the PPG core group and the PPG user group The PPG

core group is used to configure the PI interface(for more details configuration

variables refer to appendix c)

Chapter 4 System Design

35

Mobile telephone

network

The Internet

smsbox

wapbox

bearerbox

Kannel

HTTP

HTTP

HTTP server

Serving WML

files

HTTP server

Serving HTML

files

TCP

TCP

WAPSMS

SMSC

WAP phoneNetwork base station

Workstation used for http

administration

Figure 46 External interfaces of the gateway

4325 Administering the gateway through an HTTP interface

Kannel can be administered via an HTTP interface All commands are given as normal

HTTP queries so they can easily be given from command lines like this one

links -dump httpip-adressportshutdownpassword=yourchoice

But it is advantageous to have graphical user interface for gateway control so we have

designed GUI through http

Chapter 4 System Design

36

433 Short Message Service Centre (SMSC)

A SMSC is an essential component when sending a push message from an IP network to

a mobile device in the architecture supported by the components and devices It is used to

remove the TCPIP layer that the push is encapsulatedrdquo in It is also the entity that

identifies the end-point device When this is done it is also the SMSC that is responsible

for the processing and final message delivery to the device After the process of de-

encapsulation and resolution of the client identity there should not be any difference

between this message and a message that is originated locally from the operator itself

(like a SMS)

In this project we just use a virtual SMS center we try first to get connection to a real

one but our effort was worthless

Finally the following figure depicts the overall flowchart of the WAP push system

(figure 47)

Chapter 4 System Design

37

PI

PPG

Create PAP

HTTP Post

Message

processing

OTA

Connection

oriented

Sessionless Session

oriented

WTP Initiation

WAP clinet

Application

Create content

Create

capability

entity

Database

SMS center

NoYes

Figure 47 the complete flowchart of the system

38

Chapter Five

5 System implementation and results

51 Implementation

511 The Push Proxy Gateway

First of all the Kannel gateway have been compiled and installed using gcc (GNU C

Compiler) this stage go fine except the operating system required more components to

be pre-installed and will configured

Then with stages of configuration to the gateway (Appendix B) it was capable of working

as PPG Figure 51 below show the gateway when it starts

Figure 51 starting kannel gateway

Then a web based user interface had been created to provide an easy way to control the

gateway remotely Figure 52 and figure 53

39

Figure 52 GUI for gateway control

512 The Push initiator

Next the push initiator design had been implemented using java programming language

as in design phase the implementation is taken carefully to make a reusable component

that could be used by other developer

PushInitiator class (Appendix B) implements a simple push initiator which can be used

to create and send messages to a push proxy gateway (PPG)

The method sendPushMessage sends a push message via the PPG to the client The client

is identified by the address which is either the phone number (address type is PLMN) or

IP address The message content and its mime type are also given as arguments to the

method the other tow important method are

createPapMessage This method creates a Push Access Protocol (PAP) type message

40

createSiMessage This method is used to create a service indication (SI) type message

Figure 53 showing running kannel status

513 WAP site

Since this site will be built for testing purpose and making sure that the system is

functional we had not go deep in this section Just simple WAP site with tow page has

been crated

41

52 Service indication

When a SI was pushed to any of the emulator or Nokia phones it was received and

presented in the way it was supposed to as specified in the WAP standard as shown in

figures below This is a proof that the devices claiming to support WAP push do so and

the design is will working See figures 53 through 56

Figure 55 service indication

42

Figure 57 SI details

52 Service load

The emulator correctly receives and interpreted the SL push the same as all of Nokia

phones we have tested

When a SL was pushed to the Ericsson phones it was not presented in the specified way

figure 58 I think that it is because of security reasons The reason for this assumption is

that the phones only supports on or off as security in their push configuration The

emulator on the other hand presents SL correctly Finally the Siemens phone did seem to

interpret SL but the current software was not very consistent It did load the SL without

user interference in the specified way when the user already where having an active

session If the user was offline the phone interface presented a symbol on the display

and did not load the service until the user clicked on the symbol

43

Chapter Six

6 conclusion and future work

In this chapter we will provide the conclusions and proposed future work for interested

individuals

61 Conclusions

In this project a WAP push system has been successfully designed and implemented It

provides a way to partially overcome the limitations encountered when accessing the

World Wide Web using handsets After comparing the proposed project objectives with

those accomplished the main goals are seen to be met

Phones from different manufactures all differ from the WAP-standard in some

ways One of the most obvious differences is the resolution of the display

During the work it has been noticed that the WML pages must be quite small We

have also noticed that the support for tables and some other tags are a bit limited

Even though the WML standard is smaller than the HTML standard it is a little

more complicated to write correct WML pages The main conclusion is that WAP

works pretty well but the phones are a little non-stable

The push proxy gateway is configured and worked probably with virtual SMS

center and it is easy to switch to a real one

The system depends mainly on open sources (ie Linux and kannek)

The design and implementation of the push initiator work well with the kannel

gateway and it should work correctly with other gateways

Chapter 6 Conclusion

44

62 Further Work

The possibilities of wireless push are interesting enough that it has to be worth to know if

the security and conformance problems will be solved in WAP push If they are solved

and the technique is refined then there should be nothing to stop the great number of

services that will follow in its footsteps Therefore there is further work that should be

done and the most interesting parts are in my opinion these

621 Security Aspect

One of the problems today is that the phones supporting push does not have the detailed

security settings that a technique like this needs Therefore it would be interesting to look

into the possibility to add these without confusing the user I suggest furthering looking

into usability aspects of security in WAP Push for short

622 GPS integration possibility

This will provide location dependent delivery of WAP push it will have great

applications in telematic and ecommerce advertising

623 Conformance to Standards

An interesting project would be to examine if the main reason for the nonstandard

solutions in the existing WAP push software is the result of difficulties in

implementation Or if the main reason is that the manufacturers wants to provide

proprietary solutions A reason why one may want to know this is that if the problem is

depending on implementation problems then it might get better

45

Appendix A Abbreviations

CDMA Code Division Multiple Access

CO Cache Operation

DTD Document Type Definition

GSM Global System for Mobile

HTTP Hypertext Transfer Protocol

IP Internet Protocol

MSISDN Mobile Station International Subscriber Directory Number

OTA Over The Air

PAP Push Access Protocol

PushOTA Push Over The Air

PDA Personal Digital Assistant

P1 Push Initiator

PLMN Public Land Mobile Networks

PPG Push Proxy Gateway

SI Service Indication

SIA Session Initiation Application

SIR Session Initiation Request

SL Service Loading

SMPP Short Message Peer to Peer

SMS Short Message System

SMSC Short Message System Center

UCP Universal Computer Protocol

URI Uniform Resource Identifier

URL Uniform Resource Locator

UTC Universal Time Coordinated

WAP Wireless Application Protocol

WBXML WAP binary XML

WDP Wireless Datagram Protocol

WSP Wireless Session Protocol

WTLS Wireless Transport Layer Security

XML Extensible Mark-up Language

46

Appendix B Kannel gateway configurations

THIS IS A SAMPLE CONFIGURATION FOR KANNEL

group = core

admin-port = 13000

admin-password = admin

status-password = admin

admin-deny-ip =

admin-allow-ip = 127001172161455

log-file = tmpkannellog

log-level = 0

http-proxy-host = 172161411

http-proxy-port = 8080

http-proxy-exceptions = 127001

Smsbox related

smsbox-port = 13001

box-deny-ip =

box-allow-ip = 127001

bearerbox-host =localhost

Wapbox related

wapbox-port = 13002

udp-deny-ip =

udp-allow-ip = 127001

bearerbox-host =localhost

SMSC GSM

group = smsc

smsc = at

modemtype = auto

speed =9600

device = devttyS0

SMSC HTTP

group = smsc

smsc = http

system-type = kannel

port = 13016

connect-allow-ip = 127001

Appendix B

47

username = wappush

password = wappush

SMSBOX SETUP

group = smsbox

bearerbox-host = localhost

sendsms-port = 13013

sendsms-chars = 0123456789 +-

log-file = tmpsmsboxlog

log-level = 0

access-log = accesslog

white-list = 127001

black-list =

SEND-SMS USERS

group = sendsms-user

username = wappush

password = wappush

user-deny-ip =

user-allow-ip = 127001

PPG group

group = ppg

ppg-url = wappush

ppg-port = 8080

concurrent-pushes = 100

trusted-pi = true

users = 1024

service-name = ppg

ppg-smsbox-id = dlrbox

WAP PUSH USER

group = wap-push-user

wap-push-user = picom

ppg-username = wappush

ppg-password = wappush

allow-ip = localhost

48

Appendix C Selected Codes

Gateway Control Form

ltDOCTYPE HTML PUBLIC -W3CDTD HTML 32ENgt

lthtmlgt ltheadgt

lttitlegtGateway control formlttitlegt

ltheadgt

ltbody bgcolor=white text=black link=blue vlink=navy

alink=redgt

ltbase target=submitgt

ltscriptgt

function update_status()

if ( adminactionvalue == status )

adminaction = http + adminhostnamevalue +

+ adminportvalue + status +

adminstatusformatvalue

else

adminaction = http + adminhostnamevalue +

+ adminportvalue + + adminactionvalue

adminpasswordvalue = adminpasswordvalue

actiongovalue = GO GET +adminaction

ltscriptgt

lttable align=centergt

lttrgtltp align=centergtlth2gtGateway control

formlth2gtltpgtlttrgt

lttrgt lttdgtHostnamelttdgtlttdgtltinput type=text

name=adminhostname value=localhost

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPortlttdgtlttdgtltinput type=text

name=adminport value=13000

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPasswordlttdgtlttdgtltinput type=password

name=adminpassword value=

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtActionlttdgtlttdgtltselect name=adminaction

onChange=update_status()gt

ltoption value=statusgtStatusltoptiongt

ltoption value=suspendgtSuspendltoptiongt

ltoption value=isolategtIsolateltoptiongt

Appendix C

49

ltoption value=shutdowngtShutdownltoptiongt

ltoption value=resumegtResumeltoptiongt

ltselectgtlttdgt lttrgt

lttrgt lttdgtStatus Formatlttdgtlttdgtltselect

name=adminstatusformat onChange=update_status()gt

ltoption value=gthtmlltoptiongtltoption

value=txtgttxtltoptiongtltoption

value=xmlgtxmlltoptiongtltselectgtlttdgt lttrgt

ltform name=admin method=get

action=httplocalhost13000status

encoding=applicationx-www-formgt

ltinput type=hidden name=password value=gt

lttrgt

lttdgtGolttdgt

ltformgt

lttdgtltinput type=submit value=go name=actiongo

onClick=documentadminsubmit()gtlttdgt

lttrgt

lttablegt

ltbodygt

lthtmlgt

Push Initiator Class

import javanetURL

import javanetHttpURLConnection

import javaio

Class implements a simple push initiator It can be

used to create and send messages to push proxy

gateway (ppg)

public final class PushInitiator

xml version

private final static String XML_VERSION = ltxml

version=10gt

Push Access Protocol (PAP) document type

private final static String PAP_DOCTYPE =

Appendix C

50

ltDOCTYPE pap PUBLIC -WAPFORUMDTD PAP 10EN

httpwwwwapforumorgDTDpap_10dtd gt

content type of the push request multipart body

private final static String CONTENT_TYPE =

multipartrelated boundary=multipart-boundary

type=applicationxml

Service Indication (SI) document type

private static final String SI_DOCTYPE = ltDOCTYPE si

PUBLIC -WAPFORUMDTD SI 10EN +

httpwwwwapforumorgDTDsidtdgt

private static int pushId = 0

PPG url where the pap message is to be sent

private final URL ppgUrl

some push proxy gateways may also require the

authentication of the push initiator

For instance the push initiator may be required to

send an HTTP authorization header in each request

private final String authorization

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

public PushInitiator(URL ppgUrl) thisppgUrl =

ppgUrl

authorization = null

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

param authorization a ltcodegtStringltcodegt value

public PushInitiator(URL ppgUrl String authorization)

thisppgUrl = ppgUrl

Appendix C

51

thisauthorization = authorization

Systemoutprintln(Push Initiator created ppgUrl =

+ ppgUrl)

ltcodegtsendPushMessageltcodegt sends push message to

ppg

param clientAddress a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param message a ltcodegtStringltcodegt value

param mimeType a ltcodegtStringltcodegt value

exception Exception if an error occurs

public void sendPushMessage(String clientAddress

String addressTypeString message String mimeType)

throws Exception

HttpURLConnection http =

(HttpURLConnection)ppgUrlopenConnection()

String ppgServer = ppgUrlgetHost()

httpsetDoInput(true)

httpsetRequestProperty(Content-Type CONTENT_TYPE)

if(authorization = null)

if(authorizationtrim()equals())

httpsetRequestProperty(Authorization

authorization)

httpsetDoOutput(true)

PrintWriter out = new PrintWriter(new

BufferedOutputStream(httpgetOutputStream()))

outprintln(--multipart-boundary)

outprintln(Content-type applicationxml)

outprintln()

outprintln(createPapMessage(clientAddress

addressTypeppgServer genPushId() null))

outprintln()

outprintln(--multipart-boundary)

outprintln(Content-type + mimeType)

outprintln()

outprintln(message)

outprintln()

outprintln(--multipart-boundary--)

outflush()

outclose()

httpconnect()

Appendix C

52

finally read and debug the response received from

PPG

try

debugResponse(http)

catch (Exception e)

Systemerrprintln(Error in receiving the

response)

ltcodegtcreatePapMessageltcodegt creates a Push Access

Protocoltype message

param address a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param ppgServer a ltcodegtStringltcodegt value

param pushId a ltcodegtStringltcodegt value

param notificationTo a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createPapMessage(String address

String addressType String ppgServer String pushId

String notificationTo)

return XML_VERSION + n + PAP_DOCTYPE + n +

ltpap product-name=Mobile Zoo Push

Initiatorgtn +

ltpush-message push-id= + pushId +

(notificationTo = null request-notification-

to= + notificationTo ) + gtn +

ltaddress address-value=WAPPUSH= + address +

TYPE= + addressType +

+ ppgServer + gtn +

ltpush-messagegtnltpapgt

ltcodegtcreateSiMessageltcodegt creates a service

indication type message

param url a ltcodegtStringltcodegt value

param created a ltcodegtStringltcodegt value

param expires a ltcodegtStringltcodegt value

Appendix C

53

param message a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createSiMessage(String url

String sid String created String expires String

action String message)

return XML_VERSION + SI_DOCTYPE +

ltsigtn +

ltindication href= + url + +

(sid = null si-id= + sid + ) +

created = null created= + created +

) +

(action = null action= + action +

) +

(expires = null expires= + expires +

) + gt +

message +

ltindicationgtnltsigt

Debug response

param http a ltcodegtHttpURLConnectionltcodegt value

exception Exception if an error occurs

private void debugResponse(HttpURLConnection http)

throws Exception

Systemoutprintln(httpgetResponseMessage())

String headerName

int i=0

while((headerName = httpgetHeaderFieldKey(i++)) =

null)

Systemoutprintln(headerName + +

httpgetHeaderField(headerName))

Systemoutprintln()

InputStreamReader in = new InputStreamReader(new

BufferedInputStream(httpgetInputStream()))

int c

Appendix C

54

while((c = inread()) = -1)

Systemoutprint((char)c)

Systemoutprintln()

ltcodegtgenPushIdltcodegt generates an unique push id

return a ltcodegtStringltcodegt value

private String genPushId()

pushId = 100000

return SystemcurrentTimeMillis() + + pushId++

55

References

[1] Microsoft ldquoGetting Mobile Using WML and WAP to Display Web Sites on

Mobile Devicesrdquo

URL msdnmicrosoftcomen-uslibraryaa140117(office10)aspx accessed

on April 10 2008

[2] DALE BULBROOK ldquoWAPA Beginnerrsquos Guiderdquo OsborneMcGraw-Hill 2001

[3] WAP Forum Wireless Application Protocol Architecture Specification Access on

Jan 12 2008 Available

httpwww1wapforumorgtechdocumentsWAP-210-WAPArch-2006 07 12-apdf

[4] WAP Forum Push Architectural Overview access on (2008 February 3) Available

httpwww1wapforumorgtechdocumentsWAP-250-PushArchOverview-2007 04

03-apdf

[5] Service indication PDF access on 62008 Available

httpwwww3orgTRhtml401structlinkshtml

[6] WAP Push Technology (openwave) PDF access on (2008 April) Available

URL httpwwwopenwavorg

[7] Web site (httpwwwwapforumorgwhatcopyrighthtm) access on May 2008

[8] ldquoWAP Push Proxy Gateway Specificationrdquo WAP Forum access on 16-August-

2007URI httpwwwwapforumorgPDF

[9] WAP Forum Access on (2008 MAY 31) WAP Service Indication Specification

Available httpwww1wapforumorgtechdocumentsWAP-167-ServiceInd-200507

31-apdf

  • odc_fpwmlandwap_topic3
  • N100E3
  • 21
  • 5

Chapter 2 Basic Concepts

20

Suspend Request that a push session should be suspended

Resume Request to resumes a previously suspended push session

Disconnect Terminates the push session

Session request Request from the server to initialize a session to a client

244 Service Indication

The service indication SI provides a mechanism composed in an XML message to

notify a client that an external asynchronous event has occurred and indicate a service

that can be loaded in order to react to that event In order to notify the user a message is

sent from the push initiator via the proxy to the client The message will be shown to the

user and there will be a reference to a URI where the appropriate service can be loaded

For example the message could be ldquoYou have new mailrdquo and the URI to your email

service [9]

When the message is received by the client it will be presented to the user The user then

can choose to launch the service in an application eg the WML browser or to postpone

the SI for later handling Postponed SIs will be stored in the client and the user is given

the possibility to act upon them later When the user choose to launch the service the

service is started in the same way as if the user would have started it manually [9]

Messages sent with the service indication can support mechanisms to improve the end-

user-experience

User-intrusiveness levels

To improve the users understanding of the provided service and to affect the users

behavior when the message is delivered it is possible to change the level of user-

intrusiveness

Chapter 2 Basic Concepts

21

Deletion

When a pushed message becomes invalid the service provider can delete the

message in the clients For example an email notification becomes invalid when

the message are read

Replacement

When a pushed message is invalid and updated with a new message the service

provider can replace the origin message with a new one

Handling of out of order delivery

Since the wireless communication is unpredictable it can not be ensured that the

messages are received in the same order as sent This mechanism discards all

messages older than the latest received

Expiration

Some services may only be valid for a certain amount of time when the time has

expired the message is removed from the client

245 Service Loading

The service loading method provides means to convey a URI to a user agent in a mobile

client The method is conveyed in an XML message In difference from the service

indication method the client loads the content of the URI automatically without any

action from the user when the service loading message is received

Thereby the user will experience the content as if it was pushed to the mobile client and

executed In the service loading mechanism there is a reference to a service page that will

automatically be loaded without interaction with the user included For example the client

will automatically start the email service when a message about new mails on the server

is received [9]

Chapter 2 Basic Concepts

22

When the client is busy with some application it is not suitable to execute the referred

content directly upon reception of a message To avoid this client may cache the content

indicated by the URI so it becomes available to the user when the client is ready

Messages sent with the service loading method can support mechanism to improve the

end-user-experience

Control of the level of user interaction

To improve the users understanding of the provided service and the affect the

userrsquos behavior when the message is delivered it is possible to change the level

of user-intrusiveness The service can explicitly specify if the service should be

loaded or not if the client is busy on reception

Pre-emptive content caching

By setting this attribute the service loading can require that the indicated content

is downloaded and cached instead of executed This can be used to improve the

users experience of the services that otherwise would have required content to

be retrieved from an origin

23

Chapter Three

3 System requirements

Several materials and requirements must be incorporated into the design implementation

and testing The following discusses the components necessary to fulfill the project

requirements and environment

31 development environment

There are many development tools to choose from when developing for WAP Push and

hen you combine different environments with different gateways you will get a vast

numbers of choices This large flora of tools makes it difficult to choose a suitable

environment an important issue because a badly chosen one might consume a lot of time

341 Operating system

Kannel (the chosen gateway for the system) is being developed on Linux systems and

should be fairly easy to export to other Unix-like systems Although it should be working

without major problems on Windows (through Cygwin) Solaris and FreeBSD The push

initiator is implemented on java so it is operating system independent

Linux is the logical choice especially when it comes to the world severs and networking

for it promising feature as an open source low cost operating system

342 Programming language

Since system design was planned to be modular to enhance the reuse of its components as

explained above then an object oriented programming language will be a reasonable

choice Another factor is the need for a graphical user interface which imposes using a

programming language with good graphics handling capabilities at the same time it

should be over Linux

Chapter 3 System requirements

24

The best programming language to accomplish the above requirement is found to be java

which has the flowing feature

Cross platform - All clients and servers run the same Java code without any

changes or recompilation This simplifies deployment

Cost effective to develop in Java - The java language has many features that

improve developer productivity promote code reuse and reduce development and

maintenance costs

Works well with Open Source - Java with Linux and the many open source

movement projects and libraries provide a powerful mix that ensures development

is cost-effective efficient and of high quality because extensively tested libraries

components and solutions are available to plug-in to customer development

efforts

343 Nokia Mobile Internet Toolkit 41

To design and implement a WAP application on a Nokia phone the Nokia Internet

Toolkit has to be downloaded and installed on the PC A Nokia simulator is installed as

part of the installation but various phone simulators can be downloaded and installed

This simulator is used for testing purpose Also it has a server simulator based on the

Nokia Active Server if a WAP Gateway is unavailable

32 software requirements

Most of this section has been mentioned in way or other but they will be considered

briefly here

321 Kannel WAP gateway

This is an open source gateway upon which the push proxy gateway of this system will

be built on it available free of charge at kannel project web site

Chapter 3 System requirements

25

322 Linux operating system

It is important to install kannel gateway on it for this project we choose fedora core 7 for

availability reasons

323 JDK16

The java run time environment is required to implement the push initiator

32 hardware requirements

321 PC

Any Personal computer capable of running fedora core 7 with USB interface to be able

connects GSM modem

322 GSM modem

This will act as an alternative to the short message service center SMSC Obviously this

means that GSM network is required too

26

Chapter Four

4 System design

41 System Scenario

The basic scenario of a push session is that a Push Initiator (PI) transmits content to a

WAP client This is done in multiple steps as shown in Figure 31

pushOTAPAP

Gateway

PI

1

2

pull gateway

PPG

3

SMS center

Mobile device

6

5

4

Content provider78 9

Figure 41 WAP push scenario

Chapter 4 System Design

27

The PI communicates with a Push Proxy Gateway (PPG) over the Push Access Protocol

(PAP) (1 and 2) The PPG will then use the Push Over-The-Air Protocol (PushOTA) (3)

to deliver a Uniform Resource Identifier (URI) to the client via a Short Message System

Centre (SMS-C) (4 and 5) The next step for the client is then to activate the URI (6 and

7) and get the content from the server (8 and 9) The mobile device will have to use a

ldquoPull Gatewayrdquo to get the content but it is very likely that this is the same one as the PPG

The same same scenario could be viewed in sequence diagram figure (42)

Push Initiator PPG SMS Center WAP client

Send push message

Send push message response

Send WAP push message

Ack

Send WAP push message

Ack

Message read

Ack

Message read

Ack

Result notification message

Result notification response

Figure 42 WAP push sequence diagram

Chapter 4 System Design

28

43 Modular Design

Conceptually we can envision this push system as consisting of three major components

(presented in the order of the push lifetime)

first there is a Push Initiator Program that reads the generates a notification message and

transmits (pushes) it via a WAP Gateway to the customer phone This message notifies

the user that a service is available if the user accepts will ask the phonersquos browser to pull

the page from our web server via the WAP Gateway

Next there is the Push Proxy Gateway PPG which will receive the push message from

the push initiator and is responsible of doing any needed optimization protocol

compilation and conversion Also it is responsibility of the PPG to find the end user

address and send the push message to the SMS center

Finally there is the SMS center which will do the last delivery of push message to the

intended user if the user were offline the message will be saved for later time until the

WAP client is on

PI PPGSMSC

Figure 43 system modules

Chapter 4 System Design

29

43 Design of system Modules

Following sections of this chapter present a description and design of the system modules

with accompanying graphical representation

431 Push Initiator (PI)

The PI is the first logical component in the WAP Push scenario and therefore the

originator of the push message There are different kinds of PIs One example is an

automated script another one is a semi automated server version written in an applicable

scripting language supporting server side interaction

A push message is sent as an HTTP POST to the Push Proxy Gateway The POST will be

a multipart XML document with the first part being the control entity (Push Access

Protocol) the second part being the content entity (either a Service Indication or a

Service Load) and the third part being the capability entity

HTTP Post

Capability entity

Content entity (SISL)

Control entity (PAP)

Figure 44 architecture of the push message

Chapter 4 System Design

30

4311 Control entity

This part of the push contains the basic information and fields The fields can include

recipient address expiry time bearer type delivery attempt time and a URL to which a

response is to be sent if delivery confirmation is requested by the push initiator

PAP is the protocol used in WAP Push framework for specifying control information and

content that is to be pushed to a client via a Push Proxy Gateway (PPG) A Push Initiator

(PI) triggers push message processing The Push initiator class (Appendix B) of this

design shows how to generate PAP messages

The address of the used PPG should be given as an initialization parameter of the

application (ldquoppg-urlrdquo see Appendix B) This design also provides an implementation

that can be used in a special case when ldquoIPv4 IPv6rdquo type client addressing is applied and

when toolkit is used All other cases including the use of phone numbers (ldquoPLMNrdquo type

address) in sending push messages are considered

The PAP XML contains at the minimum a ltpapgt element a ltpush-messagegt

element and an ltaddressgt element

The important parts of this PAP message are the address value and type The value is

typically a MSISDN and type indicates whether to send to a MSISDN (typical case) or to

an IP Address The TYPE is almost always MSISDN as the Push Initiator (PI) will not

typically have the Mobile Stations IP address - which is generally dynamic

4312 Content entity

This is the actual data that is received by the mobile device The various content types

are Service Indication (SI) Service Load (SL) and Cache Operation (CO) in our project

we will just deal with SI and SL

The SI notifies a client about an external event by inviting the client to interact with it In

other words it informs a client about a service More precisely it sends a message that

Chapter 4 System Design

31

informs the client of a Uniform Resource Identifier (URI) where the client can access the

service

An important attribute of SI is the action attribute it may contain the action to be taken

when the client receives the SI There are two groups that the action attributes can be

divided into

First we have delete and signalmdashnone both of them is used because of their side

effects Ie with delete you take away all SIs with the same si-id as the deletion pushrdquo

including itself and with signal-none you either do nothing or you pay regard to the

info element in that push

The other group consists of signal-low signal-medium and signal-high These

attributes are all used to set the rules for the presentation in the terminal device

o Signal-low

The SI must be postponed without user intervention

o Signal-medium

The SI must be presented as soon as the implementation allows that to be carried out

without disturbing the user (Signal-medium is the value that will be used if none is

specified)

o Signal-high

The SI must be presented as soon as the implementation allows that to be carried out

without disturbing the user or earlier if it seems appropriate (This decision may for

instance be based on user preference settings)

This is the different functionalities supported by the SI we concidered

Expiration

Replacement

Deletion

Chapter 4 System Design

32

Handling of out of order delivery

Handling of information specified in the info element

A PUSH Service Indication (SI) contains at a minimum an ltsigt element and a

ltindicationgt element SL donrsquot differ so much from SI

4313 Capability entity

This entity determines the type of mobile device that is to be served This is determined

by WAP user agent profiling The sender can indicate the hardware vendor and browser

version and type of the intended recipients This capability entity is then matched at the

PPG to see which devices are compatible with the requested capability If there is a

match the content is delivered by the PPG to that specific device

Now a day most devices are compatible with WAP so we donrsquot need to create this entity

more precisely it is optional

After the push has been created in the PI it is up to the system to deliver it to the defined

destination In this system the different responsible entities are the PPG and the SMSC

Both of these two different entities are running on same server but it is only the

configuration of the SMSC that is out of my control since it is run by the operator and is

not controllable in my lab environment

432 Push Proxy Gateway (PPG)

There are various commercial WAP gateways available on the market that are quite

expensive Kannel on the other hand is an open source gateway one doesnrsquot need to pay

for it in addition one can edit the source code himself and construct his own customized

gateway Because Kannel is being developed on Linux systems (RedHat and Debian) it

can be smoothly ported to other UNIX-like operating systems

4321 Kannel gateway architecture

The gateway divides the processing load between the following three hosts

Chapter 4 System Design

33

The bearer box which connects to the SMS (Short Message Service) centers and

or CSD (Circuit Switched Data) routers providing a unified interface to them for

the wapbox The bearer box does this by implementing the WDP (Wireless

Datagram Protocol) layer of the WAP stack

The smsbox implements the rest of the SMS gateway functionality It receives

textual SMS messages from the bearerbox and interprets them as service

requests and responds to them in the appropriate way

The wapbox which hosts the upper layers of the WAP stack Each session and its

transactions are handled by the same wapbox (see figure 35)

1Figure 45 divisions of duties in kannel

4322 Working of the gateway

The bearer box receives UDP (User Datagram Protocol) packets from CSD routers

inspects them to see whether they are WAP packets if so then it will routes them to the

WAP box This simple design allows the bearer box to do a minimum of processing per

smsbox

wapbox

bearerbox

Kannel

SMS center

WAP phone

HTTP server

Chapter 4 System Design

34

packet The bearer box also sends the UDP packets that the other boxes generate which

adds some more routing processing The wapboxes implement the WTP (Wireless

Transaction Protocol) and WSP (Wireless Session Protocol) layers These take HTTP-

like requests from the phones and make the actual HTTP requests to content servers

compress the responses and send them back to the terminals (Sessions are maintained to

make as much use of the limited radio bandwidth as possible)

4323 External interfaces of the gateway

The gateway has interfaces to three external agents

bull SMS centers using various protocols

bull HTTP servers to fetch WAP and SMS content and to push WAP Content The

pull protocol is HTTP push PAP

bull WAP phones implementing the WAP protocol stack and (for push) WAP Push

client

Figure 36 summarize kannel external interfaces

4324 Configuring the gateway

The bearerbox smsbox and wapbox are the main working modules of the gateway and

must be configured before configuring the gateway These three modules are controlled

by a configuration file that has wapbox smsbox and bearerbox groups

Configuring the PPG core group

We use two components the PPG core group and the PPG user group The PPG

core group is used to configure the PI interface(for more details configuration

variables refer to appendix c)

Chapter 4 System Design

35

Mobile telephone

network

The Internet

smsbox

wapbox

bearerbox

Kannel

HTTP

HTTP

HTTP server

Serving WML

files

HTTP server

Serving HTML

files

TCP

TCP

WAPSMS

SMSC

WAP phoneNetwork base station

Workstation used for http

administration

Figure 46 External interfaces of the gateway

4325 Administering the gateway through an HTTP interface

Kannel can be administered via an HTTP interface All commands are given as normal

HTTP queries so they can easily be given from command lines like this one

links -dump httpip-adressportshutdownpassword=yourchoice

But it is advantageous to have graphical user interface for gateway control so we have

designed GUI through http

Chapter 4 System Design

36

433 Short Message Service Centre (SMSC)

A SMSC is an essential component when sending a push message from an IP network to

a mobile device in the architecture supported by the components and devices It is used to

remove the TCPIP layer that the push is encapsulatedrdquo in It is also the entity that

identifies the end-point device When this is done it is also the SMSC that is responsible

for the processing and final message delivery to the device After the process of de-

encapsulation and resolution of the client identity there should not be any difference

between this message and a message that is originated locally from the operator itself

(like a SMS)

In this project we just use a virtual SMS center we try first to get connection to a real

one but our effort was worthless

Finally the following figure depicts the overall flowchart of the WAP push system

(figure 47)

Chapter 4 System Design

37

PI

PPG

Create PAP

HTTP Post

Message

processing

OTA

Connection

oriented

Sessionless Session

oriented

WTP Initiation

WAP clinet

Application

Create content

Create

capability

entity

Database

SMS center

NoYes

Figure 47 the complete flowchart of the system

38

Chapter Five

5 System implementation and results

51 Implementation

511 The Push Proxy Gateway

First of all the Kannel gateway have been compiled and installed using gcc (GNU C

Compiler) this stage go fine except the operating system required more components to

be pre-installed and will configured

Then with stages of configuration to the gateway (Appendix B) it was capable of working

as PPG Figure 51 below show the gateway when it starts

Figure 51 starting kannel gateway

Then a web based user interface had been created to provide an easy way to control the

gateway remotely Figure 52 and figure 53

39

Figure 52 GUI for gateway control

512 The Push initiator

Next the push initiator design had been implemented using java programming language

as in design phase the implementation is taken carefully to make a reusable component

that could be used by other developer

PushInitiator class (Appendix B) implements a simple push initiator which can be used

to create and send messages to a push proxy gateway (PPG)

The method sendPushMessage sends a push message via the PPG to the client The client

is identified by the address which is either the phone number (address type is PLMN) or

IP address The message content and its mime type are also given as arguments to the

method the other tow important method are

createPapMessage This method creates a Push Access Protocol (PAP) type message

40

createSiMessage This method is used to create a service indication (SI) type message

Figure 53 showing running kannel status

513 WAP site

Since this site will be built for testing purpose and making sure that the system is

functional we had not go deep in this section Just simple WAP site with tow page has

been crated

41

52 Service indication

When a SI was pushed to any of the emulator or Nokia phones it was received and

presented in the way it was supposed to as specified in the WAP standard as shown in

figures below This is a proof that the devices claiming to support WAP push do so and

the design is will working See figures 53 through 56

Figure 55 service indication

42

Figure 57 SI details

52 Service load

The emulator correctly receives and interpreted the SL push the same as all of Nokia

phones we have tested

When a SL was pushed to the Ericsson phones it was not presented in the specified way

figure 58 I think that it is because of security reasons The reason for this assumption is

that the phones only supports on or off as security in their push configuration The

emulator on the other hand presents SL correctly Finally the Siemens phone did seem to

interpret SL but the current software was not very consistent It did load the SL without

user interference in the specified way when the user already where having an active

session If the user was offline the phone interface presented a symbol on the display

and did not load the service until the user clicked on the symbol

43

Chapter Six

6 conclusion and future work

In this chapter we will provide the conclusions and proposed future work for interested

individuals

61 Conclusions

In this project a WAP push system has been successfully designed and implemented It

provides a way to partially overcome the limitations encountered when accessing the

World Wide Web using handsets After comparing the proposed project objectives with

those accomplished the main goals are seen to be met

Phones from different manufactures all differ from the WAP-standard in some

ways One of the most obvious differences is the resolution of the display

During the work it has been noticed that the WML pages must be quite small We

have also noticed that the support for tables and some other tags are a bit limited

Even though the WML standard is smaller than the HTML standard it is a little

more complicated to write correct WML pages The main conclusion is that WAP

works pretty well but the phones are a little non-stable

The push proxy gateway is configured and worked probably with virtual SMS

center and it is easy to switch to a real one

The system depends mainly on open sources (ie Linux and kannek)

The design and implementation of the push initiator work well with the kannel

gateway and it should work correctly with other gateways

Chapter 6 Conclusion

44

62 Further Work

The possibilities of wireless push are interesting enough that it has to be worth to know if

the security and conformance problems will be solved in WAP push If they are solved

and the technique is refined then there should be nothing to stop the great number of

services that will follow in its footsteps Therefore there is further work that should be

done and the most interesting parts are in my opinion these

621 Security Aspect

One of the problems today is that the phones supporting push does not have the detailed

security settings that a technique like this needs Therefore it would be interesting to look

into the possibility to add these without confusing the user I suggest furthering looking

into usability aspects of security in WAP Push for short

622 GPS integration possibility

This will provide location dependent delivery of WAP push it will have great

applications in telematic and ecommerce advertising

623 Conformance to Standards

An interesting project would be to examine if the main reason for the nonstandard

solutions in the existing WAP push software is the result of difficulties in

implementation Or if the main reason is that the manufacturers wants to provide

proprietary solutions A reason why one may want to know this is that if the problem is

depending on implementation problems then it might get better

45

Appendix A Abbreviations

CDMA Code Division Multiple Access

CO Cache Operation

DTD Document Type Definition

GSM Global System for Mobile

HTTP Hypertext Transfer Protocol

IP Internet Protocol

MSISDN Mobile Station International Subscriber Directory Number

OTA Over The Air

PAP Push Access Protocol

PushOTA Push Over The Air

PDA Personal Digital Assistant

P1 Push Initiator

PLMN Public Land Mobile Networks

PPG Push Proxy Gateway

SI Service Indication

SIA Session Initiation Application

SIR Session Initiation Request

SL Service Loading

SMPP Short Message Peer to Peer

SMS Short Message System

SMSC Short Message System Center

UCP Universal Computer Protocol

URI Uniform Resource Identifier

URL Uniform Resource Locator

UTC Universal Time Coordinated

WAP Wireless Application Protocol

WBXML WAP binary XML

WDP Wireless Datagram Protocol

WSP Wireless Session Protocol

WTLS Wireless Transport Layer Security

XML Extensible Mark-up Language

46

Appendix B Kannel gateway configurations

THIS IS A SAMPLE CONFIGURATION FOR KANNEL

group = core

admin-port = 13000

admin-password = admin

status-password = admin

admin-deny-ip =

admin-allow-ip = 127001172161455

log-file = tmpkannellog

log-level = 0

http-proxy-host = 172161411

http-proxy-port = 8080

http-proxy-exceptions = 127001

Smsbox related

smsbox-port = 13001

box-deny-ip =

box-allow-ip = 127001

bearerbox-host =localhost

Wapbox related

wapbox-port = 13002

udp-deny-ip =

udp-allow-ip = 127001

bearerbox-host =localhost

SMSC GSM

group = smsc

smsc = at

modemtype = auto

speed =9600

device = devttyS0

SMSC HTTP

group = smsc

smsc = http

system-type = kannel

port = 13016

connect-allow-ip = 127001

Appendix B

47

username = wappush

password = wappush

SMSBOX SETUP

group = smsbox

bearerbox-host = localhost

sendsms-port = 13013

sendsms-chars = 0123456789 +-

log-file = tmpsmsboxlog

log-level = 0

access-log = accesslog

white-list = 127001

black-list =

SEND-SMS USERS

group = sendsms-user

username = wappush

password = wappush

user-deny-ip =

user-allow-ip = 127001

PPG group

group = ppg

ppg-url = wappush

ppg-port = 8080

concurrent-pushes = 100

trusted-pi = true

users = 1024

service-name = ppg

ppg-smsbox-id = dlrbox

WAP PUSH USER

group = wap-push-user

wap-push-user = picom

ppg-username = wappush

ppg-password = wappush

allow-ip = localhost

48

Appendix C Selected Codes

Gateway Control Form

ltDOCTYPE HTML PUBLIC -W3CDTD HTML 32ENgt

lthtmlgt ltheadgt

lttitlegtGateway control formlttitlegt

ltheadgt

ltbody bgcolor=white text=black link=blue vlink=navy

alink=redgt

ltbase target=submitgt

ltscriptgt

function update_status()

if ( adminactionvalue == status )

adminaction = http + adminhostnamevalue +

+ adminportvalue + status +

adminstatusformatvalue

else

adminaction = http + adminhostnamevalue +

+ adminportvalue + + adminactionvalue

adminpasswordvalue = adminpasswordvalue

actiongovalue = GO GET +adminaction

ltscriptgt

lttable align=centergt

lttrgtltp align=centergtlth2gtGateway control

formlth2gtltpgtlttrgt

lttrgt lttdgtHostnamelttdgtlttdgtltinput type=text

name=adminhostname value=localhost

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPortlttdgtlttdgtltinput type=text

name=adminport value=13000

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPasswordlttdgtlttdgtltinput type=password

name=adminpassword value=

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtActionlttdgtlttdgtltselect name=adminaction

onChange=update_status()gt

ltoption value=statusgtStatusltoptiongt

ltoption value=suspendgtSuspendltoptiongt

ltoption value=isolategtIsolateltoptiongt

Appendix C

49

ltoption value=shutdowngtShutdownltoptiongt

ltoption value=resumegtResumeltoptiongt

ltselectgtlttdgt lttrgt

lttrgt lttdgtStatus Formatlttdgtlttdgtltselect

name=adminstatusformat onChange=update_status()gt

ltoption value=gthtmlltoptiongtltoption

value=txtgttxtltoptiongtltoption

value=xmlgtxmlltoptiongtltselectgtlttdgt lttrgt

ltform name=admin method=get

action=httplocalhost13000status

encoding=applicationx-www-formgt

ltinput type=hidden name=password value=gt

lttrgt

lttdgtGolttdgt

ltformgt

lttdgtltinput type=submit value=go name=actiongo

onClick=documentadminsubmit()gtlttdgt

lttrgt

lttablegt

ltbodygt

lthtmlgt

Push Initiator Class

import javanetURL

import javanetHttpURLConnection

import javaio

Class implements a simple push initiator It can be

used to create and send messages to push proxy

gateway (ppg)

public final class PushInitiator

xml version

private final static String XML_VERSION = ltxml

version=10gt

Push Access Protocol (PAP) document type

private final static String PAP_DOCTYPE =

Appendix C

50

ltDOCTYPE pap PUBLIC -WAPFORUMDTD PAP 10EN

httpwwwwapforumorgDTDpap_10dtd gt

content type of the push request multipart body

private final static String CONTENT_TYPE =

multipartrelated boundary=multipart-boundary

type=applicationxml

Service Indication (SI) document type

private static final String SI_DOCTYPE = ltDOCTYPE si

PUBLIC -WAPFORUMDTD SI 10EN +

httpwwwwapforumorgDTDsidtdgt

private static int pushId = 0

PPG url where the pap message is to be sent

private final URL ppgUrl

some push proxy gateways may also require the

authentication of the push initiator

For instance the push initiator may be required to

send an HTTP authorization header in each request

private final String authorization

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

public PushInitiator(URL ppgUrl) thisppgUrl =

ppgUrl

authorization = null

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

param authorization a ltcodegtStringltcodegt value

public PushInitiator(URL ppgUrl String authorization)

thisppgUrl = ppgUrl

Appendix C

51

thisauthorization = authorization

Systemoutprintln(Push Initiator created ppgUrl =

+ ppgUrl)

ltcodegtsendPushMessageltcodegt sends push message to

ppg

param clientAddress a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param message a ltcodegtStringltcodegt value

param mimeType a ltcodegtStringltcodegt value

exception Exception if an error occurs

public void sendPushMessage(String clientAddress

String addressTypeString message String mimeType)

throws Exception

HttpURLConnection http =

(HttpURLConnection)ppgUrlopenConnection()

String ppgServer = ppgUrlgetHost()

httpsetDoInput(true)

httpsetRequestProperty(Content-Type CONTENT_TYPE)

if(authorization = null)

if(authorizationtrim()equals())

httpsetRequestProperty(Authorization

authorization)

httpsetDoOutput(true)

PrintWriter out = new PrintWriter(new

BufferedOutputStream(httpgetOutputStream()))

outprintln(--multipart-boundary)

outprintln(Content-type applicationxml)

outprintln()

outprintln(createPapMessage(clientAddress

addressTypeppgServer genPushId() null))

outprintln()

outprintln(--multipart-boundary)

outprintln(Content-type + mimeType)

outprintln()

outprintln(message)

outprintln()

outprintln(--multipart-boundary--)

outflush()

outclose()

httpconnect()

Appendix C

52

finally read and debug the response received from

PPG

try

debugResponse(http)

catch (Exception e)

Systemerrprintln(Error in receiving the

response)

ltcodegtcreatePapMessageltcodegt creates a Push Access

Protocoltype message

param address a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param ppgServer a ltcodegtStringltcodegt value

param pushId a ltcodegtStringltcodegt value

param notificationTo a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createPapMessage(String address

String addressType String ppgServer String pushId

String notificationTo)

return XML_VERSION + n + PAP_DOCTYPE + n +

ltpap product-name=Mobile Zoo Push

Initiatorgtn +

ltpush-message push-id= + pushId +

(notificationTo = null request-notification-

to= + notificationTo ) + gtn +

ltaddress address-value=WAPPUSH= + address +

TYPE= + addressType +

+ ppgServer + gtn +

ltpush-messagegtnltpapgt

ltcodegtcreateSiMessageltcodegt creates a service

indication type message

param url a ltcodegtStringltcodegt value

param created a ltcodegtStringltcodegt value

param expires a ltcodegtStringltcodegt value

Appendix C

53

param message a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createSiMessage(String url

String sid String created String expires String

action String message)

return XML_VERSION + SI_DOCTYPE +

ltsigtn +

ltindication href= + url + +

(sid = null si-id= + sid + ) +

created = null created= + created +

) +

(action = null action= + action +

) +

(expires = null expires= + expires +

) + gt +

message +

ltindicationgtnltsigt

Debug response

param http a ltcodegtHttpURLConnectionltcodegt value

exception Exception if an error occurs

private void debugResponse(HttpURLConnection http)

throws Exception

Systemoutprintln(httpgetResponseMessage())

String headerName

int i=0

while((headerName = httpgetHeaderFieldKey(i++)) =

null)

Systemoutprintln(headerName + +

httpgetHeaderField(headerName))

Systemoutprintln()

InputStreamReader in = new InputStreamReader(new

BufferedInputStream(httpgetInputStream()))

int c

Appendix C

54

while((c = inread()) = -1)

Systemoutprint((char)c)

Systemoutprintln()

ltcodegtgenPushIdltcodegt generates an unique push id

return a ltcodegtStringltcodegt value

private String genPushId()

pushId = 100000

return SystemcurrentTimeMillis() + + pushId++

55

References

[1] Microsoft ldquoGetting Mobile Using WML and WAP to Display Web Sites on

Mobile Devicesrdquo

URL msdnmicrosoftcomen-uslibraryaa140117(office10)aspx accessed

on April 10 2008

[2] DALE BULBROOK ldquoWAPA Beginnerrsquos Guiderdquo OsborneMcGraw-Hill 2001

[3] WAP Forum Wireless Application Protocol Architecture Specification Access on

Jan 12 2008 Available

httpwww1wapforumorgtechdocumentsWAP-210-WAPArch-2006 07 12-apdf

[4] WAP Forum Push Architectural Overview access on (2008 February 3) Available

httpwww1wapforumorgtechdocumentsWAP-250-PushArchOverview-2007 04

03-apdf

[5] Service indication PDF access on 62008 Available

httpwwww3orgTRhtml401structlinkshtml

[6] WAP Push Technology (openwave) PDF access on (2008 April) Available

URL httpwwwopenwavorg

[7] Web site (httpwwwwapforumorgwhatcopyrighthtm) access on May 2008

[8] ldquoWAP Push Proxy Gateway Specificationrdquo WAP Forum access on 16-August-

2007URI httpwwwwapforumorgPDF

[9] WAP Forum Access on (2008 MAY 31) WAP Service Indication Specification

Available httpwww1wapforumorgtechdocumentsWAP-167-ServiceInd-200507

31-apdf

  • odc_fpwmlandwap_topic3
  • N100E3
  • 21
  • 5

Chapter 2 Basic Concepts

21

Deletion

When a pushed message becomes invalid the service provider can delete the

message in the clients For example an email notification becomes invalid when

the message are read

Replacement

When a pushed message is invalid and updated with a new message the service

provider can replace the origin message with a new one

Handling of out of order delivery

Since the wireless communication is unpredictable it can not be ensured that the

messages are received in the same order as sent This mechanism discards all

messages older than the latest received

Expiration

Some services may only be valid for a certain amount of time when the time has

expired the message is removed from the client

245 Service Loading

The service loading method provides means to convey a URI to a user agent in a mobile

client The method is conveyed in an XML message In difference from the service

indication method the client loads the content of the URI automatically without any

action from the user when the service loading message is received

Thereby the user will experience the content as if it was pushed to the mobile client and

executed In the service loading mechanism there is a reference to a service page that will

automatically be loaded without interaction with the user included For example the client

will automatically start the email service when a message about new mails on the server

is received [9]

Chapter 2 Basic Concepts

22

When the client is busy with some application it is not suitable to execute the referred

content directly upon reception of a message To avoid this client may cache the content

indicated by the URI so it becomes available to the user when the client is ready

Messages sent with the service loading method can support mechanism to improve the

end-user-experience

Control of the level of user interaction

To improve the users understanding of the provided service and the affect the

userrsquos behavior when the message is delivered it is possible to change the level

of user-intrusiveness The service can explicitly specify if the service should be

loaded or not if the client is busy on reception

Pre-emptive content caching

By setting this attribute the service loading can require that the indicated content

is downloaded and cached instead of executed This can be used to improve the

users experience of the services that otherwise would have required content to

be retrieved from an origin

23

Chapter Three

3 System requirements

Several materials and requirements must be incorporated into the design implementation

and testing The following discusses the components necessary to fulfill the project

requirements and environment

31 development environment

There are many development tools to choose from when developing for WAP Push and

hen you combine different environments with different gateways you will get a vast

numbers of choices This large flora of tools makes it difficult to choose a suitable

environment an important issue because a badly chosen one might consume a lot of time

341 Operating system

Kannel (the chosen gateway for the system) is being developed on Linux systems and

should be fairly easy to export to other Unix-like systems Although it should be working

without major problems on Windows (through Cygwin) Solaris and FreeBSD The push

initiator is implemented on java so it is operating system independent

Linux is the logical choice especially when it comes to the world severs and networking

for it promising feature as an open source low cost operating system

342 Programming language

Since system design was planned to be modular to enhance the reuse of its components as

explained above then an object oriented programming language will be a reasonable

choice Another factor is the need for a graphical user interface which imposes using a

programming language with good graphics handling capabilities at the same time it

should be over Linux

Chapter 3 System requirements

24

The best programming language to accomplish the above requirement is found to be java

which has the flowing feature

Cross platform - All clients and servers run the same Java code without any

changes or recompilation This simplifies deployment

Cost effective to develop in Java - The java language has many features that

improve developer productivity promote code reuse and reduce development and

maintenance costs

Works well with Open Source - Java with Linux and the many open source

movement projects and libraries provide a powerful mix that ensures development

is cost-effective efficient and of high quality because extensively tested libraries

components and solutions are available to plug-in to customer development

efforts

343 Nokia Mobile Internet Toolkit 41

To design and implement a WAP application on a Nokia phone the Nokia Internet

Toolkit has to be downloaded and installed on the PC A Nokia simulator is installed as

part of the installation but various phone simulators can be downloaded and installed

This simulator is used for testing purpose Also it has a server simulator based on the

Nokia Active Server if a WAP Gateway is unavailable

32 software requirements

Most of this section has been mentioned in way or other but they will be considered

briefly here

321 Kannel WAP gateway

This is an open source gateway upon which the push proxy gateway of this system will

be built on it available free of charge at kannel project web site

Chapter 3 System requirements

25

322 Linux operating system

It is important to install kannel gateway on it for this project we choose fedora core 7 for

availability reasons

323 JDK16

The java run time environment is required to implement the push initiator

32 hardware requirements

321 PC

Any Personal computer capable of running fedora core 7 with USB interface to be able

connects GSM modem

322 GSM modem

This will act as an alternative to the short message service center SMSC Obviously this

means that GSM network is required too

26

Chapter Four

4 System design

41 System Scenario

The basic scenario of a push session is that a Push Initiator (PI) transmits content to a

WAP client This is done in multiple steps as shown in Figure 31

pushOTAPAP

Gateway

PI

1

2

pull gateway

PPG

3

SMS center

Mobile device

6

5

4

Content provider78 9

Figure 41 WAP push scenario

Chapter 4 System Design

27

The PI communicates with a Push Proxy Gateway (PPG) over the Push Access Protocol

(PAP) (1 and 2) The PPG will then use the Push Over-The-Air Protocol (PushOTA) (3)

to deliver a Uniform Resource Identifier (URI) to the client via a Short Message System

Centre (SMS-C) (4 and 5) The next step for the client is then to activate the URI (6 and

7) and get the content from the server (8 and 9) The mobile device will have to use a

ldquoPull Gatewayrdquo to get the content but it is very likely that this is the same one as the PPG

The same same scenario could be viewed in sequence diagram figure (42)

Push Initiator PPG SMS Center WAP client

Send push message

Send push message response

Send WAP push message

Ack

Send WAP push message

Ack

Message read

Ack

Message read

Ack

Result notification message

Result notification response

Figure 42 WAP push sequence diagram

Chapter 4 System Design

28

43 Modular Design

Conceptually we can envision this push system as consisting of three major components

(presented in the order of the push lifetime)

first there is a Push Initiator Program that reads the generates a notification message and

transmits (pushes) it via a WAP Gateway to the customer phone This message notifies

the user that a service is available if the user accepts will ask the phonersquos browser to pull

the page from our web server via the WAP Gateway

Next there is the Push Proxy Gateway PPG which will receive the push message from

the push initiator and is responsible of doing any needed optimization protocol

compilation and conversion Also it is responsibility of the PPG to find the end user

address and send the push message to the SMS center

Finally there is the SMS center which will do the last delivery of push message to the

intended user if the user were offline the message will be saved for later time until the

WAP client is on

PI PPGSMSC

Figure 43 system modules

Chapter 4 System Design

29

43 Design of system Modules

Following sections of this chapter present a description and design of the system modules

with accompanying graphical representation

431 Push Initiator (PI)

The PI is the first logical component in the WAP Push scenario and therefore the

originator of the push message There are different kinds of PIs One example is an

automated script another one is a semi automated server version written in an applicable

scripting language supporting server side interaction

A push message is sent as an HTTP POST to the Push Proxy Gateway The POST will be

a multipart XML document with the first part being the control entity (Push Access

Protocol) the second part being the content entity (either a Service Indication or a

Service Load) and the third part being the capability entity

HTTP Post

Capability entity

Content entity (SISL)

Control entity (PAP)

Figure 44 architecture of the push message

Chapter 4 System Design

30

4311 Control entity

This part of the push contains the basic information and fields The fields can include

recipient address expiry time bearer type delivery attempt time and a URL to which a

response is to be sent if delivery confirmation is requested by the push initiator

PAP is the protocol used in WAP Push framework for specifying control information and

content that is to be pushed to a client via a Push Proxy Gateway (PPG) A Push Initiator

(PI) triggers push message processing The Push initiator class (Appendix B) of this

design shows how to generate PAP messages

The address of the used PPG should be given as an initialization parameter of the

application (ldquoppg-urlrdquo see Appendix B) This design also provides an implementation

that can be used in a special case when ldquoIPv4 IPv6rdquo type client addressing is applied and

when toolkit is used All other cases including the use of phone numbers (ldquoPLMNrdquo type

address) in sending push messages are considered

The PAP XML contains at the minimum a ltpapgt element a ltpush-messagegt

element and an ltaddressgt element

The important parts of this PAP message are the address value and type The value is

typically a MSISDN and type indicates whether to send to a MSISDN (typical case) or to

an IP Address The TYPE is almost always MSISDN as the Push Initiator (PI) will not

typically have the Mobile Stations IP address - which is generally dynamic

4312 Content entity

This is the actual data that is received by the mobile device The various content types

are Service Indication (SI) Service Load (SL) and Cache Operation (CO) in our project

we will just deal with SI and SL

The SI notifies a client about an external event by inviting the client to interact with it In

other words it informs a client about a service More precisely it sends a message that

Chapter 4 System Design

31

informs the client of a Uniform Resource Identifier (URI) where the client can access the

service

An important attribute of SI is the action attribute it may contain the action to be taken

when the client receives the SI There are two groups that the action attributes can be

divided into

First we have delete and signalmdashnone both of them is used because of their side

effects Ie with delete you take away all SIs with the same si-id as the deletion pushrdquo

including itself and with signal-none you either do nothing or you pay regard to the

info element in that push

The other group consists of signal-low signal-medium and signal-high These

attributes are all used to set the rules for the presentation in the terminal device

o Signal-low

The SI must be postponed without user intervention

o Signal-medium

The SI must be presented as soon as the implementation allows that to be carried out

without disturbing the user (Signal-medium is the value that will be used if none is

specified)

o Signal-high

The SI must be presented as soon as the implementation allows that to be carried out

without disturbing the user or earlier if it seems appropriate (This decision may for

instance be based on user preference settings)

This is the different functionalities supported by the SI we concidered

Expiration

Replacement

Deletion

Chapter 4 System Design

32

Handling of out of order delivery

Handling of information specified in the info element

A PUSH Service Indication (SI) contains at a minimum an ltsigt element and a

ltindicationgt element SL donrsquot differ so much from SI

4313 Capability entity

This entity determines the type of mobile device that is to be served This is determined

by WAP user agent profiling The sender can indicate the hardware vendor and browser

version and type of the intended recipients This capability entity is then matched at the

PPG to see which devices are compatible with the requested capability If there is a

match the content is delivered by the PPG to that specific device

Now a day most devices are compatible with WAP so we donrsquot need to create this entity

more precisely it is optional

After the push has been created in the PI it is up to the system to deliver it to the defined

destination In this system the different responsible entities are the PPG and the SMSC

Both of these two different entities are running on same server but it is only the

configuration of the SMSC that is out of my control since it is run by the operator and is

not controllable in my lab environment

432 Push Proxy Gateway (PPG)

There are various commercial WAP gateways available on the market that are quite

expensive Kannel on the other hand is an open source gateway one doesnrsquot need to pay

for it in addition one can edit the source code himself and construct his own customized

gateway Because Kannel is being developed on Linux systems (RedHat and Debian) it

can be smoothly ported to other UNIX-like operating systems

4321 Kannel gateway architecture

The gateway divides the processing load between the following three hosts

Chapter 4 System Design

33

The bearer box which connects to the SMS (Short Message Service) centers and

or CSD (Circuit Switched Data) routers providing a unified interface to them for

the wapbox The bearer box does this by implementing the WDP (Wireless

Datagram Protocol) layer of the WAP stack

The smsbox implements the rest of the SMS gateway functionality It receives

textual SMS messages from the bearerbox and interprets them as service

requests and responds to them in the appropriate way

The wapbox which hosts the upper layers of the WAP stack Each session and its

transactions are handled by the same wapbox (see figure 35)

1Figure 45 divisions of duties in kannel

4322 Working of the gateway

The bearer box receives UDP (User Datagram Protocol) packets from CSD routers

inspects them to see whether they are WAP packets if so then it will routes them to the

WAP box This simple design allows the bearer box to do a minimum of processing per

smsbox

wapbox

bearerbox

Kannel

SMS center

WAP phone

HTTP server

Chapter 4 System Design

34

packet The bearer box also sends the UDP packets that the other boxes generate which

adds some more routing processing The wapboxes implement the WTP (Wireless

Transaction Protocol) and WSP (Wireless Session Protocol) layers These take HTTP-

like requests from the phones and make the actual HTTP requests to content servers

compress the responses and send them back to the terminals (Sessions are maintained to

make as much use of the limited radio bandwidth as possible)

4323 External interfaces of the gateway

The gateway has interfaces to three external agents

bull SMS centers using various protocols

bull HTTP servers to fetch WAP and SMS content and to push WAP Content The

pull protocol is HTTP push PAP

bull WAP phones implementing the WAP protocol stack and (for push) WAP Push

client

Figure 36 summarize kannel external interfaces

4324 Configuring the gateway

The bearerbox smsbox and wapbox are the main working modules of the gateway and

must be configured before configuring the gateway These three modules are controlled

by a configuration file that has wapbox smsbox and bearerbox groups

Configuring the PPG core group

We use two components the PPG core group and the PPG user group The PPG

core group is used to configure the PI interface(for more details configuration

variables refer to appendix c)

Chapter 4 System Design

35

Mobile telephone

network

The Internet

smsbox

wapbox

bearerbox

Kannel

HTTP

HTTP

HTTP server

Serving WML

files

HTTP server

Serving HTML

files

TCP

TCP

WAPSMS

SMSC

WAP phoneNetwork base station

Workstation used for http

administration

Figure 46 External interfaces of the gateway

4325 Administering the gateway through an HTTP interface

Kannel can be administered via an HTTP interface All commands are given as normal

HTTP queries so they can easily be given from command lines like this one

links -dump httpip-adressportshutdownpassword=yourchoice

But it is advantageous to have graphical user interface for gateway control so we have

designed GUI through http

Chapter 4 System Design

36

433 Short Message Service Centre (SMSC)

A SMSC is an essential component when sending a push message from an IP network to

a mobile device in the architecture supported by the components and devices It is used to

remove the TCPIP layer that the push is encapsulatedrdquo in It is also the entity that

identifies the end-point device When this is done it is also the SMSC that is responsible

for the processing and final message delivery to the device After the process of de-

encapsulation and resolution of the client identity there should not be any difference

between this message and a message that is originated locally from the operator itself

(like a SMS)

In this project we just use a virtual SMS center we try first to get connection to a real

one but our effort was worthless

Finally the following figure depicts the overall flowchart of the WAP push system

(figure 47)

Chapter 4 System Design

37

PI

PPG

Create PAP

HTTP Post

Message

processing

OTA

Connection

oriented

Sessionless Session

oriented

WTP Initiation

WAP clinet

Application

Create content

Create

capability

entity

Database

SMS center

NoYes

Figure 47 the complete flowchart of the system

38

Chapter Five

5 System implementation and results

51 Implementation

511 The Push Proxy Gateway

First of all the Kannel gateway have been compiled and installed using gcc (GNU C

Compiler) this stage go fine except the operating system required more components to

be pre-installed and will configured

Then with stages of configuration to the gateway (Appendix B) it was capable of working

as PPG Figure 51 below show the gateway when it starts

Figure 51 starting kannel gateway

Then a web based user interface had been created to provide an easy way to control the

gateway remotely Figure 52 and figure 53

39

Figure 52 GUI for gateway control

512 The Push initiator

Next the push initiator design had been implemented using java programming language

as in design phase the implementation is taken carefully to make a reusable component

that could be used by other developer

PushInitiator class (Appendix B) implements a simple push initiator which can be used

to create and send messages to a push proxy gateway (PPG)

The method sendPushMessage sends a push message via the PPG to the client The client

is identified by the address which is either the phone number (address type is PLMN) or

IP address The message content and its mime type are also given as arguments to the

method the other tow important method are

createPapMessage This method creates a Push Access Protocol (PAP) type message

40

createSiMessage This method is used to create a service indication (SI) type message

Figure 53 showing running kannel status

513 WAP site

Since this site will be built for testing purpose and making sure that the system is

functional we had not go deep in this section Just simple WAP site with tow page has

been crated

41

52 Service indication

When a SI was pushed to any of the emulator or Nokia phones it was received and

presented in the way it was supposed to as specified in the WAP standard as shown in

figures below This is a proof that the devices claiming to support WAP push do so and

the design is will working See figures 53 through 56

Figure 55 service indication

42

Figure 57 SI details

52 Service load

The emulator correctly receives and interpreted the SL push the same as all of Nokia

phones we have tested

When a SL was pushed to the Ericsson phones it was not presented in the specified way

figure 58 I think that it is because of security reasons The reason for this assumption is

that the phones only supports on or off as security in their push configuration The

emulator on the other hand presents SL correctly Finally the Siemens phone did seem to

interpret SL but the current software was not very consistent It did load the SL without

user interference in the specified way when the user already where having an active

session If the user was offline the phone interface presented a symbol on the display

and did not load the service until the user clicked on the symbol

43

Chapter Six

6 conclusion and future work

In this chapter we will provide the conclusions and proposed future work for interested

individuals

61 Conclusions

In this project a WAP push system has been successfully designed and implemented It

provides a way to partially overcome the limitations encountered when accessing the

World Wide Web using handsets After comparing the proposed project objectives with

those accomplished the main goals are seen to be met

Phones from different manufactures all differ from the WAP-standard in some

ways One of the most obvious differences is the resolution of the display

During the work it has been noticed that the WML pages must be quite small We

have also noticed that the support for tables and some other tags are a bit limited

Even though the WML standard is smaller than the HTML standard it is a little

more complicated to write correct WML pages The main conclusion is that WAP

works pretty well but the phones are a little non-stable

The push proxy gateway is configured and worked probably with virtual SMS

center and it is easy to switch to a real one

The system depends mainly on open sources (ie Linux and kannek)

The design and implementation of the push initiator work well with the kannel

gateway and it should work correctly with other gateways

Chapter 6 Conclusion

44

62 Further Work

The possibilities of wireless push are interesting enough that it has to be worth to know if

the security and conformance problems will be solved in WAP push If they are solved

and the technique is refined then there should be nothing to stop the great number of

services that will follow in its footsteps Therefore there is further work that should be

done and the most interesting parts are in my opinion these

621 Security Aspect

One of the problems today is that the phones supporting push does not have the detailed

security settings that a technique like this needs Therefore it would be interesting to look

into the possibility to add these without confusing the user I suggest furthering looking

into usability aspects of security in WAP Push for short

622 GPS integration possibility

This will provide location dependent delivery of WAP push it will have great

applications in telematic and ecommerce advertising

623 Conformance to Standards

An interesting project would be to examine if the main reason for the nonstandard

solutions in the existing WAP push software is the result of difficulties in

implementation Or if the main reason is that the manufacturers wants to provide

proprietary solutions A reason why one may want to know this is that if the problem is

depending on implementation problems then it might get better

45

Appendix A Abbreviations

CDMA Code Division Multiple Access

CO Cache Operation

DTD Document Type Definition

GSM Global System for Mobile

HTTP Hypertext Transfer Protocol

IP Internet Protocol

MSISDN Mobile Station International Subscriber Directory Number

OTA Over The Air

PAP Push Access Protocol

PushOTA Push Over The Air

PDA Personal Digital Assistant

P1 Push Initiator

PLMN Public Land Mobile Networks

PPG Push Proxy Gateway

SI Service Indication

SIA Session Initiation Application

SIR Session Initiation Request

SL Service Loading

SMPP Short Message Peer to Peer

SMS Short Message System

SMSC Short Message System Center

UCP Universal Computer Protocol

URI Uniform Resource Identifier

URL Uniform Resource Locator

UTC Universal Time Coordinated

WAP Wireless Application Protocol

WBXML WAP binary XML

WDP Wireless Datagram Protocol

WSP Wireless Session Protocol

WTLS Wireless Transport Layer Security

XML Extensible Mark-up Language

46

Appendix B Kannel gateway configurations

THIS IS A SAMPLE CONFIGURATION FOR KANNEL

group = core

admin-port = 13000

admin-password = admin

status-password = admin

admin-deny-ip =

admin-allow-ip = 127001172161455

log-file = tmpkannellog

log-level = 0

http-proxy-host = 172161411

http-proxy-port = 8080

http-proxy-exceptions = 127001

Smsbox related

smsbox-port = 13001

box-deny-ip =

box-allow-ip = 127001

bearerbox-host =localhost

Wapbox related

wapbox-port = 13002

udp-deny-ip =

udp-allow-ip = 127001

bearerbox-host =localhost

SMSC GSM

group = smsc

smsc = at

modemtype = auto

speed =9600

device = devttyS0

SMSC HTTP

group = smsc

smsc = http

system-type = kannel

port = 13016

connect-allow-ip = 127001

Appendix B

47

username = wappush

password = wappush

SMSBOX SETUP

group = smsbox

bearerbox-host = localhost

sendsms-port = 13013

sendsms-chars = 0123456789 +-

log-file = tmpsmsboxlog

log-level = 0

access-log = accesslog

white-list = 127001

black-list =

SEND-SMS USERS

group = sendsms-user

username = wappush

password = wappush

user-deny-ip =

user-allow-ip = 127001

PPG group

group = ppg

ppg-url = wappush

ppg-port = 8080

concurrent-pushes = 100

trusted-pi = true

users = 1024

service-name = ppg

ppg-smsbox-id = dlrbox

WAP PUSH USER

group = wap-push-user

wap-push-user = picom

ppg-username = wappush

ppg-password = wappush

allow-ip = localhost

48

Appendix C Selected Codes

Gateway Control Form

ltDOCTYPE HTML PUBLIC -W3CDTD HTML 32ENgt

lthtmlgt ltheadgt

lttitlegtGateway control formlttitlegt

ltheadgt

ltbody bgcolor=white text=black link=blue vlink=navy

alink=redgt

ltbase target=submitgt

ltscriptgt

function update_status()

if ( adminactionvalue == status )

adminaction = http + adminhostnamevalue +

+ adminportvalue + status +

adminstatusformatvalue

else

adminaction = http + adminhostnamevalue +

+ adminportvalue + + adminactionvalue

adminpasswordvalue = adminpasswordvalue

actiongovalue = GO GET +adminaction

ltscriptgt

lttable align=centergt

lttrgtltp align=centergtlth2gtGateway control

formlth2gtltpgtlttrgt

lttrgt lttdgtHostnamelttdgtlttdgtltinput type=text

name=adminhostname value=localhost

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPortlttdgtlttdgtltinput type=text

name=adminport value=13000

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPasswordlttdgtlttdgtltinput type=password

name=adminpassword value=

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtActionlttdgtlttdgtltselect name=adminaction

onChange=update_status()gt

ltoption value=statusgtStatusltoptiongt

ltoption value=suspendgtSuspendltoptiongt

ltoption value=isolategtIsolateltoptiongt

Appendix C

49

ltoption value=shutdowngtShutdownltoptiongt

ltoption value=resumegtResumeltoptiongt

ltselectgtlttdgt lttrgt

lttrgt lttdgtStatus Formatlttdgtlttdgtltselect

name=adminstatusformat onChange=update_status()gt

ltoption value=gthtmlltoptiongtltoption

value=txtgttxtltoptiongtltoption

value=xmlgtxmlltoptiongtltselectgtlttdgt lttrgt

ltform name=admin method=get

action=httplocalhost13000status

encoding=applicationx-www-formgt

ltinput type=hidden name=password value=gt

lttrgt

lttdgtGolttdgt

ltformgt

lttdgtltinput type=submit value=go name=actiongo

onClick=documentadminsubmit()gtlttdgt

lttrgt

lttablegt

ltbodygt

lthtmlgt

Push Initiator Class

import javanetURL

import javanetHttpURLConnection

import javaio

Class implements a simple push initiator It can be

used to create and send messages to push proxy

gateway (ppg)

public final class PushInitiator

xml version

private final static String XML_VERSION = ltxml

version=10gt

Push Access Protocol (PAP) document type

private final static String PAP_DOCTYPE =

Appendix C

50

ltDOCTYPE pap PUBLIC -WAPFORUMDTD PAP 10EN

httpwwwwapforumorgDTDpap_10dtd gt

content type of the push request multipart body

private final static String CONTENT_TYPE =

multipartrelated boundary=multipart-boundary

type=applicationxml

Service Indication (SI) document type

private static final String SI_DOCTYPE = ltDOCTYPE si

PUBLIC -WAPFORUMDTD SI 10EN +

httpwwwwapforumorgDTDsidtdgt

private static int pushId = 0

PPG url where the pap message is to be sent

private final URL ppgUrl

some push proxy gateways may also require the

authentication of the push initiator

For instance the push initiator may be required to

send an HTTP authorization header in each request

private final String authorization

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

public PushInitiator(URL ppgUrl) thisppgUrl =

ppgUrl

authorization = null

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

param authorization a ltcodegtStringltcodegt value

public PushInitiator(URL ppgUrl String authorization)

thisppgUrl = ppgUrl

Appendix C

51

thisauthorization = authorization

Systemoutprintln(Push Initiator created ppgUrl =

+ ppgUrl)

ltcodegtsendPushMessageltcodegt sends push message to

ppg

param clientAddress a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param message a ltcodegtStringltcodegt value

param mimeType a ltcodegtStringltcodegt value

exception Exception if an error occurs

public void sendPushMessage(String clientAddress

String addressTypeString message String mimeType)

throws Exception

HttpURLConnection http =

(HttpURLConnection)ppgUrlopenConnection()

String ppgServer = ppgUrlgetHost()

httpsetDoInput(true)

httpsetRequestProperty(Content-Type CONTENT_TYPE)

if(authorization = null)

if(authorizationtrim()equals())

httpsetRequestProperty(Authorization

authorization)

httpsetDoOutput(true)

PrintWriter out = new PrintWriter(new

BufferedOutputStream(httpgetOutputStream()))

outprintln(--multipart-boundary)

outprintln(Content-type applicationxml)

outprintln()

outprintln(createPapMessage(clientAddress

addressTypeppgServer genPushId() null))

outprintln()

outprintln(--multipart-boundary)

outprintln(Content-type + mimeType)

outprintln()

outprintln(message)

outprintln()

outprintln(--multipart-boundary--)

outflush()

outclose()

httpconnect()

Appendix C

52

finally read and debug the response received from

PPG

try

debugResponse(http)

catch (Exception e)

Systemerrprintln(Error in receiving the

response)

ltcodegtcreatePapMessageltcodegt creates a Push Access

Protocoltype message

param address a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param ppgServer a ltcodegtStringltcodegt value

param pushId a ltcodegtStringltcodegt value

param notificationTo a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createPapMessage(String address

String addressType String ppgServer String pushId

String notificationTo)

return XML_VERSION + n + PAP_DOCTYPE + n +

ltpap product-name=Mobile Zoo Push

Initiatorgtn +

ltpush-message push-id= + pushId +

(notificationTo = null request-notification-

to= + notificationTo ) + gtn +

ltaddress address-value=WAPPUSH= + address +

TYPE= + addressType +

+ ppgServer + gtn +

ltpush-messagegtnltpapgt

ltcodegtcreateSiMessageltcodegt creates a service

indication type message

param url a ltcodegtStringltcodegt value

param created a ltcodegtStringltcodegt value

param expires a ltcodegtStringltcodegt value

Appendix C

53

param message a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createSiMessage(String url

String sid String created String expires String

action String message)

return XML_VERSION + SI_DOCTYPE +

ltsigtn +

ltindication href= + url + +

(sid = null si-id= + sid + ) +

created = null created= + created +

) +

(action = null action= + action +

) +

(expires = null expires= + expires +

) + gt +

message +

ltindicationgtnltsigt

Debug response

param http a ltcodegtHttpURLConnectionltcodegt value

exception Exception if an error occurs

private void debugResponse(HttpURLConnection http)

throws Exception

Systemoutprintln(httpgetResponseMessage())

String headerName

int i=0

while((headerName = httpgetHeaderFieldKey(i++)) =

null)

Systemoutprintln(headerName + +

httpgetHeaderField(headerName))

Systemoutprintln()

InputStreamReader in = new InputStreamReader(new

BufferedInputStream(httpgetInputStream()))

int c

Appendix C

54

while((c = inread()) = -1)

Systemoutprint((char)c)

Systemoutprintln()

ltcodegtgenPushIdltcodegt generates an unique push id

return a ltcodegtStringltcodegt value

private String genPushId()

pushId = 100000

return SystemcurrentTimeMillis() + + pushId++

55

References

[1] Microsoft ldquoGetting Mobile Using WML and WAP to Display Web Sites on

Mobile Devicesrdquo

URL msdnmicrosoftcomen-uslibraryaa140117(office10)aspx accessed

on April 10 2008

[2] DALE BULBROOK ldquoWAPA Beginnerrsquos Guiderdquo OsborneMcGraw-Hill 2001

[3] WAP Forum Wireless Application Protocol Architecture Specification Access on

Jan 12 2008 Available

httpwww1wapforumorgtechdocumentsWAP-210-WAPArch-2006 07 12-apdf

[4] WAP Forum Push Architectural Overview access on (2008 February 3) Available

httpwww1wapforumorgtechdocumentsWAP-250-PushArchOverview-2007 04

03-apdf

[5] Service indication PDF access on 62008 Available

httpwwww3orgTRhtml401structlinkshtml

[6] WAP Push Technology (openwave) PDF access on (2008 April) Available

URL httpwwwopenwavorg

[7] Web site (httpwwwwapforumorgwhatcopyrighthtm) access on May 2008

[8] ldquoWAP Push Proxy Gateway Specificationrdquo WAP Forum access on 16-August-

2007URI httpwwwwapforumorgPDF

[9] WAP Forum Access on (2008 MAY 31) WAP Service Indication Specification

Available httpwww1wapforumorgtechdocumentsWAP-167-ServiceInd-200507

31-apdf

  • odc_fpwmlandwap_topic3
  • N100E3
  • 21
  • 5

Chapter 2 Basic Concepts

22

When the client is busy with some application it is not suitable to execute the referred

content directly upon reception of a message To avoid this client may cache the content

indicated by the URI so it becomes available to the user when the client is ready

Messages sent with the service loading method can support mechanism to improve the

end-user-experience

Control of the level of user interaction

To improve the users understanding of the provided service and the affect the

userrsquos behavior when the message is delivered it is possible to change the level

of user-intrusiveness The service can explicitly specify if the service should be

loaded or not if the client is busy on reception

Pre-emptive content caching

By setting this attribute the service loading can require that the indicated content

is downloaded and cached instead of executed This can be used to improve the

users experience of the services that otherwise would have required content to

be retrieved from an origin

23

Chapter Three

3 System requirements

Several materials and requirements must be incorporated into the design implementation

and testing The following discusses the components necessary to fulfill the project

requirements and environment

31 development environment

There are many development tools to choose from when developing for WAP Push and

hen you combine different environments with different gateways you will get a vast

numbers of choices This large flora of tools makes it difficult to choose a suitable

environment an important issue because a badly chosen one might consume a lot of time

341 Operating system

Kannel (the chosen gateway for the system) is being developed on Linux systems and

should be fairly easy to export to other Unix-like systems Although it should be working

without major problems on Windows (through Cygwin) Solaris and FreeBSD The push

initiator is implemented on java so it is operating system independent

Linux is the logical choice especially when it comes to the world severs and networking

for it promising feature as an open source low cost operating system

342 Programming language

Since system design was planned to be modular to enhance the reuse of its components as

explained above then an object oriented programming language will be a reasonable

choice Another factor is the need for a graphical user interface which imposes using a

programming language with good graphics handling capabilities at the same time it

should be over Linux

Chapter 3 System requirements

24

The best programming language to accomplish the above requirement is found to be java

which has the flowing feature

Cross platform - All clients and servers run the same Java code without any

changes or recompilation This simplifies deployment

Cost effective to develop in Java - The java language has many features that

improve developer productivity promote code reuse and reduce development and

maintenance costs

Works well with Open Source - Java with Linux and the many open source

movement projects and libraries provide a powerful mix that ensures development

is cost-effective efficient and of high quality because extensively tested libraries

components and solutions are available to plug-in to customer development

efforts

343 Nokia Mobile Internet Toolkit 41

To design and implement a WAP application on a Nokia phone the Nokia Internet

Toolkit has to be downloaded and installed on the PC A Nokia simulator is installed as

part of the installation but various phone simulators can be downloaded and installed

This simulator is used for testing purpose Also it has a server simulator based on the

Nokia Active Server if a WAP Gateway is unavailable

32 software requirements

Most of this section has been mentioned in way or other but they will be considered

briefly here

321 Kannel WAP gateway

This is an open source gateway upon which the push proxy gateway of this system will

be built on it available free of charge at kannel project web site

Chapter 3 System requirements

25

322 Linux operating system

It is important to install kannel gateway on it for this project we choose fedora core 7 for

availability reasons

323 JDK16

The java run time environment is required to implement the push initiator

32 hardware requirements

321 PC

Any Personal computer capable of running fedora core 7 with USB interface to be able

connects GSM modem

322 GSM modem

This will act as an alternative to the short message service center SMSC Obviously this

means that GSM network is required too

26

Chapter Four

4 System design

41 System Scenario

The basic scenario of a push session is that a Push Initiator (PI) transmits content to a

WAP client This is done in multiple steps as shown in Figure 31

pushOTAPAP

Gateway

PI

1

2

pull gateway

PPG

3

SMS center

Mobile device

6

5

4

Content provider78 9

Figure 41 WAP push scenario

Chapter 4 System Design

27

The PI communicates with a Push Proxy Gateway (PPG) over the Push Access Protocol

(PAP) (1 and 2) The PPG will then use the Push Over-The-Air Protocol (PushOTA) (3)

to deliver a Uniform Resource Identifier (URI) to the client via a Short Message System

Centre (SMS-C) (4 and 5) The next step for the client is then to activate the URI (6 and

7) and get the content from the server (8 and 9) The mobile device will have to use a

ldquoPull Gatewayrdquo to get the content but it is very likely that this is the same one as the PPG

The same same scenario could be viewed in sequence diagram figure (42)

Push Initiator PPG SMS Center WAP client

Send push message

Send push message response

Send WAP push message

Ack

Send WAP push message

Ack

Message read

Ack

Message read

Ack

Result notification message

Result notification response

Figure 42 WAP push sequence diagram

Chapter 4 System Design

28

43 Modular Design

Conceptually we can envision this push system as consisting of three major components

(presented in the order of the push lifetime)

first there is a Push Initiator Program that reads the generates a notification message and

transmits (pushes) it via a WAP Gateway to the customer phone This message notifies

the user that a service is available if the user accepts will ask the phonersquos browser to pull

the page from our web server via the WAP Gateway

Next there is the Push Proxy Gateway PPG which will receive the push message from

the push initiator and is responsible of doing any needed optimization protocol

compilation and conversion Also it is responsibility of the PPG to find the end user

address and send the push message to the SMS center

Finally there is the SMS center which will do the last delivery of push message to the

intended user if the user were offline the message will be saved for later time until the

WAP client is on

PI PPGSMSC

Figure 43 system modules

Chapter 4 System Design

29

43 Design of system Modules

Following sections of this chapter present a description and design of the system modules

with accompanying graphical representation

431 Push Initiator (PI)

The PI is the first logical component in the WAP Push scenario and therefore the

originator of the push message There are different kinds of PIs One example is an

automated script another one is a semi automated server version written in an applicable

scripting language supporting server side interaction

A push message is sent as an HTTP POST to the Push Proxy Gateway The POST will be

a multipart XML document with the first part being the control entity (Push Access

Protocol) the second part being the content entity (either a Service Indication or a

Service Load) and the third part being the capability entity

HTTP Post

Capability entity

Content entity (SISL)

Control entity (PAP)

Figure 44 architecture of the push message

Chapter 4 System Design

30

4311 Control entity

This part of the push contains the basic information and fields The fields can include

recipient address expiry time bearer type delivery attempt time and a URL to which a

response is to be sent if delivery confirmation is requested by the push initiator

PAP is the protocol used in WAP Push framework for specifying control information and

content that is to be pushed to a client via a Push Proxy Gateway (PPG) A Push Initiator

(PI) triggers push message processing The Push initiator class (Appendix B) of this

design shows how to generate PAP messages

The address of the used PPG should be given as an initialization parameter of the

application (ldquoppg-urlrdquo see Appendix B) This design also provides an implementation

that can be used in a special case when ldquoIPv4 IPv6rdquo type client addressing is applied and

when toolkit is used All other cases including the use of phone numbers (ldquoPLMNrdquo type

address) in sending push messages are considered

The PAP XML contains at the minimum a ltpapgt element a ltpush-messagegt

element and an ltaddressgt element

The important parts of this PAP message are the address value and type The value is

typically a MSISDN and type indicates whether to send to a MSISDN (typical case) or to

an IP Address The TYPE is almost always MSISDN as the Push Initiator (PI) will not

typically have the Mobile Stations IP address - which is generally dynamic

4312 Content entity

This is the actual data that is received by the mobile device The various content types

are Service Indication (SI) Service Load (SL) and Cache Operation (CO) in our project

we will just deal with SI and SL

The SI notifies a client about an external event by inviting the client to interact with it In

other words it informs a client about a service More precisely it sends a message that

Chapter 4 System Design

31

informs the client of a Uniform Resource Identifier (URI) where the client can access the

service

An important attribute of SI is the action attribute it may contain the action to be taken

when the client receives the SI There are two groups that the action attributes can be

divided into

First we have delete and signalmdashnone both of them is used because of their side

effects Ie with delete you take away all SIs with the same si-id as the deletion pushrdquo

including itself and with signal-none you either do nothing or you pay regard to the

info element in that push

The other group consists of signal-low signal-medium and signal-high These

attributes are all used to set the rules for the presentation in the terminal device

o Signal-low

The SI must be postponed without user intervention

o Signal-medium

The SI must be presented as soon as the implementation allows that to be carried out

without disturbing the user (Signal-medium is the value that will be used if none is

specified)

o Signal-high

The SI must be presented as soon as the implementation allows that to be carried out

without disturbing the user or earlier if it seems appropriate (This decision may for

instance be based on user preference settings)

This is the different functionalities supported by the SI we concidered

Expiration

Replacement

Deletion

Chapter 4 System Design

32

Handling of out of order delivery

Handling of information specified in the info element

A PUSH Service Indication (SI) contains at a minimum an ltsigt element and a

ltindicationgt element SL donrsquot differ so much from SI

4313 Capability entity

This entity determines the type of mobile device that is to be served This is determined

by WAP user agent profiling The sender can indicate the hardware vendor and browser

version and type of the intended recipients This capability entity is then matched at the

PPG to see which devices are compatible with the requested capability If there is a

match the content is delivered by the PPG to that specific device

Now a day most devices are compatible with WAP so we donrsquot need to create this entity

more precisely it is optional

After the push has been created in the PI it is up to the system to deliver it to the defined

destination In this system the different responsible entities are the PPG and the SMSC

Both of these two different entities are running on same server but it is only the

configuration of the SMSC that is out of my control since it is run by the operator and is

not controllable in my lab environment

432 Push Proxy Gateway (PPG)

There are various commercial WAP gateways available on the market that are quite

expensive Kannel on the other hand is an open source gateway one doesnrsquot need to pay

for it in addition one can edit the source code himself and construct his own customized

gateway Because Kannel is being developed on Linux systems (RedHat and Debian) it

can be smoothly ported to other UNIX-like operating systems

4321 Kannel gateway architecture

The gateway divides the processing load between the following three hosts

Chapter 4 System Design

33

The bearer box which connects to the SMS (Short Message Service) centers and

or CSD (Circuit Switched Data) routers providing a unified interface to them for

the wapbox The bearer box does this by implementing the WDP (Wireless

Datagram Protocol) layer of the WAP stack

The smsbox implements the rest of the SMS gateway functionality It receives

textual SMS messages from the bearerbox and interprets them as service

requests and responds to them in the appropriate way

The wapbox which hosts the upper layers of the WAP stack Each session and its

transactions are handled by the same wapbox (see figure 35)

1Figure 45 divisions of duties in kannel

4322 Working of the gateway

The bearer box receives UDP (User Datagram Protocol) packets from CSD routers

inspects them to see whether they are WAP packets if so then it will routes them to the

WAP box This simple design allows the bearer box to do a minimum of processing per

smsbox

wapbox

bearerbox

Kannel

SMS center

WAP phone

HTTP server

Chapter 4 System Design

34

packet The bearer box also sends the UDP packets that the other boxes generate which

adds some more routing processing The wapboxes implement the WTP (Wireless

Transaction Protocol) and WSP (Wireless Session Protocol) layers These take HTTP-

like requests from the phones and make the actual HTTP requests to content servers

compress the responses and send them back to the terminals (Sessions are maintained to

make as much use of the limited radio bandwidth as possible)

4323 External interfaces of the gateway

The gateway has interfaces to three external agents

bull SMS centers using various protocols

bull HTTP servers to fetch WAP and SMS content and to push WAP Content The

pull protocol is HTTP push PAP

bull WAP phones implementing the WAP protocol stack and (for push) WAP Push

client

Figure 36 summarize kannel external interfaces

4324 Configuring the gateway

The bearerbox smsbox and wapbox are the main working modules of the gateway and

must be configured before configuring the gateway These three modules are controlled

by a configuration file that has wapbox smsbox and bearerbox groups

Configuring the PPG core group

We use two components the PPG core group and the PPG user group The PPG

core group is used to configure the PI interface(for more details configuration

variables refer to appendix c)

Chapter 4 System Design

35

Mobile telephone

network

The Internet

smsbox

wapbox

bearerbox

Kannel

HTTP

HTTP

HTTP server

Serving WML

files

HTTP server

Serving HTML

files

TCP

TCP

WAPSMS

SMSC

WAP phoneNetwork base station

Workstation used for http

administration

Figure 46 External interfaces of the gateway

4325 Administering the gateway through an HTTP interface

Kannel can be administered via an HTTP interface All commands are given as normal

HTTP queries so they can easily be given from command lines like this one

links -dump httpip-adressportshutdownpassword=yourchoice

But it is advantageous to have graphical user interface for gateway control so we have

designed GUI through http

Chapter 4 System Design

36

433 Short Message Service Centre (SMSC)

A SMSC is an essential component when sending a push message from an IP network to

a mobile device in the architecture supported by the components and devices It is used to

remove the TCPIP layer that the push is encapsulatedrdquo in It is also the entity that

identifies the end-point device When this is done it is also the SMSC that is responsible

for the processing and final message delivery to the device After the process of de-

encapsulation and resolution of the client identity there should not be any difference

between this message and a message that is originated locally from the operator itself

(like a SMS)

In this project we just use a virtual SMS center we try first to get connection to a real

one but our effort was worthless

Finally the following figure depicts the overall flowchart of the WAP push system

(figure 47)

Chapter 4 System Design

37

PI

PPG

Create PAP

HTTP Post

Message

processing

OTA

Connection

oriented

Sessionless Session

oriented

WTP Initiation

WAP clinet

Application

Create content

Create

capability

entity

Database

SMS center

NoYes

Figure 47 the complete flowchart of the system

38

Chapter Five

5 System implementation and results

51 Implementation

511 The Push Proxy Gateway

First of all the Kannel gateway have been compiled and installed using gcc (GNU C

Compiler) this stage go fine except the operating system required more components to

be pre-installed and will configured

Then with stages of configuration to the gateway (Appendix B) it was capable of working

as PPG Figure 51 below show the gateway when it starts

Figure 51 starting kannel gateway

Then a web based user interface had been created to provide an easy way to control the

gateway remotely Figure 52 and figure 53

39

Figure 52 GUI for gateway control

512 The Push initiator

Next the push initiator design had been implemented using java programming language

as in design phase the implementation is taken carefully to make a reusable component

that could be used by other developer

PushInitiator class (Appendix B) implements a simple push initiator which can be used

to create and send messages to a push proxy gateway (PPG)

The method sendPushMessage sends a push message via the PPG to the client The client

is identified by the address which is either the phone number (address type is PLMN) or

IP address The message content and its mime type are also given as arguments to the

method the other tow important method are

createPapMessage This method creates a Push Access Protocol (PAP) type message

40

createSiMessage This method is used to create a service indication (SI) type message

Figure 53 showing running kannel status

513 WAP site

Since this site will be built for testing purpose and making sure that the system is

functional we had not go deep in this section Just simple WAP site with tow page has

been crated

41

52 Service indication

When a SI was pushed to any of the emulator or Nokia phones it was received and

presented in the way it was supposed to as specified in the WAP standard as shown in

figures below This is a proof that the devices claiming to support WAP push do so and

the design is will working See figures 53 through 56

Figure 55 service indication

42

Figure 57 SI details

52 Service load

The emulator correctly receives and interpreted the SL push the same as all of Nokia

phones we have tested

When a SL was pushed to the Ericsson phones it was not presented in the specified way

figure 58 I think that it is because of security reasons The reason for this assumption is

that the phones only supports on or off as security in their push configuration The

emulator on the other hand presents SL correctly Finally the Siemens phone did seem to

interpret SL but the current software was not very consistent It did load the SL without

user interference in the specified way when the user already where having an active

session If the user was offline the phone interface presented a symbol on the display

and did not load the service until the user clicked on the symbol

43

Chapter Six

6 conclusion and future work

In this chapter we will provide the conclusions and proposed future work for interested

individuals

61 Conclusions

In this project a WAP push system has been successfully designed and implemented It

provides a way to partially overcome the limitations encountered when accessing the

World Wide Web using handsets After comparing the proposed project objectives with

those accomplished the main goals are seen to be met

Phones from different manufactures all differ from the WAP-standard in some

ways One of the most obvious differences is the resolution of the display

During the work it has been noticed that the WML pages must be quite small We

have also noticed that the support for tables and some other tags are a bit limited

Even though the WML standard is smaller than the HTML standard it is a little

more complicated to write correct WML pages The main conclusion is that WAP

works pretty well but the phones are a little non-stable

The push proxy gateway is configured and worked probably with virtual SMS

center and it is easy to switch to a real one

The system depends mainly on open sources (ie Linux and kannek)

The design and implementation of the push initiator work well with the kannel

gateway and it should work correctly with other gateways

Chapter 6 Conclusion

44

62 Further Work

The possibilities of wireless push are interesting enough that it has to be worth to know if

the security and conformance problems will be solved in WAP push If they are solved

and the technique is refined then there should be nothing to stop the great number of

services that will follow in its footsteps Therefore there is further work that should be

done and the most interesting parts are in my opinion these

621 Security Aspect

One of the problems today is that the phones supporting push does not have the detailed

security settings that a technique like this needs Therefore it would be interesting to look

into the possibility to add these without confusing the user I suggest furthering looking

into usability aspects of security in WAP Push for short

622 GPS integration possibility

This will provide location dependent delivery of WAP push it will have great

applications in telematic and ecommerce advertising

623 Conformance to Standards

An interesting project would be to examine if the main reason for the nonstandard

solutions in the existing WAP push software is the result of difficulties in

implementation Or if the main reason is that the manufacturers wants to provide

proprietary solutions A reason why one may want to know this is that if the problem is

depending on implementation problems then it might get better

45

Appendix A Abbreviations

CDMA Code Division Multiple Access

CO Cache Operation

DTD Document Type Definition

GSM Global System for Mobile

HTTP Hypertext Transfer Protocol

IP Internet Protocol

MSISDN Mobile Station International Subscriber Directory Number

OTA Over The Air

PAP Push Access Protocol

PushOTA Push Over The Air

PDA Personal Digital Assistant

P1 Push Initiator

PLMN Public Land Mobile Networks

PPG Push Proxy Gateway

SI Service Indication

SIA Session Initiation Application

SIR Session Initiation Request

SL Service Loading

SMPP Short Message Peer to Peer

SMS Short Message System

SMSC Short Message System Center

UCP Universal Computer Protocol

URI Uniform Resource Identifier

URL Uniform Resource Locator

UTC Universal Time Coordinated

WAP Wireless Application Protocol

WBXML WAP binary XML

WDP Wireless Datagram Protocol

WSP Wireless Session Protocol

WTLS Wireless Transport Layer Security

XML Extensible Mark-up Language

46

Appendix B Kannel gateway configurations

THIS IS A SAMPLE CONFIGURATION FOR KANNEL

group = core

admin-port = 13000

admin-password = admin

status-password = admin

admin-deny-ip =

admin-allow-ip = 127001172161455

log-file = tmpkannellog

log-level = 0

http-proxy-host = 172161411

http-proxy-port = 8080

http-proxy-exceptions = 127001

Smsbox related

smsbox-port = 13001

box-deny-ip =

box-allow-ip = 127001

bearerbox-host =localhost

Wapbox related

wapbox-port = 13002

udp-deny-ip =

udp-allow-ip = 127001

bearerbox-host =localhost

SMSC GSM

group = smsc

smsc = at

modemtype = auto

speed =9600

device = devttyS0

SMSC HTTP

group = smsc

smsc = http

system-type = kannel

port = 13016

connect-allow-ip = 127001

Appendix B

47

username = wappush

password = wappush

SMSBOX SETUP

group = smsbox

bearerbox-host = localhost

sendsms-port = 13013

sendsms-chars = 0123456789 +-

log-file = tmpsmsboxlog

log-level = 0

access-log = accesslog

white-list = 127001

black-list =

SEND-SMS USERS

group = sendsms-user

username = wappush

password = wappush

user-deny-ip =

user-allow-ip = 127001

PPG group

group = ppg

ppg-url = wappush

ppg-port = 8080

concurrent-pushes = 100

trusted-pi = true

users = 1024

service-name = ppg

ppg-smsbox-id = dlrbox

WAP PUSH USER

group = wap-push-user

wap-push-user = picom

ppg-username = wappush

ppg-password = wappush

allow-ip = localhost

48

Appendix C Selected Codes

Gateway Control Form

ltDOCTYPE HTML PUBLIC -W3CDTD HTML 32ENgt

lthtmlgt ltheadgt

lttitlegtGateway control formlttitlegt

ltheadgt

ltbody bgcolor=white text=black link=blue vlink=navy

alink=redgt

ltbase target=submitgt

ltscriptgt

function update_status()

if ( adminactionvalue == status )

adminaction = http + adminhostnamevalue +

+ adminportvalue + status +

adminstatusformatvalue

else

adminaction = http + adminhostnamevalue +

+ adminportvalue + + adminactionvalue

adminpasswordvalue = adminpasswordvalue

actiongovalue = GO GET +adminaction

ltscriptgt

lttable align=centergt

lttrgtltp align=centergtlth2gtGateway control

formlth2gtltpgtlttrgt

lttrgt lttdgtHostnamelttdgtlttdgtltinput type=text

name=adminhostname value=localhost

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPortlttdgtlttdgtltinput type=text

name=adminport value=13000

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPasswordlttdgtlttdgtltinput type=password

name=adminpassword value=

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtActionlttdgtlttdgtltselect name=adminaction

onChange=update_status()gt

ltoption value=statusgtStatusltoptiongt

ltoption value=suspendgtSuspendltoptiongt

ltoption value=isolategtIsolateltoptiongt

Appendix C

49

ltoption value=shutdowngtShutdownltoptiongt

ltoption value=resumegtResumeltoptiongt

ltselectgtlttdgt lttrgt

lttrgt lttdgtStatus Formatlttdgtlttdgtltselect

name=adminstatusformat onChange=update_status()gt

ltoption value=gthtmlltoptiongtltoption

value=txtgttxtltoptiongtltoption

value=xmlgtxmlltoptiongtltselectgtlttdgt lttrgt

ltform name=admin method=get

action=httplocalhost13000status

encoding=applicationx-www-formgt

ltinput type=hidden name=password value=gt

lttrgt

lttdgtGolttdgt

ltformgt

lttdgtltinput type=submit value=go name=actiongo

onClick=documentadminsubmit()gtlttdgt

lttrgt

lttablegt

ltbodygt

lthtmlgt

Push Initiator Class

import javanetURL

import javanetHttpURLConnection

import javaio

Class implements a simple push initiator It can be

used to create and send messages to push proxy

gateway (ppg)

public final class PushInitiator

xml version

private final static String XML_VERSION = ltxml

version=10gt

Push Access Protocol (PAP) document type

private final static String PAP_DOCTYPE =

Appendix C

50

ltDOCTYPE pap PUBLIC -WAPFORUMDTD PAP 10EN

httpwwwwapforumorgDTDpap_10dtd gt

content type of the push request multipart body

private final static String CONTENT_TYPE =

multipartrelated boundary=multipart-boundary

type=applicationxml

Service Indication (SI) document type

private static final String SI_DOCTYPE = ltDOCTYPE si

PUBLIC -WAPFORUMDTD SI 10EN +

httpwwwwapforumorgDTDsidtdgt

private static int pushId = 0

PPG url where the pap message is to be sent

private final URL ppgUrl

some push proxy gateways may also require the

authentication of the push initiator

For instance the push initiator may be required to

send an HTTP authorization header in each request

private final String authorization

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

public PushInitiator(URL ppgUrl) thisppgUrl =

ppgUrl

authorization = null

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

param authorization a ltcodegtStringltcodegt value

public PushInitiator(URL ppgUrl String authorization)

thisppgUrl = ppgUrl

Appendix C

51

thisauthorization = authorization

Systemoutprintln(Push Initiator created ppgUrl =

+ ppgUrl)

ltcodegtsendPushMessageltcodegt sends push message to

ppg

param clientAddress a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param message a ltcodegtStringltcodegt value

param mimeType a ltcodegtStringltcodegt value

exception Exception if an error occurs

public void sendPushMessage(String clientAddress

String addressTypeString message String mimeType)

throws Exception

HttpURLConnection http =

(HttpURLConnection)ppgUrlopenConnection()

String ppgServer = ppgUrlgetHost()

httpsetDoInput(true)

httpsetRequestProperty(Content-Type CONTENT_TYPE)

if(authorization = null)

if(authorizationtrim()equals())

httpsetRequestProperty(Authorization

authorization)

httpsetDoOutput(true)

PrintWriter out = new PrintWriter(new

BufferedOutputStream(httpgetOutputStream()))

outprintln(--multipart-boundary)

outprintln(Content-type applicationxml)

outprintln()

outprintln(createPapMessage(clientAddress

addressTypeppgServer genPushId() null))

outprintln()

outprintln(--multipart-boundary)

outprintln(Content-type + mimeType)

outprintln()

outprintln(message)

outprintln()

outprintln(--multipart-boundary--)

outflush()

outclose()

httpconnect()

Appendix C

52

finally read and debug the response received from

PPG

try

debugResponse(http)

catch (Exception e)

Systemerrprintln(Error in receiving the

response)

ltcodegtcreatePapMessageltcodegt creates a Push Access

Protocoltype message

param address a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param ppgServer a ltcodegtStringltcodegt value

param pushId a ltcodegtStringltcodegt value

param notificationTo a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createPapMessage(String address

String addressType String ppgServer String pushId

String notificationTo)

return XML_VERSION + n + PAP_DOCTYPE + n +

ltpap product-name=Mobile Zoo Push

Initiatorgtn +

ltpush-message push-id= + pushId +

(notificationTo = null request-notification-

to= + notificationTo ) + gtn +

ltaddress address-value=WAPPUSH= + address +

TYPE= + addressType +

+ ppgServer + gtn +

ltpush-messagegtnltpapgt

ltcodegtcreateSiMessageltcodegt creates a service

indication type message

param url a ltcodegtStringltcodegt value

param created a ltcodegtStringltcodegt value

param expires a ltcodegtStringltcodegt value

Appendix C

53

param message a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createSiMessage(String url

String sid String created String expires String

action String message)

return XML_VERSION + SI_DOCTYPE +

ltsigtn +

ltindication href= + url + +

(sid = null si-id= + sid + ) +

created = null created= + created +

) +

(action = null action= + action +

) +

(expires = null expires= + expires +

) + gt +

message +

ltindicationgtnltsigt

Debug response

param http a ltcodegtHttpURLConnectionltcodegt value

exception Exception if an error occurs

private void debugResponse(HttpURLConnection http)

throws Exception

Systemoutprintln(httpgetResponseMessage())

String headerName

int i=0

while((headerName = httpgetHeaderFieldKey(i++)) =

null)

Systemoutprintln(headerName + +

httpgetHeaderField(headerName))

Systemoutprintln()

InputStreamReader in = new InputStreamReader(new

BufferedInputStream(httpgetInputStream()))

int c

Appendix C

54

while((c = inread()) = -1)

Systemoutprint((char)c)

Systemoutprintln()

ltcodegtgenPushIdltcodegt generates an unique push id

return a ltcodegtStringltcodegt value

private String genPushId()

pushId = 100000

return SystemcurrentTimeMillis() + + pushId++

55

References

[1] Microsoft ldquoGetting Mobile Using WML and WAP to Display Web Sites on

Mobile Devicesrdquo

URL msdnmicrosoftcomen-uslibraryaa140117(office10)aspx accessed

on April 10 2008

[2] DALE BULBROOK ldquoWAPA Beginnerrsquos Guiderdquo OsborneMcGraw-Hill 2001

[3] WAP Forum Wireless Application Protocol Architecture Specification Access on

Jan 12 2008 Available

httpwww1wapforumorgtechdocumentsWAP-210-WAPArch-2006 07 12-apdf

[4] WAP Forum Push Architectural Overview access on (2008 February 3) Available

httpwww1wapforumorgtechdocumentsWAP-250-PushArchOverview-2007 04

03-apdf

[5] Service indication PDF access on 62008 Available

httpwwww3orgTRhtml401structlinkshtml

[6] WAP Push Technology (openwave) PDF access on (2008 April) Available

URL httpwwwopenwavorg

[7] Web site (httpwwwwapforumorgwhatcopyrighthtm) access on May 2008

[8] ldquoWAP Push Proxy Gateway Specificationrdquo WAP Forum access on 16-August-

2007URI httpwwwwapforumorgPDF

[9] WAP Forum Access on (2008 MAY 31) WAP Service Indication Specification

Available httpwww1wapforumorgtechdocumentsWAP-167-ServiceInd-200507

31-apdf

  • odc_fpwmlandwap_topic3
  • N100E3
  • 21
  • 5

23

Chapter Three

3 System requirements

Several materials and requirements must be incorporated into the design implementation

and testing The following discusses the components necessary to fulfill the project

requirements and environment

31 development environment

There are many development tools to choose from when developing for WAP Push and

hen you combine different environments with different gateways you will get a vast

numbers of choices This large flora of tools makes it difficult to choose a suitable

environment an important issue because a badly chosen one might consume a lot of time

341 Operating system

Kannel (the chosen gateway for the system) is being developed on Linux systems and

should be fairly easy to export to other Unix-like systems Although it should be working

without major problems on Windows (through Cygwin) Solaris and FreeBSD The push

initiator is implemented on java so it is operating system independent

Linux is the logical choice especially when it comes to the world severs and networking

for it promising feature as an open source low cost operating system

342 Programming language

Since system design was planned to be modular to enhance the reuse of its components as

explained above then an object oriented programming language will be a reasonable

choice Another factor is the need for a graphical user interface which imposes using a

programming language with good graphics handling capabilities at the same time it

should be over Linux

Chapter 3 System requirements

24

The best programming language to accomplish the above requirement is found to be java

which has the flowing feature

Cross platform - All clients and servers run the same Java code without any

changes or recompilation This simplifies deployment

Cost effective to develop in Java - The java language has many features that

improve developer productivity promote code reuse and reduce development and

maintenance costs

Works well with Open Source - Java with Linux and the many open source

movement projects and libraries provide a powerful mix that ensures development

is cost-effective efficient and of high quality because extensively tested libraries

components and solutions are available to plug-in to customer development

efforts

343 Nokia Mobile Internet Toolkit 41

To design and implement a WAP application on a Nokia phone the Nokia Internet

Toolkit has to be downloaded and installed on the PC A Nokia simulator is installed as

part of the installation but various phone simulators can be downloaded and installed

This simulator is used for testing purpose Also it has a server simulator based on the

Nokia Active Server if a WAP Gateway is unavailable

32 software requirements

Most of this section has been mentioned in way or other but they will be considered

briefly here

321 Kannel WAP gateway

This is an open source gateway upon which the push proxy gateway of this system will

be built on it available free of charge at kannel project web site

Chapter 3 System requirements

25

322 Linux operating system

It is important to install kannel gateway on it for this project we choose fedora core 7 for

availability reasons

323 JDK16

The java run time environment is required to implement the push initiator

32 hardware requirements

321 PC

Any Personal computer capable of running fedora core 7 with USB interface to be able

connects GSM modem

322 GSM modem

This will act as an alternative to the short message service center SMSC Obviously this

means that GSM network is required too

26

Chapter Four

4 System design

41 System Scenario

The basic scenario of a push session is that a Push Initiator (PI) transmits content to a

WAP client This is done in multiple steps as shown in Figure 31

pushOTAPAP

Gateway

PI

1

2

pull gateway

PPG

3

SMS center

Mobile device

6

5

4

Content provider78 9

Figure 41 WAP push scenario

Chapter 4 System Design

27

The PI communicates with a Push Proxy Gateway (PPG) over the Push Access Protocol

(PAP) (1 and 2) The PPG will then use the Push Over-The-Air Protocol (PushOTA) (3)

to deliver a Uniform Resource Identifier (URI) to the client via a Short Message System

Centre (SMS-C) (4 and 5) The next step for the client is then to activate the URI (6 and

7) and get the content from the server (8 and 9) The mobile device will have to use a

ldquoPull Gatewayrdquo to get the content but it is very likely that this is the same one as the PPG

The same same scenario could be viewed in sequence diagram figure (42)

Push Initiator PPG SMS Center WAP client

Send push message

Send push message response

Send WAP push message

Ack

Send WAP push message

Ack

Message read

Ack

Message read

Ack

Result notification message

Result notification response

Figure 42 WAP push sequence diagram

Chapter 4 System Design

28

43 Modular Design

Conceptually we can envision this push system as consisting of three major components

(presented in the order of the push lifetime)

first there is a Push Initiator Program that reads the generates a notification message and

transmits (pushes) it via a WAP Gateway to the customer phone This message notifies

the user that a service is available if the user accepts will ask the phonersquos browser to pull

the page from our web server via the WAP Gateway

Next there is the Push Proxy Gateway PPG which will receive the push message from

the push initiator and is responsible of doing any needed optimization protocol

compilation and conversion Also it is responsibility of the PPG to find the end user

address and send the push message to the SMS center

Finally there is the SMS center which will do the last delivery of push message to the

intended user if the user were offline the message will be saved for later time until the

WAP client is on

PI PPGSMSC

Figure 43 system modules

Chapter 4 System Design

29

43 Design of system Modules

Following sections of this chapter present a description and design of the system modules

with accompanying graphical representation

431 Push Initiator (PI)

The PI is the first logical component in the WAP Push scenario and therefore the

originator of the push message There are different kinds of PIs One example is an

automated script another one is a semi automated server version written in an applicable

scripting language supporting server side interaction

A push message is sent as an HTTP POST to the Push Proxy Gateway The POST will be

a multipart XML document with the first part being the control entity (Push Access

Protocol) the second part being the content entity (either a Service Indication or a

Service Load) and the third part being the capability entity

HTTP Post

Capability entity

Content entity (SISL)

Control entity (PAP)

Figure 44 architecture of the push message

Chapter 4 System Design

30

4311 Control entity

This part of the push contains the basic information and fields The fields can include

recipient address expiry time bearer type delivery attempt time and a URL to which a

response is to be sent if delivery confirmation is requested by the push initiator

PAP is the protocol used in WAP Push framework for specifying control information and

content that is to be pushed to a client via a Push Proxy Gateway (PPG) A Push Initiator

(PI) triggers push message processing The Push initiator class (Appendix B) of this

design shows how to generate PAP messages

The address of the used PPG should be given as an initialization parameter of the

application (ldquoppg-urlrdquo see Appendix B) This design also provides an implementation

that can be used in a special case when ldquoIPv4 IPv6rdquo type client addressing is applied and

when toolkit is used All other cases including the use of phone numbers (ldquoPLMNrdquo type

address) in sending push messages are considered

The PAP XML contains at the minimum a ltpapgt element a ltpush-messagegt

element and an ltaddressgt element

The important parts of this PAP message are the address value and type The value is

typically a MSISDN and type indicates whether to send to a MSISDN (typical case) or to

an IP Address The TYPE is almost always MSISDN as the Push Initiator (PI) will not

typically have the Mobile Stations IP address - which is generally dynamic

4312 Content entity

This is the actual data that is received by the mobile device The various content types

are Service Indication (SI) Service Load (SL) and Cache Operation (CO) in our project

we will just deal with SI and SL

The SI notifies a client about an external event by inviting the client to interact with it In

other words it informs a client about a service More precisely it sends a message that

Chapter 4 System Design

31

informs the client of a Uniform Resource Identifier (URI) where the client can access the

service

An important attribute of SI is the action attribute it may contain the action to be taken

when the client receives the SI There are two groups that the action attributes can be

divided into

First we have delete and signalmdashnone both of them is used because of their side

effects Ie with delete you take away all SIs with the same si-id as the deletion pushrdquo

including itself and with signal-none you either do nothing or you pay regard to the

info element in that push

The other group consists of signal-low signal-medium and signal-high These

attributes are all used to set the rules for the presentation in the terminal device

o Signal-low

The SI must be postponed without user intervention

o Signal-medium

The SI must be presented as soon as the implementation allows that to be carried out

without disturbing the user (Signal-medium is the value that will be used if none is

specified)

o Signal-high

The SI must be presented as soon as the implementation allows that to be carried out

without disturbing the user or earlier if it seems appropriate (This decision may for

instance be based on user preference settings)

This is the different functionalities supported by the SI we concidered

Expiration

Replacement

Deletion

Chapter 4 System Design

32

Handling of out of order delivery

Handling of information specified in the info element

A PUSH Service Indication (SI) contains at a minimum an ltsigt element and a

ltindicationgt element SL donrsquot differ so much from SI

4313 Capability entity

This entity determines the type of mobile device that is to be served This is determined

by WAP user agent profiling The sender can indicate the hardware vendor and browser

version and type of the intended recipients This capability entity is then matched at the

PPG to see which devices are compatible with the requested capability If there is a

match the content is delivered by the PPG to that specific device

Now a day most devices are compatible with WAP so we donrsquot need to create this entity

more precisely it is optional

After the push has been created in the PI it is up to the system to deliver it to the defined

destination In this system the different responsible entities are the PPG and the SMSC

Both of these two different entities are running on same server but it is only the

configuration of the SMSC that is out of my control since it is run by the operator and is

not controllable in my lab environment

432 Push Proxy Gateway (PPG)

There are various commercial WAP gateways available on the market that are quite

expensive Kannel on the other hand is an open source gateway one doesnrsquot need to pay

for it in addition one can edit the source code himself and construct his own customized

gateway Because Kannel is being developed on Linux systems (RedHat and Debian) it

can be smoothly ported to other UNIX-like operating systems

4321 Kannel gateway architecture

The gateway divides the processing load between the following three hosts

Chapter 4 System Design

33

The bearer box which connects to the SMS (Short Message Service) centers and

or CSD (Circuit Switched Data) routers providing a unified interface to them for

the wapbox The bearer box does this by implementing the WDP (Wireless

Datagram Protocol) layer of the WAP stack

The smsbox implements the rest of the SMS gateway functionality It receives

textual SMS messages from the bearerbox and interprets them as service

requests and responds to them in the appropriate way

The wapbox which hosts the upper layers of the WAP stack Each session and its

transactions are handled by the same wapbox (see figure 35)

1Figure 45 divisions of duties in kannel

4322 Working of the gateway

The bearer box receives UDP (User Datagram Protocol) packets from CSD routers

inspects them to see whether they are WAP packets if so then it will routes them to the

WAP box This simple design allows the bearer box to do a minimum of processing per

smsbox

wapbox

bearerbox

Kannel

SMS center

WAP phone

HTTP server

Chapter 4 System Design

34

packet The bearer box also sends the UDP packets that the other boxes generate which

adds some more routing processing The wapboxes implement the WTP (Wireless

Transaction Protocol) and WSP (Wireless Session Protocol) layers These take HTTP-

like requests from the phones and make the actual HTTP requests to content servers

compress the responses and send them back to the terminals (Sessions are maintained to

make as much use of the limited radio bandwidth as possible)

4323 External interfaces of the gateway

The gateway has interfaces to three external agents

bull SMS centers using various protocols

bull HTTP servers to fetch WAP and SMS content and to push WAP Content The

pull protocol is HTTP push PAP

bull WAP phones implementing the WAP protocol stack and (for push) WAP Push

client

Figure 36 summarize kannel external interfaces

4324 Configuring the gateway

The bearerbox smsbox and wapbox are the main working modules of the gateway and

must be configured before configuring the gateway These three modules are controlled

by a configuration file that has wapbox smsbox and bearerbox groups

Configuring the PPG core group

We use two components the PPG core group and the PPG user group The PPG

core group is used to configure the PI interface(for more details configuration

variables refer to appendix c)

Chapter 4 System Design

35

Mobile telephone

network

The Internet

smsbox

wapbox

bearerbox

Kannel

HTTP

HTTP

HTTP server

Serving WML

files

HTTP server

Serving HTML

files

TCP

TCP

WAPSMS

SMSC

WAP phoneNetwork base station

Workstation used for http

administration

Figure 46 External interfaces of the gateway

4325 Administering the gateway through an HTTP interface

Kannel can be administered via an HTTP interface All commands are given as normal

HTTP queries so they can easily be given from command lines like this one

links -dump httpip-adressportshutdownpassword=yourchoice

But it is advantageous to have graphical user interface for gateway control so we have

designed GUI through http

Chapter 4 System Design

36

433 Short Message Service Centre (SMSC)

A SMSC is an essential component when sending a push message from an IP network to

a mobile device in the architecture supported by the components and devices It is used to

remove the TCPIP layer that the push is encapsulatedrdquo in It is also the entity that

identifies the end-point device When this is done it is also the SMSC that is responsible

for the processing and final message delivery to the device After the process of de-

encapsulation and resolution of the client identity there should not be any difference

between this message and a message that is originated locally from the operator itself

(like a SMS)

In this project we just use a virtual SMS center we try first to get connection to a real

one but our effort was worthless

Finally the following figure depicts the overall flowchart of the WAP push system

(figure 47)

Chapter 4 System Design

37

PI

PPG

Create PAP

HTTP Post

Message

processing

OTA

Connection

oriented

Sessionless Session

oriented

WTP Initiation

WAP clinet

Application

Create content

Create

capability

entity

Database

SMS center

NoYes

Figure 47 the complete flowchart of the system

38

Chapter Five

5 System implementation and results

51 Implementation

511 The Push Proxy Gateway

First of all the Kannel gateway have been compiled and installed using gcc (GNU C

Compiler) this stage go fine except the operating system required more components to

be pre-installed and will configured

Then with stages of configuration to the gateway (Appendix B) it was capable of working

as PPG Figure 51 below show the gateway when it starts

Figure 51 starting kannel gateway

Then a web based user interface had been created to provide an easy way to control the

gateway remotely Figure 52 and figure 53

39

Figure 52 GUI for gateway control

512 The Push initiator

Next the push initiator design had been implemented using java programming language

as in design phase the implementation is taken carefully to make a reusable component

that could be used by other developer

PushInitiator class (Appendix B) implements a simple push initiator which can be used

to create and send messages to a push proxy gateway (PPG)

The method sendPushMessage sends a push message via the PPG to the client The client

is identified by the address which is either the phone number (address type is PLMN) or

IP address The message content and its mime type are also given as arguments to the

method the other tow important method are

createPapMessage This method creates a Push Access Protocol (PAP) type message

40

createSiMessage This method is used to create a service indication (SI) type message

Figure 53 showing running kannel status

513 WAP site

Since this site will be built for testing purpose and making sure that the system is

functional we had not go deep in this section Just simple WAP site with tow page has

been crated

41

52 Service indication

When a SI was pushed to any of the emulator or Nokia phones it was received and

presented in the way it was supposed to as specified in the WAP standard as shown in

figures below This is a proof that the devices claiming to support WAP push do so and

the design is will working See figures 53 through 56

Figure 55 service indication

42

Figure 57 SI details

52 Service load

The emulator correctly receives and interpreted the SL push the same as all of Nokia

phones we have tested

When a SL was pushed to the Ericsson phones it was not presented in the specified way

figure 58 I think that it is because of security reasons The reason for this assumption is

that the phones only supports on or off as security in their push configuration The

emulator on the other hand presents SL correctly Finally the Siemens phone did seem to

interpret SL but the current software was not very consistent It did load the SL without

user interference in the specified way when the user already where having an active

session If the user was offline the phone interface presented a symbol on the display

and did not load the service until the user clicked on the symbol

43

Chapter Six

6 conclusion and future work

In this chapter we will provide the conclusions and proposed future work for interested

individuals

61 Conclusions

In this project a WAP push system has been successfully designed and implemented It

provides a way to partially overcome the limitations encountered when accessing the

World Wide Web using handsets After comparing the proposed project objectives with

those accomplished the main goals are seen to be met

Phones from different manufactures all differ from the WAP-standard in some

ways One of the most obvious differences is the resolution of the display

During the work it has been noticed that the WML pages must be quite small We

have also noticed that the support for tables and some other tags are a bit limited

Even though the WML standard is smaller than the HTML standard it is a little

more complicated to write correct WML pages The main conclusion is that WAP

works pretty well but the phones are a little non-stable

The push proxy gateway is configured and worked probably with virtual SMS

center and it is easy to switch to a real one

The system depends mainly on open sources (ie Linux and kannek)

The design and implementation of the push initiator work well with the kannel

gateway and it should work correctly with other gateways

Chapter 6 Conclusion

44

62 Further Work

The possibilities of wireless push are interesting enough that it has to be worth to know if

the security and conformance problems will be solved in WAP push If they are solved

and the technique is refined then there should be nothing to stop the great number of

services that will follow in its footsteps Therefore there is further work that should be

done and the most interesting parts are in my opinion these

621 Security Aspect

One of the problems today is that the phones supporting push does not have the detailed

security settings that a technique like this needs Therefore it would be interesting to look

into the possibility to add these without confusing the user I suggest furthering looking

into usability aspects of security in WAP Push for short

622 GPS integration possibility

This will provide location dependent delivery of WAP push it will have great

applications in telematic and ecommerce advertising

623 Conformance to Standards

An interesting project would be to examine if the main reason for the nonstandard

solutions in the existing WAP push software is the result of difficulties in

implementation Or if the main reason is that the manufacturers wants to provide

proprietary solutions A reason why one may want to know this is that if the problem is

depending on implementation problems then it might get better

45

Appendix A Abbreviations

CDMA Code Division Multiple Access

CO Cache Operation

DTD Document Type Definition

GSM Global System for Mobile

HTTP Hypertext Transfer Protocol

IP Internet Protocol

MSISDN Mobile Station International Subscriber Directory Number

OTA Over The Air

PAP Push Access Protocol

PushOTA Push Over The Air

PDA Personal Digital Assistant

P1 Push Initiator

PLMN Public Land Mobile Networks

PPG Push Proxy Gateway

SI Service Indication

SIA Session Initiation Application

SIR Session Initiation Request

SL Service Loading

SMPP Short Message Peer to Peer

SMS Short Message System

SMSC Short Message System Center

UCP Universal Computer Protocol

URI Uniform Resource Identifier

URL Uniform Resource Locator

UTC Universal Time Coordinated

WAP Wireless Application Protocol

WBXML WAP binary XML

WDP Wireless Datagram Protocol

WSP Wireless Session Protocol

WTLS Wireless Transport Layer Security

XML Extensible Mark-up Language

46

Appendix B Kannel gateway configurations

THIS IS A SAMPLE CONFIGURATION FOR KANNEL

group = core

admin-port = 13000

admin-password = admin

status-password = admin

admin-deny-ip =

admin-allow-ip = 127001172161455

log-file = tmpkannellog

log-level = 0

http-proxy-host = 172161411

http-proxy-port = 8080

http-proxy-exceptions = 127001

Smsbox related

smsbox-port = 13001

box-deny-ip =

box-allow-ip = 127001

bearerbox-host =localhost

Wapbox related

wapbox-port = 13002

udp-deny-ip =

udp-allow-ip = 127001

bearerbox-host =localhost

SMSC GSM

group = smsc

smsc = at

modemtype = auto

speed =9600

device = devttyS0

SMSC HTTP

group = smsc

smsc = http

system-type = kannel

port = 13016

connect-allow-ip = 127001

Appendix B

47

username = wappush

password = wappush

SMSBOX SETUP

group = smsbox

bearerbox-host = localhost

sendsms-port = 13013

sendsms-chars = 0123456789 +-

log-file = tmpsmsboxlog

log-level = 0

access-log = accesslog

white-list = 127001

black-list =

SEND-SMS USERS

group = sendsms-user

username = wappush

password = wappush

user-deny-ip =

user-allow-ip = 127001

PPG group

group = ppg

ppg-url = wappush

ppg-port = 8080

concurrent-pushes = 100

trusted-pi = true

users = 1024

service-name = ppg

ppg-smsbox-id = dlrbox

WAP PUSH USER

group = wap-push-user

wap-push-user = picom

ppg-username = wappush

ppg-password = wappush

allow-ip = localhost

48

Appendix C Selected Codes

Gateway Control Form

ltDOCTYPE HTML PUBLIC -W3CDTD HTML 32ENgt

lthtmlgt ltheadgt

lttitlegtGateway control formlttitlegt

ltheadgt

ltbody bgcolor=white text=black link=blue vlink=navy

alink=redgt

ltbase target=submitgt

ltscriptgt

function update_status()

if ( adminactionvalue == status )

adminaction = http + adminhostnamevalue +

+ adminportvalue + status +

adminstatusformatvalue

else

adminaction = http + adminhostnamevalue +

+ adminportvalue + + adminactionvalue

adminpasswordvalue = adminpasswordvalue

actiongovalue = GO GET +adminaction

ltscriptgt

lttable align=centergt

lttrgtltp align=centergtlth2gtGateway control

formlth2gtltpgtlttrgt

lttrgt lttdgtHostnamelttdgtlttdgtltinput type=text

name=adminhostname value=localhost

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPortlttdgtlttdgtltinput type=text

name=adminport value=13000

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPasswordlttdgtlttdgtltinput type=password

name=adminpassword value=

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtActionlttdgtlttdgtltselect name=adminaction

onChange=update_status()gt

ltoption value=statusgtStatusltoptiongt

ltoption value=suspendgtSuspendltoptiongt

ltoption value=isolategtIsolateltoptiongt

Appendix C

49

ltoption value=shutdowngtShutdownltoptiongt

ltoption value=resumegtResumeltoptiongt

ltselectgtlttdgt lttrgt

lttrgt lttdgtStatus Formatlttdgtlttdgtltselect

name=adminstatusformat onChange=update_status()gt

ltoption value=gthtmlltoptiongtltoption

value=txtgttxtltoptiongtltoption

value=xmlgtxmlltoptiongtltselectgtlttdgt lttrgt

ltform name=admin method=get

action=httplocalhost13000status

encoding=applicationx-www-formgt

ltinput type=hidden name=password value=gt

lttrgt

lttdgtGolttdgt

ltformgt

lttdgtltinput type=submit value=go name=actiongo

onClick=documentadminsubmit()gtlttdgt

lttrgt

lttablegt

ltbodygt

lthtmlgt

Push Initiator Class

import javanetURL

import javanetHttpURLConnection

import javaio

Class implements a simple push initiator It can be

used to create and send messages to push proxy

gateway (ppg)

public final class PushInitiator

xml version

private final static String XML_VERSION = ltxml

version=10gt

Push Access Protocol (PAP) document type

private final static String PAP_DOCTYPE =

Appendix C

50

ltDOCTYPE pap PUBLIC -WAPFORUMDTD PAP 10EN

httpwwwwapforumorgDTDpap_10dtd gt

content type of the push request multipart body

private final static String CONTENT_TYPE =

multipartrelated boundary=multipart-boundary

type=applicationxml

Service Indication (SI) document type

private static final String SI_DOCTYPE = ltDOCTYPE si

PUBLIC -WAPFORUMDTD SI 10EN +

httpwwwwapforumorgDTDsidtdgt

private static int pushId = 0

PPG url where the pap message is to be sent

private final URL ppgUrl

some push proxy gateways may also require the

authentication of the push initiator

For instance the push initiator may be required to

send an HTTP authorization header in each request

private final String authorization

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

public PushInitiator(URL ppgUrl) thisppgUrl =

ppgUrl

authorization = null

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

param authorization a ltcodegtStringltcodegt value

public PushInitiator(URL ppgUrl String authorization)

thisppgUrl = ppgUrl

Appendix C

51

thisauthorization = authorization

Systemoutprintln(Push Initiator created ppgUrl =

+ ppgUrl)

ltcodegtsendPushMessageltcodegt sends push message to

ppg

param clientAddress a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param message a ltcodegtStringltcodegt value

param mimeType a ltcodegtStringltcodegt value

exception Exception if an error occurs

public void sendPushMessage(String clientAddress

String addressTypeString message String mimeType)

throws Exception

HttpURLConnection http =

(HttpURLConnection)ppgUrlopenConnection()

String ppgServer = ppgUrlgetHost()

httpsetDoInput(true)

httpsetRequestProperty(Content-Type CONTENT_TYPE)

if(authorization = null)

if(authorizationtrim()equals())

httpsetRequestProperty(Authorization

authorization)

httpsetDoOutput(true)

PrintWriter out = new PrintWriter(new

BufferedOutputStream(httpgetOutputStream()))

outprintln(--multipart-boundary)

outprintln(Content-type applicationxml)

outprintln()

outprintln(createPapMessage(clientAddress

addressTypeppgServer genPushId() null))

outprintln()

outprintln(--multipart-boundary)

outprintln(Content-type + mimeType)

outprintln()

outprintln(message)

outprintln()

outprintln(--multipart-boundary--)

outflush()

outclose()

httpconnect()

Appendix C

52

finally read and debug the response received from

PPG

try

debugResponse(http)

catch (Exception e)

Systemerrprintln(Error in receiving the

response)

ltcodegtcreatePapMessageltcodegt creates a Push Access

Protocoltype message

param address a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param ppgServer a ltcodegtStringltcodegt value

param pushId a ltcodegtStringltcodegt value

param notificationTo a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createPapMessage(String address

String addressType String ppgServer String pushId

String notificationTo)

return XML_VERSION + n + PAP_DOCTYPE + n +

ltpap product-name=Mobile Zoo Push

Initiatorgtn +

ltpush-message push-id= + pushId +

(notificationTo = null request-notification-

to= + notificationTo ) + gtn +

ltaddress address-value=WAPPUSH= + address +

TYPE= + addressType +

+ ppgServer + gtn +

ltpush-messagegtnltpapgt

ltcodegtcreateSiMessageltcodegt creates a service

indication type message

param url a ltcodegtStringltcodegt value

param created a ltcodegtStringltcodegt value

param expires a ltcodegtStringltcodegt value

Appendix C

53

param message a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createSiMessage(String url

String sid String created String expires String

action String message)

return XML_VERSION + SI_DOCTYPE +

ltsigtn +

ltindication href= + url + +

(sid = null si-id= + sid + ) +

created = null created= + created +

) +

(action = null action= + action +

) +

(expires = null expires= + expires +

) + gt +

message +

ltindicationgtnltsigt

Debug response

param http a ltcodegtHttpURLConnectionltcodegt value

exception Exception if an error occurs

private void debugResponse(HttpURLConnection http)

throws Exception

Systemoutprintln(httpgetResponseMessage())

String headerName

int i=0

while((headerName = httpgetHeaderFieldKey(i++)) =

null)

Systemoutprintln(headerName + +

httpgetHeaderField(headerName))

Systemoutprintln()

InputStreamReader in = new InputStreamReader(new

BufferedInputStream(httpgetInputStream()))

int c

Appendix C

54

while((c = inread()) = -1)

Systemoutprint((char)c)

Systemoutprintln()

ltcodegtgenPushIdltcodegt generates an unique push id

return a ltcodegtStringltcodegt value

private String genPushId()

pushId = 100000

return SystemcurrentTimeMillis() + + pushId++

55

References

[1] Microsoft ldquoGetting Mobile Using WML and WAP to Display Web Sites on

Mobile Devicesrdquo

URL msdnmicrosoftcomen-uslibraryaa140117(office10)aspx accessed

on April 10 2008

[2] DALE BULBROOK ldquoWAPA Beginnerrsquos Guiderdquo OsborneMcGraw-Hill 2001

[3] WAP Forum Wireless Application Protocol Architecture Specification Access on

Jan 12 2008 Available

httpwww1wapforumorgtechdocumentsWAP-210-WAPArch-2006 07 12-apdf

[4] WAP Forum Push Architectural Overview access on (2008 February 3) Available

httpwww1wapforumorgtechdocumentsWAP-250-PushArchOverview-2007 04

03-apdf

[5] Service indication PDF access on 62008 Available

httpwwww3orgTRhtml401structlinkshtml

[6] WAP Push Technology (openwave) PDF access on (2008 April) Available

URL httpwwwopenwavorg

[7] Web site (httpwwwwapforumorgwhatcopyrighthtm) access on May 2008

[8] ldquoWAP Push Proxy Gateway Specificationrdquo WAP Forum access on 16-August-

2007URI httpwwwwapforumorgPDF

[9] WAP Forum Access on (2008 MAY 31) WAP Service Indication Specification

Available httpwww1wapforumorgtechdocumentsWAP-167-ServiceInd-200507

31-apdf

  • odc_fpwmlandwap_topic3
  • N100E3
  • 21
  • 5

Chapter 3 System requirements

24

The best programming language to accomplish the above requirement is found to be java

which has the flowing feature

Cross platform - All clients and servers run the same Java code without any

changes or recompilation This simplifies deployment

Cost effective to develop in Java - The java language has many features that

improve developer productivity promote code reuse and reduce development and

maintenance costs

Works well with Open Source - Java with Linux and the many open source

movement projects and libraries provide a powerful mix that ensures development

is cost-effective efficient and of high quality because extensively tested libraries

components and solutions are available to plug-in to customer development

efforts

343 Nokia Mobile Internet Toolkit 41

To design and implement a WAP application on a Nokia phone the Nokia Internet

Toolkit has to be downloaded and installed on the PC A Nokia simulator is installed as

part of the installation but various phone simulators can be downloaded and installed

This simulator is used for testing purpose Also it has a server simulator based on the

Nokia Active Server if a WAP Gateway is unavailable

32 software requirements

Most of this section has been mentioned in way or other but they will be considered

briefly here

321 Kannel WAP gateway

This is an open source gateway upon which the push proxy gateway of this system will

be built on it available free of charge at kannel project web site

Chapter 3 System requirements

25

322 Linux operating system

It is important to install kannel gateway on it for this project we choose fedora core 7 for

availability reasons

323 JDK16

The java run time environment is required to implement the push initiator

32 hardware requirements

321 PC

Any Personal computer capable of running fedora core 7 with USB interface to be able

connects GSM modem

322 GSM modem

This will act as an alternative to the short message service center SMSC Obviously this

means that GSM network is required too

26

Chapter Four

4 System design

41 System Scenario

The basic scenario of a push session is that a Push Initiator (PI) transmits content to a

WAP client This is done in multiple steps as shown in Figure 31

pushOTAPAP

Gateway

PI

1

2

pull gateway

PPG

3

SMS center

Mobile device

6

5

4

Content provider78 9

Figure 41 WAP push scenario

Chapter 4 System Design

27

The PI communicates with a Push Proxy Gateway (PPG) over the Push Access Protocol

(PAP) (1 and 2) The PPG will then use the Push Over-The-Air Protocol (PushOTA) (3)

to deliver a Uniform Resource Identifier (URI) to the client via a Short Message System

Centre (SMS-C) (4 and 5) The next step for the client is then to activate the URI (6 and

7) and get the content from the server (8 and 9) The mobile device will have to use a

ldquoPull Gatewayrdquo to get the content but it is very likely that this is the same one as the PPG

The same same scenario could be viewed in sequence diagram figure (42)

Push Initiator PPG SMS Center WAP client

Send push message

Send push message response

Send WAP push message

Ack

Send WAP push message

Ack

Message read

Ack

Message read

Ack

Result notification message

Result notification response

Figure 42 WAP push sequence diagram

Chapter 4 System Design

28

43 Modular Design

Conceptually we can envision this push system as consisting of three major components

(presented in the order of the push lifetime)

first there is a Push Initiator Program that reads the generates a notification message and

transmits (pushes) it via a WAP Gateway to the customer phone This message notifies

the user that a service is available if the user accepts will ask the phonersquos browser to pull

the page from our web server via the WAP Gateway

Next there is the Push Proxy Gateway PPG which will receive the push message from

the push initiator and is responsible of doing any needed optimization protocol

compilation and conversion Also it is responsibility of the PPG to find the end user

address and send the push message to the SMS center

Finally there is the SMS center which will do the last delivery of push message to the

intended user if the user were offline the message will be saved for later time until the

WAP client is on

PI PPGSMSC

Figure 43 system modules

Chapter 4 System Design

29

43 Design of system Modules

Following sections of this chapter present a description and design of the system modules

with accompanying graphical representation

431 Push Initiator (PI)

The PI is the first logical component in the WAP Push scenario and therefore the

originator of the push message There are different kinds of PIs One example is an

automated script another one is a semi automated server version written in an applicable

scripting language supporting server side interaction

A push message is sent as an HTTP POST to the Push Proxy Gateway The POST will be

a multipart XML document with the first part being the control entity (Push Access

Protocol) the second part being the content entity (either a Service Indication or a

Service Load) and the third part being the capability entity

HTTP Post

Capability entity

Content entity (SISL)

Control entity (PAP)

Figure 44 architecture of the push message

Chapter 4 System Design

30

4311 Control entity

This part of the push contains the basic information and fields The fields can include

recipient address expiry time bearer type delivery attempt time and a URL to which a

response is to be sent if delivery confirmation is requested by the push initiator

PAP is the protocol used in WAP Push framework for specifying control information and

content that is to be pushed to a client via a Push Proxy Gateway (PPG) A Push Initiator

(PI) triggers push message processing The Push initiator class (Appendix B) of this

design shows how to generate PAP messages

The address of the used PPG should be given as an initialization parameter of the

application (ldquoppg-urlrdquo see Appendix B) This design also provides an implementation

that can be used in a special case when ldquoIPv4 IPv6rdquo type client addressing is applied and

when toolkit is used All other cases including the use of phone numbers (ldquoPLMNrdquo type

address) in sending push messages are considered

The PAP XML contains at the minimum a ltpapgt element a ltpush-messagegt

element and an ltaddressgt element

The important parts of this PAP message are the address value and type The value is

typically a MSISDN and type indicates whether to send to a MSISDN (typical case) or to

an IP Address The TYPE is almost always MSISDN as the Push Initiator (PI) will not

typically have the Mobile Stations IP address - which is generally dynamic

4312 Content entity

This is the actual data that is received by the mobile device The various content types

are Service Indication (SI) Service Load (SL) and Cache Operation (CO) in our project

we will just deal with SI and SL

The SI notifies a client about an external event by inviting the client to interact with it In

other words it informs a client about a service More precisely it sends a message that

Chapter 4 System Design

31

informs the client of a Uniform Resource Identifier (URI) where the client can access the

service

An important attribute of SI is the action attribute it may contain the action to be taken

when the client receives the SI There are two groups that the action attributes can be

divided into

First we have delete and signalmdashnone both of them is used because of their side

effects Ie with delete you take away all SIs with the same si-id as the deletion pushrdquo

including itself and with signal-none you either do nothing or you pay regard to the

info element in that push

The other group consists of signal-low signal-medium and signal-high These

attributes are all used to set the rules for the presentation in the terminal device

o Signal-low

The SI must be postponed without user intervention

o Signal-medium

The SI must be presented as soon as the implementation allows that to be carried out

without disturbing the user (Signal-medium is the value that will be used if none is

specified)

o Signal-high

The SI must be presented as soon as the implementation allows that to be carried out

without disturbing the user or earlier if it seems appropriate (This decision may for

instance be based on user preference settings)

This is the different functionalities supported by the SI we concidered

Expiration

Replacement

Deletion

Chapter 4 System Design

32

Handling of out of order delivery

Handling of information specified in the info element

A PUSH Service Indication (SI) contains at a minimum an ltsigt element and a

ltindicationgt element SL donrsquot differ so much from SI

4313 Capability entity

This entity determines the type of mobile device that is to be served This is determined

by WAP user agent profiling The sender can indicate the hardware vendor and browser

version and type of the intended recipients This capability entity is then matched at the

PPG to see which devices are compatible with the requested capability If there is a

match the content is delivered by the PPG to that specific device

Now a day most devices are compatible with WAP so we donrsquot need to create this entity

more precisely it is optional

After the push has been created in the PI it is up to the system to deliver it to the defined

destination In this system the different responsible entities are the PPG and the SMSC

Both of these two different entities are running on same server but it is only the

configuration of the SMSC that is out of my control since it is run by the operator and is

not controllable in my lab environment

432 Push Proxy Gateway (PPG)

There are various commercial WAP gateways available on the market that are quite

expensive Kannel on the other hand is an open source gateway one doesnrsquot need to pay

for it in addition one can edit the source code himself and construct his own customized

gateway Because Kannel is being developed on Linux systems (RedHat and Debian) it

can be smoothly ported to other UNIX-like operating systems

4321 Kannel gateway architecture

The gateway divides the processing load between the following three hosts

Chapter 4 System Design

33

The bearer box which connects to the SMS (Short Message Service) centers and

or CSD (Circuit Switched Data) routers providing a unified interface to them for

the wapbox The bearer box does this by implementing the WDP (Wireless

Datagram Protocol) layer of the WAP stack

The smsbox implements the rest of the SMS gateway functionality It receives

textual SMS messages from the bearerbox and interprets them as service

requests and responds to them in the appropriate way

The wapbox which hosts the upper layers of the WAP stack Each session and its

transactions are handled by the same wapbox (see figure 35)

1Figure 45 divisions of duties in kannel

4322 Working of the gateway

The bearer box receives UDP (User Datagram Protocol) packets from CSD routers

inspects them to see whether they are WAP packets if so then it will routes them to the

WAP box This simple design allows the bearer box to do a minimum of processing per

smsbox

wapbox

bearerbox

Kannel

SMS center

WAP phone

HTTP server

Chapter 4 System Design

34

packet The bearer box also sends the UDP packets that the other boxes generate which

adds some more routing processing The wapboxes implement the WTP (Wireless

Transaction Protocol) and WSP (Wireless Session Protocol) layers These take HTTP-

like requests from the phones and make the actual HTTP requests to content servers

compress the responses and send them back to the terminals (Sessions are maintained to

make as much use of the limited radio bandwidth as possible)

4323 External interfaces of the gateway

The gateway has interfaces to three external agents

bull SMS centers using various protocols

bull HTTP servers to fetch WAP and SMS content and to push WAP Content The

pull protocol is HTTP push PAP

bull WAP phones implementing the WAP protocol stack and (for push) WAP Push

client

Figure 36 summarize kannel external interfaces

4324 Configuring the gateway

The bearerbox smsbox and wapbox are the main working modules of the gateway and

must be configured before configuring the gateway These three modules are controlled

by a configuration file that has wapbox smsbox and bearerbox groups

Configuring the PPG core group

We use two components the PPG core group and the PPG user group The PPG

core group is used to configure the PI interface(for more details configuration

variables refer to appendix c)

Chapter 4 System Design

35

Mobile telephone

network

The Internet

smsbox

wapbox

bearerbox

Kannel

HTTP

HTTP

HTTP server

Serving WML

files

HTTP server

Serving HTML

files

TCP

TCP

WAPSMS

SMSC

WAP phoneNetwork base station

Workstation used for http

administration

Figure 46 External interfaces of the gateway

4325 Administering the gateway through an HTTP interface

Kannel can be administered via an HTTP interface All commands are given as normal

HTTP queries so they can easily be given from command lines like this one

links -dump httpip-adressportshutdownpassword=yourchoice

But it is advantageous to have graphical user interface for gateway control so we have

designed GUI through http

Chapter 4 System Design

36

433 Short Message Service Centre (SMSC)

A SMSC is an essential component when sending a push message from an IP network to

a mobile device in the architecture supported by the components and devices It is used to

remove the TCPIP layer that the push is encapsulatedrdquo in It is also the entity that

identifies the end-point device When this is done it is also the SMSC that is responsible

for the processing and final message delivery to the device After the process of de-

encapsulation and resolution of the client identity there should not be any difference

between this message and a message that is originated locally from the operator itself

(like a SMS)

In this project we just use a virtual SMS center we try first to get connection to a real

one but our effort was worthless

Finally the following figure depicts the overall flowchart of the WAP push system

(figure 47)

Chapter 4 System Design

37

PI

PPG

Create PAP

HTTP Post

Message

processing

OTA

Connection

oriented

Sessionless Session

oriented

WTP Initiation

WAP clinet

Application

Create content

Create

capability

entity

Database

SMS center

NoYes

Figure 47 the complete flowchart of the system

38

Chapter Five

5 System implementation and results

51 Implementation

511 The Push Proxy Gateway

First of all the Kannel gateway have been compiled and installed using gcc (GNU C

Compiler) this stage go fine except the operating system required more components to

be pre-installed and will configured

Then with stages of configuration to the gateway (Appendix B) it was capable of working

as PPG Figure 51 below show the gateway when it starts

Figure 51 starting kannel gateway

Then a web based user interface had been created to provide an easy way to control the

gateway remotely Figure 52 and figure 53

39

Figure 52 GUI for gateway control

512 The Push initiator

Next the push initiator design had been implemented using java programming language

as in design phase the implementation is taken carefully to make a reusable component

that could be used by other developer

PushInitiator class (Appendix B) implements a simple push initiator which can be used

to create and send messages to a push proxy gateway (PPG)

The method sendPushMessage sends a push message via the PPG to the client The client

is identified by the address which is either the phone number (address type is PLMN) or

IP address The message content and its mime type are also given as arguments to the

method the other tow important method are

createPapMessage This method creates a Push Access Protocol (PAP) type message

40

createSiMessage This method is used to create a service indication (SI) type message

Figure 53 showing running kannel status

513 WAP site

Since this site will be built for testing purpose and making sure that the system is

functional we had not go deep in this section Just simple WAP site with tow page has

been crated

41

52 Service indication

When a SI was pushed to any of the emulator or Nokia phones it was received and

presented in the way it was supposed to as specified in the WAP standard as shown in

figures below This is a proof that the devices claiming to support WAP push do so and

the design is will working See figures 53 through 56

Figure 55 service indication

42

Figure 57 SI details

52 Service load

The emulator correctly receives and interpreted the SL push the same as all of Nokia

phones we have tested

When a SL was pushed to the Ericsson phones it was not presented in the specified way

figure 58 I think that it is because of security reasons The reason for this assumption is

that the phones only supports on or off as security in their push configuration The

emulator on the other hand presents SL correctly Finally the Siemens phone did seem to

interpret SL but the current software was not very consistent It did load the SL without

user interference in the specified way when the user already where having an active

session If the user was offline the phone interface presented a symbol on the display

and did not load the service until the user clicked on the symbol

43

Chapter Six

6 conclusion and future work

In this chapter we will provide the conclusions and proposed future work for interested

individuals

61 Conclusions

In this project a WAP push system has been successfully designed and implemented It

provides a way to partially overcome the limitations encountered when accessing the

World Wide Web using handsets After comparing the proposed project objectives with

those accomplished the main goals are seen to be met

Phones from different manufactures all differ from the WAP-standard in some

ways One of the most obvious differences is the resolution of the display

During the work it has been noticed that the WML pages must be quite small We

have also noticed that the support for tables and some other tags are a bit limited

Even though the WML standard is smaller than the HTML standard it is a little

more complicated to write correct WML pages The main conclusion is that WAP

works pretty well but the phones are a little non-stable

The push proxy gateway is configured and worked probably with virtual SMS

center and it is easy to switch to a real one

The system depends mainly on open sources (ie Linux and kannek)

The design and implementation of the push initiator work well with the kannel

gateway and it should work correctly with other gateways

Chapter 6 Conclusion

44

62 Further Work

The possibilities of wireless push are interesting enough that it has to be worth to know if

the security and conformance problems will be solved in WAP push If they are solved

and the technique is refined then there should be nothing to stop the great number of

services that will follow in its footsteps Therefore there is further work that should be

done and the most interesting parts are in my opinion these

621 Security Aspect

One of the problems today is that the phones supporting push does not have the detailed

security settings that a technique like this needs Therefore it would be interesting to look

into the possibility to add these without confusing the user I suggest furthering looking

into usability aspects of security in WAP Push for short

622 GPS integration possibility

This will provide location dependent delivery of WAP push it will have great

applications in telematic and ecommerce advertising

623 Conformance to Standards

An interesting project would be to examine if the main reason for the nonstandard

solutions in the existing WAP push software is the result of difficulties in

implementation Or if the main reason is that the manufacturers wants to provide

proprietary solutions A reason why one may want to know this is that if the problem is

depending on implementation problems then it might get better

45

Appendix A Abbreviations

CDMA Code Division Multiple Access

CO Cache Operation

DTD Document Type Definition

GSM Global System for Mobile

HTTP Hypertext Transfer Protocol

IP Internet Protocol

MSISDN Mobile Station International Subscriber Directory Number

OTA Over The Air

PAP Push Access Protocol

PushOTA Push Over The Air

PDA Personal Digital Assistant

P1 Push Initiator

PLMN Public Land Mobile Networks

PPG Push Proxy Gateway

SI Service Indication

SIA Session Initiation Application

SIR Session Initiation Request

SL Service Loading

SMPP Short Message Peer to Peer

SMS Short Message System

SMSC Short Message System Center

UCP Universal Computer Protocol

URI Uniform Resource Identifier

URL Uniform Resource Locator

UTC Universal Time Coordinated

WAP Wireless Application Protocol

WBXML WAP binary XML

WDP Wireless Datagram Protocol

WSP Wireless Session Protocol

WTLS Wireless Transport Layer Security

XML Extensible Mark-up Language

46

Appendix B Kannel gateway configurations

THIS IS A SAMPLE CONFIGURATION FOR KANNEL

group = core

admin-port = 13000

admin-password = admin

status-password = admin

admin-deny-ip =

admin-allow-ip = 127001172161455

log-file = tmpkannellog

log-level = 0

http-proxy-host = 172161411

http-proxy-port = 8080

http-proxy-exceptions = 127001

Smsbox related

smsbox-port = 13001

box-deny-ip =

box-allow-ip = 127001

bearerbox-host =localhost

Wapbox related

wapbox-port = 13002

udp-deny-ip =

udp-allow-ip = 127001

bearerbox-host =localhost

SMSC GSM

group = smsc

smsc = at

modemtype = auto

speed =9600

device = devttyS0

SMSC HTTP

group = smsc

smsc = http

system-type = kannel

port = 13016

connect-allow-ip = 127001

Appendix B

47

username = wappush

password = wappush

SMSBOX SETUP

group = smsbox

bearerbox-host = localhost

sendsms-port = 13013

sendsms-chars = 0123456789 +-

log-file = tmpsmsboxlog

log-level = 0

access-log = accesslog

white-list = 127001

black-list =

SEND-SMS USERS

group = sendsms-user

username = wappush

password = wappush

user-deny-ip =

user-allow-ip = 127001

PPG group

group = ppg

ppg-url = wappush

ppg-port = 8080

concurrent-pushes = 100

trusted-pi = true

users = 1024

service-name = ppg

ppg-smsbox-id = dlrbox

WAP PUSH USER

group = wap-push-user

wap-push-user = picom

ppg-username = wappush

ppg-password = wappush

allow-ip = localhost

48

Appendix C Selected Codes

Gateway Control Form

ltDOCTYPE HTML PUBLIC -W3CDTD HTML 32ENgt

lthtmlgt ltheadgt

lttitlegtGateway control formlttitlegt

ltheadgt

ltbody bgcolor=white text=black link=blue vlink=navy

alink=redgt

ltbase target=submitgt

ltscriptgt

function update_status()

if ( adminactionvalue == status )

adminaction = http + adminhostnamevalue +

+ adminportvalue + status +

adminstatusformatvalue

else

adminaction = http + adminhostnamevalue +

+ adminportvalue + + adminactionvalue

adminpasswordvalue = adminpasswordvalue

actiongovalue = GO GET +adminaction

ltscriptgt

lttable align=centergt

lttrgtltp align=centergtlth2gtGateway control

formlth2gtltpgtlttrgt

lttrgt lttdgtHostnamelttdgtlttdgtltinput type=text

name=adminhostname value=localhost

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPortlttdgtlttdgtltinput type=text

name=adminport value=13000

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPasswordlttdgtlttdgtltinput type=password

name=adminpassword value=

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtActionlttdgtlttdgtltselect name=adminaction

onChange=update_status()gt

ltoption value=statusgtStatusltoptiongt

ltoption value=suspendgtSuspendltoptiongt

ltoption value=isolategtIsolateltoptiongt

Appendix C

49

ltoption value=shutdowngtShutdownltoptiongt

ltoption value=resumegtResumeltoptiongt

ltselectgtlttdgt lttrgt

lttrgt lttdgtStatus Formatlttdgtlttdgtltselect

name=adminstatusformat onChange=update_status()gt

ltoption value=gthtmlltoptiongtltoption

value=txtgttxtltoptiongtltoption

value=xmlgtxmlltoptiongtltselectgtlttdgt lttrgt

ltform name=admin method=get

action=httplocalhost13000status

encoding=applicationx-www-formgt

ltinput type=hidden name=password value=gt

lttrgt

lttdgtGolttdgt

ltformgt

lttdgtltinput type=submit value=go name=actiongo

onClick=documentadminsubmit()gtlttdgt

lttrgt

lttablegt

ltbodygt

lthtmlgt

Push Initiator Class

import javanetURL

import javanetHttpURLConnection

import javaio

Class implements a simple push initiator It can be

used to create and send messages to push proxy

gateway (ppg)

public final class PushInitiator

xml version

private final static String XML_VERSION = ltxml

version=10gt

Push Access Protocol (PAP) document type

private final static String PAP_DOCTYPE =

Appendix C

50

ltDOCTYPE pap PUBLIC -WAPFORUMDTD PAP 10EN

httpwwwwapforumorgDTDpap_10dtd gt

content type of the push request multipart body

private final static String CONTENT_TYPE =

multipartrelated boundary=multipart-boundary

type=applicationxml

Service Indication (SI) document type

private static final String SI_DOCTYPE = ltDOCTYPE si

PUBLIC -WAPFORUMDTD SI 10EN +

httpwwwwapforumorgDTDsidtdgt

private static int pushId = 0

PPG url where the pap message is to be sent

private final URL ppgUrl

some push proxy gateways may also require the

authentication of the push initiator

For instance the push initiator may be required to

send an HTTP authorization header in each request

private final String authorization

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

public PushInitiator(URL ppgUrl) thisppgUrl =

ppgUrl

authorization = null

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

param authorization a ltcodegtStringltcodegt value

public PushInitiator(URL ppgUrl String authorization)

thisppgUrl = ppgUrl

Appendix C

51

thisauthorization = authorization

Systemoutprintln(Push Initiator created ppgUrl =

+ ppgUrl)

ltcodegtsendPushMessageltcodegt sends push message to

ppg

param clientAddress a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param message a ltcodegtStringltcodegt value

param mimeType a ltcodegtStringltcodegt value

exception Exception if an error occurs

public void sendPushMessage(String clientAddress

String addressTypeString message String mimeType)

throws Exception

HttpURLConnection http =

(HttpURLConnection)ppgUrlopenConnection()

String ppgServer = ppgUrlgetHost()

httpsetDoInput(true)

httpsetRequestProperty(Content-Type CONTENT_TYPE)

if(authorization = null)

if(authorizationtrim()equals())

httpsetRequestProperty(Authorization

authorization)

httpsetDoOutput(true)

PrintWriter out = new PrintWriter(new

BufferedOutputStream(httpgetOutputStream()))

outprintln(--multipart-boundary)

outprintln(Content-type applicationxml)

outprintln()

outprintln(createPapMessage(clientAddress

addressTypeppgServer genPushId() null))

outprintln()

outprintln(--multipart-boundary)

outprintln(Content-type + mimeType)

outprintln()

outprintln(message)

outprintln()

outprintln(--multipart-boundary--)

outflush()

outclose()

httpconnect()

Appendix C

52

finally read and debug the response received from

PPG

try

debugResponse(http)

catch (Exception e)

Systemerrprintln(Error in receiving the

response)

ltcodegtcreatePapMessageltcodegt creates a Push Access

Protocoltype message

param address a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param ppgServer a ltcodegtStringltcodegt value

param pushId a ltcodegtStringltcodegt value

param notificationTo a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createPapMessage(String address

String addressType String ppgServer String pushId

String notificationTo)

return XML_VERSION + n + PAP_DOCTYPE + n +

ltpap product-name=Mobile Zoo Push

Initiatorgtn +

ltpush-message push-id= + pushId +

(notificationTo = null request-notification-

to= + notificationTo ) + gtn +

ltaddress address-value=WAPPUSH= + address +

TYPE= + addressType +

+ ppgServer + gtn +

ltpush-messagegtnltpapgt

ltcodegtcreateSiMessageltcodegt creates a service

indication type message

param url a ltcodegtStringltcodegt value

param created a ltcodegtStringltcodegt value

param expires a ltcodegtStringltcodegt value

Appendix C

53

param message a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createSiMessage(String url

String sid String created String expires String

action String message)

return XML_VERSION + SI_DOCTYPE +

ltsigtn +

ltindication href= + url + +

(sid = null si-id= + sid + ) +

created = null created= + created +

) +

(action = null action= + action +

) +

(expires = null expires= + expires +

) + gt +

message +

ltindicationgtnltsigt

Debug response

param http a ltcodegtHttpURLConnectionltcodegt value

exception Exception if an error occurs

private void debugResponse(HttpURLConnection http)

throws Exception

Systemoutprintln(httpgetResponseMessage())

String headerName

int i=0

while((headerName = httpgetHeaderFieldKey(i++)) =

null)

Systemoutprintln(headerName + +

httpgetHeaderField(headerName))

Systemoutprintln()

InputStreamReader in = new InputStreamReader(new

BufferedInputStream(httpgetInputStream()))

int c

Appendix C

54

while((c = inread()) = -1)

Systemoutprint((char)c)

Systemoutprintln()

ltcodegtgenPushIdltcodegt generates an unique push id

return a ltcodegtStringltcodegt value

private String genPushId()

pushId = 100000

return SystemcurrentTimeMillis() + + pushId++

55

References

[1] Microsoft ldquoGetting Mobile Using WML and WAP to Display Web Sites on

Mobile Devicesrdquo

URL msdnmicrosoftcomen-uslibraryaa140117(office10)aspx accessed

on April 10 2008

[2] DALE BULBROOK ldquoWAPA Beginnerrsquos Guiderdquo OsborneMcGraw-Hill 2001

[3] WAP Forum Wireless Application Protocol Architecture Specification Access on

Jan 12 2008 Available

httpwww1wapforumorgtechdocumentsWAP-210-WAPArch-2006 07 12-apdf

[4] WAP Forum Push Architectural Overview access on (2008 February 3) Available

httpwww1wapforumorgtechdocumentsWAP-250-PushArchOverview-2007 04

03-apdf

[5] Service indication PDF access on 62008 Available

httpwwww3orgTRhtml401structlinkshtml

[6] WAP Push Technology (openwave) PDF access on (2008 April) Available

URL httpwwwopenwavorg

[7] Web site (httpwwwwapforumorgwhatcopyrighthtm) access on May 2008

[8] ldquoWAP Push Proxy Gateway Specificationrdquo WAP Forum access on 16-August-

2007URI httpwwwwapforumorgPDF

[9] WAP Forum Access on (2008 MAY 31) WAP Service Indication Specification

Available httpwww1wapforumorgtechdocumentsWAP-167-ServiceInd-200507

31-apdf

  • odc_fpwmlandwap_topic3
  • N100E3
  • 21
  • 5

Chapter 3 System requirements

25

322 Linux operating system

It is important to install kannel gateway on it for this project we choose fedora core 7 for

availability reasons

323 JDK16

The java run time environment is required to implement the push initiator

32 hardware requirements

321 PC

Any Personal computer capable of running fedora core 7 with USB interface to be able

connects GSM modem

322 GSM modem

This will act as an alternative to the short message service center SMSC Obviously this

means that GSM network is required too

26

Chapter Four

4 System design

41 System Scenario

The basic scenario of a push session is that a Push Initiator (PI) transmits content to a

WAP client This is done in multiple steps as shown in Figure 31

pushOTAPAP

Gateway

PI

1

2

pull gateway

PPG

3

SMS center

Mobile device

6

5

4

Content provider78 9

Figure 41 WAP push scenario

Chapter 4 System Design

27

The PI communicates with a Push Proxy Gateway (PPG) over the Push Access Protocol

(PAP) (1 and 2) The PPG will then use the Push Over-The-Air Protocol (PushOTA) (3)

to deliver a Uniform Resource Identifier (URI) to the client via a Short Message System

Centre (SMS-C) (4 and 5) The next step for the client is then to activate the URI (6 and

7) and get the content from the server (8 and 9) The mobile device will have to use a

ldquoPull Gatewayrdquo to get the content but it is very likely that this is the same one as the PPG

The same same scenario could be viewed in sequence diagram figure (42)

Push Initiator PPG SMS Center WAP client

Send push message

Send push message response

Send WAP push message

Ack

Send WAP push message

Ack

Message read

Ack

Message read

Ack

Result notification message

Result notification response

Figure 42 WAP push sequence diagram

Chapter 4 System Design

28

43 Modular Design

Conceptually we can envision this push system as consisting of three major components

(presented in the order of the push lifetime)

first there is a Push Initiator Program that reads the generates a notification message and

transmits (pushes) it via a WAP Gateway to the customer phone This message notifies

the user that a service is available if the user accepts will ask the phonersquos browser to pull

the page from our web server via the WAP Gateway

Next there is the Push Proxy Gateway PPG which will receive the push message from

the push initiator and is responsible of doing any needed optimization protocol

compilation and conversion Also it is responsibility of the PPG to find the end user

address and send the push message to the SMS center

Finally there is the SMS center which will do the last delivery of push message to the

intended user if the user were offline the message will be saved for later time until the

WAP client is on

PI PPGSMSC

Figure 43 system modules

Chapter 4 System Design

29

43 Design of system Modules

Following sections of this chapter present a description and design of the system modules

with accompanying graphical representation

431 Push Initiator (PI)

The PI is the first logical component in the WAP Push scenario and therefore the

originator of the push message There are different kinds of PIs One example is an

automated script another one is a semi automated server version written in an applicable

scripting language supporting server side interaction

A push message is sent as an HTTP POST to the Push Proxy Gateway The POST will be

a multipart XML document with the first part being the control entity (Push Access

Protocol) the second part being the content entity (either a Service Indication or a

Service Load) and the third part being the capability entity

HTTP Post

Capability entity

Content entity (SISL)

Control entity (PAP)

Figure 44 architecture of the push message

Chapter 4 System Design

30

4311 Control entity

This part of the push contains the basic information and fields The fields can include

recipient address expiry time bearer type delivery attempt time and a URL to which a

response is to be sent if delivery confirmation is requested by the push initiator

PAP is the protocol used in WAP Push framework for specifying control information and

content that is to be pushed to a client via a Push Proxy Gateway (PPG) A Push Initiator

(PI) triggers push message processing The Push initiator class (Appendix B) of this

design shows how to generate PAP messages

The address of the used PPG should be given as an initialization parameter of the

application (ldquoppg-urlrdquo see Appendix B) This design also provides an implementation

that can be used in a special case when ldquoIPv4 IPv6rdquo type client addressing is applied and

when toolkit is used All other cases including the use of phone numbers (ldquoPLMNrdquo type

address) in sending push messages are considered

The PAP XML contains at the minimum a ltpapgt element a ltpush-messagegt

element and an ltaddressgt element

The important parts of this PAP message are the address value and type The value is

typically a MSISDN and type indicates whether to send to a MSISDN (typical case) or to

an IP Address The TYPE is almost always MSISDN as the Push Initiator (PI) will not

typically have the Mobile Stations IP address - which is generally dynamic

4312 Content entity

This is the actual data that is received by the mobile device The various content types

are Service Indication (SI) Service Load (SL) and Cache Operation (CO) in our project

we will just deal with SI and SL

The SI notifies a client about an external event by inviting the client to interact with it In

other words it informs a client about a service More precisely it sends a message that

Chapter 4 System Design

31

informs the client of a Uniform Resource Identifier (URI) where the client can access the

service

An important attribute of SI is the action attribute it may contain the action to be taken

when the client receives the SI There are two groups that the action attributes can be

divided into

First we have delete and signalmdashnone both of them is used because of their side

effects Ie with delete you take away all SIs with the same si-id as the deletion pushrdquo

including itself and with signal-none you either do nothing or you pay regard to the

info element in that push

The other group consists of signal-low signal-medium and signal-high These

attributes are all used to set the rules for the presentation in the terminal device

o Signal-low

The SI must be postponed without user intervention

o Signal-medium

The SI must be presented as soon as the implementation allows that to be carried out

without disturbing the user (Signal-medium is the value that will be used if none is

specified)

o Signal-high

The SI must be presented as soon as the implementation allows that to be carried out

without disturbing the user or earlier if it seems appropriate (This decision may for

instance be based on user preference settings)

This is the different functionalities supported by the SI we concidered

Expiration

Replacement

Deletion

Chapter 4 System Design

32

Handling of out of order delivery

Handling of information specified in the info element

A PUSH Service Indication (SI) contains at a minimum an ltsigt element and a

ltindicationgt element SL donrsquot differ so much from SI

4313 Capability entity

This entity determines the type of mobile device that is to be served This is determined

by WAP user agent profiling The sender can indicate the hardware vendor and browser

version and type of the intended recipients This capability entity is then matched at the

PPG to see which devices are compatible with the requested capability If there is a

match the content is delivered by the PPG to that specific device

Now a day most devices are compatible with WAP so we donrsquot need to create this entity

more precisely it is optional

After the push has been created in the PI it is up to the system to deliver it to the defined

destination In this system the different responsible entities are the PPG and the SMSC

Both of these two different entities are running on same server but it is only the

configuration of the SMSC that is out of my control since it is run by the operator and is

not controllable in my lab environment

432 Push Proxy Gateway (PPG)

There are various commercial WAP gateways available on the market that are quite

expensive Kannel on the other hand is an open source gateway one doesnrsquot need to pay

for it in addition one can edit the source code himself and construct his own customized

gateway Because Kannel is being developed on Linux systems (RedHat and Debian) it

can be smoothly ported to other UNIX-like operating systems

4321 Kannel gateway architecture

The gateway divides the processing load between the following three hosts

Chapter 4 System Design

33

The bearer box which connects to the SMS (Short Message Service) centers and

or CSD (Circuit Switched Data) routers providing a unified interface to them for

the wapbox The bearer box does this by implementing the WDP (Wireless

Datagram Protocol) layer of the WAP stack

The smsbox implements the rest of the SMS gateway functionality It receives

textual SMS messages from the bearerbox and interprets them as service

requests and responds to them in the appropriate way

The wapbox which hosts the upper layers of the WAP stack Each session and its

transactions are handled by the same wapbox (see figure 35)

1Figure 45 divisions of duties in kannel

4322 Working of the gateway

The bearer box receives UDP (User Datagram Protocol) packets from CSD routers

inspects them to see whether they are WAP packets if so then it will routes them to the

WAP box This simple design allows the bearer box to do a minimum of processing per

smsbox

wapbox

bearerbox

Kannel

SMS center

WAP phone

HTTP server

Chapter 4 System Design

34

packet The bearer box also sends the UDP packets that the other boxes generate which

adds some more routing processing The wapboxes implement the WTP (Wireless

Transaction Protocol) and WSP (Wireless Session Protocol) layers These take HTTP-

like requests from the phones and make the actual HTTP requests to content servers

compress the responses and send them back to the terminals (Sessions are maintained to

make as much use of the limited radio bandwidth as possible)

4323 External interfaces of the gateway

The gateway has interfaces to three external agents

bull SMS centers using various protocols

bull HTTP servers to fetch WAP and SMS content and to push WAP Content The

pull protocol is HTTP push PAP

bull WAP phones implementing the WAP protocol stack and (for push) WAP Push

client

Figure 36 summarize kannel external interfaces

4324 Configuring the gateway

The bearerbox smsbox and wapbox are the main working modules of the gateway and

must be configured before configuring the gateway These three modules are controlled

by a configuration file that has wapbox smsbox and bearerbox groups

Configuring the PPG core group

We use two components the PPG core group and the PPG user group The PPG

core group is used to configure the PI interface(for more details configuration

variables refer to appendix c)

Chapter 4 System Design

35

Mobile telephone

network

The Internet

smsbox

wapbox

bearerbox

Kannel

HTTP

HTTP

HTTP server

Serving WML

files

HTTP server

Serving HTML

files

TCP

TCP

WAPSMS

SMSC

WAP phoneNetwork base station

Workstation used for http

administration

Figure 46 External interfaces of the gateway

4325 Administering the gateway through an HTTP interface

Kannel can be administered via an HTTP interface All commands are given as normal

HTTP queries so they can easily be given from command lines like this one

links -dump httpip-adressportshutdownpassword=yourchoice

But it is advantageous to have graphical user interface for gateway control so we have

designed GUI through http

Chapter 4 System Design

36

433 Short Message Service Centre (SMSC)

A SMSC is an essential component when sending a push message from an IP network to

a mobile device in the architecture supported by the components and devices It is used to

remove the TCPIP layer that the push is encapsulatedrdquo in It is also the entity that

identifies the end-point device When this is done it is also the SMSC that is responsible

for the processing and final message delivery to the device After the process of de-

encapsulation and resolution of the client identity there should not be any difference

between this message and a message that is originated locally from the operator itself

(like a SMS)

In this project we just use a virtual SMS center we try first to get connection to a real

one but our effort was worthless

Finally the following figure depicts the overall flowchart of the WAP push system

(figure 47)

Chapter 4 System Design

37

PI

PPG

Create PAP

HTTP Post

Message

processing

OTA

Connection

oriented

Sessionless Session

oriented

WTP Initiation

WAP clinet

Application

Create content

Create

capability

entity

Database

SMS center

NoYes

Figure 47 the complete flowchart of the system

38

Chapter Five

5 System implementation and results

51 Implementation

511 The Push Proxy Gateway

First of all the Kannel gateway have been compiled and installed using gcc (GNU C

Compiler) this stage go fine except the operating system required more components to

be pre-installed and will configured

Then with stages of configuration to the gateway (Appendix B) it was capable of working

as PPG Figure 51 below show the gateway when it starts

Figure 51 starting kannel gateway

Then a web based user interface had been created to provide an easy way to control the

gateway remotely Figure 52 and figure 53

39

Figure 52 GUI for gateway control

512 The Push initiator

Next the push initiator design had been implemented using java programming language

as in design phase the implementation is taken carefully to make a reusable component

that could be used by other developer

PushInitiator class (Appendix B) implements a simple push initiator which can be used

to create and send messages to a push proxy gateway (PPG)

The method sendPushMessage sends a push message via the PPG to the client The client

is identified by the address which is either the phone number (address type is PLMN) or

IP address The message content and its mime type are also given as arguments to the

method the other tow important method are

createPapMessage This method creates a Push Access Protocol (PAP) type message

40

createSiMessage This method is used to create a service indication (SI) type message

Figure 53 showing running kannel status

513 WAP site

Since this site will be built for testing purpose and making sure that the system is

functional we had not go deep in this section Just simple WAP site with tow page has

been crated

41

52 Service indication

When a SI was pushed to any of the emulator or Nokia phones it was received and

presented in the way it was supposed to as specified in the WAP standard as shown in

figures below This is a proof that the devices claiming to support WAP push do so and

the design is will working See figures 53 through 56

Figure 55 service indication

42

Figure 57 SI details

52 Service load

The emulator correctly receives and interpreted the SL push the same as all of Nokia

phones we have tested

When a SL was pushed to the Ericsson phones it was not presented in the specified way

figure 58 I think that it is because of security reasons The reason for this assumption is

that the phones only supports on or off as security in their push configuration The

emulator on the other hand presents SL correctly Finally the Siemens phone did seem to

interpret SL but the current software was not very consistent It did load the SL without

user interference in the specified way when the user already where having an active

session If the user was offline the phone interface presented a symbol on the display

and did not load the service until the user clicked on the symbol

43

Chapter Six

6 conclusion and future work

In this chapter we will provide the conclusions and proposed future work for interested

individuals

61 Conclusions

In this project a WAP push system has been successfully designed and implemented It

provides a way to partially overcome the limitations encountered when accessing the

World Wide Web using handsets After comparing the proposed project objectives with

those accomplished the main goals are seen to be met

Phones from different manufactures all differ from the WAP-standard in some

ways One of the most obvious differences is the resolution of the display

During the work it has been noticed that the WML pages must be quite small We

have also noticed that the support for tables and some other tags are a bit limited

Even though the WML standard is smaller than the HTML standard it is a little

more complicated to write correct WML pages The main conclusion is that WAP

works pretty well but the phones are a little non-stable

The push proxy gateway is configured and worked probably with virtual SMS

center and it is easy to switch to a real one

The system depends mainly on open sources (ie Linux and kannek)

The design and implementation of the push initiator work well with the kannel

gateway and it should work correctly with other gateways

Chapter 6 Conclusion

44

62 Further Work

The possibilities of wireless push are interesting enough that it has to be worth to know if

the security and conformance problems will be solved in WAP push If they are solved

and the technique is refined then there should be nothing to stop the great number of

services that will follow in its footsteps Therefore there is further work that should be

done and the most interesting parts are in my opinion these

621 Security Aspect

One of the problems today is that the phones supporting push does not have the detailed

security settings that a technique like this needs Therefore it would be interesting to look

into the possibility to add these without confusing the user I suggest furthering looking

into usability aspects of security in WAP Push for short

622 GPS integration possibility

This will provide location dependent delivery of WAP push it will have great

applications in telematic and ecommerce advertising

623 Conformance to Standards

An interesting project would be to examine if the main reason for the nonstandard

solutions in the existing WAP push software is the result of difficulties in

implementation Or if the main reason is that the manufacturers wants to provide

proprietary solutions A reason why one may want to know this is that if the problem is

depending on implementation problems then it might get better

45

Appendix A Abbreviations

CDMA Code Division Multiple Access

CO Cache Operation

DTD Document Type Definition

GSM Global System for Mobile

HTTP Hypertext Transfer Protocol

IP Internet Protocol

MSISDN Mobile Station International Subscriber Directory Number

OTA Over The Air

PAP Push Access Protocol

PushOTA Push Over The Air

PDA Personal Digital Assistant

P1 Push Initiator

PLMN Public Land Mobile Networks

PPG Push Proxy Gateway

SI Service Indication

SIA Session Initiation Application

SIR Session Initiation Request

SL Service Loading

SMPP Short Message Peer to Peer

SMS Short Message System

SMSC Short Message System Center

UCP Universal Computer Protocol

URI Uniform Resource Identifier

URL Uniform Resource Locator

UTC Universal Time Coordinated

WAP Wireless Application Protocol

WBXML WAP binary XML

WDP Wireless Datagram Protocol

WSP Wireless Session Protocol

WTLS Wireless Transport Layer Security

XML Extensible Mark-up Language

46

Appendix B Kannel gateway configurations

THIS IS A SAMPLE CONFIGURATION FOR KANNEL

group = core

admin-port = 13000

admin-password = admin

status-password = admin

admin-deny-ip =

admin-allow-ip = 127001172161455

log-file = tmpkannellog

log-level = 0

http-proxy-host = 172161411

http-proxy-port = 8080

http-proxy-exceptions = 127001

Smsbox related

smsbox-port = 13001

box-deny-ip =

box-allow-ip = 127001

bearerbox-host =localhost

Wapbox related

wapbox-port = 13002

udp-deny-ip =

udp-allow-ip = 127001

bearerbox-host =localhost

SMSC GSM

group = smsc

smsc = at

modemtype = auto

speed =9600

device = devttyS0

SMSC HTTP

group = smsc

smsc = http

system-type = kannel

port = 13016

connect-allow-ip = 127001

Appendix B

47

username = wappush

password = wappush

SMSBOX SETUP

group = smsbox

bearerbox-host = localhost

sendsms-port = 13013

sendsms-chars = 0123456789 +-

log-file = tmpsmsboxlog

log-level = 0

access-log = accesslog

white-list = 127001

black-list =

SEND-SMS USERS

group = sendsms-user

username = wappush

password = wappush

user-deny-ip =

user-allow-ip = 127001

PPG group

group = ppg

ppg-url = wappush

ppg-port = 8080

concurrent-pushes = 100

trusted-pi = true

users = 1024

service-name = ppg

ppg-smsbox-id = dlrbox

WAP PUSH USER

group = wap-push-user

wap-push-user = picom

ppg-username = wappush

ppg-password = wappush

allow-ip = localhost

48

Appendix C Selected Codes

Gateway Control Form

ltDOCTYPE HTML PUBLIC -W3CDTD HTML 32ENgt

lthtmlgt ltheadgt

lttitlegtGateway control formlttitlegt

ltheadgt

ltbody bgcolor=white text=black link=blue vlink=navy

alink=redgt

ltbase target=submitgt

ltscriptgt

function update_status()

if ( adminactionvalue == status )

adminaction = http + adminhostnamevalue +

+ adminportvalue + status +

adminstatusformatvalue

else

adminaction = http + adminhostnamevalue +

+ adminportvalue + + adminactionvalue

adminpasswordvalue = adminpasswordvalue

actiongovalue = GO GET +adminaction

ltscriptgt

lttable align=centergt

lttrgtltp align=centergtlth2gtGateway control

formlth2gtltpgtlttrgt

lttrgt lttdgtHostnamelttdgtlttdgtltinput type=text

name=adminhostname value=localhost

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPortlttdgtlttdgtltinput type=text

name=adminport value=13000

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPasswordlttdgtlttdgtltinput type=password

name=adminpassword value=

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtActionlttdgtlttdgtltselect name=adminaction

onChange=update_status()gt

ltoption value=statusgtStatusltoptiongt

ltoption value=suspendgtSuspendltoptiongt

ltoption value=isolategtIsolateltoptiongt

Appendix C

49

ltoption value=shutdowngtShutdownltoptiongt

ltoption value=resumegtResumeltoptiongt

ltselectgtlttdgt lttrgt

lttrgt lttdgtStatus Formatlttdgtlttdgtltselect

name=adminstatusformat onChange=update_status()gt

ltoption value=gthtmlltoptiongtltoption

value=txtgttxtltoptiongtltoption

value=xmlgtxmlltoptiongtltselectgtlttdgt lttrgt

ltform name=admin method=get

action=httplocalhost13000status

encoding=applicationx-www-formgt

ltinput type=hidden name=password value=gt

lttrgt

lttdgtGolttdgt

ltformgt

lttdgtltinput type=submit value=go name=actiongo

onClick=documentadminsubmit()gtlttdgt

lttrgt

lttablegt

ltbodygt

lthtmlgt

Push Initiator Class

import javanetURL

import javanetHttpURLConnection

import javaio

Class implements a simple push initiator It can be

used to create and send messages to push proxy

gateway (ppg)

public final class PushInitiator

xml version

private final static String XML_VERSION = ltxml

version=10gt

Push Access Protocol (PAP) document type

private final static String PAP_DOCTYPE =

Appendix C

50

ltDOCTYPE pap PUBLIC -WAPFORUMDTD PAP 10EN

httpwwwwapforumorgDTDpap_10dtd gt

content type of the push request multipart body

private final static String CONTENT_TYPE =

multipartrelated boundary=multipart-boundary

type=applicationxml

Service Indication (SI) document type

private static final String SI_DOCTYPE = ltDOCTYPE si

PUBLIC -WAPFORUMDTD SI 10EN +

httpwwwwapforumorgDTDsidtdgt

private static int pushId = 0

PPG url where the pap message is to be sent

private final URL ppgUrl

some push proxy gateways may also require the

authentication of the push initiator

For instance the push initiator may be required to

send an HTTP authorization header in each request

private final String authorization

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

public PushInitiator(URL ppgUrl) thisppgUrl =

ppgUrl

authorization = null

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

param authorization a ltcodegtStringltcodegt value

public PushInitiator(URL ppgUrl String authorization)

thisppgUrl = ppgUrl

Appendix C

51

thisauthorization = authorization

Systemoutprintln(Push Initiator created ppgUrl =

+ ppgUrl)

ltcodegtsendPushMessageltcodegt sends push message to

ppg

param clientAddress a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param message a ltcodegtStringltcodegt value

param mimeType a ltcodegtStringltcodegt value

exception Exception if an error occurs

public void sendPushMessage(String clientAddress

String addressTypeString message String mimeType)

throws Exception

HttpURLConnection http =

(HttpURLConnection)ppgUrlopenConnection()

String ppgServer = ppgUrlgetHost()

httpsetDoInput(true)

httpsetRequestProperty(Content-Type CONTENT_TYPE)

if(authorization = null)

if(authorizationtrim()equals())

httpsetRequestProperty(Authorization

authorization)

httpsetDoOutput(true)

PrintWriter out = new PrintWriter(new

BufferedOutputStream(httpgetOutputStream()))

outprintln(--multipart-boundary)

outprintln(Content-type applicationxml)

outprintln()

outprintln(createPapMessage(clientAddress

addressTypeppgServer genPushId() null))

outprintln()

outprintln(--multipart-boundary)

outprintln(Content-type + mimeType)

outprintln()

outprintln(message)

outprintln()

outprintln(--multipart-boundary--)

outflush()

outclose()

httpconnect()

Appendix C

52

finally read and debug the response received from

PPG

try

debugResponse(http)

catch (Exception e)

Systemerrprintln(Error in receiving the

response)

ltcodegtcreatePapMessageltcodegt creates a Push Access

Protocoltype message

param address a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param ppgServer a ltcodegtStringltcodegt value

param pushId a ltcodegtStringltcodegt value

param notificationTo a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createPapMessage(String address

String addressType String ppgServer String pushId

String notificationTo)

return XML_VERSION + n + PAP_DOCTYPE + n +

ltpap product-name=Mobile Zoo Push

Initiatorgtn +

ltpush-message push-id= + pushId +

(notificationTo = null request-notification-

to= + notificationTo ) + gtn +

ltaddress address-value=WAPPUSH= + address +

TYPE= + addressType +

+ ppgServer + gtn +

ltpush-messagegtnltpapgt

ltcodegtcreateSiMessageltcodegt creates a service

indication type message

param url a ltcodegtStringltcodegt value

param created a ltcodegtStringltcodegt value

param expires a ltcodegtStringltcodegt value

Appendix C

53

param message a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createSiMessage(String url

String sid String created String expires String

action String message)

return XML_VERSION + SI_DOCTYPE +

ltsigtn +

ltindication href= + url + +

(sid = null si-id= + sid + ) +

created = null created= + created +

) +

(action = null action= + action +

) +

(expires = null expires= + expires +

) + gt +

message +

ltindicationgtnltsigt

Debug response

param http a ltcodegtHttpURLConnectionltcodegt value

exception Exception if an error occurs

private void debugResponse(HttpURLConnection http)

throws Exception

Systemoutprintln(httpgetResponseMessage())

String headerName

int i=0

while((headerName = httpgetHeaderFieldKey(i++)) =

null)

Systemoutprintln(headerName + +

httpgetHeaderField(headerName))

Systemoutprintln()

InputStreamReader in = new InputStreamReader(new

BufferedInputStream(httpgetInputStream()))

int c

Appendix C

54

while((c = inread()) = -1)

Systemoutprint((char)c)

Systemoutprintln()

ltcodegtgenPushIdltcodegt generates an unique push id

return a ltcodegtStringltcodegt value

private String genPushId()

pushId = 100000

return SystemcurrentTimeMillis() + + pushId++

55

References

[1] Microsoft ldquoGetting Mobile Using WML and WAP to Display Web Sites on

Mobile Devicesrdquo

URL msdnmicrosoftcomen-uslibraryaa140117(office10)aspx accessed

on April 10 2008

[2] DALE BULBROOK ldquoWAPA Beginnerrsquos Guiderdquo OsborneMcGraw-Hill 2001

[3] WAP Forum Wireless Application Protocol Architecture Specification Access on

Jan 12 2008 Available

httpwww1wapforumorgtechdocumentsWAP-210-WAPArch-2006 07 12-apdf

[4] WAP Forum Push Architectural Overview access on (2008 February 3) Available

httpwww1wapforumorgtechdocumentsWAP-250-PushArchOverview-2007 04

03-apdf

[5] Service indication PDF access on 62008 Available

httpwwww3orgTRhtml401structlinkshtml

[6] WAP Push Technology (openwave) PDF access on (2008 April) Available

URL httpwwwopenwavorg

[7] Web site (httpwwwwapforumorgwhatcopyrighthtm) access on May 2008

[8] ldquoWAP Push Proxy Gateway Specificationrdquo WAP Forum access on 16-August-

2007URI httpwwwwapforumorgPDF

[9] WAP Forum Access on (2008 MAY 31) WAP Service Indication Specification

Available httpwww1wapforumorgtechdocumentsWAP-167-ServiceInd-200507

31-apdf

  • odc_fpwmlandwap_topic3
  • N100E3
  • 21
  • 5

26

Chapter Four

4 System design

41 System Scenario

The basic scenario of a push session is that a Push Initiator (PI) transmits content to a

WAP client This is done in multiple steps as shown in Figure 31

pushOTAPAP

Gateway

PI

1

2

pull gateway

PPG

3

SMS center

Mobile device

6

5

4

Content provider78 9

Figure 41 WAP push scenario

Chapter 4 System Design

27

The PI communicates with a Push Proxy Gateway (PPG) over the Push Access Protocol

(PAP) (1 and 2) The PPG will then use the Push Over-The-Air Protocol (PushOTA) (3)

to deliver a Uniform Resource Identifier (URI) to the client via a Short Message System

Centre (SMS-C) (4 and 5) The next step for the client is then to activate the URI (6 and

7) and get the content from the server (8 and 9) The mobile device will have to use a

ldquoPull Gatewayrdquo to get the content but it is very likely that this is the same one as the PPG

The same same scenario could be viewed in sequence diagram figure (42)

Push Initiator PPG SMS Center WAP client

Send push message

Send push message response

Send WAP push message

Ack

Send WAP push message

Ack

Message read

Ack

Message read

Ack

Result notification message

Result notification response

Figure 42 WAP push sequence diagram

Chapter 4 System Design

28

43 Modular Design

Conceptually we can envision this push system as consisting of three major components

(presented in the order of the push lifetime)

first there is a Push Initiator Program that reads the generates a notification message and

transmits (pushes) it via a WAP Gateway to the customer phone This message notifies

the user that a service is available if the user accepts will ask the phonersquos browser to pull

the page from our web server via the WAP Gateway

Next there is the Push Proxy Gateway PPG which will receive the push message from

the push initiator and is responsible of doing any needed optimization protocol

compilation and conversion Also it is responsibility of the PPG to find the end user

address and send the push message to the SMS center

Finally there is the SMS center which will do the last delivery of push message to the

intended user if the user were offline the message will be saved for later time until the

WAP client is on

PI PPGSMSC

Figure 43 system modules

Chapter 4 System Design

29

43 Design of system Modules

Following sections of this chapter present a description and design of the system modules

with accompanying graphical representation

431 Push Initiator (PI)

The PI is the first logical component in the WAP Push scenario and therefore the

originator of the push message There are different kinds of PIs One example is an

automated script another one is a semi automated server version written in an applicable

scripting language supporting server side interaction

A push message is sent as an HTTP POST to the Push Proxy Gateway The POST will be

a multipart XML document with the first part being the control entity (Push Access

Protocol) the second part being the content entity (either a Service Indication or a

Service Load) and the third part being the capability entity

HTTP Post

Capability entity

Content entity (SISL)

Control entity (PAP)

Figure 44 architecture of the push message

Chapter 4 System Design

30

4311 Control entity

This part of the push contains the basic information and fields The fields can include

recipient address expiry time bearer type delivery attempt time and a URL to which a

response is to be sent if delivery confirmation is requested by the push initiator

PAP is the protocol used in WAP Push framework for specifying control information and

content that is to be pushed to a client via a Push Proxy Gateway (PPG) A Push Initiator

(PI) triggers push message processing The Push initiator class (Appendix B) of this

design shows how to generate PAP messages

The address of the used PPG should be given as an initialization parameter of the

application (ldquoppg-urlrdquo see Appendix B) This design also provides an implementation

that can be used in a special case when ldquoIPv4 IPv6rdquo type client addressing is applied and

when toolkit is used All other cases including the use of phone numbers (ldquoPLMNrdquo type

address) in sending push messages are considered

The PAP XML contains at the minimum a ltpapgt element a ltpush-messagegt

element and an ltaddressgt element

The important parts of this PAP message are the address value and type The value is

typically a MSISDN and type indicates whether to send to a MSISDN (typical case) or to

an IP Address The TYPE is almost always MSISDN as the Push Initiator (PI) will not

typically have the Mobile Stations IP address - which is generally dynamic

4312 Content entity

This is the actual data that is received by the mobile device The various content types

are Service Indication (SI) Service Load (SL) and Cache Operation (CO) in our project

we will just deal with SI and SL

The SI notifies a client about an external event by inviting the client to interact with it In

other words it informs a client about a service More precisely it sends a message that

Chapter 4 System Design

31

informs the client of a Uniform Resource Identifier (URI) where the client can access the

service

An important attribute of SI is the action attribute it may contain the action to be taken

when the client receives the SI There are two groups that the action attributes can be

divided into

First we have delete and signalmdashnone both of them is used because of their side

effects Ie with delete you take away all SIs with the same si-id as the deletion pushrdquo

including itself and with signal-none you either do nothing or you pay regard to the

info element in that push

The other group consists of signal-low signal-medium and signal-high These

attributes are all used to set the rules for the presentation in the terminal device

o Signal-low

The SI must be postponed without user intervention

o Signal-medium

The SI must be presented as soon as the implementation allows that to be carried out

without disturbing the user (Signal-medium is the value that will be used if none is

specified)

o Signal-high

The SI must be presented as soon as the implementation allows that to be carried out

without disturbing the user or earlier if it seems appropriate (This decision may for

instance be based on user preference settings)

This is the different functionalities supported by the SI we concidered

Expiration

Replacement

Deletion

Chapter 4 System Design

32

Handling of out of order delivery

Handling of information specified in the info element

A PUSH Service Indication (SI) contains at a minimum an ltsigt element and a

ltindicationgt element SL donrsquot differ so much from SI

4313 Capability entity

This entity determines the type of mobile device that is to be served This is determined

by WAP user agent profiling The sender can indicate the hardware vendor and browser

version and type of the intended recipients This capability entity is then matched at the

PPG to see which devices are compatible with the requested capability If there is a

match the content is delivered by the PPG to that specific device

Now a day most devices are compatible with WAP so we donrsquot need to create this entity

more precisely it is optional

After the push has been created in the PI it is up to the system to deliver it to the defined

destination In this system the different responsible entities are the PPG and the SMSC

Both of these two different entities are running on same server but it is only the

configuration of the SMSC that is out of my control since it is run by the operator and is

not controllable in my lab environment

432 Push Proxy Gateway (PPG)

There are various commercial WAP gateways available on the market that are quite

expensive Kannel on the other hand is an open source gateway one doesnrsquot need to pay

for it in addition one can edit the source code himself and construct his own customized

gateway Because Kannel is being developed on Linux systems (RedHat and Debian) it

can be smoothly ported to other UNIX-like operating systems

4321 Kannel gateway architecture

The gateway divides the processing load between the following three hosts

Chapter 4 System Design

33

The bearer box which connects to the SMS (Short Message Service) centers and

or CSD (Circuit Switched Data) routers providing a unified interface to them for

the wapbox The bearer box does this by implementing the WDP (Wireless

Datagram Protocol) layer of the WAP stack

The smsbox implements the rest of the SMS gateway functionality It receives

textual SMS messages from the bearerbox and interprets them as service

requests and responds to them in the appropriate way

The wapbox which hosts the upper layers of the WAP stack Each session and its

transactions are handled by the same wapbox (see figure 35)

1Figure 45 divisions of duties in kannel

4322 Working of the gateway

The bearer box receives UDP (User Datagram Protocol) packets from CSD routers

inspects them to see whether they are WAP packets if so then it will routes them to the

WAP box This simple design allows the bearer box to do a minimum of processing per

smsbox

wapbox

bearerbox

Kannel

SMS center

WAP phone

HTTP server

Chapter 4 System Design

34

packet The bearer box also sends the UDP packets that the other boxes generate which

adds some more routing processing The wapboxes implement the WTP (Wireless

Transaction Protocol) and WSP (Wireless Session Protocol) layers These take HTTP-

like requests from the phones and make the actual HTTP requests to content servers

compress the responses and send them back to the terminals (Sessions are maintained to

make as much use of the limited radio bandwidth as possible)

4323 External interfaces of the gateway

The gateway has interfaces to three external agents

bull SMS centers using various protocols

bull HTTP servers to fetch WAP and SMS content and to push WAP Content The

pull protocol is HTTP push PAP

bull WAP phones implementing the WAP protocol stack and (for push) WAP Push

client

Figure 36 summarize kannel external interfaces

4324 Configuring the gateway

The bearerbox smsbox and wapbox are the main working modules of the gateway and

must be configured before configuring the gateway These three modules are controlled

by a configuration file that has wapbox smsbox and bearerbox groups

Configuring the PPG core group

We use two components the PPG core group and the PPG user group The PPG

core group is used to configure the PI interface(for more details configuration

variables refer to appendix c)

Chapter 4 System Design

35

Mobile telephone

network

The Internet

smsbox

wapbox

bearerbox

Kannel

HTTP

HTTP

HTTP server

Serving WML

files

HTTP server

Serving HTML

files

TCP

TCP

WAPSMS

SMSC

WAP phoneNetwork base station

Workstation used for http

administration

Figure 46 External interfaces of the gateway

4325 Administering the gateway through an HTTP interface

Kannel can be administered via an HTTP interface All commands are given as normal

HTTP queries so they can easily be given from command lines like this one

links -dump httpip-adressportshutdownpassword=yourchoice

But it is advantageous to have graphical user interface for gateway control so we have

designed GUI through http

Chapter 4 System Design

36

433 Short Message Service Centre (SMSC)

A SMSC is an essential component when sending a push message from an IP network to

a mobile device in the architecture supported by the components and devices It is used to

remove the TCPIP layer that the push is encapsulatedrdquo in It is also the entity that

identifies the end-point device When this is done it is also the SMSC that is responsible

for the processing and final message delivery to the device After the process of de-

encapsulation and resolution of the client identity there should not be any difference

between this message and a message that is originated locally from the operator itself

(like a SMS)

In this project we just use a virtual SMS center we try first to get connection to a real

one but our effort was worthless

Finally the following figure depicts the overall flowchart of the WAP push system

(figure 47)

Chapter 4 System Design

37

PI

PPG

Create PAP

HTTP Post

Message

processing

OTA

Connection

oriented

Sessionless Session

oriented

WTP Initiation

WAP clinet

Application

Create content

Create

capability

entity

Database

SMS center

NoYes

Figure 47 the complete flowchart of the system

38

Chapter Five

5 System implementation and results

51 Implementation

511 The Push Proxy Gateway

First of all the Kannel gateway have been compiled and installed using gcc (GNU C

Compiler) this stage go fine except the operating system required more components to

be pre-installed and will configured

Then with stages of configuration to the gateway (Appendix B) it was capable of working

as PPG Figure 51 below show the gateway when it starts

Figure 51 starting kannel gateway

Then a web based user interface had been created to provide an easy way to control the

gateway remotely Figure 52 and figure 53

39

Figure 52 GUI for gateway control

512 The Push initiator

Next the push initiator design had been implemented using java programming language

as in design phase the implementation is taken carefully to make a reusable component

that could be used by other developer

PushInitiator class (Appendix B) implements a simple push initiator which can be used

to create and send messages to a push proxy gateway (PPG)

The method sendPushMessage sends a push message via the PPG to the client The client

is identified by the address which is either the phone number (address type is PLMN) or

IP address The message content and its mime type are also given as arguments to the

method the other tow important method are

createPapMessage This method creates a Push Access Protocol (PAP) type message

40

createSiMessage This method is used to create a service indication (SI) type message

Figure 53 showing running kannel status

513 WAP site

Since this site will be built for testing purpose and making sure that the system is

functional we had not go deep in this section Just simple WAP site with tow page has

been crated

41

52 Service indication

When a SI was pushed to any of the emulator or Nokia phones it was received and

presented in the way it was supposed to as specified in the WAP standard as shown in

figures below This is a proof that the devices claiming to support WAP push do so and

the design is will working See figures 53 through 56

Figure 55 service indication

42

Figure 57 SI details

52 Service load

The emulator correctly receives and interpreted the SL push the same as all of Nokia

phones we have tested

When a SL was pushed to the Ericsson phones it was not presented in the specified way

figure 58 I think that it is because of security reasons The reason for this assumption is

that the phones only supports on or off as security in their push configuration The

emulator on the other hand presents SL correctly Finally the Siemens phone did seem to

interpret SL but the current software was not very consistent It did load the SL without

user interference in the specified way when the user already where having an active

session If the user was offline the phone interface presented a symbol on the display

and did not load the service until the user clicked on the symbol

43

Chapter Six

6 conclusion and future work

In this chapter we will provide the conclusions and proposed future work for interested

individuals

61 Conclusions

In this project a WAP push system has been successfully designed and implemented It

provides a way to partially overcome the limitations encountered when accessing the

World Wide Web using handsets After comparing the proposed project objectives with

those accomplished the main goals are seen to be met

Phones from different manufactures all differ from the WAP-standard in some

ways One of the most obvious differences is the resolution of the display

During the work it has been noticed that the WML pages must be quite small We

have also noticed that the support for tables and some other tags are a bit limited

Even though the WML standard is smaller than the HTML standard it is a little

more complicated to write correct WML pages The main conclusion is that WAP

works pretty well but the phones are a little non-stable

The push proxy gateway is configured and worked probably with virtual SMS

center and it is easy to switch to a real one

The system depends mainly on open sources (ie Linux and kannek)

The design and implementation of the push initiator work well with the kannel

gateway and it should work correctly with other gateways

Chapter 6 Conclusion

44

62 Further Work

The possibilities of wireless push are interesting enough that it has to be worth to know if

the security and conformance problems will be solved in WAP push If they are solved

and the technique is refined then there should be nothing to stop the great number of

services that will follow in its footsteps Therefore there is further work that should be

done and the most interesting parts are in my opinion these

621 Security Aspect

One of the problems today is that the phones supporting push does not have the detailed

security settings that a technique like this needs Therefore it would be interesting to look

into the possibility to add these without confusing the user I suggest furthering looking

into usability aspects of security in WAP Push for short

622 GPS integration possibility

This will provide location dependent delivery of WAP push it will have great

applications in telematic and ecommerce advertising

623 Conformance to Standards

An interesting project would be to examine if the main reason for the nonstandard

solutions in the existing WAP push software is the result of difficulties in

implementation Or if the main reason is that the manufacturers wants to provide

proprietary solutions A reason why one may want to know this is that if the problem is

depending on implementation problems then it might get better

45

Appendix A Abbreviations

CDMA Code Division Multiple Access

CO Cache Operation

DTD Document Type Definition

GSM Global System for Mobile

HTTP Hypertext Transfer Protocol

IP Internet Protocol

MSISDN Mobile Station International Subscriber Directory Number

OTA Over The Air

PAP Push Access Protocol

PushOTA Push Over The Air

PDA Personal Digital Assistant

P1 Push Initiator

PLMN Public Land Mobile Networks

PPG Push Proxy Gateway

SI Service Indication

SIA Session Initiation Application

SIR Session Initiation Request

SL Service Loading

SMPP Short Message Peer to Peer

SMS Short Message System

SMSC Short Message System Center

UCP Universal Computer Protocol

URI Uniform Resource Identifier

URL Uniform Resource Locator

UTC Universal Time Coordinated

WAP Wireless Application Protocol

WBXML WAP binary XML

WDP Wireless Datagram Protocol

WSP Wireless Session Protocol

WTLS Wireless Transport Layer Security

XML Extensible Mark-up Language

46

Appendix B Kannel gateway configurations

THIS IS A SAMPLE CONFIGURATION FOR KANNEL

group = core

admin-port = 13000

admin-password = admin

status-password = admin

admin-deny-ip =

admin-allow-ip = 127001172161455

log-file = tmpkannellog

log-level = 0

http-proxy-host = 172161411

http-proxy-port = 8080

http-proxy-exceptions = 127001

Smsbox related

smsbox-port = 13001

box-deny-ip =

box-allow-ip = 127001

bearerbox-host =localhost

Wapbox related

wapbox-port = 13002

udp-deny-ip =

udp-allow-ip = 127001

bearerbox-host =localhost

SMSC GSM

group = smsc

smsc = at

modemtype = auto

speed =9600

device = devttyS0

SMSC HTTP

group = smsc

smsc = http

system-type = kannel

port = 13016

connect-allow-ip = 127001

Appendix B

47

username = wappush

password = wappush

SMSBOX SETUP

group = smsbox

bearerbox-host = localhost

sendsms-port = 13013

sendsms-chars = 0123456789 +-

log-file = tmpsmsboxlog

log-level = 0

access-log = accesslog

white-list = 127001

black-list =

SEND-SMS USERS

group = sendsms-user

username = wappush

password = wappush

user-deny-ip =

user-allow-ip = 127001

PPG group

group = ppg

ppg-url = wappush

ppg-port = 8080

concurrent-pushes = 100

trusted-pi = true

users = 1024

service-name = ppg

ppg-smsbox-id = dlrbox

WAP PUSH USER

group = wap-push-user

wap-push-user = picom

ppg-username = wappush

ppg-password = wappush

allow-ip = localhost

48

Appendix C Selected Codes

Gateway Control Form

ltDOCTYPE HTML PUBLIC -W3CDTD HTML 32ENgt

lthtmlgt ltheadgt

lttitlegtGateway control formlttitlegt

ltheadgt

ltbody bgcolor=white text=black link=blue vlink=navy

alink=redgt

ltbase target=submitgt

ltscriptgt

function update_status()

if ( adminactionvalue == status )

adminaction = http + adminhostnamevalue +

+ adminportvalue + status +

adminstatusformatvalue

else

adminaction = http + adminhostnamevalue +

+ adminportvalue + + adminactionvalue

adminpasswordvalue = adminpasswordvalue

actiongovalue = GO GET +adminaction

ltscriptgt

lttable align=centergt

lttrgtltp align=centergtlth2gtGateway control

formlth2gtltpgtlttrgt

lttrgt lttdgtHostnamelttdgtlttdgtltinput type=text

name=adminhostname value=localhost

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPortlttdgtlttdgtltinput type=text

name=adminport value=13000

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPasswordlttdgtlttdgtltinput type=password

name=adminpassword value=

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtActionlttdgtlttdgtltselect name=adminaction

onChange=update_status()gt

ltoption value=statusgtStatusltoptiongt

ltoption value=suspendgtSuspendltoptiongt

ltoption value=isolategtIsolateltoptiongt

Appendix C

49

ltoption value=shutdowngtShutdownltoptiongt

ltoption value=resumegtResumeltoptiongt

ltselectgtlttdgt lttrgt

lttrgt lttdgtStatus Formatlttdgtlttdgtltselect

name=adminstatusformat onChange=update_status()gt

ltoption value=gthtmlltoptiongtltoption

value=txtgttxtltoptiongtltoption

value=xmlgtxmlltoptiongtltselectgtlttdgt lttrgt

ltform name=admin method=get

action=httplocalhost13000status

encoding=applicationx-www-formgt

ltinput type=hidden name=password value=gt

lttrgt

lttdgtGolttdgt

ltformgt

lttdgtltinput type=submit value=go name=actiongo

onClick=documentadminsubmit()gtlttdgt

lttrgt

lttablegt

ltbodygt

lthtmlgt

Push Initiator Class

import javanetURL

import javanetHttpURLConnection

import javaio

Class implements a simple push initiator It can be

used to create and send messages to push proxy

gateway (ppg)

public final class PushInitiator

xml version

private final static String XML_VERSION = ltxml

version=10gt

Push Access Protocol (PAP) document type

private final static String PAP_DOCTYPE =

Appendix C

50

ltDOCTYPE pap PUBLIC -WAPFORUMDTD PAP 10EN

httpwwwwapforumorgDTDpap_10dtd gt

content type of the push request multipart body

private final static String CONTENT_TYPE =

multipartrelated boundary=multipart-boundary

type=applicationxml

Service Indication (SI) document type

private static final String SI_DOCTYPE = ltDOCTYPE si

PUBLIC -WAPFORUMDTD SI 10EN +

httpwwwwapforumorgDTDsidtdgt

private static int pushId = 0

PPG url where the pap message is to be sent

private final URL ppgUrl

some push proxy gateways may also require the

authentication of the push initiator

For instance the push initiator may be required to

send an HTTP authorization header in each request

private final String authorization

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

public PushInitiator(URL ppgUrl) thisppgUrl =

ppgUrl

authorization = null

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

param authorization a ltcodegtStringltcodegt value

public PushInitiator(URL ppgUrl String authorization)

thisppgUrl = ppgUrl

Appendix C

51

thisauthorization = authorization

Systemoutprintln(Push Initiator created ppgUrl =

+ ppgUrl)

ltcodegtsendPushMessageltcodegt sends push message to

ppg

param clientAddress a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param message a ltcodegtStringltcodegt value

param mimeType a ltcodegtStringltcodegt value

exception Exception if an error occurs

public void sendPushMessage(String clientAddress

String addressTypeString message String mimeType)

throws Exception

HttpURLConnection http =

(HttpURLConnection)ppgUrlopenConnection()

String ppgServer = ppgUrlgetHost()

httpsetDoInput(true)

httpsetRequestProperty(Content-Type CONTENT_TYPE)

if(authorization = null)

if(authorizationtrim()equals())

httpsetRequestProperty(Authorization

authorization)

httpsetDoOutput(true)

PrintWriter out = new PrintWriter(new

BufferedOutputStream(httpgetOutputStream()))

outprintln(--multipart-boundary)

outprintln(Content-type applicationxml)

outprintln()

outprintln(createPapMessage(clientAddress

addressTypeppgServer genPushId() null))

outprintln()

outprintln(--multipart-boundary)

outprintln(Content-type + mimeType)

outprintln()

outprintln(message)

outprintln()

outprintln(--multipart-boundary--)

outflush()

outclose()

httpconnect()

Appendix C

52

finally read and debug the response received from

PPG

try

debugResponse(http)

catch (Exception e)

Systemerrprintln(Error in receiving the

response)

ltcodegtcreatePapMessageltcodegt creates a Push Access

Protocoltype message

param address a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param ppgServer a ltcodegtStringltcodegt value

param pushId a ltcodegtStringltcodegt value

param notificationTo a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createPapMessage(String address

String addressType String ppgServer String pushId

String notificationTo)

return XML_VERSION + n + PAP_DOCTYPE + n +

ltpap product-name=Mobile Zoo Push

Initiatorgtn +

ltpush-message push-id= + pushId +

(notificationTo = null request-notification-

to= + notificationTo ) + gtn +

ltaddress address-value=WAPPUSH= + address +

TYPE= + addressType +

+ ppgServer + gtn +

ltpush-messagegtnltpapgt

ltcodegtcreateSiMessageltcodegt creates a service

indication type message

param url a ltcodegtStringltcodegt value

param created a ltcodegtStringltcodegt value

param expires a ltcodegtStringltcodegt value

Appendix C

53

param message a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createSiMessage(String url

String sid String created String expires String

action String message)

return XML_VERSION + SI_DOCTYPE +

ltsigtn +

ltindication href= + url + +

(sid = null si-id= + sid + ) +

created = null created= + created +

) +

(action = null action= + action +

) +

(expires = null expires= + expires +

) + gt +

message +

ltindicationgtnltsigt

Debug response

param http a ltcodegtHttpURLConnectionltcodegt value

exception Exception if an error occurs

private void debugResponse(HttpURLConnection http)

throws Exception

Systemoutprintln(httpgetResponseMessage())

String headerName

int i=0

while((headerName = httpgetHeaderFieldKey(i++)) =

null)

Systemoutprintln(headerName + +

httpgetHeaderField(headerName))

Systemoutprintln()

InputStreamReader in = new InputStreamReader(new

BufferedInputStream(httpgetInputStream()))

int c

Appendix C

54

while((c = inread()) = -1)

Systemoutprint((char)c)

Systemoutprintln()

ltcodegtgenPushIdltcodegt generates an unique push id

return a ltcodegtStringltcodegt value

private String genPushId()

pushId = 100000

return SystemcurrentTimeMillis() + + pushId++

55

References

[1] Microsoft ldquoGetting Mobile Using WML and WAP to Display Web Sites on

Mobile Devicesrdquo

URL msdnmicrosoftcomen-uslibraryaa140117(office10)aspx accessed

on April 10 2008

[2] DALE BULBROOK ldquoWAPA Beginnerrsquos Guiderdquo OsborneMcGraw-Hill 2001

[3] WAP Forum Wireless Application Protocol Architecture Specification Access on

Jan 12 2008 Available

httpwww1wapforumorgtechdocumentsWAP-210-WAPArch-2006 07 12-apdf

[4] WAP Forum Push Architectural Overview access on (2008 February 3) Available

httpwww1wapforumorgtechdocumentsWAP-250-PushArchOverview-2007 04

03-apdf

[5] Service indication PDF access on 62008 Available

httpwwww3orgTRhtml401structlinkshtml

[6] WAP Push Technology (openwave) PDF access on (2008 April) Available

URL httpwwwopenwavorg

[7] Web site (httpwwwwapforumorgwhatcopyrighthtm) access on May 2008

[8] ldquoWAP Push Proxy Gateway Specificationrdquo WAP Forum access on 16-August-

2007URI httpwwwwapforumorgPDF

[9] WAP Forum Access on (2008 MAY 31) WAP Service Indication Specification

Available httpwww1wapforumorgtechdocumentsWAP-167-ServiceInd-200507

31-apdf

  • odc_fpwmlandwap_topic3
  • N100E3
  • 21
  • 5

Chapter 4 System Design

27

The PI communicates with a Push Proxy Gateway (PPG) over the Push Access Protocol

(PAP) (1 and 2) The PPG will then use the Push Over-The-Air Protocol (PushOTA) (3)

to deliver a Uniform Resource Identifier (URI) to the client via a Short Message System

Centre (SMS-C) (4 and 5) The next step for the client is then to activate the URI (6 and

7) and get the content from the server (8 and 9) The mobile device will have to use a

ldquoPull Gatewayrdquo to get the content but it is very likely that this is the same one as the PPG

The same same scenario could be viewed in sequence diagram figure (42)

Push Initiator PPG SMS Center WAP client

Send push message

Send push message response

Send WAP push message

Ack

Send WAP push message

Ack

Message read

Ack

Message read

Ack

Result notification message

Result notification response

Figure 42 WAP push sequence diagram

Chapter 4 System Design

28

43 Modular Design

Conceptually we can envision this push system as consisting of three major components

(presented in the order of the push lifetime)

first there is a Push Initiator Program that reads the generates a notification message and

transmits (pushes) it via a WAP Gateway to the customer phone This message notifies

the user that a service is available if the user accepts will ask the phonersquos browser to pull

the page from our web server via the WAP Gateway

Next there is the Push Proxy Gateway PPG which will receive the push message from

the push initiator and is responsible of doing any needed optimization protocol

compilation and conversion Also it is responsibility of the PPG to find the end user

address and send the push message to the SMS center

Finally there is the SMS center which will do the last delivery of push message to the

intended user if the user were offline the message will be saved for later time until the

WAP client is on

PI PPGSMSC

Figure 43 system modules

Chapter 4 System Design

29

43 Design of system Modules

Following sections of this chapter present a description and design of the system modules

with accompanying graphical representation

431 Push Initiator (PI)

The PI is the first logical component in the WAP Push scenario and therefore the

originator of the push message There are different kinds of PIs One example is an

automated script another one is a semi automated server version written in an applicable

scripting language supporting server side interaction

A push message is sent as an HTTP POST to the Push Proxy Gateway The POST will be

a multipart XML document with the first part being the control entity (Push Access

Protocol) the second part being the content entity (either a Service Indication or a

Service Load) and the third part being the capability entity

HTTP Post

Capability entity

Content entity (SISL)

Control entity (PAP)

Figure 44 architecture of the push message

Chapter 4 System Design

30

4311 Control entity

This part of the push contains the basic information and fields The fields can include

recipient address expiry time bearer type delivery attempt time and a URL to which a

response is to be sent if delivery confirmation is requested by the push initiator

PAP is the protocol used in WAP Push framework for specifying control information and

content that is to be pushed to a client via a Push Proxy Gateway (PPG) A Push Initiator

(PI) triggers push message processing The Push initiator class (Appendix B) of this

design shows how to generate PAP messages

The address of the used PPG should be given as an initialization parameter of the

application (ldquoppg-urlrdquo see Appendix B) This design also provides an implementation

that can be used in a special case when ldquoIPv4 IPv6rdquo type client addressing is applied and

when toolkit is used All other cases including the use of phone numbers (ldquoPLMNrdquo type

address) in sending push messages are considered

The PAP XML contains at the minimum a ltpapgt element a ltpush-messagegt

element and an ltaddressgt element

The important parts of this PAP message are the address value and type The value is

typically a MSISDN and type indicates whether to send to a MSISDN (typical case) or to

an IP Address The TYPE is almost always MSISDN as the Push Initiator (PI) will not

typically have the Mobile Stations IP address - which is generally dynamic

4312 Content entity

This is the actual data that is received by the mobile device The various content types

are Service Indication (SI) Service Load (SL) and Cache Operation (CO) in our project

we will just deal with SI and SL

The SI notifies a client about an external event by inviting the client to interact with it In

other words it informs a client about a service More precisely it sends a message that

Chapter 4 System Design

31

informs the client of a Uniform Resource Identifier (URI) where the client can access the

service

An important attribute of SI is the action attribute it may contain the action to be taken

when the client receives the SI There are two groups that the action attributes can be

divided into

First we have delete and signalmdashnone both of them is used because of their side

effects Ie with delete you take away all SIs with the same si-id as the deletion pushrdquo

including itself and with signal-none you either do nothing or you pay regard to the

info element in that push

The other group consists of signal-low signal-medium and signal-high These

attributes are all used to set the rules for the presentation in the terminal device

o Signal-low

The SI must be postponed without user intervention

o Signal-medium

The SI must be presented as soon as the implementation allows that to be carried out

without disturbing the user (Signal-medium is the value that will be used if none is

specified)

o Signal-high

The SI must be presented as soon as the implementation allows that to be carried out

without disturbing the user or earlier if it seems appropriate (This decision may for

instance be based on user preference settings)

This is the different functionalities supported by the SI we concidered

Expiration

Replacement

Deletion

Chapter 4 System Design

32

Handling of out of order delivery

Handling of information specified in the info element

A PUSH Service Indication (SI) contains at a minimum an ltsigt element and a

ltindicationgt element SL donrsquot differ so much from SI

4313 Capability entity

This entity determines the type of mobile device that is to be served This is determined

by WAP user agent profiling The sender can indicate the hardware vendor and browser

version and type of the intended recipients This capability entity is then matched at the

PPG to see which devices are compatible with the requested capability If there is a

match the content is delivered by the PPG to that specific device

Now a day most devices are compatible with WAP so we donrsquot need to create this entity

more precisely it is optional

After the push has been created in the PI it is up to the system to deliver it to the defined

destination In this system the different responsible entities are the PPG and the SMSC

Both of these two different entities are running on same server but it is only the

configuration of the SMSC that is out of my control since it is run by the operator and is

not controllable in my lab environment

432 Push Proxy Gateway (PPG)

There are various commercial WAP gateways available on the market that are quite

expensive Kannel on the other hand is an open source gateway one doesnrsquot need to pay

for it in addition one can edit the source code himself and construct his own customized

gateway Because Kannel is being developed on Linux systems (RedHat and Debian) it

can be smoothly ported to other UNIX-like operating systems

4321 Kannel gateway architecture

The gateway divides the processing load between the following three hosts

Chapter 4 System Design

33

The bearer box which connects to the SMS (Short Message Service) centers and

or CSD (Circuit Switched Data) routers providing a unified interface to them for

the wapbox The bearer box does this by implementing the WDP (Wireless

Datagram Protocol) layer of the WAP stack

The smsbox implements the rest of the SMS gateway functionality It receives

textual SMS messages from the bearerbox and interprets them as service

requests and responds to them in the appropriate way

The wapbox which hosts the upper layers of the WAP stack Each session and its

transactions are handled by the same wapbox (see figure 35)

1Figure 45 divisions of duties in kannel

4322 Working of the gateway

The bearer box receives UDP (User Datagram Protocol) packets from CSD routers

inspects them to see whether they are WAP packets if so then it will routes them to the

WAP box This simple design allows the bearer box to do a minimum of processing per

smsbox

wapbox

bearerbox

Kannel

SMS center

WAP phone

HTTP server

Chapter 4 System Design

34

packet The bearer box also sends the UDP packets that the other boxes generate which

adds some more routing processing The wapboxes implement the WTP (Wireless

Transaction Protocol) and WSP (Wireless Session Protocol) layers These take HTTP-

like requests from the phones and make the actual HTTP requests to content servers

compress the responses and send them back to the terminals (Sessions are maintained to

make as much use of the limited radio bandwidth as possible)

4323 External interfaces of the gateway

The gateway has interfaces to three external agents

bull SMS centers using various protocols

bull HTTP servers to fetch WAP and SMS content and to push WAP Content The

pull protocol is HTTP push PAP

bull WAP phones implementing the WAP protocol stack and (for push) WAP Push

client

Figure 36 summarize kannel external interfaces

4324 Configuring the gateway

The bearerbox smsbox and wapbox are the main working modules of the gateway and

must be configured before configuring the gateway These three modules are controlled

by a configuration file that has wapbox smsbox and bearerbox groups

Configuring the PPG core group

We use two components the PPG core group and the PPG user group The PPG

core group is used to configure the PI interface(for more details configuration

variables refer to appendix c)

Chapter 4 System Design

35

Mobile telephone

network

The Internet

smsbox

wapbox

bearerbox

Kannel

HTTP

HTTP

HTTP server

Serving WML

files

HTTP server

Serving HTML

files

TCP

TCP

WAPSMS

SMSC

WAP phoneNetwork base station

Workstation used for http

administration

Figure 46 External interfaces of the gateway

4325 Administering the gateway through an HTTP interface

Kannel can be administered via an HTTP interface All commands are given as normal

HTTP queries so they can easily be given from command lines like this one

links -dump httpip-adressportshutdownpassword=yourchoice

But it is advantageous to have graphical user interface for gateway control so we have

designed GUI through http

Chapter 4 System Design

36

433 Short Message Service Centre (SMSC)

A SMSC is an essential component when sending a push message from an IP network to

a mobile device in the architecture supported by the components and devices It is used to

remove the TCPIP layer that the push is encapsulatedrdquo in It is also the entity that

identifies the end-point device When this is done it is also the SMSC that is responsible

for the processing and final message delivery to the device After the process of de-

encapsulation and resolution of the client identity there should not be any difference

between this message and a message that is originated locally from the operator itself

(like a SMS)

In this project we just use a virtual SMS center we try first to get connection to a real

one but our effort was worthless

Finally the following figure depicts the overall flowchart of the WAP push system

(figure 47)

Chapter 4 System Design

37

PI

PPG

Create PAP

HTTP Post

Message

processing

OTA

Connection

oriented

Sessionless Session

oriented

WTP Initiation

WAP clinet

Application

Create content

Create

capability

entity

Database

SMS center

NoYes

Figure 47 the complete flowchart of the system

38

Chapter Five

5 System implementation and results

51 Implementation

511 The Push Proxy Gateway

First of all the Kannel gateway have been compiled and installed using gcc (GNU C

Compiler) this stage go fine except the operating system required more components to

be pre-installed and will configured

Then with stages of configuration to the gateway (Appendix B) it was capable of working

as PPG Figure 51 below show the gateway when it starts

Figure 51 starting kannel gateway

Then a web based user interface had been created to provide an easy way to control the

gateway remotely Figure 52 and figure 53

39

Figure 52 GUI for gateway control

512 The Push initiator

Next the push initiator design had been implemented using java programming language

as in design phase the implementation is taken carefully to make a reusable component

that could be used by other developer

PushInitiator class (Appendix B) implements a simple push initiator which can be used

to create and send messages to a push proxy gateway (PPG)

The method sendPushMessage sends a push message via the PPG to the client The client

is identified by the address which is either the phone number (address type is PLMN) or

IP address The message content and its mime type are also given as arguments to the

method the other tow important method are

createPapMessage This method creates a Push Access Protocol (PAP) type message

40

createSiMessage This method is used to create a service indication (SI) type message

Figure 53 showing running kannel status

513 WAP site

Since this site will be built for testing purpose and making sure that the system is

functional we had not go deep in this section Just simple WAP site with tow page has

been crated

41

52 Service indication

When a SI was pushed to any of the emulator or Nokia phones it was received and

presented in the way it was supposed to as specified in the WAP standard as shown in

figures below This is a proof that the devices claiming to support WAP push do so and

the design is will working See figures 53 through 56

Figure 55 service indication

42

Figure 57 SI details

52 Service load

The emulator correctly receives and interpreted the SL push the same as all of Nokia

phones we have tested

When a SL was pushed to the Ericsson phones it was not presented in the specified way

figure 58 I think that it is because of security reasons The reason for this assumption is

that the phones only supports on or off as security in their push configuration The

emulator on the other hand presents SL correctly Finally the Siemens phone did seem to

interpret SL but the current software was not very consistent It did load the SL without

user interference in the specified way when the user already where having an active

session If the user was offline the phone interface presented a symbol on the display

and did not load the service until the user clicked on the symbol

43

Chapter Six

6 conclusion and future work

In this chapter we will provide the conclusions and proposed future work for interested

individuals

61 Conclusions

In this project a WAP push system has been successfully designed and implemented It

provides a way to partially overcome the limitations encountered when accessing the

World Wide Web using handsets After comparing the proposed project objectives with

those accomplished the main goals are seen to be met

Phones from different manufactures all differ from the WAP-standard in some

ways One of the most obvious differences is the resolution of the display

During the work it has been noticed that the WML pages must be quite small We

have also noticed that the support for tables and some other tags are a bit limited

Even though the WML standard is smaller than the HTML standard it is a little

more complicated to write correct WML pages The main conclusion is that WAP

works pretty well but the phones are a little non-stable

The push proxy gateway is configured and worked probably with virtual SMS

center and it is easy to switch to a real one

The system depends mainly on open sources (ie Linux and kannek)

The design and implementation of the push initiator work well with the kannel

gateway and it should work correctly with other gateways

Chapter 6 Conclusion

44

62 Further Work

The possibilities of wireless push are interesting enough that it has to be worth to know if

the security and conformance problems will be solved in WAP push If they are solved

and the technique is refined then there should be nothing to stop the great number of

services that will follow in its footsteps Therefore there is further work that should be

done and the most interesting parts are in my opinion these

621 Security Aspect

One of the problems today is that the phones supporting push does not have the detailed

security settings that a technique like this needs Therefore it would be interesting to look

into the possibility to add these without confusing the user I suggest furthering looking

into usability aspects of security in WAP Push for short

622 GPS integration possibility

This will provide location dependent delivery of WAP push it will have great

applications in telematic and ecommerce advertising

623 Conformance to Standards

An interesting project would be to examine if the main reason for the nonstandard

solutions in the existing WAP push software is the result of difficulties in

implementation Or if the main reason is that the manufacturers wants to provide

proprietary solutions A reason why one may want to know this is that if the problem is

depending on implementation problems then it might get better

45

Appendix A Abbreviations

CDMA Code Division Multiple Access

CO Cache Operation

DTD Document Type Definition

GSM Global System for Mobile

HTTP Hypertext Transfer Protocol

IP Internet Protocol

MSISDN Mobile Station International Subscriber Directory Number

OTA Over The Air

PAP Push Access Protocol

PushOTA Push Over The Air

PDA Personal Digital Assistant

P1 Push Initiator

PLMN Public Land Mobile Networks

PPG Push Proxy Gateway

SI Service Indication

SIA Session Initiation Application

SIR Session Initiation Request

SL Service Loading

SMPP Short Message Peer to Peer

SMS Short Message System

SMSC Short Message System Center

UCP Universal Computer Protocol

URI Uniform Resource Identifier

URL Uniform Resource Locator

UTC Universal Time Coordinated

WAP Wireless Application Protocol

WBXML WAP binary XML

WDP Wireless Datagram Protocol

WSP Wireless Session Protocol

WTLS Wireless Transport Layer Security

XML Extensible Mark-up Language

46

Appendix B Kannel gateway configurations

THIS IS A SAMPLE CONFIGURATION FOR KANNEL

group = core

admin-port = 13000

admin-password = admin

status-password = admin

admin-deny-ip =

admin-allow-ip = 127001172161455

log-file = tmpkannellog

log-level = 0

http-proxy-host = 172161411

http-proxy-port = 8080

http-proxy-exceptions = 127001

Smsbox related

smsbox-port = 13001

box-deny-ip =

box-allow-ip = 127001

bearerbox-host =localhost

Wapbox related

wapbox-port = 13002

udp-deny-ip =

udp-allow-ip = 127001

bearerbox-host =localhost

SMSC GSM

group = smsc

smsc = at

modemtype = auto

speed =9600

device = devttyS0

SMSC HTTP

group = smsc

smsc = http

system-type = kannel

port = 13016

connect-allow-ip = 127001

Appendix B

47

username = wappush

password = wappush

SMSBOX SETUP

group = smsbox

bearerbox-host = localhost

sendsms-port = 13013

sendsms-chars = 0123456789 +-

log-file = tmpsmsboxlog

log-level = 0

access-log = accesslog

white-list = 127001

black-list =

SEND-SMS USERS

group = sendsms-user

username = wappush

password = wappush

user-deny-ip =

user-allow-ip = 127001

PPG group

group = ppg

ppg-url = wappush

ppg-port = 8080

concurrent-pushes = 100

trusted-pi = true

users = 1024

service-name = ppg

ppg-smsbox-id = dlrbox

WAP PUSH USER

group = wap-push-user

wap-push-user = picom

ppg-username = wappush

ppg-password = wappush

allow-ip = localhost

48

Appendix C Selected Codes

Gateway Control Form

ltDOCTYPE HTML PUBLIC -W3CDTD HTML 32ENgt

lthtmlgt ltheadgt

lttitlegtGateway control formlttitlegt

ltheadgt

ltbody bgcolor=white text=black link=blue vlink=navy

alink=redgt

ltbase target=submitgt

ltscriptgt

function update_status()

if ( adminactionvalue == status )

adminaction = http + adminhostnamevalue +

+ adminportvalue + status +

adminstatusformatvalue

else

adminaction = http + adminhostnamevalue +

+ adminportvalue + + adminactionvalue

adminpasswordvalue = adminpasswordvalue

actiongovalue = GO GET +adminaction

ltscriptgt

lttable align=centergt

lttrgtltp align=centergtlth2gtGateway control

formlth2gtltpgtlttrgt

lttrgt lttdgtHostnamelttdgtlttdgtltinput type=text

name=adminhostname value=localhost

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPortlttdgtlttdgtltinput type=text

name=adminport value=13000

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPasswordlttdgtlttdgtltinput type=password

name=adminpassword value=

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtActionlttdgtlttdgtltselect name=adminaction

onChange=update_status()gt

ltoption value=statusgtStatusltoptiongt

ltoption value=suspendgtSuspendltoptiongt

ltoption value=isolategtIsolateltoptiongt

Appendix C

49

ltoption value=shutdowngtShutdownltoptiongt

ltoption value=resumegtResumeltoptiongt

ltselectgtlttdgt lttrgt

lttrgt lttdgtStatus Formatlttdgtlttdgtltselect

name=adminstatusformat onChange=update_status()gt

ltoption value=gthtmlltoptiongtltoption

value=txtgttxtltoptiongtltoption

value=xmlgtxmlltoptiongtltselectgtlttdgt lttrgt

ltform name=admin method=get

action=httplocalhost13000status

encoding=applicationx-www-formgt

ltinput type=hidden name=password value=gt

lttrgt

lttdgtGolttdgt

ltformgt

lttdgtltinput type=submit value=go name=actiongo

onClick=documentadminsubmit()gtlttdgt

lttrgt

lttablegt

ltbodygt

lthtmlgt

Push Initiator Class

import javanetURL

import javanetHttpURLConnection

import javaio

Class implements a simple push initiator It can be

used to create and send messages to push proxy

gateway (ppg)

public final class PushInitiator

xml version

private final static String XML_VERSION = ltxml

version=10gt

Push Access Protocol (PAP) document type

private final static String PAP_DOCTYPE =

Appendix C

50

ltDOCTYPE pap PUBLIC -WAPFORUMDTD PAP 10EN

httpwwwwapforumorgDTDpap_10dtd gt

content type of the push request multipart body

private final static String CONTENT_TYPE =

multipartrelated boundary=multipart-boundary

type=applicationxml

Service Indication (SI) document type

private static final String SI_DOCTYPE = ltDOCTYPE si

PUBLIC -WAPFORUMDTD SI 10EN +

httpwwwwapforumorgDTDsidtdgt

private static int pushId = 0

PPG url where the pap message is to be sent

private final URL ppgUrl

some push proxy gateways may also require the

authentication of the push initiator

For instance the push initiator may be required to

send an HTTP authorization header in each request

private final String authorization

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

public PushInitiator(URL ppgUrl) thisppgUrl =

ppgUrl

authorization = null

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

param authorization a ltcodegtStringltcodegt value

public PushInitiator(URL ppgUrl String authorization)

thisppgUrl = ppgUrl

Appendix C

51

thisauthorization = authorization

Systemoutprintln(Push Initiator created ppgUrl =

+ ppgUrl)

ltcodegtsendPushMessageltcodegt sends push message to

ppg

param clientAddress a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param message a ltcodegtStringltcodegt value

param mimeType a ltcodegtStringltcodegt value

exception Exception if an error occurs

public void sendPushMessage(String clientAddress

String addressTypeString message String mimeType)

throws Exception

HttpURLConnection http =

(HttpURLConnection)ppgUrlopenConnection()

String ppgServer = ppgUrlgetHost()

httpsetDoInput(true)

httpsetRequestProperty(Content-Type CONTENT_TYPE)

if(authorization = null)

if(authorizationtrim()equals())

httpsetRequestProperty(Authorization

authorization)

httpsetDoOutput(true)

PrintWriter out = new PrintWriter(new

BufferedOutputStream(httpgetOutputStream()))

outprintln(--multipart-boundary)

outprintln(Content-type applicationxml)

outprintln()

outprintln(createPapMessage(clientAddress

addressTypeppgServer genPushId() null))

outprintln()

outprintln(--multipart-boundary)

outprintln(Content-type + mimeType)

outprintln()

outprintln(message)

outprintln()

outprintln(--multipart-boundary--)

outflush()

outclose()

httpconnect()

Appendix C

52

finally read and debug the response received from

PPG

try

debugResponse(http)

catch (Exception e)

Systemerrprintln(Error in receiving the

response)

ltcodegtcreatePapMessageltcodegt creates a Push Access

Protocoltype message

param address a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param ppgServer a ltcodegtStringltcodegt value

param pushId a ltcodegtStringltcodegt value

param notificationTo a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createPapMessage(String address

String addressType String ppgServer String pushId

String notificationTo)

return XML_VERSION + n + PAP_DOCTYPE + n +

ltpap product-name=Mobile Zoo Push

Initiatorgtn +

ltpush-message push-id= + pushId +

(notificationTo = null request-notification-

to= + notificationTo ) + gtn +

ltaddress address-value=WAPPUSH= + address +

TYPE= + addressType +

+ ppgServer + gtn +

ltpush-messagegtnltpapgt

ltcodegtcreateSiMessageltcodegt creates a service

indication type message

param url a ltcodegtStringltcodegt value

param created a ltcodegtStringltcodegt value

param expires a ltcodegtStringltcodegt value

Appendix C

53

param message a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createSiMessage(String url

String sid String created String expires String

action String message)

return XML_VERSION + SI_DOCTYPE +

ltsigtn +

ltindication href= + url + +

(sid = null si-id= + sid + ) +

created = null created= + created +

) +

(action = null action= + action +

) +

(expires = null expires= + expires +

) + gt +

message +

ltindicationgtnltsigt

Debug response

param http a ltcodegtHttpURLConnectionltcodegt value

exception Exception if an error occurs

private void debugResponse(HttpURLConnection http)

throws Exception

Systemoutprintln(httpgetResponseMessage())

String headerName

int i=0

while((headerName = httpgetHeaderFieldKey(i++)) =

null)

Systemoutprintln(headerName + +

httpgetHeaderField(headerName))

Systemoutprintln()

InputStreamReader in = new InputStreamReader(new

BufferedInputStream(httpgetInputStream()))

int c

Appendix C

54

while((c = inread()) = -1)

Systemoutprint((char)c)

Systemoutprintln()

ltcodegtgenPushIdltcodegt generates an unique push id

return a ltcodegtStringltcodegt value

private String genPushId()

pushId = 100000

return SystemcurrentTimeMillis() + + pushId++

55

References

[1] Microsoft ldquoGetting Mobile Using WML and WAP to Display Web Sites on

Mobile Devicesrdquo

URL msdnmicrosoftcomen-uslibraryaa140117(office10)aspx accessed

on April 10 2008

[2] DALE BULBROOK ldquoWAPA Beginnerrsquos Guiderdquo OsborneMcGraw-Hill 2001

[3] WAP Forum Wireless Application Protocol Architecture Specification Access on

Jan 12 2008 Available

httpwww1wapforumorgtechdocumentsWAP-210-WAPArch-2006 07 12-apdf

[4] WAP Forum Push Architectural Overview access on (2008 February 3) Available

httpwww1wapforumorgtechdocumentsWAP-250-PushArchOverview-2007 04

03-apdf

[5] Service indication PDF access on 62008 Available

httpwwww3orgTRhtml401structlinkshtml

[6] WAP Push Technology (openwave) PDF access on (2008 April) Available

URL httpwwwopenwavorg

[7] Web site (httpwwwwapforumorgwhatcopyrighthtm) access on May 2008

[8] ldquoWAP Push Proxy Gateway Specificationrdquo WAP Forum access on 16-August-

2007URI httpwwwwapforumorgPDF

[9] WAP Forum Access on (2008 MAY 31) WAP Service Indication Specification

Available httpwww1wapforumorgtechdocumentsWAP-167-ServiceInd-200507

31-apdf

  • odc_fpwmlandwap_topic3
  • N100E3
  • 21
  • 5

Chapter 4 System Design

28

43 Modular Design

Conceptually we can envision this push system as consisting of three major components

(presented in the order of the push lifetime)

first there is a Push Initiator Program that reads the generates a notification message and

transmits (pushes) it via a WAP Gateway to the customer phone This message notifies

the user that a service is available if the user accepts will ask the phonersquos browser to pull

the page from our web server via the WAP Gateway

Next there is the Push Proxy Gateway PPG which will receive the push message from

the push initiator and is responsible of doing any needed optimization protocol

compilation and conversion Also it is responsibility of the PPG to find the end user

address and send the push message to the SMS center

Finally there is the SMS center which will do the last delivery of push message to the

intended user if the user were offline the message will be saved for later time until the

WAP client is on

PI PPGSMSC

Figure 43 system modules

Chapter 4 System Design

29

43 Design of system Modules

Following sections of this chapter present a description and design of the system modules

with accompanying graphical representation

431 Push Initiator (PI)

The PI is the first logical component in the WAP Push scenario and therefore the

originator of the push message There are different kinds of PIs One example is an

automated script another one is a semi automated server version written in an applicable

scripting language supporting server side interaction

A push message is sent as an HTTP POST to the Push Proxy Gateway The POST will be

a multipart XML document with the first part being the control entity (Push Access

Protocol) the second part being the content entity (either a Service Indication or a

Service Load) and the third part being the capability entity

HTTP Post

Capability entity

Content entity (SISL)

Control entity (PAP)

Figure 44 architecture of the push message

Chapter 4 System Design

30

4311 Control entity

This part of the push contains the basic information and fields The fields can include

recipient address expiry time bearer type delivery attempt time and a URL to which a

response is to be sent if delivery confirmation is requested by the push initiator

PAP is the protocol used in WAP Push framework for specifying control information and

content that is to be pushed to a client via a Push Proxy Gateway (PPG) A Push Initiator

(PI) triggers push message processing The Push initiator class (Appendix B) of this

design shows how to generate PAP messages

The address of the used PPG should be given as an initialization parameter of the

application (ldquoppg-urlrdquo see Appendix B) This design also provides an implementation

that can be used in a special case when ldquoIPv4 IPv6rdquo type client addressing is applied and

when toolkit is used All other cases including the use of phone numbers (ldquoPLMNrdquo type

address) in sending push messages are considered

The PAP XML contains at the minimum a ltpapgt element a ltpush-messagegt

element and an ltaddressgt element

The important parts of this PAP message are the address value and type The value is

typically a MSISDN and type indicates whether to send to a MSISDN (typical case) or to

an IP Address The TYPE is almost always MSISDN as the Push Initiator (PI) will not

typically have the Mobile Stations IP address - which is generally dynamic

4312 Content entity

This is the actual data that is received by the mobile device The various content types

are Service Indication (SI) Service Load (SL) and Cache Operation (CO) in our project

we will just deal with SI and SL

The SI notifies a client about an external event by inviting the client to interact with it In

other words it informs a client about a service More precisely it sends a message that

Chapter 4 System Design

31

informs the client of a Uniform Resource Identifier (URI) where the client can access the

service

An important attribute of SI is the action attribute it may contain the action to be taken

when the client receives the SI There are two groups that the action attributes can be

divided into

First we have delete and signalmdashnone both of them is used because of their side

effects Ie with delete you take away all SIs with the same si-id as the deletion pushrdquo

including itself and with signal-none you either do nothing or you pay regard to the

info element in that push

The other group consists of signal-low signal-medium and signal-high These

attributes are all used to set the rules for the presentation in the terminal device

o Signal-low

The SI must be postponed without user intervention

o Signal-medium

The SI must be presented as soon as the implementation allows that to be carried out

without disturbing the user (Signal-medium is the value that will be used if none is

specified)

o Signal-high

The SI must be presented as soon as the implementation allows that to be carried out

without disturbing the user or earlier if it seems appropriate (This decision may for

instance be based on user preference settings)

This is the different functionalities supported by the SI we concidered

Expiration

Replacement

Deletion

Chapter 4 System Design

32

Handling of out of order delivery

Handling of information specified in the info element

A PUSH Service Indication (SI) contains at a minimum an ltsigt element and a

ltindicationgt element SL donrsquot differ so much from SI

4313 Capability entity

This entity determines the type of mobile device that is to be served This is determined

by WAP user agent profiling The sender can indicate the hardware vendor and browser

version and type of the intended recipients This capability entity is then matched at the

PPG to see which devices are compatible with the requested capability If there is a

match the content is delivered by the PPG to that specific device

Now a day most devices are compatible with WAP so we donrsquot need to create this entity

more precisely it is optional

After the push has been created in the PI it is up to the system to deliver it to the defined

destination In this system the different responsible entities are the PPG and the SMSC

Both of these two different entities are running on same server but it is only the

configuration of the SMSC that is out of my control since it is run by the operator and is

not controllable in my lab environment

432 Push Proxy Gateway (PPG)

There are various commercial WAP gateways available on the market that are quite

expensive Kannel on the other hand is an open source gateway one doesnrsquot need to pay

for it in addition one can edit the source code himself and construct his own customized

gateway Because Kannel is being developed on Linux systems (RedHat and Debian) it

can be smoothly ported to other UNIX-like operating systems

4321 Kannel gateway architecture

The gateway divides the processing load between the following three hosts

Chapter 4 System Design

33

The bearer box which connects to the SMS (Short Message Service) centers and

or CSD (Circuit Switched Data) routers providing a unified interface to them for

the wapbox The bearer box does this by implementing the WDP (Wireless

Datagram Protocol) layer of the WAP stack

The smsbox implements the rest of the SMS gateway functionality It receives

textual SMS messages from the bearerbox and interprets them as service

requests and responds to them in the appropriate way

The wapbox which hosts the upper layers of the WAP stack Each session and its

transactions are handled by the same wapbox (see figure 35)

1Figure 45 divisions of duties in kannel

4322 Working of the gateway

The bearer box receives UDP (User Datagram Protocol) packets from CSD routers

inspects them to see whether they are WAP packets if so then it will routes them to the

WAP box This simple design allows the bearer box to do a minimum of processing per

smsbox

wapbox

bearerbox

Kannel

SMS center

WAP phone

HTTP server

Chapter 4 System Design

34

packet The bearer box also sends the UDP packets that the other boxes generate which

adds some more routing processing The wapboxes implement the WTP (Wireless

Transaction Protocol) and WSP (Wireless Session Protocol) layers These take HTTP-

like requests from the phones and make the actual HTTP requests to content servers

compress the responses and send them back to the terminals (Sessions are maintained to

make as much use of the limited radio bandwidth as possible)

4323 External interfaces of the gateway

The gateway has interfaces to three external agents

bull SMS centers using various protocols

bull HTTP servers to fetch WAP and SMS content and to push WAP Content The

pull protocol is HTTP push PAP

bull WAP phones implementing the WAP protocol stack and (for push) WAP Push

client

Figure 36 summarize kannel external interfaces

4324 Configuring the gateway

The bearerbox smsbox and wapbox are the main working modules of the gateway and

must be configured before configuring the gateway These three modules are controlled

by a configuration file that has wapbox smsbox and bearerbox groups

Configuring the PPG core group

We use two components the PPG core group and the PPG user group The PPG

core group is used to configure the PI interface(for more details configuration

variables refer to appendix c)

Chapter 4 System Design

35

Mobile telephone

network

The Internet

smsbox

wapbox

bearerbox

Kannel

HTTP

HTTP

HTTP server

Serving WML

files

HTTP server

Serving HTML

files

TCP

TCP

WAPSMS

SMSC

WAP phoneNetwork base station

Workstation used for http

administration

Figure 46 External interfaces of the gateway

4325 Administering the gateway through an HTTP interface

Kannel can be administered via an HTTP interface All commands are given as normal

HTTP queries so they can easily be given from command lines like this one

links -dump httpip-adressportshutdownpassword=yourchoice

But it is advantageous to have graphical user interface for gateway control so we have

designed GUI through http

Chapter 4 System Design

36

433 Short Message Service Centre (SMSC)

A SMSC is an essential component when sending a push message from an IP network to

a mobile device in the architecture supported by the components and devices It is used to

remove the TCPIP layer that the push is encapsulatedrdquo in It is also the entity that

identifies the end-point device When this is done it is also the SMSC that is responsible

for the processing and final message delivery to the device After the process of de-

encapsulation and resolution of the client identity there should not be any difference

between this message and a message that is originated locally from the operator itself

(like a SMS)

In this project we just use a virtual SMS center we try first to get connection to a real

one but our effort was worthless

Finally the following figure depicts the overall flowchart of the WAP push system

(figure 47)

Chapter 4 System Design

37

PI

PPG

Create PAP

HTTP Post

Message

processing

OTA

Connection

oriented

Sessionless Session

oriented

WTP Initiation

WAP clinet

Application

Create content

Create

capability

entity

Database

SMS center

NoYes

Figure 47 the complete flowchart of the system

38

Chapter Five

5 System implementation and results

51 Implementation

511 The Push Proxy Gateway

First of all the Kannel gateway have been compiled and installed using gcc (GNU C

Compiler) this stage go fine except the operating system required more components to

be pre-installed and will configured

Then with stages of configuration to the gateway (Appendix B) it was capable of working

as PPG Figure 51 below show the gateway when it starts

Figure 51 starting kannel gateway

Then a web based user interface had been created to provide an easy way to control the

gateway remotely Figure 52 and figure 53

39

Figure 52 GUI for gateway control

512 The Push initiator

Next the push initiator design had been implemented using java programming language

as in design phase the implementation is taken carefully to make a reusable component

that could be used by other developer

PushInitiator class (Appendix B) implements a simple push initiator which can be used

to create and send messages to a push proxy gateway (PPG)

The method sendPushMessage sends a push message via the PPG to the client The client

is identified by the address which is either the phone number (address type is PLMN) or

IP address The message content and its mime type are also given as arguments to the

method the other tow important method are

createPapMessage This method creates a Push Access Protocol (PAP) type message

40

createSiMessage This method is used to create a service indication (SI) type message

Figure 53 showing running kannel status

513 WAP site

Since this site will be built for testing purpose and making sure that the system is

functional we had not go deep in this section Just simple WAP site with tow page has

been crated

41

52 Service indication

When a SI was pushed to any of the emulator or Nokia phones it was received and

presented in the way it was supposed to as specified in the WAP standard as shown in

figures below This is a proof that the devices claiming to support WAP push do so and

the design is will working See figures 53 through 56

Figure 55 service indication

42

Figure 57 SI details

52 Service load

The emulator correctly receives and interpreted the SL push the same as all of Nokia

phones we have tested

When a SL was pushed to the Ericsson phones it was not presented in the specified way

figure 58 I think that it is because of security reasons The reason for this assumption is

that the phones only supports on or off as security in their push configuration The

emulator on the other hand presents SL correctly Finally the Siemens phone did seem to

interpret SL but the current software was not very consistent It did load the SL without

user interference in the specified way when the user already where having an active

session If the user was offline the phone interface presented a symbol on the display

and did not load the service until the user clicked on the symbol

43

Chapter Six

6 conclusion and future work

In this chapter we will provide the conclusions and proposed future work for interested

individuals

61 Conclusions

In this project a WAP push system has been successfully designed and implemented It

provides a way to partially overcome the limitations encountered when accessing the

World Wide Web using handsets After comparing the proposed project objectives with

those accomplished the main goals are seen to be met

Phones from different manufactures all differ from the WAP-standard in some

ways One of the most obvious differences is the resolution of the display

During the work it has been noticed that the WML pages must be quite small We

have also noticed that the support for tables and some other tags are a bit limited

Even though the WML standard is smaller than the HTML standard it is a little

more complicated to write correct WML pages The main conclusion is that WAP

works pretty well but the phones are a little non-stable

The push proxy gateway is configured and worked probably with virtual SMS

center and it is easy to switch to a real one

The system depends mainly on open sources (ie Linux and kannek)

The design and implementation of the push initiator work well with the kannel

gateway and it should work correctly with other gateways

Chapter 6 Conclusion

44

62 Further Work

The possibilities of wireless push are interesting enough that it has to be worth to know if

the security and conformance problems will be solved in WAP push If they are solved

and the technique is refined then there should be nothing to stop the great number of

services that will follow in its footsteps Therefore there is further work that should be

done and the most interesting parts are in my opinion these

621 Security Aspect

One of the problems today is that the phones supporting push does not have the detailed

security settings that a technique like this needs Therefore it would be interesting to look

into the possibility to add these without confusing the user I suggest furthering looking

into usability aspects of security in WAP Push for short

622 GPS integration possibility

This will provide location dependent delivery of WAP push it will have great

applications in telematic and ecommerce advertising

623 Conformance to Standards

An interesting project would be to examine if the main reason for the nonstandard

solutions in the existing WAP push software is the result of difficulties in

implementation Or if the main reason is that the manufacturers wants to provide

proprietary solutions A reason why one may want to know this is that if the problem is

depending on implementation problems then it might get better

45

Appendix A Abbreviations

CDMA Code Division Multiple Access

CO Cache Operation

DTD Document Type Definition

GSM Global System for Mobile

HTTP Hypertext Transfer Protocol

IP Internet Protocol

MSISDN Mobile Station International Subscriber Directory Number

OTA Over The Air

PAP Push Access Protocol

PushOTA Push Over The Air

PDA Personal Digital Assistant

P1 Push Initiator

PLMN Public Land Mobile Networks

PPG Push Proxy Gateway

SI Service Indication

SIA Session Initiation Application

SIR Session Initiation Request

SL Service Loading

SMPP Short Message Peer to Peer

SMS Short Message System

SMSC Short Message System Center

UCP Universal Computer Protocol

URI Uniform Resource Identifier

URL Uniform Resource Locator

UTC Universal Time Coordinated

WAP Wireless Application Protocol

WBXML WAP binary XML

WDP Wireless Datagram Protocol

WSP Wireless Session Protocol

WTLS Wireless Transport Layer Security

XML Extensible Mark-up Language

46

Appendix B Kannel gateway configurations

THIS IS A SAMPLE CONFIGURATION FOR KANNEL

group = core

admin-port = 13000

admin-password = admin

status-password = admin

admin-deny-ip =

admin-allow-ip = 127001172161455

log-file = tmpkannellog

log-level = 0

http-proxy-host = 172161411

http-proxy-port = 8080

http-proxy-exceptions = 127001

Smsbox related

smsbox-port = 13001

box-deny-ip =

box-allow-ip = 127001

bearerbox-host =localhost

Wapbox related

wapbox-port = 13002

udp-deny-ip =

udp-allow-ip = 127001

bearerbox-host =localhost

SMSC GSM

group = smsc

smsc = at

modemtype = auto

speed =9600

device = devttyS0

SMSC HTTP

group = smsc

smsc = http

system-type = kannel

port = 13016

connect-allow-ip = 127001

Appendix B

47

username = wappush

password = wappush

SMSBOX SETUP

group = smsbox

bearerbox-host = localhost

sendsms-port = 13013

sendsms-chars = 0123456789 +-

log-file = tmpsmsboxlog

log-level = 0

access-log = accesslog

white-list = 127001

black-list =

SEND-SMS USERS

group = sendsms-user

username = wappush

password = wappush

user-deny-ip =

user-allow-ip = 127001

PPG group

group = ppg

ppg-url = wappush

ppg-port = 8080

concurrent-pushes = 100

trusted-pi = true

users = 1024

service-name = ppg

ppg-smsbox-id = dlrbox

WAP PUSH USER

group = wap-push-user

wap-push-user = picom

ppg-username = wappush

ppg-password = wappush

allow-ip = localhost

48

Appendix C Selected Codes

Gateway Control Form

ltDOCTYPE HTML PUBLIC -W3CDTD HTML 32ENgt

lthtmlgt ltheadgt

lttitlegtGateway control formlttitlegt

ltheadgt

ltbody bgcolor=white text=black link=blue vlink=navy

alink=redgt

ltbase target=submitgt

ltscriptgt

function update_status()

if ( adminactionvalue == status )

adminaction = http + adminhostnamevalue +

+ adminportvalue + status +

adminstatusformatvalue

else

adminaction = http + adminhostnamevalue +

+ adminportvalue + + adminactionvalue

adminpasswordvalue = adminpasswordvalue

actiongovalue = GO GET +adminaction

ltscriptgt

lttable align=centergt

lttrgtltp align=centergtlth2gtGateway control

formlth2gtltpgtlttrgt

lttrgt lttdgtHostnamelttdgtlttdgtltinput type=text

name=adminhostname value=localhost

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPortlttdgtlttdgtltinput type=text

name=adminport value=13000

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPasswordlttdgtlttdgtltinput type=password

name=adminpassword value=

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtActionlttdgtlttdgtltselect name=adminaction

onChange=update_status()gt

ltoption value=statusgtStatusltoptiongt

ltoption value=suspendgtSuspendltoptiongt

ltoption value=isolategtIsolateltoptiongt

Appendix C

49

ltoption value=shutdowngtShutdownltoptiongt

ltoption value=resumegtResumeltoptiongt

ltselectgtlttdgt lttrgt

lttrgt lttdgtStatus Formatlttdgtlttdgtltselect

name=adminstatusformat onChange=update_status()gt

ltoption value=gthtmlltoptiongtltoption

value=txtgttxtltoptiongtltoption

value=xmlgtxmlltoptiongtltselectgtlttdgt lttrgt

ltform name=admin method=get

action=httplocalhost13000status

encoding=applicationx-www-formgt

ltinput type=hidden name=password value=gt

lttrgt

lttdgtGolttdgt

ltformgt

lttdgtltinput type=submit value=go name=actiongo

onClick=documentadminsubmit()gtlttdgt

lttrgt

lttablegt

ltbodygt

lthtmlgt

Push Initiator Class

import javanetURL

import javanetHttpURLConnection

import javaio

Class implements a simple push initiator It can be

used to create and send messages to push proxy

gateway (ppg)

public final class PushInitiator

xml version

private final static String XML_VERSION = ltxml

version=10gt

Push Access Protocol (PAP) document type

private final static String PAP_DOCTYPE =

Appendix C

50

ltDOCTYPE pap PUBLIC -WAPFORUMDTD PAP 10EN

httpwwwwapforumorgDTDpap_10dtd gt

content type of the push request multipart body

private final static String CONTENT_TYPE =

multipartrelated boundary=multipart-boundary

type=applicationxml

Service Indication (SI) document type

private static final String SI_DOCTYPE = ltDOCTYPE si

PUBLIC -WAPFORUMDTD SI 10EN +

httpwwwwapforumorgDTDsidtdgt

private static int pushId = 0

PPG url where the pap message is to be sent

private final URL ppgUrl

some push proxy gateways may also require the

authentication of the push initiator

For instance the push initiator may be required to

send an HTTP authorization header in each request

private final String authorization

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

public PushInitiator(URL ppgUrl) thisppgUrl =

ppgUrl

authorization = null

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

param authorization a ltcodegtStringltcodegt value

public PushInitiator(URL ppgUrl String authorization)

thisppgUrl = ppgUrl

Appendix C

51

thisauthorization = authorization

Systemoutprintln(Push Initiator created ppgUrl =

+ ppgUrl)

ltcodegtsendPushMessageltcodegt sends push message to

ppg

param clientAddress a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param message a ltcodegtStringltcodegt value

param mimeType a ltcodegtStringltcodegt value

exception Exception if an error occurs

public void sendPushMessage(String clientAddress

String addressTypeString message String mimeType)

throws Exception

HttpURLConnection http =

(HttpURLConnection)ppgUrlopenConnection()

String ppgServer = ppgUrlgetHost()

httpsetDoInput(true)

httpsetRequestProperty(Content-Type CONTENT_TYPE)

if(authorization = null)

if(authorizationtrim()equals())

httpsetRequestProperty(Authorization

authorization)

httpsetDoOutput(true)

PrintWriter out = new PrintWriter(new

BufferedOutputStream(httpgetOutputStream()))

outprintln(--multipart-boundary)

outprintln(Content-type applicationxml)

outprintln()

outprintln(createPapMessage(clientAddress

addressTypeppgServer genPushId() null))

outprintln()

outprintln(--multipart-boundary)

outprintln(Content-type + mimeType)

outprintln()

outprintln(message)

outprintln()

outprintln(--multipart-boundary--)

outflush()

outclose()

httpconnect()

Appendix C

52

finally read and debug the response received from

PPG

try

debugResponse(http)

catch (Exception e)

Systemerrprintln(Error in receiving the

response)

ltcodegtcreatePapMessageltcodegt creates a Push Access

Protocoltype message

param address a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param ppgServer a ltcodegtStringltcodegt value

param pushId a ltcodegtStringltcodegt value

param notificationTo a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createPapMessage(String address

String addressType String ppgServer String pushId

String notificationTo)

return XML_VERSION + n + PAP_DOCTYPE + n +

ltpap product-name=Mobile Zoo Push

Initiatorgtn +

ltpush-message push-id= + pushId +

(notificationTo = null request-notification-

to= + notificationTo ) + gtn +

ltaddress address-value=WAPPUSH= + address +

TYPE= + addressType +

+ ppgServer + gtn +

ltpush-messagegtnltpapgt

ltcodegtcreateSiMessageltcodegt creates a service

indication type message

param url a ltcodegtStringltcodegt value

param created a ltcodegtStringltcodegt value

param expires a ltcodegtStringltcodegt value

Appendix C

53

param message a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createSiMessage(String url

String sid String created String expires String

action String message)

return XML_VERSION + SI_DOCTYPE +

ltsigtn +

ltindication href= + url + +

(sid = null si-id= + sid + ) +

created = null created= + created +

) +

(action = null action= + action +

) +

(expires = null expires= + expires +

) + gt +

message +

ltindicationgtnltsigt

Debug response

param http a ltcodegtHttpURLConnectionltcodegt value

exception Exception if an error occurs

private void debugResponse(HttpURLConnection http)

throws Exception

Systemoutprintln(httpgetResponseMessage())

String headerName

int i=0

while((headerName = httpgetHeaderFieldKey(i++)) =

null)

Systemoutprintln(headerName + +

httpgetHeaderField(headerName))

Systemoutprintln()

InputStreamReader in = new InputStreamReader(new

BufferedInputStream(httpgetInputStream()))

int c

Appendix C

54

while((c = inread()) = -1)

Systemoutprint((char)c)

Systemoutprintln()

ltcodegtgenPushIdltcodegt generates an unique push id

return a ltcodegtStringltcodegt value

private String genPushId()

pushId = 100000

return SystemcurrentTimeMillis() + + pushId++

55

References

[1] Microsoft ldquoGetting Mobile Using WML and WAP to Display Web Sites on

Mobile Devicesrdquo

URL msdnmicrosoftcomen-uslibraryaa140117(office10)aspx accessed

on April 10 2008

[2] DALE BULBROOK ldquoWAPA Beginnerrsquos Guiderdquo OsborneMcGraw-Hill 2001

[3] WAP Forum Wireless Application Protocol Architecture Specification Access on

Jan 12 2008 Available

httpwww1wapforumorgtechdocumentsWAP-210-WAPArch-2006 07 12-apdf

[4] WAP Forum Push Architectural Overview access on (2008 February 3) Available

httpwww1wapforumorgtechdocumentsWAP-250-PushArchOverview-2007 04

03-apdf

[5] Service indication PDF access on 62008 Available

httpwwww3orgTRhtml401structlinkshtml

[6] WAP Push Technology (openwave) PDF access on (2008 April) Available

URL httpwwwopenwavorg

[7] Web site (httpwwwwapforumorgwhatcopyrighthtm) access on May 2008

[8] ldquoWAP Push Proxy Gateway Specificationrdquo WAP Forum access on 16-August-

2007URI httpwwwwapforumorgPDF

[9] WAP Forum Access on (2008 MAY 31) WAP Service Indication Specification

Available httpwww1wapforumorgtechdocumentsWAP-167-ServiceInd-200507

31-apdf

  • odc_fpwmlandwap_topic3
  • N100E3
  • 21
  • 5

Chapter 4 System Design

29

43 Design of system Modules

Following sections of this chapter present a description and design of the system modules

with accompanying graphical representation

431 Push Initiator (PI)

The PI is the first logical component in the WAP Push scenario and therefore the

originator of the push message There are different kinds of PIs One example is an

automated script another one is a semi automated server version written in an applicable

scripting language supporting server side interaction

A push message is sent as an HTTP POST to the Push Proxy Gateway The POST will be

a multipart XML document with the first part being the control entity (Push Access

Protocol) the second part being the content entity (either a Service Indication or a

Service Load) and the third part being the capability entity

HTTP Post

Capability entity

Content entity (SISL)

Control entity (PAP)

Figure 44 architecture of the push message

Chapter 4 System Design

30

4311 Control entity

This part of the push contains the basic information and fields The fields can include

recipient address expiry time bearer type delivery attempt time and a URL to which a

response is to be sent if delivery confirmation is requested by the push initiator

PAP is the protocol used in WAP Push framework for specifying control information and

content that is to be pushed to a client via a Push Proxy Gateway (PPG) A Push Initiator

(PI) triggers push message processing The Push initiator class (Appendix B) of this

design shows how to generate PAP messages

The address of the used PPG should be given as an initialization parameter of the

application (ldquoppg-urlrdquo see Appendix B) This design also provides an implementation

that can be used in a special case when ldquoIPv4 IPv6rdquo type client addressing is applied and

when toolkit is used All other cases including the use of phone numbers (ldquoPLMNrdquo type

address) in sending push messages are considered

The PAP XML contains at the minimum a ltpapgt element a ltpush-messagegt

element and an ltaddressgt element

The important parts of this PAP message are the address value and type The value is

typically a MSISDN and type indicates whether to send to a MSISDN (typical case) or to

an IP Address The TYPE is almost always MSISDN as the Push Initiator (PI) will not

typically have the Mobile Stations IP address - which is generally dynamic

4312 Content entity

This is the actual data that is received by the mobile device The various content types

are Service Indication (SI) Service Load (SL) and Cache Operation (CO) in our project

we will just deal with SI and SL

The SI notifies a client about an external event by inviting the client to interact with it In

other words it informs a client about a service More precisely it sends a message that

Chapter 4 System Design

31

informs the client of a Uniform Resource Identifier (URI) where the client can access the

service

An important attribute of SI is the action attribute it may contain the action to be taken

when the client receives the SI There are two groups that the action attributes can be

divided into

First we have delete and signalmdashnone both of them is used because of their side

effects Ie with delete you take away all SIs with the same si-id as the deletion pushrdquo

including itself and with signal-none you either do nothing or you pay regard to the

info element in that push

The other group consists of signal-low signal-medium and signal-high These

attributes are all used to set the rules for the presentation in the terminal device

o Signal-low

The SI must be postponed without user intervention

o Signal-medium

The SI must be presented as soon as the implementation allows that to be carried out

without disturbing the user (Signal-medium is the value that will be used if none is

specified)

o Signal-high

The SI must be presented as soon as the implementation allows that to be carried out

without disturbing the user or earlier if it seems appropriate (This decision may for

instance be based on user preference settings)

This is the different functionalities supported by the SI we concidered

Expiration

Replacement

Deletion

Chapter 4 System Design

32

Handling of out of order delivery

Handling of information specified in the info element

A PUSH Service Indication (SI) contains at a minimum an ltsigt element and a

ltindicationgt element SL donrsquot differ so much from SI

4313 Capability entity

This entity determines the type of mobile device that is to be served This is determined

by WAP user agent profiling The sender can indicate the hardware vendor and browser

version and type of the intended recipients This capability entity is then matched at the

PPG to see which devices are compatible with the requested capability If there is a

match the content is delivered by the PPG to that specific device

Now a day most devices are compatible with WAP so we donrsquot need to create this entity

more precisely it is optional

After the push has been created in the PI it is up to the system to deliver it to the defined

destination In this system the different responsible entities are the PPG and the SMSC

Both of these two different entities are running on same server but it is only the

configuration of the SMSC that is out of my control since it is run by the operator and is

not controllable in my lab environment

432 Push Proxy Gateway (PPG)

There are various commercial WAP gateways available on the market that are quite

expensive Kannel on the other hand is an open source gateway one doesnrsquot need to pay

for it in addition one can edit the source code himself and construct his own customized

gateway Because Kannel is being developed on Linux systems (RedHat and Debian) it

can be smoothly ported to other UNIX-like operating systems

4321 Kannel gateway architecture

The gateway divides the processing load between the following three hosts

Chapter 4 System Design

33

The bearer box which connects to the SMS (Short Message Service) centers and

or CSD (Circuit Switched Data) routers providing a unified interface to them for

the wapbox The bearer box does this by implementing the WDP (Wireless

Datagram Protocol) layer of the WAP stack

The smsbox implements the rest of the SMS gateway functionality It receives

textual SMS messages from the bearerbox and interprets them as service

requests and responds to them in the appropriate way

The wapbox which hosts the upper layers of the WAP stack Each session and its

transactions are handled by the same wapbox (see figure 35)

1Figure 45 divisions of duties in kannel

4322 Working of the gateway

The bearer box receives UDP (User Datagram Protocol) packets from CSD routers

inspects them to see whether they are WAP packets if so then it will routes them to the

WAP box This simple design allows the bearer box to do a minimum of processing per

smsbox

wapbox

bearerbox

Kannel

SMS center

WAP phone

HTTP server

Chapter 4 System Design

34

packet The bearer box also sends the UDP packets that the other boxes generate which

adds some more routing processing The wapboxes implement the WTP (Wireless

Transaction Protocol) and WSP (Wireless Session Protocol) layers These take HTTP-

like requests from the phones and make the actual HTTP requests to content servers

compress the responses and send them back to the terminals (Sessions are maintained to

make as much use of the limited radio bandwidth as possible)

4323 External interfaces of the gateway

The gateway has interfaces to three external agents

bull SMS centers using various protocols

bull HTTP servers to fetch WAP and SMS content and to push WAP Content The

pull protocol is HTTP push PAP

bull WAP phones implementing the WAP protocol stack and (for push) WAP Push

client

Figure 36 summarize kannel external interfaces

4324 Configuring the gateway

The bearerbox smsbox and wapbox are the main working modules of the gateway and

must be configured before configuring the gateway These three modules are controlled

by a configuration file that has wapbox smsbox and bearerbox groups

Configuring the PPG core group

We use two components the PPG core group and the PPG user group The PPG

core group is used to configure the PI interface(for more details configuration

variables refer to appendix c)

Chapter 4 System Design

35

Mobile telephone

network

The Internet

smsbox

wapbox

bearerbox

Kannel

HTTP

HTTP

HTTP server

Serving WML

files

HTTP server

Serving HTML

files

TCP

TCP

WAPSMS

SMSC

WAP phoneNetwork base station

Workstation used for http

administration

Figure 46 External interfaces of the gateway

4325 Administering the gateway through an HTTP interface

Kannel can be administered via an HTTP interface All commands are given as normal

HTTP queries so they can easily be given from command lines like this one

links -dump httpip-adressportshutdownpassword=yourchoice

But it is advantageous to have graphical user interface for gateway control so we have

designed GUI through http

Chapter 4 System Design

36

433 Short Message Service Centre (SMSC)

A SMSC is an essential component when sending a push message from an IP network to

a mobile device in the architecture supported by the components and devices It is used to

remove the TCPIP layer that the push is encapsulatedrdquo in It is also the entity that

identifies the end-point device When this is done it is also the SMSC that is responsible

for the processing and final message delivery to the device After the process of de-

encapsulation and resolution of the client identity there should not be any difference

between this message and a message that is originated locally from the operator itself

(like a SMS)

In this project we just use a virtual SMS center we try first to get connection to a real

one but our effort was worthless

Finally the following figure depicts the overall flowchart of the WAP push system

(figure 47)

Chapter 4 System Design

37

PI

PPG

Create PAP

HTTP Post

Message

processing

OTA

Connection

oriented

Sessionless Session

oriented

WTP Initiation

WAP clinet

Application

Create content

Create

capability

entity

Database

SMS center

NoYes

Figure 47 the complete flowchart of the system

38

Chapter Five

5 System implementation and results

51 Implementation

511 The Push Proxy Gateway

First of all the Kannel gateway have been compiled and installed using gcc (GNU C

Compiler) this stage go fine except the operating system required more components to

be pre-installed and will configured

Then with stages of configuration to the gateway (Appendix B) it was capable of working

as PPG Figure 51 below show the gateway when it starts

Figure 51 starting kannel gateway

Then a web based user interface had been created to provide an easy way to control the

gateway remotely Figure 52 and figure 53

39

Figure 52 GUI for gateway control

512 The Push initiator

Next the push initiator design had been implemented using java programming language

as in design phase the implementation is taken carefully to make a reusable component

that could be used by other developer

PushInitiator class (Appendix B) implements a simple push initiator which can be used

to create and send messages to a push proxy gateway (PPG)

The method sendPushMessage sends a push message via the PPG to the client The client

is identified by the address which is either the phone number (address type is PLMN) or

IP address The message content and its mime type are also given as arguments to the

method the other tow important method are

createPapMessage This method creates a Push Access Protocol (PAP) type message

40

createSiMessage This method is used to create a service indication (SI) type message

Figure 53 showing running kannel status

513 WAP site

Since this site will be built for testing purpose and making sure that the system is

functional we had not go deep in this section Just simple WAP site with tow page has

been crated

41

52 Service indication

When a SI was pushed to any of the emulator or Nokia phones it was received and

presented in the way it was supposed to as specified in the WAP standard as shown in

figures below This is a proof that the devices claiming to support WAP push do so and

the design is will working See figures 53 through 56

Figure 55 service indication

42

Figure 57 SI details

52 Service load

The emulator correctly receives and interpreted the SL push the same as all of Nokia

phones we have tested

When a SL was pushed to the Ericsson phones it was not presented in the specified way

figure 58 I think that it is because of security reasons The reason for this assumption is

that the phones only supports on or off as security in their push configuration The

emulator on the other hand presents SL correctly Finally the Siemens phone did seem to

interpret SL but the current software was not very consistent It did load the SL without

user interference in the specified way when the user already where having an active

session If the user was offline the phone interface presented a symbol on the display

and did not load the service until the user clicked on the symbol

43

Chapter Six

6 conclusion and future work

In this chapter we will provide the conclusions and proposed future work for interested

individuals

61 Conclusions

In this project a WAP push system has been successfully designed and implemented It

provides a way to partially overcome the limitations encountered when accessing the

World Wide Web using handsets After comparing the proposed project objectives with

those accomplished the main goals are seen to be met

Phones from different manufactures all differ from the WAP-standard in some

ways One of the most obvious differences is the resolution of the display

During the work it has been noticed that the WML pages must be quite small We

have also noticed that the support for tables and some other tags are a bit limited

Even though the WML standard is smaller than the HTML standard it is a little

more complicated to write correct WML pages The main conclusion is that WAP

works pretty well but the phones are a little non-stable

The push proxy gateway is configured and worked probably with virtual SMS

center and it is easy to switch to a real one

The system depends mainly on open sources (ie Linux and kannek)

The design and implementation of the push initiator work well with the kannel

gateway and it should work correctly with other gateways

Chapter 6 Conclusion

44

62 Further Work

The possibilities of wireless push are interesting enough that it has to be worth to know if

the security and conformance problems will be solved in WAP push If they are solved

and the technique is refined then there should be nothing to stop the great number of

services that will follow in its footsteps Therefore there is further work that should be

done and the most interesting parts are in my opinion these

621 Security Aspect

One of the problems today is that the phones supporting push does not have the detailed

security settings that a technique like this needs Therefore it would be interesting to look

into the possibility to add these without confusing the user I suggest furthering looking

into usability aspects of security in WAP Push for short

622 GPS integration possibility

This will provide location dependent delivery of WAP push it will have great

applications in telematic and ecommerce advertising

623 Conformance to Standards

An interesting project would be to examine if the main reason for the nonstandard

solutions in the existing WAP push software is the result of difficulties in

implementation Or if the main reason is that the manufacturers wants to provide

proprietary solutions A reason why one may want to know this is that if the problem is

depending on implementation problems then it might get better

45

Appendix A Abbreviations

CDMA Code Division Multiple Access

CO Cache Operation

DTD Document Type Definition

GSM Global System for Mobile

HTTP Hypertext Transfer Protocol

IP Internet Protocol

MSISDN Mobile Station International Subscriber Directory Number

OTA Over The Air

PAP Push Access Protocol

PushOTA Push Over The Air

PDA Personal Digital Assistant

P1 Push Initiator

PLMN Public Land Mobile Networks

PPG Push Proxy Gateway

SI Service Indication

SIA Session Initiation Application

SIR Session Initiation Request

SL Service Loading

SMPP Short Message Peer to Peer

SMS Short Message System

SMSC Short Message System Center

UCP Universal Computer Protocol

URI Uniform Resource Identifier

URL Uniform Resource Locator

UTC Universal Time Coordinated

WAP Wireless Application Protocol

WBXML WAP binary XML

WDP Wireless Datagram Protocol

WSP Wireless Session Protocol

WTLS Wireless Transport Layer Security

XML Extensible Mark-up Language

46

Appendix B Kannel gateway configurations

THIS IS A SAMPLE CONFIGURATION FOR KANNEL

group = core

admin-port = 13000

admin-password = admin

status-password = admin

admin-deny-ip =

admin-allow-ip = 127001172161455

log-file = tmpkannellog

log-level = 0

http-proxy-host = 172161411

http-proxy-port = 8080

http-proxy-exceptions = 127001

Smsbox related

smsbox-port = 13001

box-deny-ip =

box-allow-ip = 127001

bearerbox-host =localhost

Wapbox related

wapbox-port = 13002

udp-deny-ip =

udp-allow-ip = 127001

bearerbox-host =localhost

SMSC GSM

group = smsc

smsc = at

modemtype = auto

speed =9600

device = devttyS0

SMSC HTTP

group = smsc

smsc = http

system-type = kannel

port = 13016

connect-allow-ip = 127001

Appendix B

47

username = wappush

password = wappush

SMSBOX SETUP

group = smsbox

bearerbox-host = localhost

sendsms-port = 13013

sendsms-chars = 0123456789 +-

log-file = tmpsmsboxlog

log-level = 0

access-log = accesslog

white-list = 127001

black-list =

SEND-SMS USERS

group = sendsms-user

username = wappush

password = wappush

user-deny-ip =

user-allow-ip = 127001

PPG group

group = ppg

ppg-url = wappush

ppg-port = 8080

concurrent-pushes = 100

trusted-pi = true

users = 1024

service-name = ppg

ppg-smsbox-id = dlrbox

WAP PUSH USER

group = wap-push-user

wap-push-user = picom

ppg-username = wappush

ppg-password = wappush

allow-ip = localhost

48

Appendix C Selected Codes

Gateway Control Form

ltDOCTYPE HTML PUBLIC -W3CDTD HTML 32ENgt

lthtmlgt ltheadgt

lttitlegtGateway control formlttitlegt

ltheadgt

ltbody bgcolor=white text=black link=blue vlink=navy

alink=redgt

ltbase target=submitgt

ltscriptgt

function update_status()

if ( adminactionvalue == status )

adminaction = http + adminhostnamevalue +

+ adminportvalue + status +

adminstatusformatvalue

else

adminaction = http + adminhostnamevalue +

+ adminportvalue + + adminactionvalue

adminpasswordvalue = adminpasswordvalue

actiongovalue = GO GET +adminaction

ltscriptgt

lttable align=centergt

lttrgtltp align=centergtlth2gtGateway control

formlth2gtltpgtlttrgt

lttrgt lttdgtHostnamelttdgtlttdgtltinput type=text

name=adminhostname value=localhost

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPortlttdgtlttdgtltinput type=text

name=adminport value=13000

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPasswordlttdgtlttdgtltinput type=password

name=adminpassword value=

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtActionlttdgtlttdgtltselect name=adminaction

onChange=update_status()gt

ltoption value=statusgtStatusltoptiongt

ltoption value=suspendgtSuspendltoptiongt

ltoption value=isolategtIsolateltoptiongt

Appendix C

49

ltoption value=shutdowngtShutdownltoptiongt

ltoption value=resumegtResumeltoptiongt

ltselectgtlttdgt lttrgt

lttrgt lttdgtStatus Formatlttdgtlttdgtltselect

name=adminstatusformat onChange=update_status()gt

ltoption value=gthtmlltoptiongtltoption

value=txtgttxtltoptiongtltoption

value=xmlgtxmlltoptiongtltselectgtlttdgt lttrgt

ltform name=admin method=get

action=httplocalhost13000status

encoding=applicationx-www-formgt

ltinput type=hidden name=password value=gt

lttrgt

lttdgtGolttdgt

ltformgt

lttdgtltinput type=submit value=go name=actiongo

onClick=documentadminsubmit()gtlttdgt

lttrgt

lttablegt

ltbodygt

lthtmlgt

Push Initiator Class

import javanetURL

import javanetHttpURLConnection

import javaio

Class implements a simple push initiator It can be

used to create and send messages to push proxy

gateway (ppg)

public final class PushInitiator

xml version

private final static String XML_VERSION = ltxml

version=10gt

Push Access Protocol (PAP) document type

private final static String PAP_DOCTYPE =

Appendix C

50

ltDOCTYPE pap PUBLIC -WAPFORUMDTD PAP 10EN

httpwwwwapforumorgDTDpap_10dtd gt

content type of the push request multipart body

private final static String CONTENT_TYPE =

multipartrelated boundary=multipart-boundary

type=applicationxml

Service Indication (SI) document type

private static final String SI_DOCTYPE = ltDOCTYPE si

PUBLIC -WAPFORUMDTD SI 10EN +

httpwwwwapforumorgDTDsidtdgt

private static int pushId = 0

PPG url where the pap message is to be sent

private final URL ppgUrl

some push proxy gateways may also require the

authentication of the push initiator

For instance the push initiator may be required to

send an HTTP authorization header in each request

private final String authorization

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

public PushInitiator(URL ppgUrl) thisppgUrl =

ppgUrl

authorization = null

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

param authorization a ltcodegtStringltcodegt value

public PushInitiator(URL ppgUrl String authorization)

thisppgUrl = ppgUrl

Appendix C

51

thisauthorization = authorization

Systemoutprintln(Push Initiator created ppgUrl =

+ ppgUrl)

ltcodegtsendPushMessageltcodegt sends push message to

ppg

param clientAddress a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param message a ltcodegtStringltcodegt value

param mimeType a ltcodegtStringltcodegt value

exception Exception if an error occurs

public void sendPushMessage(String clientAddress

String addressTypeString message String mimeType)

throws Exception

HttpURLConnection http =

(HttpURLConnection)ppgUrlopenConnection()

String ppgServer = ppgUrlgetHost()

httpsetDoInput(true)

httpsetRequestProperty(Content-Type CONTENT_TYPE)

if(authorization = null)

if(authorizationtrim()equals())

httpsetRequestProperty(Authorization

authorization)

httpsetDoOutput(true)

PrintWriter out = new PrintWriter(new

BufferedOutputStream(httpgetOutputStream()))

outprintln(--multipart-boundary)

outprintln(Content-type applicationxml)

outprintln()

outprintln(createPapMessage(clientAddress

addressTypeppgServer genPushId() null))

outprintln()

outprintln(--multipart-boundary)

outprintln(Content-type + mimeType)

outprintln()

outprintln(message)

outprintln()

outprintln(--multipart-boundary--)

outflush()

outclose()

httpconnect()

Appendix C

52

finally read and debug the response received from

PPG

try

debugResponse(http)

catch (Exception e)

Systemerrprintln(Error in receiving the

response)

ltcodegtcreatePapMessageltcodegt creates a Push Access

Protocoltype message

param address a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param ppgServer a ltcodegtStringltcodegt value

param pushId a ltcodegtStringltcodegt value

param notificationTo a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createPapMessage(String address

String addressType String ppgServer String pushId

String notificationTo)

return XML_VERSION + n + PAP_DOCTYPE + n +

ltpap product-name=Mobile Zoo Push

Initiatorgtn +

ltpush-message push-id= + pushId +

(notificationTo = null request-notification-

to= + notificationTo ) + gtn +

ltaddress address-value=WAPPUSH= + address +

TYPE= + addressType +

+ ppgServer + gtn +

ltpush-messagegtnltpapgt

ltcodegtcreateSiMessageltcodegt creates a service

indication type message

param url a ltcodegtStringltcodegt value

param created a ltcodegtStringltcodegt value

param expires a ltcodegtStringltcodegt value

Appendix C

53

param message a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createSiMessage(String url

String sid String created String expires String

action String message)

return XML_VERSION + SI_DOCTYPE +

ltsigtn +

ltindication href= + url + +

(sid = null si-id= + sid + ) +

created = null created= + created +

) +

(action = null action= + action +

) +

(expires = null expires= + expires +

) + gt +

message +

ltindicationgtnltsigt

Debug response

param http a ltcodegtHttpURLConnectionltcodegt value

exception Exception if an error occurs

private void debugResponse(HttpURLConnection http)

throws Exception

Systemoutprintln(httpgetResponseMessage())

String headerName

int i=0

while((headerName = httpgetHeaderFieldKey(i++)) =

null)

Systemoutprintln(headerName + +

httpgetHeaderField(headerName))

Systemoutprintln()

InputStreamReader in = new InputStreamReader(new

BufferedInputStream(httpgetInputStream()))

int c

Appendix C

54

while((c = inread()) = -1)

Systemoutprint((char)c)

Systemoutprintln()

ltcodegtgenPushIdltcodegt generates an unique push id

return a ltcodegtStringltcodegt value

private String genPushId()

pushId = 100000

return SystemcurrentTimeMillis() + + pushId++

55

References

[1] Microsoft ldquoGetting Mobile Using WML and WAP to Display Web Sites on

Mobile Devicesrdquo

URL msdnmicrosoftcomen-uslibraryaa140117(office10)aspx accessed

on April 10 2008

[2] DALE BULBROOK ldquoWAPA Beginnerrsquos Guiderdquo OsborneMcGraw-Hill 2001

[3] WAP Forum Wireless Application Protocol Architecture Specification Access on

Jan 12 2008 Available

httpwww1wapforumorgtechdocumentsWAP-210-WAPArch-2006 07 12-apdf

[4] WAP Forum Push Architectural Overview access on (2008 February 3) Available

httpwww1wapforumorgtechdocumentsWAP-250-PushArchOverview-2007 04

03-apdf

[5] Service indication PDF access on 62008 Available

httpwwww3orgTRhtml401structlinkshtml

[6] WAP Push Technology (openwave) PDF access on (2008 April) Available

URL httpwwwopenwavorg

[7] Web site (httpwwwwapforumorgwhatcopyrighthtm) access on May 2008

[8] ldquoWAP Push Proxy Gateway Specificationrdquo WAP Forum access on 16-August-

2007URI httpwwwwapforumorgPDF

[9] WAP Forum Access on (2008 MAY 31) WAP Service Indication Specification

Available httpwww1wapforumorgtechdocumentsWAP-167-ServiceInd-200507

31-apdf

  • odc_fpwmlandwap_topic3
  • N100E3
  • 21
  • 5

Chapter 4 System Design

30

4311 Control entity

This part of the push contains the basic information and fields The fields can include

recipient address expiry time bearer type delivery attempt time and a URL to which a

response is to be sent if delivery confirmation is requested by the push initiator

PAP is the protocol used in WAP Push framework for specifying control information and

content that is to be pushed to a client via a Push Proxy Gateway (PPG) A Push Initiator

(PI) triggers push message processing The Push initiator class (Appendix B) of this

design shows how to generate PAP messages

The address of the used PPG should be given as an initialization parameter of the

application (ldquoppg-urlrdquo see Appendix B) This design also provides an implementation

that can be used in a special case when ldquoIPv4 IPv6rdquo type client addressing is applied and

when toolkit is used All other cases including the use of phone numbers (ldquoPLMNrdquo type

address) in sending push messages are considered

The PAP XML contains at the minimum a ltpapgt element a ltpush-messagegt

element and an ltaddressgt element

The important parts of this PAP message are the address value and type The value is

typically a MSISDN and type indicates whether to send to a MSISDN (typical case) or to

an IP Address The TYPE is almost always MSISDN as the Push Initiator (PI) will not

typically have the Mobile Stations IP address - which is generally dynamic

4312 Content entity

This is the actual data that is received by the mobile device The various content types

are Service Indication (SI) Service Load (SL) and Cache Operation (CO) in our project

we will just deal with SI and SL

The SI notifies a client about an external event by inviting the client to interact with it In

other words it informs a client about a service More precisely it sends a message that

Chapter 4 System Design

31

informs the client of a Uniform Resource Identifier (URI) where the client can access the

service

An important attribute of SI is the action attribute it may contain the action to be taken

when the client receives the SI There are two groups that the action attributes can be

divided into

First we have delete and signalmdashnone both of them is used because of their side

effects Ie with delete you take away all SIs with the same si-id as the deletion pushrdquo

including itself and with signal-none you either do nothing or you pay regard to the

info element in that push

The other group consists of signal-low signal-medium and signal-high These

attributes are all used to set the rules for the presentation in the terminal device

o Signal-low

The SI must be postponed without user intervention

o Signal-medium

The SI must be presented as soon as the implementation allows that to be carried out

without disturbing the user (Signal-medium is the value that will be used if none is

specified)

o Signal-high

The SI must be presented as soon as the implementation allows that to be carried out

without disturbing the user or earlier if it seems appropriate (This decision may for

instance be based on user preference settings)

This is the different functionalities supported by the SI we concidered

Expiration

Replacement

Deletion

Chapter 4 System Design

32

Handling of out of order delivery

Handling of information specified in the info element

A PUSH Service Indication (SI) contains at a minimum an ltsigt element and a

ltindicationgt element SL donrsquot differ so much from SI

4313 Capability entity

This entity determines the type of mobile device that is to be served This is determined

by WAP user agent profiling The sender can indicate the hardware vendor and browser

version and type of the intended recipients This capability entity is then matched at the

PPG to see which devices are compatible with the requested capability If there is a

match the content is delivered by the PPG to that specific device

Now a day most devices are compatible with WAP so we donrsquot need to create this entity

more precisely it is optional

After the push has been created in the PI it is up to the system to deliver it to the defined

destination In this system the different responsible entities are the PPG and the SMSC

Both of these two different entities are running on same server but it is only the

configuration of the SMSC that is out of my control since it is run by the operator and is

not controllable in my lab environment

432 Push Proxy Gateway (PPG)

There are various commercial WAP gateways available on the market that are quite

expensive Kannel on the other hand is an open source gateway one doesnrsquot need to pay

for it in addition one can edit the source code himself and construct his own customized

gateway Because Kannel is being developed on Linux systems (RedHat and Debian) it

can be smoothly ported to other UNIX-like operating systems

4321 Kannel gateway architecture

The gateway divides the processing load between the following three hosts

Chapter 4 System Design

33

The bearer box which connects to the SMS (Short Message Service) centers and

or CSD (Circuit Switched Data) routers providing a unified interface to them for

the wapbox The bearer box does this by implementing the WDP (Wireless

Datagram Protocol) layer of the WAP stack

The smsbox implements the rest of the SMS gateway functionality It receives

textual SMS messages from the bearerbox and interprets them as service

requests and responds to them in the appropriate way

The wapbox which hosts the upper layers of the WAP stack Each session and its

transactions are handled by the same wapbox (see figure 35)

1Figure 45 divisions of duties in kannel

4322 Working of the gateway

The bearer box receives UDP (User Datagram Protocol) packets from CSD routers

inspects them to see whether they are WAP packets if so then it will routes them to the

WAP box This simple design allows the bearer box to do a minimum of processing per

smsbox

wapbox

bearerbox

Kannel

SMS center

WAP phone

HTTP server

Chapter 4 System Design

34

packet The bearer box also sends the UDP packets that the other boxes generate which

adds some more routing processing The wapboxes implement the WTP (Wireless

Transaction Protocol) and WSP (Wireless Session Protocol) layers These take HTTP-

like requests from the phones and make the actual HTTP requests to content servers

compress the responses and send them back to the terminals (Sessions are maintained to

make as much use of the limited radio bandwidth as possible)

4323 External interfaces of the gateway

The gateway has interfaces to three external agents

bull SMS centers using various protocols

bull HTTP servers to fetch WAP and SMS content and to push WAP Content The

pull protocol is HTTP push PAP

bull WAP phones implementing the WAP protocol stack and (for push) WAP Push

client

Figure 36 summarize kannel external interfaces

4324 Configuring the gateway

The bearerbox smsbox and wapbox are the main working modules of the gateway and

must be configured before configuring the gateway These three modules are controlled

by a configuration file that has wapbox smsbox and bearerbox groups

Configuring the PPG core group

We use two components the PPG core group and the PPG user group The PPG

core group is used to configure the PI interface(for more details configuration

variables refer to appendix c)

Chapter 4 System Design

35

Mobile telephone

network

The Internet

smsbox

wapbox

bearerbox

Kannel

HTTP

HTTP

HTTP server

Serving WML

files

HTTP server

Serving HTML

files

TCP

TCP

WAPSMS

SMSC

WAP phoneNetwork base station

Workstation used for http

administration

Figure 46 External interfaces of the gateway

4325 Administering the gateway through an HTTP interface

Kannel can be administered via an HTTP interface All commands are given as normal

HTTP queries so they can easily be given from command lines like this one

links -dump httpip-adressportshutdownpassword=yourchoice

But it is advantageous to have graphical user interface for gateway control so we have

designed GUI through http

Chapter 4 System Design

36

433 Short Message Service Centre (SMSC)

A SMSC is an essential component when sending a push message from an IP network to

a mobile device in the architecture supported by the components and devices It is used to

remove the TCPIP layer that the push is encapsulatedrdquo in It is also the entity that

identifies the end-point device When this is done it is also the SMSC that is responsible

for the processing and final message delivery to the device After the process of de-

encapsulation and resolution of the client identity there should not be any difference

between this message and a message that is originated locally from the operator itself

(like a SMS)

In this project we just use a virtual SMS center we try first to get connection to a real

one but our effort was worthless

Finally the following figure depicts the overall flowchart of the WAP push system

(figure 47)

Chapter 4 System Design

37

PI

PPG

Create PAP

HTTP Post

Message

processing

OTA

Connection

oriented

Sessionless Session

oriented

WTP Initiation

WAP clinet

Application

Create content

Create

capability

entity

Database

SMS center

NoYes

Figure 47 the complete flowchart of the system

38

Chapter Five

5 System implementation and results

51 Implementation

511 The Push Proxy Gateway

First of all the Kannel gateway have been compiled and installed using gcc (GNU C

Compiler) this stage go fine except the operating system required more components to

be pre-installed and will configured

Then with stages of configuration to the gateway (Appendix B) it was capable of working

as PPG Figure 51 below show the gateway when it starts

Figure 51 starting kannel gateway

Then a web based user interface had been created to provide an easy way to control the

gateway remotely Figure 52 and figure 53

39

Figure 52 GUI for gateway control

512 The Push initiator

Next the push initiator design had been implemented using java programming language

as in design phase the implementation is taken carefully to make a reusable component

that could be used by other developer

PushInitiator class (Appendix B) implements a simple push initiator which can be used

to create and send messages to a push proxy gateway (PPG)

The method sendPushMessage sends a push message via the PPG to the client The client

is identified by the address which is either the phone number (address type is PLMN) or

IP address The message content and its mime type are also given as arguments to the

method the other tow important method are

createPapMessage This method creates a Push Access Protocol (PAP) type message

40

createSiMessage This method is used to create a service indication (SI) type message

Figure 53 showing running kannel status

513 WAP site

Since this site will be built for testing purpose and making sure that the system is

functional we had not go deep in this section Just simple WAP site with tow page has

been crated

41

52 Service indication

When a SI was pushed to any of the emulator or Nokia phones it was received and

presented in the way it was supposed to as specified in the WAP standard as shown in

figures below This is a proof that the devices claiming to support WAP push do so and

the design is will working See figures 53 through 56

Figure 55 service indication

42

Figure 57 SI details

52 Service load

The emulator correctly receives and interpreted the SL push the same as all of Nokia

phones we have tested

When a SL was pushed to the Ericsson phones it was not presented in the specified way

figure 58 I think that it is because of security reasons The reason for this assumption is

that the phones only supports on or off as security in their push configuration The

emulator on the other hand presents SL correctly Finally the Siemens phone did seem to

interpret SL but the current software was not very consistent It did load the SL without

user interference in the specified way when the user already where having an active

session If the user was offline the phone interface presented a symbol on the display

and did not load the service until the user clicked on the symbol

43

Chapter Six

6 conclusion and future work

In this chapter we will provide the conclusions and proposed future work for interested

individuals

61 Conclusions

In this project a WAP push system has been successfully designed and implemented It

provides a way to partially overcome the limitations encountered when accessing the

World Wide Web using handsets After comparing the proposed project objectives with

those accomplished the main goals are seen to be met

Phones from different manufactures all differ from the WAP-standard in some

ways One of the most obvious differences is the resolution of the display

During the work it has been noticed that the WML pages must be quite small We

have also noticed that the support for tables and some other tags are a bit limited

Even though the WML standard is smaller than the HTML standard it is a little

more complicated to write correct WML pages The main conclusion is that WAP

works pretty well but the phones are a little non-stable

The push proxy gateway is configured and worked probably with virtual SMS

center and it is easy to switch to a real one

The system depends mainly on open sources (ie Linux and kannek)

The design and implementation of the push initiator work well with the kannel

gateway and it should work correctly with other gateways

Chapter 6 Conclusion

44

62 Further Work

The possibilities of wireless push are interesting enough that it has to be worth to know if

the security and conformance problems will be solved in WAP push If they are solved

and the technique is refined then there should be nothing to stop the great number of

services that will follow in its footsteps Therefore there is further work that should be

done and the most interesting parts are in my opinion these

621 Security Aspect

One of the problems today is that the phones supporting push does not have the detailed

security settings that a technique like this needs Therefore it would be interesting to look

into the possibility to add these without confusing the user I suggest furthering looking

into usability aspects of security in WAP Push for short

622 GPS integration possibility

This will provide location dependent delivery of WAP push it will have great

applications in telematic and ecommerce advertising

623 Conformance to Standards

An interesting project would be to examine if the main reason for the nonstandard

solutions in the existing WAP push software is the result of difficulties in

implementation Or if the main reason is that the manufacturers wants to provide

proprietary solutions A reason why one may want to know this is that if the problem is

depending on implementation problems then it might get better

45

Appendix A Abbreviations

CDMA Code Division Multiple Access

CO Cache Operation

DTD Document Type Definition

GSM Global System for Mobile

HTTP Hypertext Transfer Protocol

IP Internet Protocol

MSISDN Mobile Station International Subscriber Directory Number

OTA Over The Air

PAP Push Access Protocol

PushOTA Push Over The Air

PDA Personal Digital Assistant

P1 Push Initiator

PLMN Public Land Mobile Networks

PPG Push Proxy Gateway

SI Service Indication

SIA Session Initiation Application

SIR Session Initiation Request

SL Service Loading

SMPP Short Message Peer to Peer

SMS Short Message System

SMSC Short Message System Center

UCP Universal Computer Protocol

URI Uniform Resource Identifier

URL Uniform Resource Locator

UTC Universal Time Coordinated

WAP Wireless Application Protocol

WBXML WAP binary XML

WDP Wireless Datagram Protocol

WSP Wireless Session Protocol

WTLS Wireless Transport Layer Security

XML Extensible Mark-up Language

46

Appendix B Kannel gateway configurations

THIS IS A SAMPLE CONFIGURATION FOR KANNEL

group = core

admin-port = 13000

admin-password = admin

status-password = admin

admin-deny-ip =

admin-allow-ip = 127001172161455

log-file = tmpkannellog

log-level = 0

http-proxy-host = 172161411

http-proxy-port = 8080

http-proxy-exceptions = 127001

Smsbox related

smsbox-port = 13001

box-deny-ip =

box-allow-ip = 127001

bearerbox-host =localhost

Wapbox related

wapbox-port = 13002

udp-deny-ip =

udp-allow-ip = 127001

bearerbox-host =localhost

SMSC GSM

group = smsc

smsc = at

modemtype = auto

speed =9600

device = devttyS0

SMSC HTTP

group = smsc

smsc = http

system-type = kannel

port = 13016

connect-allow-ip = 127001

Appendix B

47

username = wappush

password = wappush

SMSBOX SETUP

group = smsbox

bearerbox-host = localhost

sendsms-port = 13013

sendsms-chars = 0123456789 +-

log-file = tmpsmsboxlog

log-level = 0

access-log = accesslog

white-list = 127001

black-list =

SEND-SMS USERS

group = sendsms-user

username = wappush

password = wappush

user-deny-ip =

user-allow-ip = 127001

PPG group

group = ppg

ppg-url = wappush

ppg-port = 8080

concurrent-pushes = 100

trusted-pi = true

users = 1024

service-name = ppg

ppg-smsbox-id = dlrbox

WAP PUSH USER

group = wap-push-user

wap-push-user = picom

ppg-username = wappush

ppg-password = wappush

allow-ip = localhost

48

Appendix C Selected Codes

Gateway Control Form

ltDOCTYPE HTML PUBLIC -W3CDTD HTML 32ENgt

lthtmlgt ltheadgt

lttitlegtGateway control formlttitlegt

ltheadgt

ltbody bgcolor=white text=black link=blue vlink=navy

alink=redgt

ltbase target=submitgt

ltscriptgt

function update_status()

if ( adminactionvalue == status )

adminaction = http + adminhostnamevalue +

+ adminportvalue + status +

adminstatusformatvalue

else

adminaction = http + adminhostnamevalue +

+ adminportvalue + + adminactionvalue

adminpasswordvalue = adminpasswordvalue

actiongovalue = GO GET +adminaction

ltscriptgt

lttable align=centergt

lttrgtltp align=centergtlth2gtGateway control

formlth2gtltpgtlttrgt

lttrgt lttdgtHostnamelttdgtlttdgtltinput type=text

name=adminhostname value=localhost

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPortlttdgtlttdgtltinput type=text

name=adminport value=13000

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPasswordlttdgtlttdgtltinput type=password

name=adminpassword value=

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtActionlttdgtlttdgtltselect name=adminaction

onChange=update_status()gt

ltoption value=statusgtStatusltoptiongt

ltoption value=suspendgtSuspendltoptiongt

ltoption value=isolategtIsolateltoptiongt

Appendix C

49

ltoption value=shutdowngtShutdownltoptiongt

ltoption value=resumegtResumeltoptiongt

ltselectgtlttdgt lttrgt

lttrgt lttdgtStatus Formatlttdgtlttdgtltselect

name=adminstatusformat onChange=update_status()gt

ltoption value=gthtmlltoptiongtltoption

value=txtgttxtltoptiongtltoption

value=xmlgtxmlltoptiongtltselectgtlttdgt lttrgt

ltform name=admin method=get

action=httplocalhost13000status

encoding=applicationx-www-formgt

ltinput type=hidden name=password value=gt

lttrgt

lttdgtGolttdgt

ltformgt

lttdgtltinput type=submit value=go name=actiongo

onClick=documentadminsubmit()gtlttdgt

lttrgt

lttablegt

ltbodygt

lthtmlgt

Push Initiator Class

import javanetURL

import javanetHttpURLConnection

import javaio

Class implements a simple push initiator It can be

used to create and send messages to push proxy

gateway (ppg)

public final class PushInitiator

xml version

private final static String XML_VERSION = ltxml

version=10gt

Push Access Protocol (PAP) document type

private final static String PAP_DOCTYPE =

Appendix C

50

ltDOCTYPE pap PUBLIC -WAPFORUMDTD PAP 10EN

httpwwwwapforumorgDTDpap_10dtd gt

content type of the push request multipart body

private final static String CONTENT_TYPE =

multipartrelated boundary=multipart-boundary

type=applicationxml

Service Indication (SI) document type

private static final String SI_DOCTYPE = ltDOCTYPE si

PUBLIC -WAPFORUMDTD SI 10EN +

httpwwwwapforumorgDTDsidtdgt

private static int pushId = 0

PPG url where the pap message is to be sent

private final URL ppgUrl

some push proxy gateways may also require the

authentication of the push initiator

For instance the push initiator may be required to

send an HTTP authorization header in each request

private final String authorization

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

public PushInitiator(URL ppgUrl) thisppgUrl =

ppgUrl

authorization = null

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

param authorization a ltcodegtStringltcodegt value

public PushInitiator(URL ppgUrl String authorization)

thisppgUrl = ppgUrl

Appendix C

51

thisauthorization = authorization

Systemoutprintln(Push Initiator created ppgUrl =

+ ppgUrl)

ltcodegtsendPushMessageltcodegt sends push message to

ppg

param clientAddress a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param message a ltcodegtStringltcodegt value

param mimeType a ltcodegtStringltcodegt value

exception Exception if an error occurs

public void sendPushMessage(String clientAddress

String addressTypeString message String mimeType)

throws Exception

HttpURLConnection http =

(HttpURLConnection)ppgUrlopenConnection()

String ppgServer = ppgUrlgetHost()

httpsetDoInput(true)

httpsetRequestProperty(Content-Type CONTENT_TYPE)

if(authorization = null)

if(authorizationtrim()equals())

httpsetRequestProperty(Authorization

authorization)

httpsetDoOutput(true)

PrintWriter out = new PrintWriter(new

BufferedOutputStream(httpgetOutputStream()))

outprintln(--multipart-boundary)

outprintln(Content-type applicationxml)

outprintln()

outprintln(createPapMessage(clientAddress

addressTypeppgServer genPushId() null))

outprintln()

outprintln(--multipart-boundary)

outprintln(Content-type + mimeType)

outprintln()

outprintln(message)

outprintln()

outprintln(--multipart-boundary--)

outflush()

outclose()

httpconnect()

Appendix C

52

finally read and debug the response received from

PPG

try

debugResponse(http)

catch (Exception e)

Systemerrprintln(Error in receiving the

response)

ltcodegtcreatePapMessageltcodegt creates a Push Access

Protocoltype message

param address a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param ppgServer a ltcodegtStringltcodegt value

param pushId a ltcodegtStringltcodegt value

param notificationTo a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createPapMessage(String address

String addressType String ppgServer String pushId

String notificationTo)

return XML_VERSION + n + PAP_DOCTYPE + n +

ltpap product-name=Mobile Zoo Push

Initiatorgtn +

ltpush-message push-id= + pushId +

(notificationTo = null request-notification-

to= + notificationTo ) + gtn +

ltaddress address-value=WAPPUSH= + address +

TYPE= + addressType +

+ ppgServer + gtn +

ltpush-messagegtnltpapgt

ltcodegtcreateSiMessageltcodegt creates a service

indication type message

param url a ltcodegtStringltcodegt value

param created a ltcodegtStringltcodegt value

param expires a ltcodegtStringltcodegt value

Appendix C

53

param message a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createSiMessage(String url

String sid String created String expires String

action String message)

return XML_VERSION + SI_DOCTYPE +

ltsigtn +

ltindication href= + url + +

(sid = null si-id= + sid + ) +

created = null created= + created +

) +

(action = null action= + action +

) +

(expires = null expires= + expires +

) + gt +

message +

ltindicationgtnltsigt

Debug response

param http a ltcodegtHttpURLConnectionltcodegt value

exception Exception if an error occurs

private void debugResponse(HttpURLConnection http)

throws Exception

Systemoutprintln(httpgetResponseMessage())

String headerName

int i=0

while((headerName = httpgetHeaderFieldKey(i++)) =

null)

Systemoutprintln(headerName + +

httpgetHeaderField(headerName))

Systemoutprintln()

InputStreamReader in = new InputStreamReader(new

BufferedInputStream(httpgetInputStream()))

int c

Appendix C

54

while((c = inread()) = -1)

Systemoutprint((char)c)

Systemoutprintln()

ltcodegtgenPushIdltcodegt generates an unique push id

return a ltcodegtStringltcodegt value

private String genPushId()

pushId = 100000

return SystemcurrentTimeMillis() + + pushId++

55

References

[1] Microsoft ldquoGetting Mobile Using WML and WAP to Display Web Sites on

Mobile Devicesrdquo

URL msdnmicrosoftcomen-uslibraryaa140117(office10)aspx accessed

on April 10 2008

[2] DALE BULBROOK ldquoWAPA Beginnerrsquos Guiderdquo OsborneMcGraw-Hill 2001

[3] WAP Forum Wireless Application Protocol Architecture Specification Access on

Jan 12 2008 Available

httpwww1wapforumorgtechdocumentsWAP-210-WAPArch-2006 07 12-apdf

[4] WAP Forum Push Architectural Overview access on (2008 February 3) Available

httpwww1wapforumorgtechdocumentsWAP-250-PushArchOverview-2007 04

03-apdf

[5] Service indication PDF access on 62008 Available

httpwwww3orgTRhtml401structlinkshtml

[6] WAP Push Technology (openwave) PDF access on (2008 April) Available

URL httpwwwopenwavorg

[7] Web site (httpwwwwapforumorgwhatcopyrighthtm) access on May 2008

[8] ldquoWAP Push Proxy Gateway Specificationrdquo WAP Forum access on 16-August-

2007URI httpwwwwapforumorgPDF

[9] WAP Forum Access on (2008 MAY 31) WAP Service Indication Specification

Available httpwww1wapforumorgtechdocumentsWAP-167-ServiceInd-200507

31-apdf

  • odc_fpwmlandwap_topic3
  • N100E3
  • 21
  • 5

Chapter 4 System Design

31

informs the client of a Uniform Resource Identifier (URI) where the client can access the

service

An important attribute of SI is the action attribute it may contain the action to be taken

when the client receives the SI There are two groups that the action attributes can be

divided into

First we have delete and signalmdashnone both of them is used because of their side

effects Ie with delete you take away all SIs with the same si-id as the deletion pushrdquo

including itself and with signal-none you either do nothing or you pay regard to the

info element in that push

The other group consists of signal-low signal-medium and signal-high These

attributes are all used to set the rules for the presentation in the terminal device

o Signal-low

The SI must be postponed without user intervention

o Signal-medium

The SI must be presented as soon as the implementation allows that to be carried out

without disturbing the user (Signal-medium is the value that will be used if none is

specified)

o Signal-high

The SI must be presented as soon as the implementation allows that to be carried out

without disturbing the user or earlier if it seems appropriate (This decision may for

instance be based on user preference settings)

This is the different functionalities supported by the SI we concidered

Expiration

Replacement

Deletion

Chapter 4 System Design

32

Handling of out of order delivery

Handling of information specified in the info element

A PUSH Service Indication (SI) contains at a minimum an ltsigt element and a

ltindicationgt element SL donrsquot differ so much from SI

4313 Capability entity

This entity determines the type of mobile device that is to be served This is determined

by WAP user agent profiling The sender can indicate the hardware vendor and browser

version and type of the intended recipients This capability entity is then matched at the

PPG to see which devices are compatible with the requested capability If there is a

match the content is delivered by the PPG to that specific device

Now a day most devices are compatible with WAP so we donrsquot need to create this entity

more precisely it is optional

After the push has been created in the PI it is up to the system to deliver it to the defined

destination In this system the different responsible entities are the PPG and the SMSC

Both of these two different entities are running on same server but it is only the

configuration of the SMSC that is out of my control since it is run by the operator and is

not controllable in my lab environment

432 Push Proxy Gateway (PPG)

There are various commercial WAP gateways available on the market that are quite

expensive Kannel on the other hand is an open source gateway one doesnrsquot need to pay

for it in addition one can edit the source code himself and construct his own customized

gateway Because Kannel is being developed on Linux systems (RedHat and Debian) it

can be smoothly ported to other UNIX-like operating systems

4321 Kannel gateway architecture

The gateway divides the processing load between the following three hosts

Chapter 4 System Design

33

The bearer box which connects to the SMS (Short Message Service) centers and

or CSD (Circuit Switched Data) routers providing a unified interface to them for

the wapbox The bearer box does this by implementing the WDP (Wireless

Datagram Protocol) layer of the WAP stack

The smsbox implements the rest of the SMS gateway functionality It receives

textual SMS messages from the bearerbox and interprets them as service

requests and responds to them in the appropriate way

The wapbox which hosts the upper layers of the WAP stack Each session and its

transactions are handled by the same wapbox (see figure 35)

1Figure 45 divisions of duties in kannel

4322 Working of the gateway

The bearer box receives UDP (User Datagram Protocol) packets from CSD routers

inspects them to see whether they are WAP packets if so then it will routes them to the

WAP box This simple design allows the bearer box to do a minimum of processing per

smsbox

wapbox

bearerbox

Kannel

SMS center

WAP phone

HTTP server

Chapter 4 System Design

34

packet The bearer box also sends the UDP packets that the other boxes generate which

adds some more routing processing The wapboxes implement the WTP (Wireless

Transaction Protocol) and WSP (Wireless Session Protocol) layers These take HTTP-

like requests from the phones and make the actual HTTP requests to content servers

compress the responses and send them back to the terminals (Sessions are maintained to

make as much use of the limited radio bandwidth as possible)

4323 External interfaces of the gateway

The gateway has interfaces to three external agents

bull SMS centers using various protocols

bull HTTP servers to fetch WAP and SMS content and to push WAP Content The

pull protocol is HTTP push PAP

bull WAP phones implementing the WAP protocol stack and (for push) WAP Push

client

Figure 36 summarize kannel external interfaces

4324 Configuring the gateway

The bearerbox smsbox and wapbox are the main working modules of the gateway and

must be configured before configuring the gateway These three modules are controlled

by a configuration file that has wapbox smsbox and bearerbox groups

Configuring the PPG core group

We use two components the PPG core group and the PPG user group The PPG

core group is used to configure the PI interface(for more details configuration

variables refer to appendix c)

Chapter 4 System Design

35

Mobile telephone

network

The Internet

smsbox

wapbox

bearerbox

Kannel

HTTP

HTTP

HTTP server

Serving WML

files

HTTP server

Serving HTML

files

TCP

TCP

WAPSMS

SMSC

WAP phoneNetwork base station

Workstation used for http

administration

Figure 46 External interfaces of the gateway

4325 Administering the gateway through an HTTP interface

Kannel can be administered via an HTTP interface All commands are given as normal

HTTP queries so they can easily be given from command lines like this one

links -dump httpip-adressportshutdownpassword=yourchoice

But it is advantageous to have graphical user interface for gateway control so we have

designed GUI through http

Chapter 4 System Design

36

433 Short Message Service Centre (SMSC)

A SMSC is an essential component when sending a push message from an IP network to

a mobile device in the architecture supported by the components and devices It is used to

remove the TCPIP layer that the push is encapsulatedrdquo in It is also the entity that

identifies the end-point device When this is done it is also the SMSC that is responsible

for the processing and final message delivery to the device After the process of de-

encapsulation and resolution of the client identity there should not be any difference

between this message and a message that is originated locally from the operator itself

(like a SMS)

In this project we just use a virtual SMS center we try first to get connection to a real

one but our effort was worthless

Finally the following figure depicts the overall flowchart of the WAP push system

(figure 47)

Chapter 4 System Design

37

PI

PPG

Create PAP

HTTP Post

Message

processing

OTA

Connection

oriented

Sessionless Session

oriented

WTP Initiation

WAP clinet

Application

Create content

Create

capability

entity

Database

SMS center

NoYes

Figure 47 the complete flowchart of the system

38

Chapter Five

5 System implementation and results

51 Implementation

511 The Push Proxy Gateway

First of all the Kannel gateway have been compiled and installed using gcc (GNU C

Compiler) this stage go fine except the operating system required more components to

be pre-installed and will configured

Then with stages of configuration to the gateway (Appendix B) it was capable of working

as PPG Figure 51 below show the gateway when it starts

Figure 51 starting kannel gateway

Then a web based user interface had been created to provide an easy way to control the

gateway remotely Figure 52 and figure 53

39

Figure 52 GUI for gateway control

512 The Push initiator

Next the push initiator design had been implemented using java programming language

as in design phase the implementation is taken carefully to make a reusable component

that could be used by other developer

PushInitiator class (Appendix B) implements a simple push initiator which can be used

to create and send messages to a push proxy gateway (PPG)

The method sendPushMessage sends a push message via the PPG to the client The client

is identified by the address which is either the phone number (address type is PLMN) or

IP address The message content and its mime type are also given as arguments to the

method the other tow important method are

createPapMessage This method creates a Push Access Protocol (PAP) type message

40

createSiMessage This method is used to create a service indication (SI) type message

Figure 53 showing running kannel status

513 WAP site

Since this site will be built for testing purpose and making sure that the system is

functional we had not go deep in this section Just simple WAP site with tow page has

been crated

41

52 Service indication

When a SI was pushed to any of the emulator or Nokia phones it was received and

presented in the way it was supposed to as specified in the WAP standard as shown in

figures below This is a proof that the devices claiming to support WAP push do so and

the design is will working See figures 53 through 56

Figure 55 service indication

42

Figure 57 SI details

52 Service load

The emulator correctly receives and interpreted the SL push the same as all of Nokia

phones we have tested

When a SL was pushed to the Ericsson phones it was not presented in the specified way

figure 58 I think that it is because of security reasons The reason for this assumption is

that the phones only supports on or off as security in their push configuration The

emulator on the other hand presents SL correctly Finally the Siemens phone did seem to

interpret SL but the current software was not very consistent It did load the SL without

user interference in the specified way when the user already where having an active

session If the user was offline the phone interface presented a symbol on the display

and did not load the service until the user clicked on the symbol

43

Chapter Six

6 conclusion and future work

In this chapter we will provide the conclusions and proposed future work for interested

individuals

61 Conclusions

In this project a WAP push system has been successfully designed and implemented It

provides a way to partially overcome the limitations encountered when accessing the

World Wide Web using handsets After comparing the proposed project objectives with

those accomplished the main goals are seen to be met

Phones from different manufactures all differ from the WAP-standard in some

ways One of the most obvious differences is the resolution of the display

During the work it has been noticed that the WML pages must be quite small We

have also noticed that the support for tables and some other tags are a bit limited

Even though the WML standard is smaller than the HTML standard it is a little

more complicated to write correct WML pages The main conclusion is that WAP

works pretty well but the phones are a little non-stable

The push proxy gateway is configured and worked probably with virtual SMS

center and it is easy to switch to a real one

The system depends mainly on open sources (ie Linux and kannek)

The design and implementation of the push initiator work well with the kannel

gateway and it should work correctly with other gateways

Chapter 6 Conclusion

44

62 Further Work

The possibilities of wireless push are interesting enough that it has to be worth to know if

the security and conformance problems will be solved in WAP push If they are solved

and the technique is refined then there should be nothing to stop the great number of

services that will follow in its footsteps Therefore there is further work that should be

done and the most interesting parts are in my opinion these

621 Security Aspect

One of the problems today is that the phones supporting push does not have the detailed

security settings that a technique like this needs Therefore it would be interesting to look

into the possibility to add these without confusing the user I suggest furthering looking

into usability aspects of security in WAP Push for short

622 GPS integration possibility

This will provide location dependent delivery of WAP push it will have great

applications in telematic and ecommerce advertising

623 Conformance to Standards

An interesting project would be to examine if the main reason for the nonstandard

solutions in the existing WAP push software is the result of difficulties in

implementation Or if the main reason is that the manufacturers wants to provide

proprietary solutions A reason why one may want to know this is that if the problem is

depending on implementation problems then it might get better

45

Appendix A Abbreviations

CDMA Code Division Multiple Access

CO Cache Operation

DTD Document Type Definition

GSM Global System for Mobile

HTTP Hypertext Transfer Protocol

IP Internet Protocol

MSISDN Mobile Station International Subscriber Directory Number

OTA Over The Air

PAP Push Access Protocol

PushOTA Push Over The Air

PDA Personal Digital Assistant

P1 Push Initiator

PLMN Public Land Mobile Networks

PPG Push Proxy Gateway

SI Service Indication

SIA Session Initiation Application

SIR Session Initiation Request

SL Service Loading

SMPP Short Message Peer to Peer

SMS Short Message System

SMSC Short Message System Center

UCP Universal Computer Protocol

URI Uniform Resource Identifier

URL Uniform Resource Locator

UTC Universal Time Coordinated

WAP Wireless Application Protocol

WBXML WAP binary XML

WDP Wireless Datagram Protocol

WSP Wireless Session Protocol

WTLS Wireless Transport Layer Security

XML Extensible Mark-up Language

46

Appendix B Kannel gateway configurations

THIS IS A SAMPLE CONFIGURATION FOR KANNEL

group = core

admin-port = 13000

admin-password = admin

status-password = admin

admin-deny-ip =

admin-allow-ip = 127001172161455

log-file = tmpkannellog

log-level = 0

http-proxy-host = 172161411

http-proxy-port = 8080

http-proxy-exceptions = 127001

Smsbox related

smsbox-port = 13001

box-deny-ip =

box-allow-ip = 127001

bearerbox-host =localhost

Wapbox related

wapbox-port = 13002

udp-deny-ip =

udp-allow-ip = 127001

bearerbox-host =localhost

SMSC GSM

group = smsc

smsc = at

modemtype = auto

speed =9600

device = devttyS0

SMSC HTTP

group = smsc

smsc = http

system-type = kannel

port = 13016

connect-allow-ip = 127001

Appendix B

47

username = wappush

password = wappush

SMSBOX SETUP

group = smsbox

bearerbox-host = localhost

sendsms-port = 13013

sendsms-chars = 0123456789 +-

log-file = tmpsmsboxlog

log-level = 0

access-log = accesslog

white-list = 127001

black-list =

SEND-SMS USERS

group = sendsms-user

username = wappush

password = wappush

user-deny-ip =

user-allow-ip = 127001

PPG group

group = ppg

ppg-url = wappush

ppg-port = 8080

concurrent-pushes = 100

trusted-pi = true

users = 1024

service-name = ppg

ppg-smsbox-id = dlrbox

WAP PUSH USER

group = wap-push-user

wap-push-user = picom

ppg-username = wappush

ppg-password = wappush

allow-ip = localhost

48

Appendix C Selected Codes

Gateway Control Form

ltDOCTYPE HTML PUBLIC -W3CDTD HTML 32ENgt

lthtmlgt ltheadgt

lttitlegtGateway control formlttitlegt

ltheadgt

ltbody bgcolor=white text=black link=blue vlink=navy

alink=redgt

ltbase target=submitgt

ltscriptgt

function update_status()

if ( adminactionvalue == status )

adminaction = http + adminhostnamevalue +

+ adminportvalue + status +

adminstatusformatvalue

else

adminaction = http + adminhostnamevalue +

+ adminportvalue + + adminactionvalue

adminpasswordvalue = adminpasswordvalue

actiongovalue = GO GET +adminaction

ltscriptgt

lttable align=centergt

lttrgtltp align=centergtlth2gtGateway control

formlth2gtltpgtlttrgt

lttrgt lttdgtHostnamelttdgtlttdgtltinput type=text

name=adminhostname value=localhost

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPortlttdgtlttdgtltinput type=text

name=adminport value=13000

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPasswordlttdgtlttdgtltinput type=password

name=adminpassword value=

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtActionlttdgtlttdgtltselect name=adminaction

onChange=update_status()gt

ltoption value=statusgtStatusltoptiongt

ltoption value=suspendgtSuspendltoptiongt

ltoption value=isolategtIsolateltoptiongt

Appendix C

49

ltoption value=shutdowngtShutdownltoptiongt

ltoption value=resumegtResumeltoptiongt

ltselectgtlttdgt lttrgt

lttrgt lttdgtStatus Formatlttdgtlttdgtltselect

name=adminstatusformat onChange=update_status()gt

ltoption value=gthtmlltoptiongtltoption

value=txtgttxtltoptiongtltoption

value=xmlgtxmlltoptiongtltselectgtlttdgt lttrgt

ltform name=admin method=get

action=httplocalhost13000status

encoding=applicationx-www-formgt

ltinput type=hidden name=password value=gt

lttrgt

lttdgtGolttdgt

ltformgt

lttdgtltinput type=submit value=go name=actiongo

onClick=documentadminsubmit()gtlttdgt

lttrgt

lttablegt

ltbodygt

lthtmlgt

Push Initiator Class

import javanetURL

import javanetHttpURLConnection

import javaio

Class implements a simple push initiator It can be

used to create and send messages to push proxy

gateway (ppg)

public final class PushInitiator

xml version

private final static String XML_VERSION = ltxml

version=10gt

Push Access Protocol (PAP) document type

private final static String PAP_DOCTYPE =

Appendix C

50

ltDOCTYPE pap PUBLIC -WAPFORUMDTD PAP 10EN

httpwwwwapforumorgDTDpap_10dtd gt

content type of the push request multipart body

private final static String CONTENT_TYPE =

multipartrelated boundary=multipart-boundary

type=applicationxml

Service Indication (SI) document type

private static final String SI_DOCTYPE = ltDOCTYPE si

PUBLIC -WAPFORUMDTD SI 10EN +

httpwwwwapforumorgDTDsidtdgt

private static int pushId = 0

PPG url where the pap message is to be sent

private final URL ppgUrl

some push proxy gateways may also require the

authentication of the push initiator

For instance the push initiator may be required to

send an HTTP authorization header in each request

private final String authorization

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

public PushInitiator(URL ppgUrl) thisppgUrl =

ppgUrl

authorization = null

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

param authorization a ltcodegtStringltcodegt value

public PushInitiator(URL ppgUrl String authorization)

thisppgUrl = ppgUrl

Appendix C

51

thisauthorization = authorization

Systemoutprintln(Push Initiator created ppgUrl =

+ ppgUrl)

ltcodegtsendPushMessageltcodegt sends push message to

ppg

param clientAddress a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param message a ltcodegtStringltcodegt value

param mimeType a ltcodegtStringltcodegt value

exception Exception if an error occurs

public void sendPushMessage(String clientAddress

String addressTypeString message String mimeType)

throws Exception

HttpURLConnection http =

(HttpURLConnection)ppgUrlopenConnection()

String ppgServer = ppgUrlgetHost()

httpsetDoInput(true)

httpsetRequestProperty(Content-Type CONTENT_TYPE)

if(authorization = null)

if(authorizationtrim()equals())

httpsetRequestProperty(Authorization

authorization)

httpsetDoOutput(true)

PrintWriter out = new PrintWriter(new

BufferedOutputStream(httpgetOutputStream()))

outprintln(--multipart-boundary)

outprintln(Content-type applicationxml)

outprintln()

outprintln(createPapMessage(clientAddress

addressTypeppgServer genPushId() null))

outprintln()

outprintln(--multipart-boundary)

outprintln(Content-type + mimeType)

outprintln()

outprintln(message)

outprintln()

outprintln(--multipart-boundary--)

outflush()

outclose()

httpconnect()

Appendix C

52

finally read and debug the response received from

PPG

try

debugResponse(http)

catch (Exception e)

Systemerrprintln(Error in receiving the

response)

ltcodegtcreatePapMessageltcodegt creates a Push Access

Protocoltype message

param address a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param ppgServer a ltcodegtStringltcodegt value

param pushId a ltcodegtStringltcodegt value

param notificationTo a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createPapMessage(String address

String addressType String ppgServer String pushId

String notificationTo)

return XML_VERSION + n + PAP_DOCTYPE + n +

ltpap product-name=Mobile Zoo Push

Initiatorgtn +

ltpush-message push-id= + pushId +

(notificationTo = null request-notification-

to= + notificationTo ) + gtn +

ltaddress address-value=WAPPUSH= + address +

TYPE= + addressType +

+ ppgServer + gtn +

ltpush-messagegtnltpapgt

ltcodegtcreateSiMessageltcodegt creates a service

indication type message

param url a ltcodegtStringltcodegt value

param created a ltcodegtStringltcodegt value

param expires a ltcodegtStringltcodegt value

Appendix C

53

param message a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createSiMessage(String url

String sid String created String expires String

action String message)

return XML_VERSION + SI_DOCTYPE +

ltsigtn +

ltindication href= + url + +

(sid = null si-id= + sid + ) +

created = null created= + created +

) +

(action = null action= + action +

) +

(expires = null expires= + expires +

) + gt +

message +

ltindicationgtnltsigt

Debug response

param http a ltcodegtHttpURLConnectionltcodegt value

exception Exception if an error occurs

private void debugResponse(HttpURLConnection http)

throws Exception

Systemoutprintln(httpgetResponseMessage())

String headerName

int i=0

while((headerName = httpgetHeaderFieldKey(i++)) =

null)

Systemoutprintln(headerName + +

httpgetHeaderField(headerName))

Systemoutprintln()

InputStreamReader in = new InputStreamReader(new

BufferedInputStream(httpgetInputStream()))

int c

Appendix C

54

while((c = inread()) = -1)

Systemoutprint((char)c)

Systemoutprintln()

ltcodegtgenPushIdltcodegt generates an unique push id

return a ltcodegtStringltcodegt value

private String genPushId()

pushId = 100000

return SystemcurrentTimeMillis() + + pushId++

55

References

[1] Microsoft ldquoGetting Mobile Using WML and WAP to Display Web Sites on

Mobile Devicesrdquo

URL msdnmicrosoftcomen-uslibraryaa140117(office10)aspx accessed

on April 10 2008

[2] DALE BULBROOK ldquoWAPA Beginnerrsquos Guiderdquo OsborneMcGraw-Hill 2001

[3] WAP Forum Wireless Application Protocol Architecture Specification Access on

Jan 12 2008 Available

httpwww1wapforumorgtechdocumentsWAP-210-WAPArch-2006 07 12-apdf

[4] WAP Forum Push Architectural Overview access on (2008 February 3) Available

httpwww1wapforumorgtechdocumentsWAP-250-PushArchOverview-2007 04

03-apdf

[5] Service indication PDF access on 62008 Available

httpwwww3orgTRhtml401structlinkshtml

[6] WAP Push Technology (openwave) PDF access on (2008 April) Available

URL httpwwwopenwavorg

[7] Web site (httpwwwwapforumorgwhatcopyrighthtm) access on May 2008

[8] ldquoWAP Push Proxy Gateway Specificationrdquo WAP Forum access on 16-August-

2007URI httpwwwwapforumorgPDF

[9] WAP Forum Access on (2008 MAY 31) WAP Service Indication Specification

Available httpwww1wapforumorgtechdocumentsWAP-167-ServiceInd-200507

31-apdf

  • odc_fpwmlandwap_topic3
  • N100E3
  • 21
  • 5

Chapter 4 System Design

32

Handling of out of order delivery

Handling of information specified in the info element

A PUSH Service Indication (SI) contains at a minimum an ltsigt element and a

ltindicationgt element SL donrsquot differ so much from SI

4313 Capability entity

This entity determines the type of mobile device that is to be served This is determined

by WAP user agent profiling The sender can indicate the hardware vendor and browser

version and type of the intended recipients This capability entity is then matched at the

PPG to see which devices are compatible with the requested capability If there is a

match the content is delivered by the PPG to that specific device

Now a day most devices are compatible with WAP so we donrsquot need to create this entity

more precisely it is optional

After the push has been created in the PI it is up to the system to deliver it to the defined

destination In this system the different responsible entities are the PPG and the SMSC

Both of these two different entities are running on same server but it is only the

configuration of the SMSC that is out of my control since it is run by the operator and is

not controllable in my lab environment

432 Push Proxy Gateway (PPG)

There are various commercial WAP gateways available on the market that are quite

expensive Kannel on the other hand is an open source gateway one doesnrsquot need to pay

for it in addition one can edit the source code himself and construct his own customized

gateway Because Kannel is being developed on Linux systems (RedHat and Debian) it

can be smoothly ported to other UNIX-like operating systems

4321 Kannel gateway architecture

The gateway divides the processing load between the following three hosts

Chapter 4 System Design

33

The bearer box which connects to the SMS (Short Message Service) centers and

or CSD (Circuit Switched Data) routers providing a unified interface to them for

the wapbox The bearer box does this by implementing the WDP (Wireless

Datagram Protocol) layer of the WAP stack

The smsbox implements the rest of the SMS gateway functionality It receives

textual SMS messages from the bearerbox and interprets them as service

requests and responds to them in the appropriate way

The wapbox which hosts the upper layers of the WAP stack Each session and its

transactions are handled by the same wapbox (see figure 35)

1Figure 45 divisions of duties in kannel

4322 Working of the gateway

The bearer box receives UDP (User Datagram Protocol) packets from CSD routers

inspects them to see whether they are WAP packets if so then it will routes them to the

WAP box This simple design allows the bearer box to do a minimum of processing per

smsbox

wapbox

bearerbox

Kannel

SMS center

WAP phone

HTTP server

Chapter 4 System Design

34

packet The bearer box also sends the UDP packets that the other boxes generate which

adds some more routing processing The wapboxes implement the WTP (Wireless

Transaction Protocol) and WSP (Wireless Session Protocol) layers These take HTTP-

like requests from the phones and make the actual HTTP requests to content servers

compress the responses and send them back to the terminals (Sessions are maintained to

make as much use of the limited radio bandwidth as possible)

4323 External interfaces of the gateway

The gateway has interfaces to three external agents

bull SMS centers using various protocols

bull HTTP servers to fetch WAP and SMS content and to push WAP Content The

pull protocol is HTTP push PAP

bull WAP phones implementing the WAP protocol stack and (for push) WAP Push

client

Figure 36 summarize kannel external interfaces

4324 Configuring the gateway

The bearerbox smsbox and wapbox are the main working modules of the gateway and

must be configured before configuring the gateway These three modules are controlled

by a configuration file that has wapbox smsbox and bearerbox groups

Configuring the PPG core group

We use two components the PPG core group and the PPG user group The PPG

core group is used to configure the PI interface(for more details configuration

variables refer to appendix c)

Chapter 4 System Design

35

Mobile telephone

network

The Internet

smsbox

wapbox

bearerbox

Kannel

HTTP

HTTP

HTTP server

Serving WML

files

HTTP server

Serving HTML

files

TCP

TCP

WAPSMS

SMSC

WAP phoneNetwork base station

Workstation used for http

administration

Figure 46 External interfaces of the gateway

4325 Administering the gateway through an HTTP interface

Kannel can be administered via an HTTP interface All commands are given as normal

HTTP queries so they can easily be given from command lines like this one

links -dump httpip-adressportshutdownpassword=yourchoice

But it is advantageous to have graphical user interface for gateway control so we have

designed GUI through http

Chapter 4 System Design

36

433 Short Message Service Centre (SMSC)

A SMSC is an essential component when sending a push message from an IP network to

a mobile device in the architecture supported by the components and devices It is used to

remove the TCPIP layer that the push is encapsulatedrdquo in It is also the entity that

identifies the end-point device When this is done it is also the SMSC that is responsible

for the processing and final message delivery to the device After the process of de-

encapsulation and resolution of the client identity there should not be any difference

between this message and a message that is originated locally from the operator itself

(like a SMS)

In this project we just use a virtual SMS center we try first to get connection to a real

one but our effort was worthless

Finally the following figure depicts the overall flowchart of the WAP push system

(figure 47)

Chapter 4 System Design

37

PI

PPG

Create PAP

HTTP Post

Message

processing

OTA

Connection

oriented

Sessionless Session

oriented

WTP Initiation

WAP clinet

Application

Create content

Create

capability

entity

Database

SMS center

NoYes

Figure 47 the complete flowchart of the system

38

Chapter Five

5 System implementation and results

51 Implementation

511 The Push Proxy Gateway

First of all the Kannel gateway have been compiled and installed using gcc (GNU C

Compiler) this stage go fine except the operating system required more components to

be pre-installed and will configured

Then with stages of configuration to the gateway (Appendix B) it was capable of working

as PPG Figure 51 below show the gateway when it starts

Figure 51 starting kannel gateway

Then a web based user interface had been created to provide an easy way to control the

gateway remotely Figure 52 and figure 53

39

Figure 52 GUI for gateway control

512 The Push initiator

Next the push initiator design had been implemented using java programming language

as in design phase the implementation is taken carefully to make a reusable component

that could be used by other developer

PushInitiator class (Appendix B) implements a simple push initiator which can be used

to create and send messages to a push proxy gateway (PPG)

The method sendPushMessage sends a push message via the PPG to the client The client

is identified by the address which is either the phone number (address type is PLMN) or

IP address The message content and its mime type are also given as arguments to the

method the other tow important method are

createPapMessage This method creates a Push Access Protocol (PAP) type message

40

createSiMessage This method is used to create a service indication (SI) type message

Figure 53 showing running kannel status

513 WAP site

Since this site will be built for testing purpose and making sure that the system is

functional we had not go deep in this section Just simple WAP site with tow page has

been crated

41

52 Service indication

When a SI was pushed to any of the emulator or Nokia phones it was received and

presented in the way it was supposed to as specified in the WAP standard as shown in

figures below This is a proof that the devices claiming to support WAP push do so and

the design is will working See figures 53 through 56

Figure 55 service indication

42

Figure 57 SI details

52 Service load

The emulator correctly receives and interpreted the SL push the same as all of Nokia

phones we have tested

When a SL was pushed to the Ericsson phones it was not presented in the specified way

figure 58 I think that it is because of security reasons The reason for this assumption is

that the phones only supports on or off as security in their push configuration The

emulator on the other hand presents SL correctly Finally the Siemens phone did seem to

interpret SL but the current software was not very consistent It did load the SL without

user interference in the specified way when the user already where having an active

session If the user was offline the phone interface presented a symbol on the display

and did not load the service until the user clicked on the symbol

43

Chapter Six

6 conclusion and future work

In this chapter we will provide the conclusions and proposed future work for interested

individuals

61 Conclusions

In this project a WAP push system has been successfully designed and implemented It

provides a way to partially overcome the limitations encountered when accessing the

World Wide Web using handsets After comparing the proposed project objectives with

those accomplished the main goals are seen to be met

Phones from different manufactures all differ from the WAP-standard in some

ways One of the most obvious differences is the resolution of the display

During the work it has been noticed that the WML pages must be quite small We

have also noticed that the support for tables and some other tags are a bit limited

Even though the WML standard is smaller than the HTML standard it is a little

more complicated to write correct WML pages The main conclusion is that WAP

works pretty well but the phones are a little non-stable

The push proxy gateway is configured and worked probably with virtual SMS

center and it is easy to switch to a real one

The system depends mainly on open sources (ie Linux and kannek)

The design and implementation of the push initiator work well with the kannel

gateway and it should work correctly with other gateways

Chapter 6 Conclusion

44

62 Further Work

The possibilities of wireless push are interesting enough that it has to be worth to know if

the security and conformance problems will be solved in WAP push If they are solved

and the technique is refined then there should be nothing to stop the great number of

services that will follow in its footsteps Therefore there is further work that should be

done and the most interesting parts are in my opinion these

621 Security Aspect

One of the problems today is that the phones supporting push does not have the detailed

security settings that a technique like this needs Therefore it would be interesting to look

into the possibility to add these without confusing the user I suggest furthering looking

into usability aspects of security in WAP Push for short

622 GPS integration possibility

This will provide location dependent delivery of WAP push it will have great

applications in telematic and ecommerce advertising

623 Conformance to Standards

An interesting project would be to examine if the main reason for the nonstandard

solutions in the existing WAP push software is the result of difficulties in

implementation Or if the main reason is that the manufacturers wants to provide

proprietary solutions A reason why one may want to know this is that if the problem is

depending on implementation problems then it might get better

45

Appendix A Abbreviations

CDMA Code Division Multiple Access

CO Cache Operation

DTD Document Type Definition

GSM Global System for Mobile

HTTP Hypertext Transfer Protocol

IP Internet Protocol

MSISDN Mobile Station International Subscriber Directory Number

OTA Over The Air

PAP Push Access Protocol

PushOTA Push Over The Air

PDA Personal Digital Assistant

P1 Push Initiator

PLMN Public Land Mobile Networks

PPG Push Proxy Gateway

SI Service Indication

SIA Session Initiation Application

SIR Session Initiation Request

SL Service Loading

SMPP Short Message Peer to Peer

SMS Short Message System

SMSC Short Message System Center

UCP Universal Computer Protocol

URI Uniform Resource Identifier

URL Uniform Resource Locator

UTC Universal Time Coordinated

WAP Wireless Application Protocol

WBXML WAP binary XML

WDP Wireless Datagram Protocol

WSP Wireless Session Protocol

WTLS Wireless Transport Layer Security

XML Extensible Mark-up Language

46

Appendix B Kannel gateway configurations

THIS IS A SAMPLE CONFIGURATION FOR KANNEL

group = core

admin-port = 13000

admin-password = admin

status-password = admin

admin-deny-ip =

admin-allow-ip = 127001172161455

log-file = tmpkannellog

log-level = 0

http-proxy-host = 172161411

http-proxy-port = 8080

http-proxy-exceptions = 127001

Smsbox related

smsbox-port = 13001

box-deny-ip =

box-allow-ip = 127001

bearerbox-host =localhost

Wapbox related

wapbox-port = 13002

udp-deny-ip =

udp-allow-ip = 127001

bearerbox-host =localhost

SMSC GSM

group = smsc

smsc = at

modemtype = auto

speed =9600

device = devttyS0

SMSC HTTP

group = smsc

smsc = http

system-type = kannel

port = 13016

connect-allow-ip = 127001

Appendix B

47

username = wappush

password = wappush

SMSBOX SETUP

group = smsbox

bearerbox-host = localhost

sendsms-port = 13013

sendsms-chars = 0123456789 +-

log-file = tmpsmsboxlog

log-level = 0

access-log = accesslog

white-list = 127001

black-list =

SEND-SMS USERS

group = sendsms-user

username = wappush

password = wappush

user-deny-ip =

user-allow-ip = 127001

PPG group

group = ppg

ppg-url = wappush

ppg-port = 8080

concurrent-pushes = 100

trusted-pi = true

users = 1024

service-name = ppg

ppg-smsbox-id = dlrbox

WAP PUSH USER

group = wap-push-user

wap-push-user = picom

ppg-username = wappush

ppg-password = wappush

allow-ip = localhost

48

Appendix C Selected Codes

Gateway Control Form

ltDOCTYPE HTML PUBLIC -W3CDTD HTML 32ENgt

lthtmlgt ltheadgt

lttitlegtGateway control formlttitlegt

ltheadgt

ltbody bgcolor=white text=black link=blue vlink=navy

alink=redgt

ltbase target=submitgt

ltscriptgt

function update_status()

if ( adminactionvalue == status )

adminaction = http + adminhostnamevalue +

+ adminportvalue + status +

adminstatusformatvalue

else

adminaction = http + adminhostnamevalue +

+ adminportvalue + + adminactionvalue

adminpasswordvalue = adminpasswordvalue

actiongovalue = GO GET +adminaction

ltscriptgt

lttable align=centergt

lttrgtltp align=centergtlth2gtGateway control

formlth2gtltpgtlttrgt

lttrgt lttdgtHostnamelttdgtlttdgtltinput type=text

name=adminhostname value=localhost

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPortlttdgtlttdgtltinput type=text

name=adminport value=13000

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPasswordlttdgtlttdgtltinput type=password

name=adminpassword value=

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtActionlttdgtlttdgtltselect name=adminaction

onChange=update_status()gt

ltoption value=statusgtStatusltoptiongt

ltoption value=suspendgtSuspendltoptiongt

ltoption value=isolategtIsolateltoptiongt

Appendix C

49

ltoption value=shutdowngtShutdownltoptiongt

ltoption value=resumegtResumeltoptiongt

ltselectgtlttdgt lttrgt

lttrgt lttdgtStatus Formatlttdgtlttdgtltselect

name=adminstatusformat onChange=update_status()gt

ltoption value=gthtmlltoptiongtltoption

value=txtgttxtltoptiongtltoption

value=xmlgtxmlltoptiongtltselectgtlttdgt lttrgt

ltform name=admin method=get

action=httplocalhost13000status

encoding=applicationx-www-formgt

ltinput type=hidden name=password value=gt

lttrgt

lttdgtGolttdgt

ltformgt

lttdgtltinput type=submit value=go name=actiongo

onClick=documentadminsubmit()gtlttdgt

lttrgt

lttablegt

ltbodygt

lthtmlgt

Push Initiator Class

import javanetURL

import javanetHttpURLConnection

import javaio

Class implements a simple push initiator It can be

used to create and send messages to push proxy

gateway (ppg)

public final class PushInitiator

xml version

private final static String XML_VERSION = ltxml

version=10gt

Push Access Protocol (PAP) document type

private final static String PAP_DOCTYPE =

Appendix C

50

ltDOCTYPE pap PUBLIC -WAPFORUMDTD PAP 10EN

httpwwwwapforumorgDTDpap_10dtd gt

content type of the push request multipart body

private final static String CONTENT_TYPE =

multipartrelated boundary=multipart-boundary

type=applicationxml

Service Indication (SI) document type

private static final String SI_DOCTYPE = ltDOCTYPE si

PUBLIC -WAPFORUMDTD SI 10EN +

httpwwwwapforumorgDTDsidtdgt

private static int pushId = 0

PPG url where the pap message is to be sent

private final URL ppgUrl

some push proxy gateways may also require the

authentication of the push initiator

For instance the push initiator may be required to

send an HTTP authorization header in each request

private final String authorization

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

public PushInitiator(URL ppgUrl) thisppgUrl =

ppgUrl

authorization = null

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

param authorization a ltcodegtStringltcodegt value

public PushInitiator(URL ppgUrl String authorization)

thisppgUrl = ppgUrl

Appendix C

51

thisauthorization = authorization

Systemoutprintln(Push Initiator created ppgUrl =

+ ppgUrl)

ltcodegtsendPushMessageltcodegt sends push message to

ppg

param clientAddress a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param message a ltcodegtStringltcodegt value

param mimeType a ltcodegtStringltcodegt value

exception Exception if an error occurs

public void sendPushMessage(String clientAddress

String addressTypeString message String mimeType)

throws Exception

HttpURLConnection http =

(HttpURLConnection)ppgUrlopenConnection()

String ppgServer = ppgUrlgetHost()

httpsetDoInput(true)

httpsetRequestProperty(Content-Type CONTENT_TYPE)

if(authorization = null)

if(authorizationtrim()equals())

httpsetRequestProperty(Authorization

authorization)

httpsetDoOutput(true)

PrintWriter out = new PrintWriter(new

BufferedOutputStream(httpgetOutputStream()))

outprintln(--multipart-boundary)

outprintln(Content-type applicationxml)

outprintln()

outprintln(createPapMessage(clientAddress

addressTypeppgServer genPushId() null))

outprintln()

outprintln(--multipart-boundary)

outprintln(Content-type + mimeType)

outprintln()

outprintln(message)

outprintln()

outprintln(--multipart-boundary--)

outflush()

outclose()

httpconnect()

Appendix C

52

finally read and debug the response received from

PPG

try

debugResponse(http)

catch (Exception e)

Systemerrprintln(Error in receiving the

response)

ltcodegtcreatePapMessageltcodegt creates a Push Access

Protocoltype message

param address a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param ppgServer a ltcodegtStringltcodegt value

param pushId a ltcodegtStringltcodegt value

param notificationTo a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createPapMessage(String address

String addressType String ppgServer String pushId

String notificationTo)

return XML_VERSION + n + PAP_DOCTYPE + n +

ltpap product-name=Mobile Zoo Push

Initiatorgtn +

ltpush-message push-id= + pushId +

(notificationTo = null request-notification-

to= + notificationTo ) + gtn +

ltaddress address-value=WAPPUSH= + address +

TYPE= + addressType +

+ ppgServer + gtn +

ltpush-messagegtnltpapgt

ltcodegtcreateSiMessageltcodegt creates a service

indication type message

param url a ltcodegtStringltcodegt value

param created a ltcodegtStringltcodegt value

param expires a ltcodegtStringltcodegt value

Appendix C

53

param message a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createSiMessage(String url

String sid String created String expires String

action String message)

return XML_VERSION + SI_DOCTYPE +

ltsigtn +

ltindication href= + url + +

(sid = null si-id= + sid + ) +

created = null created= + created +

) +

(action = null action= + action +

) +

(expires = null expires= + expires +

) + gt +

message +

ltindicationgtnltsigt

Debug response

param http a ltcodegtHttpURLConnectionltcodegt value

exception Exception if an error occurs

private void debugResponse(HttpURLConnection http)

throws Exception

Systemoutprintln(httpgetResponseMessage())

String headerName

int i=0

while((headerName = httpgetHeaderFieldKey(i++)) =

null)

Systemoutprintln(headerName + +

httpgetHeaderField(headerName))

Systemoutprintln()

InputStreamReader in = new InputStreamReader(new

BufferedInputStream(httpgetInputStream()))

int c

Appendix C

54

while((c = inread()) = -1)

Systemoutprint((char)c)

Systemoutprintln()

ltcodegtgenPushIdltcodegt generates an unique push id

return a ltcodegtStringltcodegt value

private String genPushId()

pushId = 100000

return SystemcurrentTimeMillis() + + pushId++

55

References

[1] Microsoft ldquoGetting Mobile Using WML and WAP to Display Web Sites on

Mobile Devicesrdquo

URL msdnmicrosoftcomen-uslibraryaa140117(office10)aspx accessed

on April 10 2008

[2] DALE BULBROOK ldquoWAPA Beginnerrsquos Guiderdquo OsborneMcGraw-Hill 2001

[3] WAP Forum Wireless Application Protocol Architecture Specification Access on

Jan 12 2008 Available

httpwww1wapforumorgtechdocumentsWAP-210-WAPArch-2006 07 12-apdf

[4] WAP Forum Push Architectural Overview access on (2008 February 3) Available

httpwww1wapforumorgtechdocumentsWAP-250-PushArchOverview-2007 04

03-apdf

[5] Service indication PDF access on 62008 Available

httpwwww3orgTRhtml401structlinkshtml

[6] WAP Push Technology (openwave) PDF access on (2008 April) Available

URL httpwwwopenwavorg

[7] Web site (httpwwwwapforumorgwhatcopyrighthtm) access on May 2008

[8] ldquoWAP Push Proxy Gateway Specificationrdquo WAP Forum access on 16-August-

2007URI httpwwwwapforumorgPDF

[9] WAP Forum Access on (2008 MAY 31) WAP Service Indication Specification

Available httpwww1wapforumorgtechdocumentsWAP-167-ServiceInd-200507

31-apdf

  • odc_fpwmlandwap_topic3
  • N100E3
  • 21
  • 5

Chapter 4 System Design

33

The bearer box which connects to the SMS (Short Message Service) centers and

or CSD (Circuit Switched Data) routers providing a unified interface to them for

the wapbox The bearer box does this by implementing the WDP (Wireless

Datagram Protocol) layer of the WAP stack

The smsbox implements the rest of the SMS gateway functionality It receives

textual SMS messages from the bearerbox and interprets them as service

requests and responds to them in the appropriate way

The wapbox which hosts the upper layers of the WAP stack Each session and its

transactions are handled by the same wapbox (see figure 35)

1Figure 45 divisions of duties in kannel

4322 Working of the gateway

The bearer box receives UDP (User Datagram Protocol) packets from CSD routers

inspects them to see whether they are WAP packets if so then it will routes them to the

WAP box This simple design allows the bearer box to do a minimum of processing per

smsbox

wapbox

bearerbox

Kannel

SMS center

WAP phone

HTTP server

Chapter 4 System Design

34

packet The bearer box also sends the UDP packets that the other boxes generate which

adds some more routing processing The wapboxes implement the WTP (Wireless

Transaction Protocol) and WSP (Wireless Session Protocol) layers These take HTTP-

like requests from the phones and make the actual HTTP requests to content servers

compress the responses and send them back to the terminals (Sessions are maintained to

make as much use of the limited radio bandwidth as possible)

4323 External interfaces of the gateway

The gateway has interfaces to three external agents

bull SMS centers using various protocols

bull HTTP servers to fetch WAP and SMS content and to push WAP Content The

pull protocol is HTTP push PAP

bull WAP phones implementing the WAP protocol stack and (for push) WAP Push

client

Figure 36 summarize kannel external interfaces

4324 Configuring the gateway

The bearerbox smsbox and wapbox are the main working modules of the gateway and

must be configured before configuring the gateway These three modules are controlled

by a configuration file that has wapbox smsbox and bearerbox groups

Configuring the PPG core group

We use two components the PPG core group and the PPG user group The PPG

core group is used to configure the PI interface(for more details configuration

variables refer to appendix c)

Chapter 4 System Design

35

Mobile telephone

network

The Internet

smsbox

wapbox

bearerbox

Kannel

HTTP

HTTP

HTTP server

Serving WML

files

HTTP server

Serving HTML

files

TCP

TCP

WAPSMS

SMSC

WAP phoneNetwork base station

Workstation used for http

administration

Figure 46 External interfaces of the gateway

4325 Administering the gateway through an HTTP interface

Kannel can be administered via an HTTP interface All commands are given as normal

HTTP queries so they can easily be given from command lines like this one

links -dump httpip-adressportshutdownpassword=yourchoice

But it is advantageous to have graphical user interface for gateway control so we have

designed GUI through http

Chapter 4 System Design

36

433 Short Message Service Centre (SMSC)

A SMSC is an essential component when sending a push message from an IP network to

a mobile device in the architecture supported by the components and devices It is used to

remove the TCPIP layer that the push is encapsulatedrdquo in It is also the entity that

identifies the end-point device When this is done it is also the SMSC that is responsible

for the processing and final message delivery to the device After the process of de-

encapsulation and resolution of the client identity there should not be any difference

between this message and a message that is originated locally from the operator itself

(like a SMS)

In this project we just use a virtual SMS center we try first to get connection to a real

one but our effort was worthless

Finally the following figure depicts the overall flowchart of the WAP push system

(figure 47)

Chapter 4 System Design

37

PI

PPG

Create PAP

HTTP Post

Message

processing

OTA

Connection

oriented

Sessionless Session

oriented

WTP Initiation

WAP clinet

Application

Create content

Create

capability

entity

Database

SMS center

NoYes

Figure 47 the complete flowchart of the system

38

Chapter Five

5 System implementation and results

51 Implementation

511 The Push Proxy Gateway

First of all the Kannel gateway have been compiled and installed using gcc (GNU C

Compiler) this stage go fine except the operating system required more components to

be pre-installed and will configured

Then with stages of configuration to the gateway (Appendix B) it was capable of working

as PPG Figure 51 below show the gateway when it starts

Figure 51 starting kannel gateway

Then a web based user interface had been created to provide an easy way to control the

gateway remotely Figure 52 and figure 53

39

Figure 52 GUI for gateway control

512 The Push initiator

Next the push initiator design had been implemented using java programming language

as in design phase the implementation is taken carefully to make a reusable component

that could be used by other developer

PushInitiator class (Appendix B) implements a simple push initiator which can be used

to create and send messages to a push proxy gateway (PPG)

The method sendPushMessage sends a push message via the PPG to the client The client

is identified by the address which is either the phone number (address type is PLMN) or

IP address The message content and its mime type are also given as arguments to the

method the other tow important method are

createPapMessage This method creates a Push Access Protocol (PAP) type message

40

createSiMessage This method is used to create a service indication (SI) type message

Figure 53 showing running kannel status

513 WAP site

Since this site will be built for testing purpose and making sure that the system is

functional we had not go deep in this section Just simple WAP site with tow page has

been crated

41

52 Service indication

When a SI was pushed to any of the emulator or Nokia phones it was received and

presented in the way it was supposed to as specified in the WAP standard as shown in

figures below This is a proof that the devices claiming to support WAP push do so and

the design is will working See figures 53 through 56

Figure 55 service indication

42

Figure 57 SI details

52 Service load

The emulator correctly receives and interpreted the SL push the same as all of Nokia

phones we have tested

When a SL was pushed to the Ericsson phones it was not presented in the specified way

figure 58 I think that it is because of security reasons The reason for this assumption is

that the phones only supports on or off as security in their push configuration The

emulator on the other hand presents SL correctly Finally the Siemens phone did seem to

interpret SL but the current software was not very consistent It did load the SL without

user interference in the specified way when the user already where having an active

session If the user was offline the phone interface presented a symbol on the display

and did not load the service until the user clicked on the symbol

43

Chapter Six

6 conclusion and future work

In this chapter we will provide the conclusions and proposed future work for interested

individuals

61 Conclusions

In this project a WAP push system has been successfully designed and implemented It

provides a way to partially overcome the limitations encountered when accessing the

World Wide Web using handsets After comparing the proposed project objectives with

those accomplished the main goals are seen to be met

Phones from different manufactures all differ from the WAP-standard in some

ways One of the most obvious differences is the resolution of the display

During the work it has been noticed that the WML pages must be quite small We

have also noticed that the support for tables and some other tags are a bit limited

Even though the WML standard is smaller than the HTML standard it is a little

more complicated to write correct WML pages The main conclusion is that WAP

works pretty well but the phones are a little non-stable

The push proxy gateway is configured and worked probably with virtual SMS

center and it is easy to switch to a real one

The system depends mainly on open sources (ie Linux and kannek)

The design and implementation of the push initiator work well with the kannel

gateway and it should work correctly with other gateways

Chapter 6 Conclusion

44

62 Further Work

The possibilities of wireless push are interesting enough that it has to be worth to know if

the security and conformance problems will be solved in WAP push If they are solved

and the technique is refined then there should be nothing to stop the great number of

services that will follow in its footsteps Therefore there is further work that should be

done and the most interesting parts are in my opinion these

621 Security Aspect

One of the problems today is that the phones supporting push does not have the detailed

security settings that a technique like this needs Therefore it would be interesting to look

into the possibility to add these without confusing the user I suggest furthering looking

into usability aspects of security in WAP Push for short

622 GPS integration possibility

This will provide location dependent delivery of WAP push it will have great

applications in telematic and ecommerce advertising

623 Conformance to Standards

An interesting project would be to examine if the main reason for the nonstandard

solutions in the existing WAP push software is the result of difficulties in

implementation Or if the main reason is that the manufacturers wants to provide

proprietary solutions A reason why one may want to know this is that if the problem is

depending on implementation problems then it might get better

45

Appendix A Abbreviations

CDMA Code Division Multiple Access

CO Cache Operation

DTD Document Type Definition

GSM Global System for Mobile

HTTP Hypertext Transfer Protocol

IP Internet Protocol

MSISDN Mobile Station International Subscriber Directory Number

OTA Over The Air

PAP Push Access Protocol

PushOTA Push Over The Air

PDA Personal Digital Assistant

P1 Push Initiator

PLMN Public Land Mobile Networks

PPG Push Proxy Gateway

SI Service Indication

SIA Session Initiation Application

SIR Session Initiation Request

SL Service Loading

SMPP Short Message Peer to Peer

SMS Short Message System

SMSC Short Message System Center

UCP Universal Computer Protocol

URI Uniform Resource Identifier

URL Uniform Resource Locator

UTC Universal Time Coordinated

WAP Wireless Application Protocol

WBXML WAP binary XML

WDP Wireless Datagram Protocol

WSP Wireless Session Protocol

WTLS Wireless Transport Layer Security

XML Extensible Mark-up Language

46

Appendix B Kannel gateway configurations

THIS IS A SAMPLE CONFIGURATION FOR KANNEL

group = core

admin-port = 13000

admin-password = admin

status-password = admin

admin-deny-ip =

admin-allow-ip = 127001172161455

log-file = tmpkannellog

log-level = 0

http-proxy-host = 172161411

http-proxy-port = 8080

http-proxy-exceptions = 127001

Smsbox related

smsbox-port = 13001

box-deny-ip =

box-allow-ip = 127001

bearerbox-host =localhost

Wapbox related

wapbox-port = 13002

udp-deny-ip =

udp-allow-ip = 127001

bearerbox-host =localhost

SMSC GSM

group = smsc

smsc = at

modemtype = auto

speed =9600

device = devttyS0

SMSC HTTP

group = smsc

smsc = http

system-type = kannel

port = 13016

connect-allow-ip = 127001

Appendix B

47

username = wappush

password = wappush

SMSBOX SETUP

group = smsbox

bearerbox-host = localhost

sendsms-port = 13013

sendsms-chars = 0123456789 +-

log-file = tmpsmsboxlog

log-level = 0

access-log = accesslog

white-list = 127001

black-list =

SEND-SMS USERS

group = sendsms-user

username = wappush

password = wappush

user-deny-ip =

user-allow-ip = 127001

PPG group

group = ppg

ppg-url = wappush

ppg-port = 8080

concurrent-pushes = 100

trusted-pi = true

users = 1024

service-name = ppg

ppg-smsbox-id = dlrbox

WAP PUSH USER

group = wap-push-user

wap-push-user = picom

ppg-username = wappush

ppg-password = wappush

allow-ip = localhost

48

Appendix C Selected Codes

Gateway Control Form

ltDOCTYPE HTML PUBLIC -W3CDTD HTML 32ENgt

lthtmlgt ltheadgt

lttitlegtGateway control formlttitlegt

ltheadgt

ltbody bgcolor=white text=black link=blue vlink=navy

alink=redgt

ltbase target=submitgt

ltscriptgt

function update_status()

if ( adminactionvalue == status )

adminaction = http + adminhostnamevalue +

+ adminportvalue + status +

adminstatusformatvalue

else

adminaction = http + adminhostnamevalue +

+ adminportvalue + + adminactionvalue

adminpasswordvalue = adminpasswordvalue

actiongovalue = GO GET +adminaction

ltscriptgt

lttable align=centergt

lttrgtltp align=centergtlth2gtGateway control

formlth2gtltpgtlttrgt

lttrgt lttdgtHostnamelttdgtlttdgtltinput type=text

name=adminhostname value=localhost

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPortlttdgtlttdgtltinput type=text

name=adminport value=13000

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPasswordlttdgtlttdgtltinput type=password

name=adminpassword value=

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtActionlttdgtlttdgtltselect name=adminaction

onChange=update_status()gt

ltoption value=statusgtStatusltoptiongt

ltoption value=suspendgtSuspendltoptiongt

ltoption value=isolategtIsolateltoptiongt

Appendix C

49

ltoption value=shutdowngtShutdownltoptiongt

ltoption value=resumegtResumeltoptiongt

ltselectgtlttdgt lttrgt

lttrgt lttdgtStatus Formatlttdgtlttdgtltselect

name=adminstatusformat onChange=update_status()gt

ltoption value=gthtmlltoptiongtltoption

value=txtgttxtltoptiongtltoption

value=xmlgtxmlltoptiongtltselectgtlttdgt lttrgt

ltform name=admin method=get

action=httplocalhost13000status

encoding=applicationx-www-formgt

ltinput type=hidden name=password value=gt

lttrgt

lttdgtGolttdgt

ltformgt

lttdgtltinput type=submit value=go name=actiongo

onClick=documentadminsubmit()gtlttdgt

lttrgt

lttablegt

ltbodygt

lthtmlgt

Push Initiator Class

import javanetURL

import javanetHttpURLConnection

import javaio

Class implements a simple push initiator It can be

used to create and send messages to push proxy

gateway (ppg)

public final class PushInitiator

xml version

private final static String XML_VERSION = ltxml

version=10gt

Push Access Protocol (PAP) document type

private final static String PAP_DOCTYPE =

Appendix C

50

ltDOCTYPE pap PUBLIC -WAPFORUMDTD PAP 10EN

httpwwwwapforumorgDTDpap_10dtd gt

content type of the push request multipart body

private final static String CONTENT_TYPE =

multipartrelated boundary=multipart-boundary

type=applicationxml

Service Indication (SI) document type

private static final String SI_DOCTYPE = ltDOCTYPE si

PUBLIC -WAPFORUMDTD SI 10EN +

httpwwwwapforumorgDTDsidtdgt

private static int pushId = 0

PPG url where the pap message is to be sent

private final URL ppgUrl

some push proxy gateways may also require the

authentication of the push initiator

For instance the push initiator may be required to

send an HTTP authorization header in each request

private final String authorization

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

public PushInitiator(URL ppgUrl) thisppgUrl =

ppgUrl

authorization = null

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

param authorization a ltcodegtStringltcodegt value

public PushInitiator(URL ppgUrl String authorization)

thisppgUrl = ppgUrl

Appendix C

51

thisauthorization = authorization

Systemoutprintln(Push Initiator created ppgUrl =

+ ppgUrl)

ltcodegtsendPushMessageltcodegt sends push message to

ppg

param clientAddress a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param message a ltcodegtStringltcodegt value

param mimeType a ltcodegtStringltcodegt value

exception Exception if an error occurs

public void sendPushMessage(String clientAddress

String addressTypeString message String mimeType)

throws Exception

HttpURLConnection http =

(HttpURLConnection)ppgUrlopenConnection()

String ppgServer = ppgUrlgetHost()

httpsetDoInput(true)

httpsetRequestProperty(Content-Type CONTENT_TYPE)

if(authorization = null)

if(authorizationtrim()equals())

httpsetRequestProperty(Authorization

authorization)

httpsetDoOutput(true)

PrintWriter out = new PrintWriter(new

BufferedOutputStream(httpgetOutputStream()))

outprintln(--multipart-boundary)

outprintln(Content-type applicationxml)

outprintln()

outprintln(createPapMessage(clientAddress

addressTypeppgServer genPushId() null))

outprintln()

outprintln(--multipart-boundary)

outprintln(Content-type + mimeType)

outprintln()

outprintln(message)

outprintln()

outprintln(--multipart-boundary--)

outflush()

outclose()

httpconnect()

Appendix C

52

finally read and debug the response received from

PPG

try

debugResponse(http)

catch (Exception e)

Systemerrprintln(Error in receiving the

response)

ltcodegtcreatePapMessageltcodegt creates a Push Access

Protocoltype message

param address a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param ppgServer a ltcodegtStringltcodegt value

param pushId a ltcodegtStringltcodegt value

param notificationTo a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createPapMessage(String address

String addressType String ppgServer String pushId

String notificationTo)

return XML_VERSION + n + PAP_DOCTYPE + n +

ltpap product-name=Mobile Zoo Push

Initiatorgtn +

ltpush-message push-id= + pushId +

(notificationTo = null request-notification-

to= + notificationTo ) + gtn +

ltaddress address-value=WAPPUSH= + address +

TYPE= + addressType +

+ ppgServer + gtn +

ltpush-messagegtnltpapgt

ltcodegtcreateSiMessageltcodegt creates a service

indication type message

param url a ltcodegtStringltcodegt value

param created a ltcodegtStringltcodegt value

param expires a ltcodegtStringltcodegt value

Appendix C

53

param message a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createSiMessage(String url

String sid String created String expires String

action String message)

return XML_VERSION + SI_DOCTYPE +

ltsigtn +

ltindication href= + url + +

(sid = null si-id= + sid + ) +

created = null created= + created +

) +

(action = null action= + action +

) +

(expires = null expires= + expires +

) + gt +

message +

ltindicationgtnltsigt

Debug response

param http a ltcodegtHttpURLConnectionltcodegt value

exception Exception if an error occurs

private void debugResponse(HttpURLConnection http)

throws Exception

Systemoutprintln(httpgetResponseMessage())

String headerName

int i=0

while((headerName = httpgetHeaderFieldKey(i++)) =

null)

Systemoutprintln(headerName + +

httpgetHeaderField(headerName))

Systemoutprintln()

InputStreamReader in = new InputStreamReader(new

BufferedInputStream(httpgetInputStream()))

int c

Appendix C

54

while((c = inread()) = -1)

Systemoutprint((char)c)

Systemoutprintln()

ltcodegtgenPushIdltcodegt generates an unique push id

return a ltcodegtStringltcodegt value

private String genPushId()

pushId = 100000

return SystemcurrentTimeMillis() + + pushId++

55

References

[1] Microsoft ldquoGetting Mobile Using WML and WAP to Display Web Sites on

Mobile Devicesrdquo

URL msdnmicrosoftcomen-uslibraryaa140117(office10)aspx accessed

on April 10 2008

[2] DALE BULBROOK ldquoWAPA Beginnerrsquos Guiderdquo OsborneMcGraw-Hill 2001

[3] WAP Forum Wireless Application Protocol Architecture Specification Access on

Jan 12 2008 Available

httpwww1wapforumorgtechdocumentsWAP-210-WAPArch-2006 07 12-apdf

[4] WAP Forum Push Architectural Overview access on (2008 February 3) Available

httpwww1wapforumorgtechdocumentsWAP-250-PushArchOverview-2007 04

03-apdf

[5] Service indication PDF access on 62008 Available

httpwwww3orgTRhtml401structlinkshtml

[6] WAP Push Technology (openwave) PDF access on (2008 April) Available

URL httpwwwopenwavorg

[7] Web site (httpwwwwapforumorgwhatcopyrighthtm) access on May 2008

[8] ldquoWAP Push Proxy Gateway Specificationrdquo WAP Forum access on 16-August-

2007URI httpwwwwapforumorgPDF

[9] WAP Forum Access on (2008 MAY 31) WAP Service Indication Specification

Available httpwww1wapforumorgtechdocumentsWAP-167-ServiceInd-200507

31-apdf

  • odc_fpwmlandwap_topic3
  • N100E3
  • 21
  • 5

Chapter 4 System Design

34

packet The bearer box also sends the UDP packets that the other boxes generate which

adds some more routing processing The wapboxes implement the WTP (Wireless

Transaction Protocol) and WSP (Wireless Session Protocol) layers These take HTTP-

like requests from the phones and make the actual HTTP requests to content servers

compress the responses and send them back to the terminals (Sessions are maintained to

make as much use of the limited radio bandwidth as possible)

4323 External interfaces of the gateway

The gateway has interfaces to three external agents

bull SMS centers using various protocols

bull HTTP servers to fetch WAP and SMS content and to push WAP Content The

pull protocol is HTTP push PAP

bull WAP phones implementing the WAP protocol stack and (for push) WAP Push

client

Figure 36 summarize kannel external interfaces

4324 Configuring the gateway

The bearerbox smsbox and wapbox are the main working modules of the gateway and

must be configured before configuring the gateway These three modules are controlled

by a configuration file that has wapbox smsbox and bearerbox groups

Configuring the PPG core group

We use two components the PPG core group and the PPG user group The PPG

core group is used to configure the PI interface(for more details configuration

variables refer to appendix c)

Chapter 4 System Design

35

Mobile telephone

network

The Internet

smsbox

wapbox

bearerbox

Kannel

HTTP

HTTP

HTTP server

Serving WML

files

HTTP server

Serving HTML

files

TCP

TCP

WAPSMS

SMSC

WAP phoneNetwork base station

Workstation used for http

administration

Figure 46 External interfaces of the gateway

4325 Administering the gateway through an HTTP interface

Kannel can be administered via an HTTP interface All commands are given as normal

HTTP queries so they can easily be given from command lines like this one

links -dump httpip-adressportshutdownpassword=yourchoice

But it is advantageous to have graphical user interface for gateway control so we have

designed GUI through http

Chapter 4 System Design

36

433 Short Message Service Centre (SMSC)

A SMSC is an essential component when sending a push message from an IP network to

a mobile device in the architecture supported by the components and devices It is used to

remove the TCPIP layer that the push is encapsulatedrdquo in It is also the entity that

identifies the end-point device When this is done it is also the SMSC that is responsible

for the processing and final message delivery to the device After the process of de-

encapsulation and resolution of the client identity there should not be any difference

between this message and a message that is originated locally from the operator itself

(like a SMS)

In this project we just use a virtual SMS center we try first to get connection to a real

one but our effort was worthless

Finally the following figure depicts the overall flowchart of the WAP push system

(figure 47)

Chapter 4 System Design

37

PI

PPG

Create PAP

HTTP Post

Message

processing

OTA

Connection

oriented

Sessionless Session

oriented

WTP Initiation

WAP clinet

Application

Create content

Create

capability

entity

Database

SMS center

NoYes

Figure 47 the complete flowchart of the system

38

Chapter Five

5 System implementation and results

51 Implementation

511 The Push Proxy Gateway

First of all the Kannel gateway have been compiled and installed using gcc (GNU C

Compiler) this stage go fine except the operating system required more components to

be pre-installed and will configured

Then with stages of configuration to the gateway (Appendix B) it was capable of working

as PPG Figure 51 below show the gateway when it starts

Figure 51 starting kannel gateway

Then a web based user interface had been created to provide an easy way to control the

gateway remotely Figure 52 and figure 53

39

Figure 52 GUI for gateway control

512 The Push initiator

Next the push initiator design had been implemented using java programming language

as in design phase the implementation is taken carefully to make a reusable component

that could be used by other developer

PushInitiator class (Appendix B) implements a simple push initiator which can be used

to create and send messages to a push proxy gateway (PPG)

The method sendPushMessage sends a push message via the PPG to the client The client

is identified by the address which is either the phone number (address type is PLMN) or

IP address The message content and its mime type are also given as arguments to the

method the other tow important method are

createPapMessage This method creates a Push Access Protocol (PAP) type message

40

createSiMessage This method is used to create a service indication (SI) type message

Figure 53 showing running kannel status

513 WAP site

Since this site will be built for testing purpose and making sure that the system is

functional we had not go deep in this section Just simple WAP site with tow page has

been crated

41

52 Service indication

When a SI was pushed to any of the emulator or Nokia phones it was received and

presented in the way it was supposed to as specified in the WAP standard as shown in

figures below This is a proof that the devices claiming to support WAP push do so and

the design is will working See figures 53 through 56

Figure 55 service indication

42

Figure 57 SI details

52 Service load

The emulator correctly receives and interpreted the SL push the same as all of Nokia

phones we have tested

When a SL was pushed to the Ericsson phones it was not presented in the specified way

figure 58 I think that it is because of security reasons The reason for this assumption is

that the phones only supports on or off as security in their push configuration The

emulator on the other hand presents SL correctly Finally the Siemens phone did seem to

interpret SL but the current software was not very consistent It did load the SL without

user interference in the specified way when the user already where having an active

session If the user was offline the phone interface presented a symbol on the display

and did not load the service until the user clicked on the symbol

43

Chapter Six

6 conclusion and future work

In this chapter we will provide the conclusions and proposed future work for interested

individuals

61 Conclusions

In this project a WAP push system has been successfully designed and implemented It

provides a way to partially overcome the limitations encountered when accessing the

World Wide Web using handsets After comparing the proposed project objectives with

those accomplished the main goals are seen to be met

Phones from different manufactures all differ from the WAP-standard in some

ways One of the most obvious differences is the resolution of the display

During the work it has been noticed that the WML pages must be quite small We

have also noticed that the support for tables and some other tags are a bit limited

Even though the WML standard is smaller than the HTML standard it is a little

more complicated to write correct WML pages The main conclusion is that WAP

works pretty well but the phones are a little non-stable

The push proxy gateway is configured and worked probably with virtual SMS

center and it is easy to switch to a real one

The system depends mainly on open sources (ie Linux and kannek)

The design and implementation of the push initiator work well with the kannel

gateway and it should work correctly with other gateways

Chapter 6 Conclusion

44

62 Further Work

The possibilities of wireless push are interesting enough that it has to be worth to know if

the security and conformance problems will be solved in WAP push If they are solved

and the technique is refined then there should be nothing to stop the great number of

services that will follow in its footsteps Therefore there is further work that should be

done and the most interesting parts are in my opinion these

621 Security Aspect

One of the problems today is that the phones supporting push does not have the detailed

security settings that a technique like this needs Therefore it would be interesting to look

into the possibility to add these without confusing the user I suggest furthering looking

into usability aspects of security in WAP Push for short

622 GPS integration possibility

This will provide location dependent delivery of WAP push it will have great

applications in telematic and ecommerce advertising

623 Conformance to Standards

An interesting project would be to examine if the main reason for the nonstandard

solutions in the existing WAP push software is the result of difficulties in

implementation Or if the main reason is that the manufacturers wants to provide

proprietary solutions A reason why one may want to know this is that if the problem is

depending on implementation problems then it might get better

45

Appendix A Abbreviations

CDMA Code Division Multiple Access

CO Cache Operation

DTD Document Type Definition

GSM Global System for Mobile

HTTP Hypertext Transfer Protocol

IP Internet Protocol

MSISDN Mobile Station International Subscriber Directory Number

OTA Over The Air

PAP Push Access Protocol

PushOTA Push Over The Air

PDA Personal Digital Assistant

P1 Push Initiator

PLMN Public Land Mobile Networks

PPG Push Proxy Gateway

SI Service Indication

SIA Session Initiation Application

SIR Session Initiation Request

SL Service Loading

SMPP Short Message Peer to Peer

SMS Short Message System

SMSC Short Message System Center

UCP Universal Computer Protocol

URI Uniform Resource Identifier

URL Uniform Resource Locator

UTC Universal Time Coordinated

WAP Wireless Application Protocol

WBXML WAP binary XML

WDP Wireless Datagram Protocol

WSP Wireless Session Protocol

WTLS Wireless Transport Layer Security

XML Extensible Mark-up Language

46

Appendix B Kannel gateway configurations

THIS IS A SAMPLE CONFIGURATION FOR KANNEL

group = core

admin-port = 13000

admin-password = admin

status-password = admin

admin-deny-ip =

admin-allow-ip = 127001172161455

log-file = tmpkannellog

log-level = 0

http-proxy-host = 172161411

http-proxy-port = 8080

http-proxy-exceptions = 127001

Smsbox related

smsbox-port = 13001

box-deny-ip =

box-allow-ip = 127001

bearerbox-host =localhost

Wapbox related

wapbox-port = 13002

udp-deny-ip =

udp-allow-ip = 127001

bearerbox-host =localhost

SMSC GSM

group = smsc

smsc = at

modemtype = auto

speed =9600

device = devttyS0

SMSC HTTP

group = smsc

smsc = http

system-type = kannel

port = 13016

connect-allow-ip = 127001

Appendix B

47

username = wappush

password = wappush

SMSBOX SETUP

group = smsbox

bearerbox-host = localhost

sendsms-port = 13013

sendsms-chars = 0123456789 +-

log-file = tmpsmsboxlog

log-level = 0

access-log = accesslog

white-list = 127001

black-list =

SEND-SMS USERS

group = sendsms-user

username = wappush

password = wappush

user-deny-ip =

user-allow-ip = 127001

PPG group

group = ppg

ppg-url = wappush

ppg-port = 8080

concurrent-pushes = 100

trusted-pi = true

users = 1024

service-name = ppg

ppg-smsbox-id = dlrbox

WAP PUSH USER

group = wap-push-user

wap-push-user = picom

ppg-username = wappush

ppg-password = wappush

allow-ip = localhost

48

Appendix C Selected Codes

Gateway Control Form

ltDOCTYPE HTML PUBLIC -W3CDTD HTML 32ENgt

lthtmlgt ltheadgt

lttitlegtGateway control formlttitlegt

ltheadgt

ltbody bgcolor=white text=black link=blue vlink=navy

alink=redgt

ltbase target=submitgt

ltscriptgt

function update_status()

if ( adminactionvalue == status )

adminaction = http + adminhostnamevalue +

+ adminportvalue + status +

adminstatusformatvalue

else

adminaction = http + adminhostnamevalue +

+ adminportvalue + + adminactionvalue

adminpasswordvalue = adminpasswordvalue

actiongovalue = GO GET +adminaction

ltscriptgt

lttable align=centergt

lttrgtltp align=centergtlth2gtGateway control

formlth2gtltpgtlttrgt

lttrgt lttdgtHostnamelttdgtlttdgtltinput type=text

name=adminhostname value=localhost

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPortlttdgtlttdgtltinput type=text

name=adminport value=13000

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPasswordlttdgtlttdgtltinput type=password

name=adminpassword value=

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtActionlttdgtlttdgtltselect name=adminaction

onChange=update_status()gt

ltoption value=statusgtStatusltoptiongt

ltoption value=suspendgtSuspendltoptiongt

ltoption value=isolategtIsolateltoptiongt

Appendix C

49

ltoption value=shutdowngtShutdownltoptiongt

ltoption value=resumegtResumeltoptiongt

ltselectgtlttdgt lttrgt

lttrgt lttdgtStatus Formatlttdgtlttdgtltselect

name=adminstatusformat onChange=update_status()gt

ltoption value=gthtmlltoptiongtltoption

value=txtgttxtltoptiongtltoption

value=xmlgtxmlltoptiongtltselectgtlttdgt lttrgt

ltform name=admin method=get

action=httplocalhost13000status

encoding=applicationx-www-formgt

ltinput type=hidden name=password value=gt

lttrgt

lttdgtGolttdgt

ltformgt

lttdgtltinput type=submit value=go name=actiongo

onClick=documentadminsubmit()gtlttdgt

lttrgt

lttablegt

ltbodygt

lthtmlgt

Push Initiator Class

import javanetURL

import javanetHttpURLConnection

import javaio

Class implements a simple push initiator It can be

used to create and send messages to push proxy

gateway (ppg)

public final class PushInitiator

xml version

private final static String XML_VERSION = ltxml

version=10gt

Push Access Protocol (PAP) document type

private final static String PAP_DOCTYPE =

Appendix C

50

ltDOCTYPE pap PUBLIC -WAPFORUMDTD PAP 10EN

httpwwwwapforumorgDTDpap_10dtd gt

content type of the push request multipart body

private final static String CONTENT_TYPE =

multipartrelated boundary=multipart-boundary

type=applicationxml

Service Indication (SI) document type

private static final String SI_DOCTYPE = ltDOCTYPE si

PUBLIC -WAPFORUMDTD SI 10EN +

httpwwwwapforumorgDTDsidtdgt

private static int pushId = 0

PPG url where the pap message is to be sent

private final URL ppgUrl

some push proxy gateways may also require the

authentication of the push initiator

For instance the push initiator may be required to

send an HTTP authorization header in each request

private final String authorization

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

public PushInitiator(URL ppgUrl) thisppgUrl =

ppgUrl

authorization = null

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

param authorization a ltcodegtStringltcodegt value

public PushInitiator(URL ppgUrl String authorization)

thisppgUrl = ppgUrl

Appendix C

51

thisauthorization = authorization

Systemoutprintln(Push Initiator created ppgUrl =

+ ppgUrl)

ltcodegtsendPushMessageltcodegt sends push message to

ppg

param clientAddress a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param message a ltcodegtStringltcodegt value

param mimeType a ltcodegtStringltcodegt value

exception Exception if an error occurs

public void sendPushMessage(String clientAddress

String addressTypeString message String mimeType)

throws Exception

HttpURLConnection http =

(HttpURLConnection)ppgUrlopenConnection()

String ppgServer = ppgUrlgetHost()

httpsetDoInput(true)

httpsetRequestProperty(Content-Type CONTENT_TYPE)

if(authorization = null)

if(authorizationtrim()equals())

httpsetRequestProperty(Authorization

authorization)

httpsetDoOutput(true)

PrintWriter out = new PrintWriter(new

BufferedOutputStream(httpgetOutputStream()))

outprintln(--multipart-boundary)

outprintln(Content-type applicationxml)

outprintln()

outprintln(createPapMessage(clientAddress

addressTypeppgServer genPushId() null))

outprintln()

outprintln(--multipart-boundary)

outprintln(Content-type + mimeType)

outprintln()

outprintln(message)

outprintln()

outprintln(--multipart-boundary--)

outflush()

outclose()

httpconnect()

Appendix C

52

finally read and debug the response received from

PPG

try

debugResponse(http)

catch (Exception e)

Systemerrprintln(Error in receiving the

response)

ltcodegtcreatePapMessageltcodegt creates a Push Access

Protocoltype message

param address a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param ppgServer a ltcodegtStringltcodegt value

param pushId a ltcodegtStringltcodegt value

param notificationTo a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createPapMessage(String address

String addressType String ppgServer String pushId

String notificationTo)

return XML_VERSION + n + PAP_DOCTYPE + n +

ltpap product-name=Mobile Zoo Push

Initiatorgtn +

ltpush-message push-id= + pushId +

(notificationTo = null request-notification-

to= + notificationTo ) + gtn +

ltaddress address-value=WAPPUSH= + address +

TYPE= + addressType +

+ ppgServer + gtn +

ltpush-messagegtnltpapgt

ltcodegtcreateSiMessageltcodegt creates a service

indication type message

param url a ltcodegtStringltcodegt value

param created a ltcodegtStringltcodegt value

param expires a ltcodegtStringltcodegt value

Appendix C

53

param message a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createSiMessage(String url

String sid String created String expires String

action String message)

return XML_VERSION + SI_DOCTYPE +

ltsigtn +

ltindication href= + url + +

(sid = null si-id= + sid + ) +

created = null created= + created +

) +

(action = null action= + action +

) +

(expires = null expires= + expires +

) + gt +

message +

ltindicationgtnltsigt

Debug response

param http a ltcodegtHttpURLConnectionltcodegt value

exception Exception if an error occurs

private void debugResponse(HttpURLConnection http)

throws Exception

Systemoutprintln(httpgetResponseMessage())

String headerName

int i=0

while((headerName = httpgetHeaderFieldKey(i++)) =

null)

Systemoutprintln(headerName + +

httpgetHeaderField(headerName))

Systemoutprintln()

InputStreamReader in = new InputStreamReader(new

BufferedInputStream(httpgetInputStream()))

int c

Appendix C

54

while((c = inread()) = -1)

Systemoutprint((char)c)

Systemoutprintln()

ltcodegtgenPushIdltcodegt generates an unique push id

return a ltcodegtStringltcodegt value

private String genPushId()

pushId = 100000

return SystemcurrentTimeMillis() + + pushId++

55

References

[1] Microsoft ldquoGetting Mobile Using WML and WAP to Display Web Sites on

Mobile Devicesrdquo

URL msdnmicrosoftcomen-uslibraryaa140117(office10)aspx accessed

on April 10 2008

[2] DALE BULBROOK ldquoWAPA Beginnerrsquos Guiderdquo OsborneMcGraw-Hill 2001

[3] WAP Forum Wireless Application Protocol Architecture Specification Access on

Jan 12 2008 Available

httpwww1wapforumorgtechdocumentsWAP-210-WAPArch-2006 07 12-apdf

[4] WAP Forum Push Architectural Overview access on (2008 February 3) Available

httpwww1wapforumorgtechdocumentsWAP-250-PushArchOverview-2007 04

03-apdf

[5] Service indication PDF access on 62008 Available

httpwwww3orgTRhtml401structlinkshtml

[6] WAP Push Technology (openwave) PDF access on (2008 April) Available

URL httpwwwopenwavorg

[7] Web site (httpwwwwapforumorgwhatcopyrighthtm) access on May 2008

[8] ldquoWAP Push Proxy Gateway Specificationrdquo WAP Forum access on 16-August-

2007URI httpwwwwapforumorgPDF

[9] WAP Forum Access on (2008 MAY 31) WAP Service Indication Specification

Available httpwww1wapforumorgtechdocumentsWAP-167-ServiceInd-200507

31-apdf

  • odc_fpwmlandwap_topic3
  • N100E3
  • 21
  • 5

Chapter 4 System Design

35

Mobile telephone

network

The Internet

smsbox

wapbox

bearerbox

Kannel

HTTP

HTTP

HTTP server

Serving WML

files

HTTP server

Serving HTML

files

TCP

TCP

WAPSMS

SMSC

WAP phoneNetwork base station

Workstation used for http

administration

Figure 46 External interfaces of the gateway

4325 Administering the gateway through an HTTP interface

Kannel can be administered via an HTTP interface All commands are given as normal

HTTP queries so they can easily be given from command lines like this one

links -dump httpip-adressportshutdownpassword=yourchoice

But it is advantageous to have graphical user interface for gateway control so we have

designed GUI through http

Chapter 4 System Design

36

433 Short Message Service Centre (SMSC)

A SMSC is an essential component when sending a push message from an IP network to

a mobile device in the architecture supported by the components and devices It is used to

remove the TCPIP layer that the push is encapsulatedrdquo in It is also the entity that

identifies the end-point device When this is done it is also the SMSC that is responsible

for the processing and final message delivery to the device After the process of de-

encapsulation and resolution of the client identity there should not be any difference

between this message and a message that is originated locally from the operator itself

(like a SMS)

In this project we just use a virtual SMS center we try first to get connection to a real

one but our effort was worthless

Finally the following figure depicts the overall flowchart of the WAP push system

(figure 47)

Chapter 4 System Design

37

PI

PPG

Create PAP

HTTP Post

Message

processing

OTA

Connection

oriented

Sessionless Session

oriented

WTP Initiation

WAP clinet

Application

Create content

Create

capability

entity

Database

SMS center

NoYes

Figure 47 the complete flowchart of the system

38

Chapter Five

5 System implementation and results

51 Implementation

511 The Push Proxy Gateway

First of all the Kannel gateway have been compiled and installed using gcc (GNU C

Compiler) this stage go fine except the operating system required more components to

be pre-installed and will configured

Then with stages of configuration to the gateway (Appendix B) it was capable of working

as PPG Figure 51 below show the gateway when it starts

Figure 51 starting kannel gateway

Then a web based user interface had been created to provide an easy way to control the

gateway remotely Figure 52 and figure 53

39

Figure 52 GUI for gateway control

512 The Push initiator

Next the push initiator design had been implemented using java programming language

as in design phase the implementation is taken carefully to make a reusable component

that could be used by other developer

PushInitiator class (Appendix B) implements a simple push initiator which can be used

to create and send messages to a push proxy gateway (PPG)

The method sendPushMessage sends a push message via the PPG to the client The client

is identified by the address which is either the phone number (address type is PLMN) or

IP address The message content and its mime type are also given as arguments to the

method the other tow important method are

createPapMessage This method creates a Push Access Protocol (PAP) type message

40

createSiMessage This method is used to create a service indication (SI) type message

Figure 53 showing running kannel status

513 WAP site

Since this site will be built for testing purpose and making sure that the system is

functional we had not go deep in this section Just simple WAP site with tow page has

been crated

41

52 Service indication

When a SI was pushed to any of the emulator or Nokia phones it was received and

presented in the way it was supposed to as specified in the WAP standard as shown in

figures below This is a proof that the devices claiming to support WAP push do so and

the design is will working See figures 53 through 56

Figure 55 service indication

42

Figure 57 SI details

52 Service load

The emulator correctly receives and interpreted the SL push the same as all of Nokia

phones we have tested

When a SL was pushed to the Ericsson phones it was not presented in the specified way

figure 58 I think that it is because of security reasons The reason for this assumption is

that the phones only supports on or off as security in their push configuration The

emulator on the other hand presents SL correctly Finally the Siemens phone did seem to

interpret SL but the current software was not very consistent It did load the SL without

user interference in the specified way when the user already where having an active

session If the user was offline the phone interface presented a symbol on the display

and did not load the service until the user clicked on the symbol

43

Chapter Six

6 conclusion and future work

In this chapter we will provide the conclusions and proposed future work for interested

individuals

61 Conclusions

In this project a WAP push system has been successfully designed and implemented It

provides a way to partially overcome the limitations encountered when accessing the

World Wide Web using handsets After comparing the proposed project objectives with

those accomplished the main goals are seen to be met

Phones from different manufactures all differ from the WAP-standard in some

ways One of the most obvious differences is the resolution of the display

During the work it has been noticed that the WML pages must be quite small We

have also noticed that the support for tables and some other tags are a bit limited

Even though the WML standard is smaller than the HTML standard it is a little

more complicated to write correct WML pages The main conclusion is that WAP

works pretty well but the phones are a little non-stable

The push proxy gateway is configured and worked probably with virtual SMS

center and it is easy to switch to a real one

The system depends mainly on open sources (ie Linux and kannek)

The design and implementation of the push initiator work well with the kannel

gateway and it should work correctly with other gateways

Chapter 6 Conclusion

44

62 Further Work

The possibilities of wireless push are interesting enough that it has to be worth to know if

the security and conformance problems will be solved in WAP push If they are solved

and the technique is refined then there should be nothing to stop the great number of

services that will follow in its footsteps Therefore there is further work that should be

done and the most interesting parts are in my opinion these

621 Security Aspect

One of the problems today is that the phones supporting push does not have the detailed

security settings that a technique like this needs Therefore it would be interesting to look

into the possibility to add these without confusing the user I suggest furthering looking

into usability aspects of security in WAP Push for short

622 GPS integration possibility

This will provide location dependent delivery of WAP push it will have great

applications in telematic and ecommerce advertising

623 Conformance to Standards

An interesting project would be to examine if the main reason for the nonstandard

solutions in the existing WAP push software is the result of difficulties in

implementation Or if the main reason is that the manufacturers wants to provide

proprietary solutions A reason why one may want to know this is that if the problem is

depending on implementation problems then it might get better

45

Appendix A Abbreviations

CDMA Code Division Multiple Access

CO Cache Operation

DTD Document Type Definition

GSM Global System for Mobile

HTTP Hypertext Transfer Protocol

IP Internet Protocol

MSISDN Mobile Station International Subscriber Directory Number

OTA Over The Air

PAP Push Access Protocol

PushOTA Push Over The Air

PDA Personal Digital Assistant

P1 Push Initiator

PLMN Public Land Mobile Networks

PPG Push Proxy Gateway

SI Service Indication

SIA Session Initiation Application

SIR Session Initiation Request

SL Service Loading

SMPP Short Message Peer to Peer

SMS Short Message System

SMSC Short Message System Center

UCP Universal Computer Protocol

URI Uniform Resource Identifier

URL Uniform Resource Locator

UTC Universal Time Coordinated

WAP Wireless Application Protocol

WBXML WAP binary XML

WDP Wireless Datagram Protocol

WSP Wireless Session Protocol

WTLS Wireless Transport Layer Security

XML Extensible Mark-up Language

46

Appendix B Kannel gateway configurations

THIS IS A SAMPLE CONFIGURATION FOR KANNEL

group = core

admin-port = 13000

admin-password = admin

status-password = admin

admin-deny-ip =

admin-allow-ip = 127001172161455

log-file = tmpkannellog

log-level = 0

http-proxy-host = 172161411

http-proxy-port = 8080

http-proxy-exceptions = 127001

Smsbox related

smsbox-port = 13001

box-deny-ip =

box-allow-ip = 127001

bearerbox-host =localhost

Wapbox related

wapbox-port = 13002

udp-deny-ip =

udp-allow-ip = 127001

bearerbox-host =localhost

SMSC GSM

group = smsc

smsc = at

modemtype = auto

speed =9600

device = devttyS0

SMSC HTTP

group = smsc

smsc = http

system-type = kannel

port = 13016

connect-allow-ip = 127001

Appendix B

47

username = wappush

password = wappush

SMSBOX SETUP

group = smsbox

bearerbox-host = localhost

sendsms-port = 13013

sendsms-chars = 0123456789 +-

log-file = tmpsmsboxlog

log-level = 0

access-log = accesslog

white-list = 127001

black-list =

SEND-SMS USERS

group = sendsms-user

username = wappush

password = wappush

user-deny-ip =

user-allow-ip = 127001

PPG group

group = ppg

ppg-url = wappush

ppg-port = 8080

concurrent-pushes = 100

trusted-pi = true

users = 1024

service-name = ppg

ppg-smsbox-id = dlrbox

WAP PUSH USER

group = wap-push-user

wap-push-user = picom

ppg-username = wappush

ppg-password = wappush

allow-ip = localhost

48

Appendix C Selected Codes

Gateway Control Form

ltDOCTYPE HTML PUBLIC -W3CDTD HTML 32ENgt

lthtmlgt ltheadgt

lttitlegtGateway control formlttitlegt

ltheadgt

ltbody bgcolor=white text=black link=blue vlink=navy

alink=redgt

ltbase target=submitgt

ltscriptgt

function update_status()

if ( adminactionvalue == status )

adminaction = http + adminhostnamevalue +

+ adminportvalue + status +

adminstatusformatvalue

else

adminaction = http + adminhostnamevalue +

+ adminportvalue + + adminactionvalue

adminpasswordvalue = adminpasswordvalue

actiongovalue = GO GET +adminaction

ltscriptgt

lttable align=centergt

lttrgtltp align=centergtlth2gtGateway control

formlth2gtltpgtlttrgt

lttrgt lttdgtHostnamelttdgtlttdgtltinput type=text

name=adminhostname value=localhost

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPortlttdgtlttdgtltinput type=text

name=adminport value=13000

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPasswordlttdgtlttdgtltinput type=password

name=adminpassword value=

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtActionlttdgtlttdgtltselect name=adminaction

onChange=update_status()gt

ltoption value=statusgtStatusltoptiongt

ltoption value=suspendgtSuspendltoptiongt

ltoption value=isolategtIsolateltoptiongt

Appendix C

49

ltoption value=shutdowngtShutdownltoptiongt

ltoption value=resumegtResumeltoptiongt

ltselectgtlttdgt lttrgt

lttrgt lttdgtStatus Formatlttdgtlttdgtltselect

name=adminstatusformat onChange=update_status()gt

ltoption value=gthtmlltoptiongtltoption

value=txtgttxtltoptiongtltoption

value=xmlgtxmlltoptiongtltselectgtlttdgt lttrgt

ltform name=admin method=get

action=httplocalhost13000status

encoding=applicationx-www-formgt

ltinput type=hidden name=password value=gt

lttrgt

lttdgtGolttdgt

ltformgt

lttdgtltinput type=submit value=go name=actiongo

onClick=documentadminsubmit()gtlttdgt

lttrgt

lttablegt

ltbodygt

lthtmlgt

Push Initiator Class

import javanetURL

import javanetHttpURLConnection

import javaio

Class implements a simple push initiator It can be

used to create and send messages to push proxy

gateway (ppg)

public final class PushInitiator

xml version

private final static String XML_VERSION = ltxml

version=10gt

Push Access Protocol (PAP) document type

private final static String PAP_DOCTYPE =

Appendix C

50

ltDOCTYPE pap PUBLIC -WAPFORUMDTD PAP 10EN

httpwwwwapforumorgDTDpap_10dtd gt

content type of the push request multipart body

private final static String CONTENT_TYPE =

multipartrelated boundary=multipart-boundary

type=applicationxml

Service Indication (SI) document type

private static final String SI_DOCTYPE = ltDOCTYPE si

PUBLIC -WAPFORUMDTD SI 10EN +

httpwwwwapforumorgDTDsidtdgt

private static int pushId = 0

PPG url where the pap message is to be sent

private final URL ppgUrl

some push proxy gateways may also require the

authentication of the push initiator

For instance the push initiator may be required to

send an HTTP authorization header in each request

private final String authorization

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

public PushInitiator(URL ppgUrl) thisppgUrl =

ppgUrl

authorization = null

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

param authorization a ltcodegtStringltcodegt value

public PushInitiator(URL ppgUrl String authorization)

thisppgUrl = ppgUrl

Appendix C

51

thisauthorization = authorization

Systemoutprintln(Push Initiator created ppgUrl =

+ ppgUrl)

ltcodegtsendPushMessageltcodegt sends push message to

ppg

param clientAddress a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param message a ltcodegtStringltcodegt value

param mimeType a ltcodegtStringltcodegt value

exception Exception if an error occurs

public void sendPushMessage(String clientAddress

String addressTypeString message String mimeType)

throws Exception

HttpURLConnection http =

(HttpURLConnection)ppgUrlopenConnection()

String ppgServer = ppgUrlgetHost()

httpsetDoInput(true)

httpsetRequestProperty(Content-Type CONTENT_TYPE)

if(authorization = null)

if(authorizationtrim()equals())

httpsetRequestProperty(Authorization

authorization)

httpsetDoOutput(true)

PrintWriter out = new PrintWriter(new

BufferedOutputStream(httpgetOutputStream()))

outprintln(--multipart-boundary)

outprintln(Content-type applicationxml)

outprintln()

outprintln(createPapMessage(clientAddress

addressTypeppgServer genPushId() null))

outprintln()

outprintln(--multipart-boundary)

outprintln(Content-type + mimeType)

outprintln()

outprintln(message)

outprintln()

outprintln(--multipart-boundary--)

outflush()

outclose()

httpconnect()

Appendix C

52

finally read and debug the response received from

PPG

try

debugResponse(http)

catch (Exception e)

Systemerrprintln(Error in receiving the

response)

ltcodegtcreatePapMessageltcodegt creates a Push Access

Protocoltype message

param address a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param ppgServer a ltcodegtStringltcodegt value

param pushId a ltcodegtStringltcodegt value

param notificationTo a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createPapMessage(String address

String addressType String ppgServer String pushId

String notificationTo)

return XML_VERSION + n + PAP_DOCTYPE + n +

ltpap product-name=Mobile Zoo Push

Initiatorgtn +

ltpush-message push-id= + pushId +

(notificationTo = null request-notification-

to= + notificationTo ) + gtn +

ltaddress address-value=WAPPUSH= + address +

TYPE= + addressType +

+ ppgServer + gtn +

ltpush-messagegtnltpapgt

ltcodegtcreateSiMessageltcodegt creates a service

indication type message

param url a ltcodegtStringltcodegt value

param created a ltcodegtStringltcodegt value

param expires a ltcodegtStringltcodegt value

Appendix C

53

param message a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createSiMessage(String url

String sid String created String expires String

action String message)

return XML_VERSION + SI_DOCTYPE +

ltsigtn +

ltindication href= + url + +

(sid = null si-id= + sid + ) +

created = null created= + created +

) +

(action = null action= + action +

) +

(expires = null expires= + expires +

) + gt +

message +

ltindicationgtnltsigt

Debug response

param http a ltcodegtHttpURLConnectionltcodegt value

exception Exception if an error occurs

private void debugResponse(HttpURLConnection http)

throws Exception

Systemoutprintln(httpgetResponseMessage())

String headerName

int i=0

while((headerName = httpgetHeaderFieldKey(i++)) =

null)

Systemoutprintln(headerName + +

httpgetHeaderField(headerName))

Systemoutprintln()

InputStreamReader in = new InputStreamReader(new

BufferedInputStream(httpgetInputStream()))

int c

Appendix C

54

while((c = inread()) = -1)

Systemoutprint((char)c)

Systemoutprintln()

ltcodegtgenPushIdltcodegt generates an unique push id

return a ltcodegtStringltcodegt value

private String genPushId()

pushId = 100000

return SystemcurrentTimeMillis() + + pushId++

55

References

[1] Microsoft ldquoGetting Mobile Using WML and WAP to Display Web Sites on

Mobile Devicesrdquo

URL msdnmicrosoftcomen-uslibraryaa140117(office10)aspx accessed

on April 10 2008

[2] DALE BULBROOK ldquoWAPA Beginnerrsquos Guiderdquo OsborneMcGraw-Hill 2001

[3] WAP Forum Wireless Application Protocol Architecture Specification Access on

Jan 12 2008 Available

httpwww1wapforumorgtechdocumentsWAP-210-WAPArch-2006 07 12-apdf

[4] WAP Forum Push Architectural Overview access on (2008 February 3) Available

httpwww1wapforumorgtechdocumentsWAP-250-PushArchOverview-2007 04

03-apdf

[5] Service indication PDF access on 62008 Available

httpwwww3orgTRhtml401structlinkshtml

[6] WAP Push Technology (openwave) PDF access on (2008 April) Available

URL httpwwwopenwavorg

[7] Web site (httpwwwwapforumorgwhatcopyrighthtm) access on May 2008

[8] ldquoWAP Push Proxy Gateway Specificationrdquo WAP Forum access on 16-August-

2007URI httpwwwwapforumorgPDF

[9] WAP Forum Access on (2008 MAY 31) WAP Service Indication Specification

Available httpwww1wapforumorgtechdocumentsWAP-167-ServiceInd-200507

31-apdf

  • odc_fpwmlandwap_topic3
  • N100E3
  • 21
  • 5

Chapter 4 System Design

36

433 Short Message Service Centre (SMSC)

A SMSC is an essential component when sending a push message from an IP network to

a mobile device in the architecture supported by the components and devices It is used to

remove the TCPIP layer that the push is encapsulatedrdquo in It is also the entity that

identifies the end-point device When this is done it is also the SMSC that is responsible

for the processing and final message delivery to the device After the process of de-

encapsulation and resolution of the client identity there should not be any difference

between this message and a message that is originated locally from the operator itself

(like a SMS)

In this project we just use a virtual SMS center we try first to get connection to a real

one but our effort was worthless

Finally the following figure depicts the overall flowchart of the WAP push system

(figure 47)

Chapter 4 System Design

37

PI

PPG

Create PAP

HTTP Post

Message

processing

OTA

Connection

oriented

Sessionless Session

oriented

WTP Initiation

WAP clinet

Application

Create content

Create

capability

entity

Database

SMS center

NoYes

Figure 47 the complete flowchart of the system

38

Chapter Five

5 System implementation and results

51 Implementation

511 The Push Proxy Gateway

First of all the Kannel gateway have been compiled and installed using gcc (GNU C

Compiler) this stage go fine except the operating system required more components to

be pre-installed and will configured

Then with stages of configuration to the gateway (Appendix B) it was capable of working

as PPG Figure 51 below show the gateway when it starts

Figure 51 starting kannel gateway

Then a web based user interface had been created to provide an easy way to control the

gateway remotely Figure 52 and figure 53

39

Figure 52 GUI for gateway control

512 The Push initiator

Next the push initiator design had been implemented using java programming language

as in design phase the implementation is taken carefully to make a reusable component

that could be used by other developer

PushInitiator class (Appendix B) implements a simple push initiator which can be used

to create and send messages to a push proxy gateway (PPG)

The method sendPushMessage sends a push message via the PPG to the client The client

is identified by the address which is either the phone number (address type is PLMN) or

IP address The message content and its mime type are also given as arguments to the

method the other tow important method are

createPapMessage This method creates a Push Access Protocol (PAP) type message

40

createSiMessage This method is used to create a service indication (SI) type message

Figure 53 showing running kannel status

513 WAP site

Since this site will be built for testing purpose and making sure that the system is

functional we had not go deep in this section Just simple WAP site with tow page has

been crated

41

52 Service indication

When a SI was pushed to any of the emulator or Nokia phones it was received and

presented in the way it was supposed to as specified in the WAP standard as shown in

figures below This is a proof that the devices claiming to support WAP push do so and

the design is will working See figures 53 through 56

Figure 55 service indication

42

Figure 57 SI details

52 Service load

The emulator correctly receives and interpreted the SL push the same as all of Nokia

phones we have tested

When a SL was pushed to the Ericsson phones it was not presented in the specified way

figure 58 I think that it is because of security reasons The reason for this assumption is

that the phones only supports on or off as security in their push configuration The

emulator on the other hand presents SL correctly Finally the Siemens phone did seem to

interpret SL but the current software was not very consistent It did load the SL without

user interference in the specified way when the user already where having an active

session If the user was offline the phone interface presented a symbol on the display

and did not load the service until the user clicked on the symbol

43

Chapter Six

6 conclusion and future work

In this chapter we will provide the conclusions and proposed future work for interested

individuals

61 Conclusions

In this project a WAP push system has been successfully designed and implemented It

provides a way to partially overcome the limitations encountered when accessing the

World Wide Web using handsets After comparing the proposed project objectives with

those accomplished the main goals are seen to be met

Phones from different manufactures all differ from the WAP-standard in some

ways One of the most obvious differences is the resolution of the display

During the work it has been noticed that the WML pages must be quite small We

have also noticed that the support for tables and some other tags are a bit limited

Even though the WML standard is smaller than the HTML standard it is a little

more complicated to write correct WML pages The main conclusion is that WAP

works pretty well but the phones are a little non-stable

The push proxy gateway is configured and worked probably with virtual SMS

center and it is easy to switch to a real one

The system depends mainly on open sources (ie Linux and kannek)

The design and implementation of the push initiator work well with the kannel

gateway and it should work correctly with other gateways

Chapter 6 Conclusion

44

62 Further Work

The possibilities of wireless push are interesting enough that it has to be worth to know if

the security and conformance problems will be solved in WAP push If they are solved

and the technique is refined then there should be nothing to stop the great number of

services that will follow in its footsteps Therefore there is further work that should be

done and the most interesting parts are in my opinion these

621 Security Aspect

One of the problems today is that the phones supporting push does not have the detailed

security settings that a technique like this needs Therefore it would be interesting to look

into the possibility to add these without confusing the user I suggest furthering looking

into usability aspects of security in WAP Push for short

622 GPS integration possibility

This will provide location dependent delivery of WAP push it will have great

applications in telematic and ecommerce advertising

623 Conformance to Standards

An interesting project would be to examine if the main reason for the nonstandard

solutions in the existing WAP push software is the result of difficulties in

implementation Or if the main reason is that the manufacturers wants to provide

proprietary solutions A reason why one may want to know this is that if the problem is

depending on implementation problems then it might get better

45

Appendix A Abbreviations

CDMA Code Division Multiple Access

CO Cache Operation

DTD Document Type Definition

GSM Global System for Mobile

HTTP Hypertext Transfer Protocol

IP Internet Protocol

MSISDN Mobile Station International Subscriber Directory Number

OTA Over The Air

PAP Push Access Protocol

PushOTA Push Over The Air

PDA Personal Digital Assistant

P1 Push Initiator

PLMN Public Land Mobile Networks

PPG Push Proxy Gateway

SI Service Indication

SIA Session Initiation Application

SIR Session Initiation Request

SL Service Loading

SMPP Short Message Peer to Peer

SMS Short Message System

SMSC Short Message System Center

UCP Universal Computer Protocol

URI Uniform Resource Identifier

URL Uniform Resource Locator

UTC Universal Time Coordinated

WAP Wireless Application Protocol

WBXML WAP binary XML

WDP Wireless Datagram Protocol

WSP Wireless Session Protocol

WTLS Wireless Transport Layer Security

XML Extensible Mark-up Language

46

Appendix B Kannel gateway configurations

THIS IS A SAMPLE CONFIGURATION FOR KANNEL

group = core

admin-port = 13000

admin-password = admin

status-password = admin

admin-deny-ip =

admin-allow-ip = 127001172161455

log-file = tmpkannellog

log-level = 0

http-proxy-host = 172161411

http-proxy-port = 8080

http-proxy-exceptions = 127001

Smsbox related

smsbox-port = 13001

box-deny-ip =

box-allow-ip = 127001

bearerbox-host =localhost

Wapbox related

wapbox-port = 13002

udp-deny-ip =

udp-allow-ip = 127001

bearerbox-host =localhost

SMSC GSM

group = smsc

smsc = at

modemtype = auto

speed =9600

device = devttyS0

SMSC HTTP

group = smsc

smsc = http

system-type = kannel

port = 13016

connect-allow-ip = 127001

Appendix B

47

username = wappush

password = wappush

SMSBOX SETUP

group = smsbox

bearerbox-host = localhost

sendsms-port = 13013

sendsms-chars = 0123456789 +-

log-file = tmpsmsboxlog

log-level = 0

access-log = accesslog

white-list = 127001

black-list =

SEND-SMS USERS

group = sendsms-user

username = wappush

password = wappush

user-deny-ip =

user-allow-ip = 127001

PPG group

group = ppg

ppg-url = wappush

ppg-port = 8080

concurrent-pushes = 100

trusted-pi = true

users = 1024

service-name = ppg

ppg-smsbox-id = dlrbox

WAP PUSH USER

group = wap-push-user

wap-push-user = picom

ppg-username = wappush

ppg-password = wappush

allow-ip = localhost

48

Appendix C Selected Codes

Gateway Control Form

ltDOCTYPE HTML PUBLIC -W3CDTD HTML 32ENgt

lthtmlgt ltheadgt

lttitlegtGateway control formlttitlegt

ltheadgt

ltbody bgcolor=white text=black link=blue vlink=navy

alink=redgt

ltbase target=submitgt

ltscriptgt

function update_status()

if ( adminactionvalue == status )

adminaction = http + adminhostnamevalue +

+ adminportvalue + status +

adminstatusformatvalue

else

adminaction = http + adminhostnamevalue +

+ adminportvalue + + adminactionvalue

adminpasswordvalue = adminpasswordvalue

actiongovalue = GO GET +adminaction

ltscriptgt

lttable align=centergt

lttrgtltp align=centergtlth2gtGateway control

formlth2gtltpgtlttrgt

lttrgt lttdgtHostnamelttdgtlttdgtltinput type=text

name=adminhostname value=localhost

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPortlttdgtlttdgtltinput type=text

name=adminport value=13000

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPasswordlttdgtlttdgtltinput type=password

name=adminpassword value=

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtActionlttdgtlttdgtltselect name=adminaction

onChange=update_status()gt

ltoption value=statusgtStatusltoptiongt

ltoption value=suspendgtSuspendltoptiongt

ltoption value=isolategtIsolateltoptiongt

Appendix C

49

ltoption value=shutdowngtShutdownltoptiongt

ltoption value=resumegtResumeltoptiongt

ltselectgtlttdgt lttrgt

lttrgt lttdgtStatus Formatlttdgtlttdgtltselect

name=adminstatusformat onChange=update_status()gt

ltoption value=gthtmlltoptiongtltoption

value=txtgttxtltoptiongtltoption

value=xmlgtxmlltoptiongtltselectgtlttdgt lttrgt

ltform name=admin method=get

action=httplocalhost13000status

encoding=applicationx-www-formgt

ltinput type=hidden name=password value=gt

lttrgt

lttdgtGolttdgt

ltformgt

lttdgtltinput type=submit value=go name=actiongo

onClick=documentadminsubmit()gtlttdgt

lttrgt

lttablegt

ltbodygt

lthtmlgt

Push Initiator Class

import javanetURL

import javanetHttpURLConnection

import javaio

Class implements a simple push initiator It can be

used to create and send messages to push proxy

gateway (ppg)

public final class PushInitiator

xml version

private final static String XML_VERSION = ltxml

version=10gt

Push Access Protocol (PAP) document type

private final static String PAP_DOCTYPE =

Appendix C

50

ltDOCTYPE pap PUBLIC -WAPFORUMDTD PAP 10EN

httpwwwwapforumorgDTDpap_10dtd gt

content type of the push request multipart body

private final static String CONTENT_TYPE =

multipartrelated boundary=multipart-boundary

type=applicationxml

Service Indication (SI) document type

private static final String SI_DOCTYPE = ltDOCTYPE si

PUBLIC -WAPFORUMDTD SI 10EN +

httpwwwwapforumorgDTDsidtdgt

private static int pushId = 0

PPG url where the pap message is to be sent

private final URL ppgUrl

some push proxy gateways may also require the

authentication of the push initiator

For instance the push initiator may be required to

send an HTTP authorization header in each request

private final String authorization

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

public PushInitiator(URL ppgUrl) thisppgUrl =

ppgUrl

authorization = null

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

param authorization a ltcodegtStringltcodegt value

public PushInitiator(URL ppgUrl String authorization)

thisppgUrl = ppgUrl

Appendix C

51

thisauthorization = authorization

Systemoutprintln(Push Initiator created ppgUrl =

+ ppgUrl)

ltcodegtsendPushMessageltcodegt sends push message to

ppg

param clientAddress a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param message a ltcodegtStringltcodegt value

param mimeType a ltcodegtStringltcodegt value

exception Exception if an error occurs

public void sendPushMessage(String clientAddress

String addressTypeString message String mimeType)

throws Exception

HttpURLConnection http =

(HttpURLConnection)ppgUrlopenConnection()

String ppgServer = ppgUrlgetHost()

httpsetDoInput(true)

httpsetRequestProperty(Content-Type CONTENT_TYPE)

if(authorization = null)

if(authorizationtrim()equals())

httpsetRequestProperty(Authorization

authorization)

httpsetDoOutput(true)

PrintWriter out = new PrintWriter(new

BufferedOutputStream(httpgetOutputStream()))

outprintln(--multipart-boundary)

outprintln(Content-type applicationxml)

outprintln()

outprintln(createPapMessage(clientAddress

addressTypeppgServer genPushId() null))

outprintln()

outprintln(--multipart-boundary)

outprintln(Content-type + mimeType)

outprintln()

outprintln(message)

outprintln()

outprintln(--multipart-boundary--)

outflush()

outclose()

httpconnect()

Appendix C

52

finally read and debug the response received from

PPG

try

debugResponse(http)

catch (Exception e)

Systemerrprintln(Error in receiving the

response)

ltcodegtcreatePapMessageltcodegt creates a Push Access

Protocoltype message

param address a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param ppgServer a ltcodegtStringltcodegt value

param pushId a ltcodegtStringltcodegt value

param notificationTo a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createPapMessage(String address

String addressType String ppgServer String pushId

String notificationTo)

return XML_VERSION + n + PAP_DOCTYPE + n +

ltpap product-name=Mobile Zoo Push

Initiatorgtn +

ltpush-message push-id= + pushId +

(notificationTo = null request-notification-

to= + notificationTo ) + gtn +

ltaddress address-value=WAPPUSH= + address +

TYPE= + addressType +

+ ppgServer + gtn +

ltpush-messagegtnltpapgt

ltcodegtcreateSiMessageltcodegt creates a service

indication type message

param url a ltcodegtStringltcodegt value

param created a ltcodegtStringltcodegt value

param expires a ltcodegtStringltcodegt value

Appendix C

53

param message a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createSiMessage(String url

String sid String created String expires String

action String message)

return XML_VERSION + SI_DOCTYPE +

ltsigtn +

ltindication href= + url + +

(sid = null si-id= + sid + ) +

created = null created= + created +

) +

(action = null action= + action +

) +

(expires = null expires= + expires +

) + gt +

message +

ltindicationgtnltsigt

Debug response

param http a ltcodegtHttpURLConnectionltcodegt value

exception Exception if an error occurs

private void debugResponse(HttpURLConnection http)

throws Exception

Systemoutprintln(httpgetResponseMessage())

String headerName

int i=0

while((headerName = httpgetHeaderFieldKey(i++)) =

null)

Systemoutprintln(headerName + +

httpgetHeaderField(headerName))

Systemoutprintln()

InputStreamReader in = new InputStreamReader(new

BufferedInputStream(httpgetInputStream()))

int c

Appendix C

54

while((c = inread()) = -1)

Systemoutprint((char)c)

Systemoutprintln()

ltcodegtgenPushIdltcodegt generates an unique push id

return a ltcodegtStringltcodegt value

private String genPushId()

pushId = 100000

return SystemcurrentTimeMillis() + + pushId++

55

References

[1] Microsoft ldquoGetting Mobile Using WML and WAP to Display Web Sites on

Mobile Devicesrdquo

URL msdnmicrosoftcomen-uslibraryaa140117(office10)aspx accessed

on April 10 2008

[2] DALE BULBROOK ldquoWAPA Beginnerrsquos Guiderdquo OsborneMcGraw-Hill 2001

[3] WAP Forum Wireless Application Protocol Architecture Specification Access on

Jan 12 2008 Available

httpwww1wapforumorgtechdocumentsWAP-210-WAPArch-2006 07 12-apdf

[4] WAP Forum Push Architectural Overview access on (2008 February 3) Available

httpwww1wapforumorgtechdocumentsWAP-250-PushArchOverview-2007 04

03-apdf

[5] Service indication PDF access on 62008 Available

httpwwww3orgTRhtml401structlinkshtml

[6] WAP Push Technology (openwave) PDF access on (2008 April) Available

URL httpwwwopenwavorg

[7] Web site (httpwwwwapforumorgwhatcopyrighthtm) access on May 2008

[8] ldquoWAP Push Proxy Gateway Specificationrdquo WAP Forum access on 16-August-

2007URI httpwwwwapforumorgPDF

[9] WAP Forum Access on (2008 MAY 31) WAP Service Indication Specification

Available httpwww1wapforumorgtechdocumentsWAP-167-ServiceInd-200507

31-apdf

  • odc_fpwmlandwap_topic3
  • N100E3
  • 21
  • 5

Chapter 4 System Design

37

PI

PPG

Create PAP

HTTP Post

Message

processing

OTA

Connection

oriented

Sessionless Session

oriented

WTP Initiation

WAP clinet

Application

Create content

Create

capability

entity

Database

SMS center

NoYes

Figure 47 the complete flowchart of the system

38

Chapter Five

5 System implementation and results

51 Implementation

511 The Push Proxy Gateway

First of all the Kannel gateway have been compiled and installed using gcc (GNU C

Compiler) this stage go fine except the operating system required more components to

be pre-installed and will configured

Then with stages of configuration to the gateway (Appendix B) it was capable of working

as PPG Figure 51 below show the gateway when it starts

Figure 51 starting kannel gateway

Then a web based user interface had been created to provide an easy way to control the

gateway remotely Figure 52 and figure 53

39

Figure 52 GUI for gateway control

512 The Push initiator

Next the push initiator design had been implemented using java programming language

as in design phase the implementation is taken carefully to make a reusable component

that could be used by other developer

PushInitiator class (Appendix B) implements a simple push initiator which can be used

to create and send messages to a push proxy gateway (PPG)

The method sendPushMessage sends a push message via the PPG to the client The client

is identified by the address which is either the phone number (address type is PLMN) or

IP address The message content and its mime type are also given as arguments to the

method the other tow important method are

createPapMessage This method creates a Push Access Protocol (PAP) type message

40

createSiMessage This method is used to create a service indication (SI) type message

Figure 53 showing running kannel status

513 WAP site

Since this site will be built for testing purpose and making sure that the system is

functional we had not go deep in this section Just simple WAP site with tow page has

been crated

41

52 Service indication

When a SI was pushed to any of the emulator or Nokia phones it was received and

presented in the way it was supposed to as specified in the WAP standard as shown in

figures below This is a proof that the devices claiming to support WAP push do so and

the design is will working See figures 53 through 56

Figure 55 service indication

42

Figure 57 SI details

52 Service load

The emulator correctly receives and interpreted the SL push the same as all of Nokia

phones we have tested

When a SL was pushed to the Ericsson phones it was not presented in the specified way

figure 58 I think that it is because of security reasons The reason for this assumption is

that the phones only supports on or off as security in their push configuration The

emulator on the other hand presents SL correctly Finally the Siemens phone did seem to

interpret SL but the current software was not very consistent It did load the SL without

user interference in the specified way when the user already where having an active

session If the user was offline the phone interface presented a symbol on the display

and did not load the service until the user clicked on the symbol

43

Chapter Six

6 conclusion and future work

In this chapter we will provide the conclusions and proposed future work for interested

individuals

61 Conclusions

In this project a WAP push system has been successfully designed and implemented It

provides a way to partially overcome the limitations encountered when accessing the

World Wide Web using handsets After comparing the proposed project objectives with

those accomplished the main goals are seen to be met

Phones from different manufactures all differ from the WAP-standard in some

ways One of the most obvious differences is the resolution of the display

During the work it has been noticed that the WML pages must be quite small We

have also noticed that the support for tables and some other tags are a bit limited

Even though the WML standard is smaller than the HTML standard it is a little

more complicated to write correct WML pages The main conclusion is that WAP

works pretty well but the phones are a little non-stable

The push proxy gateway is configured and worked probably with virtual SMS

center and it is easy to switch to a real one

The system depends mainly on open sources (ie Linux and kannek)

The design and implementation of the push initiator work well with the kannel

gateway and it should work correctly with other gateways

Chapter 6 Conclusion

44

62 Further Work

The possibilities of wireless push are interesting enough that it has to be worth to know if

the security and conformance problems will be solved in WAP push If they are solved

and the technique is refined then there should be nothing to stop the great number of

services that will follow in its footsteps Therefore there is further work that should be

done and the most interesting parts are in my opinion these

621 Security Aspect

One of the problems today is that the phones supporting push does not have the detailed

security settings that a technique like this needs Therefore it would be interesting to look

into the possibility to add these without confusing the user I suggest furthering looking

into usability aspects of security in WAP Push for short

622 GPS integration possibility

This will provide location dependent delivery of WAP push it will have great

applications in telematic and ecommerce advertising

623 Conformance to Standards

An interesting project would be to examine if the main reason for the nonstandard

solutions in the existing WAP push software is the result of difficulties in

implementation Or if the main reason is that the manufacturers wants to provide

proprietary solutions A reason why one may want to know this is that if the problem is

depending on implementation problems then it might get better

45

Appendix A Abbreviations

CDMA Code Division Multiple Access

CO Cache Operation

DTD Document Type Definition

GSM Global System for Mobile

HTTP Hypertext Transfer Protocol

IP Internet Protocol

MSISDN Mobile Station International Subscriber Directory Number

OTA Over The Air

PAP Push Access Protocol

PushOTA Push Over The Air

PDA Personal Digital Assistant

P1 Push Initiator

PLMN Public Land Mobile Networks

PPG Push Proxy Gateway

SI Service Indication

SIA Session Initiation Application

SIR Session Initiation Request

SL Service Loading

SMPP Short Message Peer to Peer

SMS Short Message System

SMSC Short Message System Center

UCP Universal Computer Protocol

URI Uniform Resource Identifier

URL Uniform Resource Locator

UTC Universal Time Coordinated

WAP Wireless Application Protocol

WBXML WAP binary XML

WDP Wireless Datagram Protocol

WSP Wireless Session Protocol

WTLS Wireless Transport Layer Security

XML Extensible Mark-up Language

46

Appendix B Kannel gateway configurations

THIS IS A SAMPLE CONFIGURATION FOR KANNEL

group = core

admin-port = 13000

admin-password = admin

status-password = admin

admin-deny-ip =

admin-allow-ip = 127001172161455

log-file = tmpkannellog

log-level = 0

http-proxy-host = 172161411

http-proxy-port = 8080

http-proxy-exceptions = 127001

Smsbox related

smsbox-port = 13001

box-deny-ip =

box-allow-ip = 127001

bearerbox-host =localhost

Wapbox related

wapbox-port = 13002

udp-deny-ip =

udp-allow-ip = 127001

bearerbox-host =localhost

SMSC GSM

group = smsc

smsc = at

modemtype = auto

speed =9600

device = devttyS0

SMSC HTTP

group = smsc

smsc = http

system-type = kannel

port = 13016

connect-allow-ip = 127001

Appendix B

47

username = wappush

password = wappush

SMSBOX SETUP

group = smsbox

bearerbox-host = localhost

sendsms-port = 13013

sendsms-chars = 0123456789 +-

log-file = tmpsmsboxlog

log-level = 0

access-log = accesslog

white-list = 127001

black-list =

SEND-SMS USERS

group = sendsms-user

username = wappush

password = wappush

user-deny-ip =

user-allow-ip = 127001

PPG group

group = ppg

ppg-url = wappush

ppg-port = 8080

concurrent-pushes = 100

trusted-pi = true

users = 1024

service-name = ppg

ppg-smsbox-id = dlrbox

WAP PUSH USER

group = wap-push-user

wap-push-user = picom

ppg-username = wappush

ppg-password = wappush

allow-ip = localhost

48

Appendix C Selected Codes

Gateway Control Form

ltDOCTYPE HTML PUBLIC -W3CDTD HTML 32ENgt

lthtmlgt ltheadgt

lttitlegtGateway control formlttitlegt

ltheadgt

ltbody bgcolor=white text=black link=blue vlink=navy

alink=redgt

ltbase target=submitgt

ltscriptgt

function update_status()

if ( adminactionvalue == status )

adminaction = http + adminhostnamevalue +

+ adminportvalue + status +

adminstatusformatvalue

else

adminaction = http + adminhostnamevalue +

+ adminportvalue + + adminactionvalue

adminpasswordvalue = adminpasswordvalue

actiongovalue = GO GET +adminaction

ltscriptgt

lttable align=centergt

lttrgtltp align=centergtlth2gtGateway control

formlth2gtltpgtlttrgt

lttrgt lttdgtHostnamelttdgtlttdgtltinput type=text

name=adminhostname value=localhost

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPortlttdgtlttdgtltinput type=text

name=adminport value=13000

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPasswordlttdgtlttdgtltinput type=password

name=adminpassword value=

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtActionlttdgtlttdgtltselect name=adminaction

onChange=update_status()gt

ltoption value=statusgtStatusltoptiongt

ltoption value=suspendgtSuspendltoptiongt

ltoption value=isolategtIsolateltoptiongt

Appendix C

49

ltoption value=shutdowngtShutdownltoptiongt

ltoption value=resumegtResumeltoptiongt

ltselectgtlttdgt lttrgt

lttrgt lttdgtStatus Formatlttdgtlttdgtltselect

name=adminstatusformat onChange=update_status()gt

ltoption value=gthtmlltoptiongtltoption

value=txtgttxtltoptiongtltoption

value=xmlgtxmlltoptiongtltselectgtlttdgt lttrgt

ltform name=admin method=get

action=httplocalhost13000status

encoding=applicationx-www-formgt

ltinput type=hidden name=password value=gt

lttrgt

lttdgtGolttdgt

ltformgt

lttdgtltinput type=submit value=go name=actiongo

onClick=documentadminsubmit()gtlttdgt

lttrgt

lttablegt

ltbodygt

lthtmlgt

Push Initiator Class

import javanetURL

import javanetHttpURLConnection

import javaio

Class implements a simple push initiator It can be

used to create and send messages to push proxy

gateway (ppg)

public final class PushInitiator

xml version

private final static String XML_VERSION = ltxml

version=10gt

Push Access Protocol (PAP) document type

private final static String PAP_DOCTYPE =

Appendix C

50

ltDOCTYPE pap PUBLIC -WAPFORUMDTD PAP 10EN

httpwwwwapforumorgDTDpap_10dtd gt

content type of the push request multipart body

private final static String CONTENT_TYPE =

multipartrelated boundary=multipart-boundary

type=applicationxml

Service Indication (SI) document type

private static final String SI_DOCTYPE = ltDOCTYPE si

PUBLIC -WAPFORUMDTD SI 10EN +

httpwwwwapforumorgDTDsidtdgt

private static int pushId = 0

PPG url where the pap message is to be sent

private final URL ppgUrl

some push proxy gateways may also require the

authentication of the push initiator

For instance the push initiator may be required to

send an HTTP authorization header in each request

private final String authorization

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

public PushInitiator(URL ppgUrl) thisppgUrl =

ppgUrl

authorization = null

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

param authorization a ltcodegtStringltcodegt value

public PushInitiator(URL ppgUrl String authorization)

thisppgUrl = ppgUrl

Appendix C

51

thisauthorization = authorization

Systemoutprintln(Push Initiator created ppgUrl =

+ ppgUrl)

ltcodegtsendPushMessageltcodegt sends push message to

ppg

param clientAddress a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param message a ltcodegtStringltcodegt value

param mimeType a ltcodegtStringltcodegt value

exception Exception if an error occurs

public void sendPushMessage(String clientAddress

String addressTypeString message String mimeType)

throws Exception

HttpURLConnection http =

(HttpURLConnection)ppgUrlopenConnection()

String ppgServer = ppgUrlgetHost()

httpsetDoInput(true)

httpsetRequestProperty(Content-Type CONTENT_TYPE)

if(authorization = null)

if(authorizationtrim()equals())

httpsetRequestProperty(Authorization

authorization)

httpsetDoOutput(true)

PrintWriter out = new PrintWriter(new

BufferedOutputStream(httpgetOutputStream()))

outprintln(--multipart-boundary)

outprintln(Content-type applicationxml)

outprintln()

outprintln(createPapMessage(clientAddress

addressTypeppgServer genPushId() null))

outprintln()

outprintln(--multipart-boundary)

outprintln(Content-type + mimeType)

outprintln()

outprintln(message)

outprintln()

outprintln(--multipart-boundary--)

outflush()

outclose()

httpconnect()

Appendix C

52

finally read and debug the response received from

PPG

try

debugResponse(http)

catch (Exception e)

Systemerrprintln(Error in receiving the

response)

ltcodegtcreatePapMessageltcodegt creates a Push Access

Protocoltype message

param address a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param ppgServer a ltcodegtStringltcodegt value

param pushId a ltcodegtStringltcodegt value

param notificationTo a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createPapMessage(String address

String addressType String ppgServer String pushId

String notificationTo)

return XML_VERSION + n + PAP_DOCTYPE + n +

ltpap product-name=Mobile Zoo Push

Initiatorgtn +

ltpush-message push-id= + pushId +

(notificationTo = null request-notification-

to= + notificationTo ) + gtn +

ltaddress address-value=WAPPUSH= + address +

TYPE= + addressType +

+ ppgServer + gtn +

ltpush-messagegtnltpapgt

ltcodegtcreateSiMessageltcodegt creates a service

indication type message

param url a ltcodegtStringltcodegt value

param created a ltcodegtStringltcodegt value

param expires a ltcodegtStringltcodegt value

Appendix C

53

param message a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createSiMessage(String url

String sid String created String expires String

action String message)

return XML_VERSION + SI_DOCTYPE +

ltsigtn +

ltindication href= + url + +

(sid = null si-id= + sid + ) +

created = null created= + created +

) +

(action = null action= + action +

) +

(expires = null expires= + expires +

) + gt +

message +

ltindicationgtnltsigt

Debug response

param http a ltcodegtHttpURLConnectionltcodegt value

exception Exception if an error occurs

private void debugResponse(HttpURLConnection http)

throws Exception

Systemoutprintln(httpgetResponseMessage())

String headerName

int i=0

while((headerName = httpgetHeaderFieldKey(i++)) =

null)

Systemoutprintln(headerName + +

httpgetHeaderField(headerName))

Systemoutprintln()

InputStreamReader in = new InputStreamReader(new

BufferedInputStream(httpgetInputStream()))

int c

Appendix C

54

while((c = inread()) = -1)

Systemoutprint((char)c)

Systemoutprintln()

ltcodegtgenPushIdltcodegt generates an unique push id

return a ltcodegtStringltcodegt value

private String genPushId()

pushId = 100000

return SystemcurrentTimeMillis() + + pushId++

55

References

[1] Microsoft ldquoGetting Mobile Using WML and WAP to Display Web Sites on

Mobile Devicesrdquo

URL msdnmicrosoftcomen-uslibraryaa140117(office10)aspx accessed

on April 10 2008

[2] DALE BULBROOK ldquoWAPA Beginnerrsquos Guiderdquo OsborneMcGraw-Hill 2001

[3] WAP Forum Wireless Application Protocol Architecture Specification Access on

Jan 12 2008 Available

httpwww1wapforumorgtechdocumentsWAP-210-WAPArch-2006 07 12-apdf

[4] WAP Forum Push Architectural Overview access on (2008 February 3) Available

httpwww1wapforumorgtechdocumentsWAP-250-PushArchOverview-2007 04

03-apdf

[5] Service indication PDF access on 62008 Available

httpwwww3orgTRhtml401structlinkshtml

[6] WAP Push Technology (openwave) PDF access on (2008 April) Available

URL httpwwwopenwavorg

[7] Web site (httpwwwwapforumorgwhatcopyrighthtm) access on May 2008

[8] ldquoWAP Push Proxy Gateway Specificationrdquo WAP Forum access on 16-August-

2007URI httpwwwwapforumorgPDF

[9] WAP Forum Access on (2008 MAY 31) WAP Service Indication Specification

Available httpwww1wapforumorgtechdocumentsWAP-167-ServiceInd-200507

31-apdf

  • odc_fpwmlandwap_topic3
  • N100E3
  • 21
  • 5

38

Chapter Five

5 System implementation and results

51 Implementation

511 The Push Proxy Gateway

First of all the Kannel gateway have been compiled and installed using gcc (GNU C

Compiler) this stage go fine except the operating system required more components to

be pre-installed and will configured

Then with stages of configuration to the gateway (Appendix B) it was capable of working

as PPG Figure 51 below show the gateway when it starts

Figure 51 starting kannel gateway

Then a web based user interface had been created to provide an easy way to control the

gateway remotely Figure 52 and figure 53

39

Figure 52 GUI for gateway control

512 The Push initiator

Next the push initiator design had been implemented using java programming language

as in design phase the implementation is taken carefully to make a reusable component

that could be used by other developer

PushInitiator class (Appendix B) implements a simple push initiator which can be used

to create and send messages to a push proxy gateway (PPG)

The method sendPushMessage sends a push message via the PPG to the client The client

is identified by the address which is either the phone number (address type is PLMN) or

IP address The message content and its mime type are also given as arguments to the

method the other tow important method are

createPapMessage This method creates a Push Access Protocol (PAP) type message

40

createSiMessage This method is used to create a service indication (SI) type message

Figure 53 showing running kannel status

513 WAP site

Since this site will be built for testing purpose and making sure that the system is

functional we had not go deep in this section Just simple WAP site with tow page has

been crated

41

52 Service indication

When a SI was pushed to any of the emulator or Nokia phones it was received and

presented in the way it was supposed to as specified in the WAP standard as shown in

figures below This is a proof that the devices claiming to support WAP push do so and

the design is will working See figures 53 through 56

Figure 55 service indication

42

Figure 57 SI details

52 Service load

The emulator correctly receives and interpreted the SL push the same as all of Nokia

phones we have tested

When a SL was pushed to the Ericsson phones it was not presented in the specified way

figure 58 I think that it is because of security reasons The reason for this assumption is

that the phones only supports on or off as security in their push configuration The

emulator on the other hand presents SL correctly Finally the Siemens phone did seem to

interpret SL but the current software was not very consistent It did load the SL without

user interference in the specified way when the user already where having an active

session If the user was offline the phone interface presented a symbol on the display

and did not load the service until the user clicked on the symbol

43

Chapter Six

6 conclusion and future work

In this chapter we will provide the conclusions and proposed future work for interested

individuals

61 Conclusions

In this project a WAP push system has been successfully designed and implemented It

provides a way to partially overcome the limitations encountered when accessing the

World Wide Web using handsets After comparing the proposed project objectives with

those accomplished the main goals are seen to be met

Phones from different manufactures all differ from the WAP-standard in some

ways One of the most obvious differences is the resolution of the display

During the work it has been noticed that the WML pages must be quite small We

have also noticed that the support for tables and some other tags are a bit limited

Even though the WML standard is smaller than the HTML standard it is a little

more complicated to write correct WML pages The main conclusion is that WAP

works pretty well but the phones are a little non-stable

The push proxy gateway is configured and worked probably with virtual SMS

center and it is easy to switch to a real one

The system depends mainly on open sources (ie Linux and kannek)

The design and implementation of the push initiator work well with the kannel

gateway and it should work correctly with other gateways

Chapter 6 Conclusion

44

62 Further Work

The possibilities of wireless push are interesting enough that it has to be worth to know if

the security and conformance problems will be solved in WAP push If they are solved

and the technique is refined then there should be nothing to stop the great number of

services that will follow in its footsteps Therefore there is further work that should be

done and the most interesting parts are in my opinion these

621 Security Aspect

One of the problems today is that the phones supporting push does not have the detailed

security settings that a technique like this needs Therefore it would be interesting to look

into the possibility to add these without confusing the user I suggest furthering looking

into usability aspects of security in WAP Push for short

622 GPS integration possibility

This will provide location dependent delivery of WAP push it will have great

applications in telematic and ecommerce advertising

623 Conformance to Standards

An interesting project would be to examine if the main reason for the nonstandard

solutions in the existing WAP push software is the result of difficulties in

implementation Or if the main reason is that the manufacturers wants to provide

proprietary solutions A reason why one may want to know this is that if the problem is

depending on implementation problems then it might get better

45

Appendix A Abbreviations

CDMA Code Division Multiple Access

CO Cache Operation

DTD Document Type Definition

GSM Global System for Mobile

HTTP Hypertext Transfer Protocol

IP Internet Protocol

MSISDN Mobile Station International Subscriber Directory Number

OTA Over The Air

PAP Push Access Protocol

PushOTA Push Over The Air

PDA Personal Digital Assistant

P1 Push Initiator

PLMN Public Land Mobile Networks

PPG Push Proxy Gateway

SI Service Indication

SIA Session Initiation Application

SIR Session Initiation Request

SL Service Loading

SMPP Short Message Peer to Peer

SMS Short Message System

SMSC Short Message System Center

UCP Universal Computer Protocol

URI Uniform Resource Identifier

URL Uniform Resource Locator

UTC Universal Time Coordinated

WAP Wireless Application Protocol

WBXML WAP binary XML

WDP Wireless Datagram Protocol

WSP Wireless Session Protocol

WTLS Wireless Transport Layer Security

XML Extensible Mark-up Language

46

Appendix B Kannel gateway configurations

THIS IS A SAMPLE CONFIGURATION FOR KANNEL

group = core

admin-port = 13000

admin-password = admin

status-password = admin

admin-deny-ip =

admin-allow-ip = 127001172161455

log-file = tmpkannellog

log-level = 0

http-proxy-host = 172161411

http-proxy-port = 8080

http-proxy-exceptions = 127001

Smsbox related

smsbox-port = 13001

box-deny-ip =

box-allow-ip = 127001

bearerbox-host =localhost

Wapbox related

wapbox-port = 13002

udp-deny-ip =

udp-allow-ip = 127001

bearerbox-host =localhost

SMSC GSM

group = smsc

smsc = at

modemtype = auto

speed =9600

device = devttyS0

SMSC HTTP

group = smsc

smsc = http

system-type = kannel

port = 13016

connect-allow-ip = 127001

Appendix B

47

username = wappush

password = wappush

SMSBOX SETUP

group = smsbox

bearerbox-host = localhost

sendsms-port = 13013

sendsms-chars = 0123456789 +-

log-file = tmpsmsboxlog

log-level = 0

access-log = accesslog

white-list = 127001

black-list =

SEND-SMS USERS

group = sendsms-user

username = wappush

password = wappush

user-deny-ip =

user-allow-ip = 127001

PPG group

group = ppg

ppg-url = wappush

ppg-port = 8080

concurrent-pushes = 100

trusted-pi = true

users = 1024

service-name = ppg

ppg-smsbox-id = dlrbox

WAP PUSH USER

group = wap-push-user

wap-push-user = picom

ppg-username = wappush

ppg-password = wappush

allow-ip = localhost

48

Appendix C Selected Codes

Gateway Control Form

ltDOCTYPE HTML PUBLIC -W3CDTD HTML 32ENgt

lthtmlgt ltheadgt

lttitlegtGateway control formlttitlegt

ltheadgt

ltbody bgcolor=white text=black link=blue vlink=navy

alink=redgt

ltbase target=submitgt

ltscriptgt

function update_status()

if ( adminactionvalue == status )

adminaction = http + adminhostnamevalue +

+ adminportvalue + status +

adminstatusformatvalue

else

adminaction = http + adminhostnamevalue +

+ adminportvalue + + adminactionvalue

adminpasswordvalue = adminpasswordvalue

actiongovalue = GO GET +adminaction

ltscriptgt

lttable align=centergt

lttrgtltp align=centergtlth2gtGateway control

formlth2gtltpgtlttrgt

lttrgt lttdgtHostnamelttdgtlttdgtltinput type=text

name=adminhostname value=localhost

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPortlttdgtlttdgtltinput type=text

name=adminport value=13000

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPasswordlttdgtlttdgtltinput type=password

name=adminpassword value=

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtActionlttdgtlttdgtltselect name=adminaction

onChange=update_status()gt

ltoption value=statusgtStatusltoptiongt

ltoption value=suspendgtSuspendltoptiongt

ltoption value=isolategtIsolateltoptiongt

Appendix C

49

ltoption value=shutdowngtShutdownltoptiongt

ltoption value=resumegtResumeltoptiongt

ltselectgtlttdgt lttrgt

lttrgt lttdgtStatus Formatlttdgtlttdgtltselect

name=adminstatusformat onChange=update_status()gt

ltoption value=gthtmlltoptiongtltoption

value=txtgttxtltoptiongtltoption

value=xmlgtxmlltoptiongtltselectgtlttdgt lttrgt

ltform name=admin method=get

action=httplocalhost13000status

encoding=applicationx-www-formgt

ltinput type=hidden name=password value=gt

lttrgt

lttdgtGolttdgt

ltformgt

lttdgtltinput type=submit value=go name=actiongo

onClick=documentadminsubmit()gtlttdgt

lttrgt

lttablegt

ltbodygt

lthtmlgt

Push Initiator Class

import javanetURL

import javanetHttpURLConnection

import javaio

Class implements a simple push initiator It can be

used to create and send messages to push proxy

gateway (ppg)

public final class PushInitiator

xml version

private final static String XML_VERSION = ltxml

version=10gt

Push Access Protocol (PAP) document type

private final static String PAP_DOCTYPE =

Appendix C

50

ltDOCTYPE pap PUBLIC -WAPFORUMDTD PAP 10EN

httpwwwwapforumorgDTDpap_10dtd gt

content type of the push request multipart body

private final static String CONTENT_TYPE =

multipartrelated boundary=multipart-boundary

type=applicationxml

Service Indication (SI) document type

private static final String SI_DOCTYPE = ltDOCTYPE si

PUBLIC -WAPFORUMDTD SI 10EN +

httpwwwwapforumorgDTDsidtdgt

private static int pushId = 0

PPG url where the pap message is to be sent

private final URL ppgUrl

some push proxy gateways may also require the

authentication of the push initiator

For instance the push initiator may be required to

send an HTTP authorization header in each request

private final String authorization

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

public PushInitiator(URL ppgUrl) thisppgUrl =

ppgUrl

authorization = null

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

param authorization a ltcodegtStringltcodegt value

public PushInitiator(URL ppgUrl String authorization)

thisppgUrl = ppgUrl

Appendix C

51

thisauthorization = authorization

Systemoutprintln(Push Initiator created ppgUrl =

+ ppgUrl)

ltcodegtsendPushMessageltcodegt sends push message to

ppg

param clientAddress a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param message a ltcodegtStringltcodegt value

param mimeType a ltcodegtStringltcodegt value

exception Exception if an error occurs

public void sendPushMessage(String clientAddress

String addressTypeString message String mimeType)

throws Exception

HttpURLConnection http =

(HttpURLConnection)ppgUrlopenConnection()

String ppgServer = ppgUrlgetHost()

httpsetDoInput(true)

httpsetRequestProperty(Content-Type CONTENT_TYPE)

if(authorization = null)

if(authorizationtrim()equals())

httpsetRequestProperty(Authorization

authorization)

httpsetDoOutput(true)

PrintWriter out = new PrintWriter(new

BufferedOutputStream(httpgetOutputStream()))

outprintln(--multipart-boundary)

outprintln(Content-type applicationxml)

outprintln()

outprintln(createPapMessage(clientAddress

addressTypeppgServer genPushId() null))

outprintln()

outprintln(--multipart-boundary)

outprintln(Content-type + mimeType)

outprintln()

outprintln(message)

outprintln()

outprintln(--multipart-boundary--)

outflush()

outclose()

httpconnect()

Appendix C

52

finally read and debug the response received from

PPG

try

debugResponse(http)

catch (Exception e)

Systemerrprintln(Error in receiving the

response)

ltcodegtcreatePapMessageltcodegt creates a Push Access

Protocoltype message

param address a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param ppgServer a ltcodegtStringltcodegt value

param pushId a ltcodegtStringltcodegt value

param notificationTo a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createPapMessage(String address

String addressType String ppgServer String pushId

String notificationTo)

return XML_VERSION + n + PAP_DOCTYPE + n +

ltpap product-name=Mobile Zoo Push

Initiatorgtn +

ltpush-message push-id= + pushId +

(notificationTo = null request-notification-

to= + notificationTo ) + gtn +

ltaddress address-value=WAPPUSH= + address +

TYPE= + addressType +

+ ppgServer + gtn +

ltpush-messagegtnltpapgt

ltcodegtcreateSiMessageltcodegt creates a service

indication type message

param url a ltcodegtStringltcodegt value

param created a ltcodegtStringltcodegt value

param expires a ltcodegtStringltcodegt value

Appendix C

53

param message a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createSiMessage(String url

String sid String created String expires String

action String message)

return XML_VERSION + SI_DOCTYPE +

ltsigtn +

ltindication href= + url + +

(sid = null si-id= + sid + ) +

created = null created= + created +

) +

(action = null action= + action +

) +

(expires = null expires= + expires +

) + gt +

message +

ltindicationgtnltsigt

Debug response

param http a ltcodegtHttpURLConnectionltcodegt value

exception Exception if an error occurs

private void debugResponse(HttpURLConnection http)

throws Exception

Systemoutprintln(httpgetResponseMessage())

String headerName

int i=0

while((headerName = httpgetHeaderFieldKey(i++)) =

null)

Systemoutprintln(headerName + +

httpgetHeaderField(headerName))

Systemoutprintln()

InputStreamReader in = new InputStreamReader(new

BufferedInputStream(httpgetInputStream()))

int c

Appendix C

54

while((c = inread()) = -1)

Systemoutprint((char)c)

Systemoutprintln()

ltcodegtgenPushIdltcodegt generates an unique push id

return a ltcodegtStringltcodegt value

private String genPushId()

pushId = 100000

return SystemcurrentTimeMillis() + + pushId++

55

References

[1] Microsoft ldquoGetting Mobile Using WML and WAP to Display Web Sites on

Mobile Devicesrdquo

URL msdnmicrosoftcomen-uslibraryaa140117(office10)aspx accessed

on April 10 2008

[2] DALE BULBROOK ldquoWAPA Beginnerrsquos Guiderdquo OsborneMcGraw-Hill 2001

[3] WAP Forum Wireless Application Protocol Architecture Specification Access on

Jan 12 2008 Available

httpwww1wapforumorgtechdocumentsWAP-210-WAPArch-2006 07 12-apdf

[4] WAP Forum Push Architectural Overview access on (2008 February 3) Available

httpwww1wapforumorgtechdocumentsWAP-250-PushArchOverview-2007 04

03-apdf

[5] Service indication PDF access on 62008 Available

httpwwww3orgTRhtml401structlinkshtml

[6] WAP Push Technology (openwave) PDF access on (2008 April) Available

URL httpwwwopenwavorg

[7] Web site (httpwwwwapforumorgwhatcopyrighthtm) access on May 2008

[8] ldquoWAP Push Proxy Gateway Specificationrdquo WAP Forum access on 16-August-

2007URI httpwwwwapforumorgPDF

[9] WAP Forum Access on (2008 MAY 31) WAP Service Indication Specification

Available httpwww1wapforumorgtechdocumentsWAP-167-ServiceInd-200507

31-apdf

  • odc_fpwmlandwap_topic3
  • N100E3
  • 21
  • 5

39

Figure 52 GUI for gateway control

512 The Push initiator

Next the push initiator design had been implemented using java programming language

as in design phase the implementation is taken carefully to make a reusable component

that could be used by other developer

PushInitiator class (Appendix B) implements a simple push initiator which can be used

to create and send messages to a push proxy gateway (PPG)

The method sendPushMessage sends a push message via the PPG to the client The client

is identified by the address which is either the phone number (address type is PLMN) or

IP address The message content and its mime type are also given as arguments to the

method the other tow important method are

createPapMessage This method creates a Push Access Protocol (PAP) type message

40

createSiMessage This method is used to create a service indication (SI) type message

Figure 53 showing running kannel status

513 WAP site

Since this site will be built for testing purpose and making sure that the system is

functional we had not go deep in this section Just simple WAP site with tow page has

been crated

41

52 Service indication

When a SI was pushed to any of the emulator or Nokia phones it was received and

presented in the way it was supposed to as specified in the WAP standard as shown in

figures below This is a proof that the devices claiming to support WAP push do so and

the design is will working See figures 53 through 56

Figure 55 service indication

42

Figure 57 SI details

52 Service load

The emulator correctly receives and interpreted the SL push the same as all of Nokia

phones we have tested

When a SL was pushed to the Ericsson phones it was not presented in the specified way

figure 58 I think that it is because of security reasons The reason for this assumption is

that the phones only supports on or off as security in their push configuration The

emulator on the other hand presents SL correctly Finally the Siemens phone did seem to

interpret SL but the current software was not very consistent It did load the SL without

user interference in the specified way when the user already where having an active

session If the user was offline the phone interface presented a symbol on the display

and did not load the service until the user clicked on the symbol

43

Chapter Six

6 conclusion and future work

In this chapter we will provide the conclusions and proposed future work for interested

individuals

61 Conclusions

In this project a WAP push system has been successfully designed and implemented It

provides a way to partially overcome the limitations encountered when accessing the

World Wide Web using handsets After comparing the proposed project objectives with

those accomplished the main goals are seen to be met

Phones from different manufactures all differ from the WAP-standard in some

ways One of the most obvious differences is the resolution of the display

During the work it has been noticed that the WML pages must be quite small We

have also noticed that the support for tables and some other tags are a bit limited

Even though the WML standard is smaller than the HTML standard it is a little

more complicated to write correct WML pages The main conclusion is that WAP

works pretty well but the phones are a little non-stable

The push proxy gateway is configured and worked probably with virtual SMS

center and it is easy to switch to a real one

The system depends mainly on open sources (ie Linux and kannek)

The design and implementation of the push initiator work well with the kannel

gateway and it should work correctly with other gateways

Chapter 6 Conclusion

44

62 Further Work

The possibilities of wireless push are interesting enough that it has to be worth to know if

the security and conformance problems will be solved in WAP push If they are solved

and the technique is refined then there should be nothing to stop the great number of

services that will follow in its footsteps Therefore there is further work that should be

done and the most interesting parts are in my opinion these

621 Security Aspect

One of the problems today is that the phones supporting push does not have the detailed

security settings that a technique like this needs Therefore it would be interesting to look

into the possibility to add these without confusing the user I suggest furthering looking

into usability aspects of security in WAP Push for short

622 GPS integration possibility

This will provide location dependent delivery of WAP push it will have great

applications in telematic and ecommerce advertising

623 Conformance to Standards

An interesting project would be to examine if the main reason for the nonstandard

solutions in the existing WAP push software is the result of difficulties in

implementation Or if the main reason is that the manufacturers wants to provide

proprietary solutions A reason why one may want to know this is that if the problem is

depending on implementation problems then it might get better

45

Appendix A Abbreviations

CDMA Code Division Multiple Access

CO Cache Operation

DTD Document Type Definition

GSM Global System for Mobile

HTTP Hypertext Transfer Protocol

IP Internet Protocol

MSISDN Mobile Station International Subscriber Directory Number

OTA Over The Air

PAP Push Access Protocol

PushOTA Push Over The Air

PDA Personal Digital Assistant

P1 Push Initiator

PLMN Public Land Mobile Networks

PPG Push Proxy Gateway

SI Service Indication

SIA Session Initiation Application

SIR Session Initiation Request

SL Service Loading

SMPP Short Message Peer to Peer

SMS Short Message System

SMSC Short Message System Center

UCP Universal Computer Protocol

URI Uniform Resource Identifier

URL Uniform Resource Locator

UTC Universal Time Coordinated

WAP Wireless Application Protocol

WBXML WAP binary XML

WDP Wireless Datagram Protocol

WSP Wireless Session Protocol

WTLS Wireless Transport Layer Security

XML Extensible Mark-up Language

46

Appendix B Kannel gateway configurations

THIS IS A SAMPLE CONFIGURATION FOR KANNEL

group = core

admin-port = 13000

admin-password = admin

status-password = admin

admin-deny-ip =

admin-allow-ip = 127001172161455

log-file = tmpkannellog

log-level = 0

http-proxy-host = 172161411

http-proxy-port = 8080

http-proxy-exceptions = 127001

Smsbox related

smsbox-port = 13001

box-deny-ip =

box-allow-ip = 127001

bearerbox-host =localhost

Wapbox related

wapbox-port = 13002

udp-deny-ip =

udp-allow-ip = 127001

bearerbox-host =localhost

SMSC GSM

group = smsc

smsc = at

modemtype = auto

speed =9600

device = devttyS0

SMSC HTTP

group = smsc

smsc = http

system-type = kannel

port = 13016

connect-allow-ip = 127001

Appendix B

47

username = wappush

password = wappush

SMSBOX SETUP

group = smsbox

bearerbox-host = localhost

sendsms-port = 13013

sendsms-chars = 0123456789 +-

log-file = tmpsmsboxlog

log-level = 0

access-log = accesslog

white-list = 127001

black-list =

SEND-SMS USERS

group = sendsms-user

username = wappush

password = wappush

user-deny-ip =

user-allow-ip = 127001

PPG group

group = ppg

ppg-url = wappush

ppg-port = 8080

concurrent-pushes = 100

trusted-pi = true

users = 1024

service-name = ppg

ppg-smsbox-id = dlrbox

WAP PUSH USER

group = wap-push-user

wap-push-user = picom

ppg-username = wappush

ppg-password = wappush

allow-ip = localhost

48

Appendix C Selected Codes

Gateway Control Form

ltDOCTYPE HTML PUBLIC -W3CDTD HTML 32ENgt

lthtmlgt ltheadgt

lttitlegtGateway control formlttitlegt

ltheadgt

ltbody bgcolor=white text=black link=blue vlink=navy

alink=redgt

ltbase target=submitgt

ltscriptgt

function update_status()

if ( adminactionvalue == status )

adminaction = http + adminhostnamevalue +

+ adminportvalue + status +

adminstatusformatvalue

else

adminaction = http + adminhostnamevalue +

+ adminportvalue + + adminactionvalue

adminpasswordvalue = adminpasswordvalue

actiongovalue = GO GET +adminaction

ltscriptgt

lttable align=centergt

lttrgtltp align=centergtlth2gtGateway control

formlth2gtltpgtlttrgt

lttrgt lttdgtHostnamelttdgtlttdgtltinput type=text

name=adminhostname value=localhost

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPortlttdgtlttdgtltinput type=text

name=adminport value=13000

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPasswordlttdgtlttdgtltinput type=password

name=adminpassword value=

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtActionlttdgtlttdgtltselect name=adminaction

onChange=update_status()gt

ltoption value=statusgtStatusltoptiongt

ltoption value=suspendgtSuspendltoptiongt

ltoption value=isolategtIsolateltoptiongt

Appendix C

49

ltoption value=shutdowngtShutdownltoptiongt

ltoption value=resumegtResumeltoptiongt

ltselectgtlttdgt lttrgt

lttrgt lttdgtStatus Formatlttdgtlttdgtltselect

name=adminstatusformat onChange=update_status()gt

ltoption value=gthtmlltoptiongtltoption

value=txtgttxtltoptiongtltoption

value=xmlgtxmlltoptiongtltselectgtlttdgt lttrgt

ltform name=admin method=get

action=httplocalhost13000status

encoding=applicationx-www-formgt

ltinput type=hidden name=password value=gt

lttrgt

lttdgtGolttdgt

ltformgt

lttdgtltinput type=submit value=go name=actiongo

onClick=documentadminsubmit()gtlttdgt

lttrgt

lttablegt

ltbodygt

lthtmlgt

Push Initiator Class

import javanetURL

import javanetHttpURLConnection

import javaio

Class implements a simple push initiator It can be

used to create and send messages to push proxy

gateway (ppg)

public final class PushInitiator

xml version

private final static String XML_VERSION = ltxml

version=10gt

Push Access Protocol (PAP) document type

private final static String PAP_DOCTYPE =

Appendix C

50

ltDOCTYPE pap PUBLIC -WAPFORUMDTD PAP 10EN

httpwwwwapforumorgDTDpap_10dtd gt

content type of the push request multipart body

private final static String CONTENT_TYPE =

multipartrelated boundary=multipart-boundary

type=applicationxml

Service Indication (SI) document type

private static final String SI_DOCTYPE = ltDOCTYPE si

PUBLIC -WAPFORUMDTD SI 10EN +

httpwwwwapforumorgDTDsidtdgt

private static int pushId = 0

PPG url where the pap message is to be sent

private final URL ppgUrl

some push proxy gateways may also require the

authentication of the push initiator

For instance the push initiator may be required to

send an HTTP authorization header in each request

private final String authorization

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

public PushInitiator(URL ppgUrl) thisppgUrl =

ppgUrl

authorization = null

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

param authorization a ltcodegtStringltcodegt value

public PushInitiator(URL ppgUrl String authorization)

thisppgUrl = ppgUrl

Appendix C

51

thisauthorization = authorization

Systemoutprintln(Push Initiator created ppgUrl =

+ ppgUrl)

ltcodegtsendPushMessageltcodegt sends push message to

ppg

param clientAddress a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param message a ltcodegtStringltcodegt value

param mimeType a ltcodegtStringltcodegt value

exception Exception if an error occurs

public void sendPushMessage(String clientAddress

String addressTypeString message String mimeType)

throws Exception

HttpURLConnection http =

(HttpURLConnection)ppgUrlopenConnection()

String ppgServer = ppgUrlgetHost()

httpsetDoInput(true)

httpsetRequestProperty(Content-Type CONTENT_TYPE)

if(authorization = null)

if(authorizationtrim()equals())

httpsetRequestProperty(Authorization

authorization)

httpsetDoOutput(true)

PrintWriter out = new PrintWriter(new

BufferedOutputStream(httpgetOutputStream()))

outprintln(--multipart-boundary)

outprintln(Content-type applicationxml)

outprintln()

outprintln(createPapMessage(clientAddress

addressTypeppgServer genPushId() null))

outprintln()

outprintln(--multipart-boundary)

outprintln(Content-type + mimeType)

outprintln()

outprintln(message)

outprintln()

outprintln(--multipart-boundary--)

outflush()

outclose()

httpconnect()

Appendix C

52

finally read and debug the response received from

PPG

try

debugResponse(http)

catch (Exception e)

Systemerrprintln(Error in receiving the

response)

ltcodegtcreatePapMessageltcodegt creates a Push Access

Protocoltype message

param address a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param ppgServer a ltcodegtStringltcodegt value

param pushId a ltcodegtStringltcodegt value

param notificationTo a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createPapMessage(String address

String addressType String ppgServer String pushId

String notificationTo)

return XML_VERSION + n + PAP_DOCTYPE + n +

ltpap product-name=Mobile Zoo Push

Initiatorgtn +

ltpush-message push-id= + pushId +

(notificationTo = null request-notification-

to= + notificationTo ) + gtn +

ltaddress address-value=WAPPUSH= + address +

TYPE= + addressType +

+ ppgServer + gtn +

ltpush-messagegtnltpapgt

ltcodegtcreateSiMessageltcodegt creates a service

indication type message

param url a ltcodegtStringltcodegt value

param created a ltcodegtStringltcodegt value

param expires a ltcodegtStringltcodegt value

Appendix C

53

param message a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createSiMessage(String url

String sid String created String expires String

action String message)

return XML_VERSION + SI_DOCTYPE +

ltsigtn +

ltindication href= + url + +

(sid = null si-id= + sid + ) +

created = null created= + created +

) +

(action = null action= + action +

) +

(expires = null expires= + expires +

) + gt +

message +

ltindicationgtnltsigt

Debug response

param http a ltcodegtHttpURLConnectionltcodegt value

exception Exception if an error occurs

private void debugResponse(HttpURLConnection http)

throws Exception

Systemoutprintln(httpgetResponseMessage())

String headerName

int i=0

while((headerName = httpgetHeaderFieldKey(i++)) =

null)

Systemoutprintln(headerName + +

httpgetHeaderField(headerName))

Systemoutprintln()

InputStreamReader in = new InputStreamReader(new

BufferedInputStream(httpgetInputStream()))

int c

Appendix C

54

while((c = inread()) = -1)

Systemoutprint((char)c)

Systemoutprintln()

ltcodegtgenPushIdltcodegt generates an unique push id

return a ltcodegtStringltcodegt value

private String genPushId()

pushId = 100000

return SystemcurrentTimeMillis() + + pushId++

55

References

[1] Microsoft ldquoGetting Mobile Using WML and WAP to Display Web Sites on

Mobile Devicesrdquo

URL msdnmicrosoftcomen-uslibraryaa140117(office10)aspx accessed

on April 10 2008

[2] DALE BULBROOK ldquoWAPA Beginnerrsquos Guiderdquo OsborneMcGraw-Hill 2001

[3] WAP Forum Wireless Application Protocol Architecture Specification Access on

Jan 12 2008 Available

httpwww1wapforumorgtechdocumentsWAP-210-WAPArch-2006 07 12-apdf

[4] WAP Forum Push Architectural Overview access on (2008 February 3) Available

httpwww1wapforumorgtechdocumentsWAP-250-PushArchOverview-2007 04

03-apdf

[5] Service indication PDF access on 62008 Available

httpwwww3orgTRhtml401structlinkshtml

[6] WAP Push Technology (openwave) PDF access on (2008 April) Available

URL httpwwwopenwavorg

[7] Web site (httpwwwwapforumorgwhatcopyrighthtm) access on May 2008

[8] ldquoWAP Push Proxy Gateway Specificationrdquo WAP Forum access on 16-August-

2007URI httpwwwwapforumorgPDF

[9] WAP Forum Access on (2008 MAY 31) WAP Service Indication Specification

Available httpwww1wapforumorgtechdocumentsWAP-167-ServiceInd-200507

31-apdf

  • odc_fpwmlandwap_topic3
  • N100E3
  • 21
  • 5

40

createSiMessage This method is used to create a service indication (SI) type message

Figure 53 showing running kannel status

513 WAP site

Since this site will be built for testing purpose and making sure that the system is

functional we had not go deep in this section Just simple WAP site with tow page has

been crated

41

52 Service indication

When a SI was pushed to any of the emulator or Nokia phones it was received and

presented in the way it was supposed to as specified in the WAP standard as shown in

figures below This is a proof that the devices claiming to support WAP push do so and

the design is will working See figures 53 through 56

Figure 55 service indication

42

Figure 57 SI details

52 Service load

The emulator correctly receives and interpreted the SL push the same as all of Nokia

phones we have tested

When a SL was pushed to the Ericsson phones it was not presented in the specified way

figure 58 I think that it is because of security reasons The reason for this assumption is

that the phones only supports on or off as security in their push configuration The

emulator on the other hand presents SL correctly Finally the Siemens phone did seem to

interpret SL but the current software was not very consistent It did load the SL without

user interference in the specified way when the user already where having an active

session If the user was offline the phone interface presented a symbol on the display

and did not load the service until the user clicked on the symbol

43

Chapter Six

6 conclusion and future work

In this chapter we will provide the conclusions and proposed future work for interested

individuals

61 Conclusions

In this project a WAP push system has been successfully designed and implemented It

provides a way to partially overcome the limitations encountered when accessing the

World Wide Web using handsets After comparing the proposed project objectives with

those accomplished the main goals are seen to be met

Phones from different manufactures all differ from the WAP-standard in some

ways One of the most obvious differences is the resolution of the display

During the work it has been noticed that the WML pages must be quite small We

have also noticed that the support for tables and some other tags are a bit limited

Even though the WML standard is smaller than the HTML standard it is a little

more complicated to write correct WML pages The main conclusion is that WAP

works pretty well but the phones are a little non-stable

The push proxy gateway is configured and worked probably with virtual SMS

center and it is easy to switch to a real one

The system depends mainly on open sources (ie Linux and kannek)

The design and implementation of the push initiator work well with the kannel

gateway and it should work correctly with other gateways

Chapter 6 Conclusion

44

62 Further Work

The possibilities of wireless push are interesting enough that it has to be worth to know if

the security and conformance problems will be solved in WAP push If they are solved

and the technique is refined then there should be nothing to stop the great number of

services that will follow in its footsteps Therefore there is further work that should be

done and the most interesting parts are in my opinion these

621 Security Aspect

One of the problems today is that the phones supporting push does not have the detailed

security settings that a technique like this needs Therefore it would be interesting to look

into the possibility to add these without confusing the user I suggest furthering looking

into usability aspects of security in WAP Push for short

622 GPS integration possibility

This will provide location dependent delivery of WAP push it will have great

applications in telematic and ecommerce advertising

623 Conformance to Standards

An interesting project would be to examine if the main reason for the nonstandard

solutions in the existing WAP push software is the result of difficulties in

implementation Or if the main reason is that the manufacturers wants to provide

proprietary solutions A reason why one may want to know this is that if the problem is

depending on implementation problems then it might get better

45

Appendix A Abbreviations

CDMA Code Division Multiple Access

CO Cache Operation

DTD Document Type Definition

GSM Global System for Mobile

HTTP Hypertext Transfer Protocol

IP Internet Protocol

MSISDN Mobile Station International Subscriber Directory Number

OTA Over The Air

PAP Push Access Protocol

PushOTA Push Over The Air

PDA Personal Digital Assistant

P1 Push Initiator

PLMN Public Land Mobile Networks

PPG Push Proxy Gateway

SI Service Indication

SIA Session Initiation Application

SIR Session Initiation Request

SL Service Loading

SMPP Short Message Peer to Peer

SMS Short Message System

SMSC Short Message System Center

UCP Universal Computer Protocol

URI Uniform Resource Identifier

URL Uniform Resource Locator

UTC Universal Time Coordinated

WAP Wireless Application Protocol

WBXML WAP binary XML

WDP Wireless Datagram Protocol

WSP Wireless Session Protocol

WTLS Wireless Transport Layer Security

XML Extensible Mark-up Language

46

Appendix B Kannel gateway configurations

THIS IS A SAMPLE CONFIGURATION FOR KANNEL

group = core

admin-port = 13000

admin-password = admin

status-password = admin

admin-deny-ip =

admin-allow-ip = 127001172161455

log-file = tmpkannellog

log-level = 0

http-proxy-host = 172161411

http-proxy-port = 8080

http-proxy-exceptions = 127001

Smsbox related

smsbox-port = 13001

box-deny-ip =

box-allow-ip = 127001

bearerbox-host =localhost

Wapbox related

wapbox-port = 13002

udp-deny-ip =

udp-allow-ip = 127001

bearerbox-host =localhost

SMSC GSM

group = smsc

smsc = at

modemtype = auto

speed =9600

device = devttyS0

SMSC HTTP

group = smsc

smsc = http

system-type = kannel

port = 13016

connect-allow-ip = 127001

Appendix B

47

username = wappush

password = wappush

SMSBOX SETUP

group = smsbox

bearerbox-host = localhost

sendsms-port = 13013

sendsms-chars = 0123456789 +-

log-file = tmpsmsboxlog

log-level = 0

access-log = accesslog

white-list = 127001

black-list =

SEND-SMS USERS

group = sendsms-user

username = wappush

password = wappush

user-deny-ip =

user-allow-ip = 127001

PPG group

group = ppg

ppg-url = wappush

ppg-port = 8080

concurrent-pushes = 100

trusted-pi = true

users = 1024

service-name = ppg

ppg-smsbox-id = dlrbox

WAP PUSH USER

group = wap-push-user

wap-push-user = picom

ppg-username = wappush

ppg-password = wappush

allow-ip = localhost

48

Appendix C Selected Codes

Gateway Control Form

ltDOCTYPE HTML PUBLIC -W3CDTD HTML 32ENgt

lthtmlgt ltheadgt

lttitlegtGateway control formlttitlegt

ltheadgt

ltbody bgcolor=white text=black link=blue vlink=navy

alink=redgt

ltbase target=submitgt

ltscriptgt

function update_status()

if ( adminactionvalue == status )

adminaction = http + adminhostnamevalue +

+ adminportvalue + status +

adminstatusformatvalue

else

adminaction = http + adminhostnamevalue +

+ adminportvalue + + adminactionvalue

adminpasswordvalue = adminpasswordvalue

actiongovalue = GO GET +adminaction

ltscriptgt

lttable align=centergt

lttrgtltp align=centergtlth2gtGateway control

formlth2gtltpgtlttrgt

lttrgt lttdgtHostnamelttdgtlttdgtltinput type=text

name=adminhostname value=localhost

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPortlttdgtlttdgtltinput type=text

name=adminport value=13000

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPasswordlttdgtlttdgtltinput type=password

name=adminpassword value=

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtActionlttdgtlttdgtltselect name=adminaction

onChange=update_status()gt

ltoption value=statusgtStatusltoptiongt

ltoption value=suspendgtSuspendltoptiongt

ltoption value=isolategtIsolateltoptiongt

Appendix C

49

ltoption value=shutdowngtShutdownltoptiongt

ltoption value=resumegtResumeltoptiongt

ltselectgtlttdgt lttrgt

lttrgt lttdgtStatus Formatlttdgtlttdgtltselect

name=adminstatusformat onChange=update_status()gt

ltoption value=gthtmlltoptiongtltoption

value=txtgttxtltoptiongtltoption

value=xmlgtxmlltoptiongtltselectgtlttdgt lttrgt

ltform name=admin method=get

action=httplocalhost13000status

encoding=applicationx-www-formgt

ltinput type=hidden name=password value=gt

lttrgt

lttdgtGolttdgt

ltformgt

lttdgtltinput type=submit value=go name=actiongo

onClick=documentadminsubmit()gtlttdgt

lttrgt

lttablegt

ltbodygt

lthtmlgt

Push Initiator Class

import javanetURL

import javanetHttpURLConnection

import javaio

Class implements a simple push initiator It can be

used to create and send messages to push proxy

gateway (ppg)

public final class PushInitiator

xml version

private final static String XML_VERSION = ltxml

version=10gt

Push Access Protocol (PAP) document type

private final static String PAP_DOCTYPE =

Appendix C

50

ltDOCTYPE pap PUBLIC -WAPFORUMDTD PAP 10EN

httpwwwwapforumorgDTDpap_10dtd gt

content type of the push request multipart body

private final static String CONTENT_TYPE =

multipartrelated boundary=multipart-boundary

type=applicationxml

Service Indication (SI) document type

private static final String SI_DOCTYPE = ltDOCTYPE si

PUBLIC -WAPFORUMDTD SI 10EN +

httpwwwwapforumorgDTDsidtdgt

private static int pushId = 0

PPG url where the pap message is to be sent

private final URL ppgUrl

some push proxy gateways may also require the

authentication of the push initiator

For instance the push initiator may be required to

send an HTTP authorization header in each request

private final String authorization

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

public PushInitiator(URL ppgUrl) thisppgUrl =

ppgUrl

authorization = null

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

param authorization a ltcodegtStringltcodegt value

public PushInitiator(URL ppgUrl String authorization)

thisppgUrl = ppgUrl

Appendix C

51

thisauthorization = authorization

Systemoutprintln(Push Initiator created ppgUrl =

+ ppgUrl)

ltcodegtsendPushMessageltcodegt sends push message to

ppg

param clientAddress a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param message a ltcodegtStringltcodegt value

param mimeType a ltcodegtStringltcodegt value

exception Exception if an error occurs

public void sendPushMessage(String clientAddress

String addressTypeString message String mimeType)

throws Exception

HttpURLConnection http =

(HttpURLConnection)ppgUrlopenConnection()

String ppgServer = ppgUrlgetHost()

httpsetDoInput(true)

httpsetRequestProperty(Content-Type CONTENT_TYPE)

if(authorization = null)

if(authorizationtrim()equals())

httpsetRequestProperty(Authorization

authorization)

httpsetDoOutput(true)

PrintWriter out = new PrintWriter(new

BufferedOutputStream(httpgetOutputStream()))

outprintln(--multipart-boundary)

outprintln(Content-type applicationxml)

outprintln()

outprintln(createPapMessage(clientAddress

addressTypeppgServer genPushId() null))

outprintln()

outprintln(--multipart-boundary)

outprintln(Content-type + mimeType)

outprintln()

outprintln(message)

outprintln()

outprintln(--multipart-boundary--)

outflush()

outclose()

httpconnect()

Appendix C

52

finally read and debug the response received from

PPG

try

debugResponse(http)

catch (Exception e)

Systemerrprintln(Error in receiving the

response)

ltcodegtcreatePapMessageltcodegt creates a Push Access

Protocoltype message

param address a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param ppgServer a ltcodegtStringltcodegt value

param pushId a ltcodegtStringltcodegt value

param notificationTo a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createPapMessage(String address

String addressType String ppgServer String pushId

String notificationTo)

return XML_VERSION + n + PAP_DOCTYPE + n +

ltpap product-name=Mobile Zoo Push

Initiatorgtn +

ltpush-message push-id= + pushId +

(notificationTo = null request-notification-

to= + notificationTo ) + gtn +

ltaddress address-value=WAPPUSH= + address +

TYPE= + addressType +

+ ppgServer + gtn +

ltpush-messagegtnltpapgt

ltcodegtcreateSiMessageltcodegt creates a service

indication type message

param url a ltcodegtStringltcodegt value

param created a ltcodegtStringltcodegt value

param expires a ltcodegtStringltcodegt value

Appendix C

53

param message a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createSiMessage(String url

String sid String created String expires String

action String message)

return XML_VERSION + SI_DOCTYPE +

ltsigtn +

ltindication href= + url + +

(sid = null si-id= + sid + ) +

created = null created= + created +

) +

(action = null action= + action +

) +

(expires = null expires= + expires +

) + gt +

message +

ltindicationgtnltsigt

Debug response

param http a ltcodegtHttpURLConnectionltcodegt value

exception Exception if an error occurs

private void debugResponse(HttpURLConnection http)

throws Exception

Systemoutprintln(httpgetResponseMessage())

String headerName

int i=0

while((headerName = httpgetHeaderFieldKey(i++)) =

null)

Systemoutprintln(headerName + +

httpgetHeaderField(headerName))

Systemoutprintln()

InputStreamReader in = new InputStreamReader(new

BufferedInputStream(httpgetInputStream()))

int c

Appendix C

54

while((c = inread()) = -1)

Systemoutprint((char)c)

Systemoutprintln()

ltcodegtgenPushIdltcodegt generates an unique push id

return a ltcodegtStringltcodegt value

private String genPushId()

pushId = 100000

return SystemcurrentTimeMillis() + + pushId++

55

References

[1] Microsoft ldquoGetting Mobile Using WML and WAP to Display Web Sites on

Mobile Devicesrdquo

URL msdnmicrosoftcomen-uslibraryaa140117(office10)aspx accessed

on April 10 2008

[2] DALE BULBROOK ldquoWAPA Beginnerrsquos Guiderdquo OsborneMcGraw-Hill 2001

[3] WAP Forum Wireless Application Protocol Architecture Specification Access on

Jan 12 2008 Available

httpwww1wapforumorgtechdocumentsWAP-210-WAPArch-2006 07 12-apdf

[4] WAP Forum Push Architectural Overview access on (2008 February 3) Available

httpwww1wapforumorgtechdocumentsWAP-250-PushArchOverview-2007 04

03-apdf

[5] Service indication PDF access on 62008 Available

httpwwww3orgTRhtml401structlinkshtml

[6] WAP Push Technology (openwave) PDF access on (2008 April) Available

URL httpwwwopenwavorg

[7] Web site (httpwwwwapforumorgwhatcopyrighthtm) access on May 2008

[8] ldquoWAP Push Proxy Gateway Specificationrdquo WAP Forum access on 16-August-

2007URI httpwwwwapforumorgPDF

[9] WAP Forum Access on (2008 MAY 31) WAP Service Indication Specification

Available httpwww1wapforumorgtechdocumentsWAP-167-ServiceInd-200507

31-apdf

  • odc_fpwmlandwap_topic3
  • N100E3
  • 21
  • 5

41

52 Service indication

When a SI was pushed to any of the emulator or Nokia phones it was received and

presented in the way it was supposed to as specified in the WAP standard as shown in

figures below This is a proof that the devices claiming to support WAP push do so and

the design is will working See figures 53 through 56

Figure 55 service indication

42

Figure 57 SI details

52 Service load

The emulator correctly receives and interpreted the SL push the same as all of Nokia

phones we have tested

When a SL was pushed to the Ericsson phones it was not presented in the specified way

figure 58 I think that it is because of security reasons The reason for this assumption is

that the phones only supports on or off as security in their push configuration The

emulator on the other hand presents SL correctly Finally the Siemens phone did seem to

interpret SL but the current software was not very consistent It did load the SL without

user interference in the specified way when the user already where having an active

session If the user was offline the phone interface presented a symbol on the display

and did not load the service until the user clicked on the symbol

43

Chapter Six

6 conclusion and future work

In this chapter we will provide the conclusions and proposed future work for interested

individuals

61 Conclusions

In this project a WAP push system has been successfully designed and implemented It

provides a way to partially overcome the limitations encountered when accessing the

World Wide Web using handsets After comparing the proposed project objectives with

those accomplished the main goals are seen to be met

Phones from different manufactures all differ from the WAP-standard in some

ways One of the most obvious differences is the resolution of the display

During the work it has been noticed that the WML pages must be quite small We

have also noticed that the support for tables and some other tags are a bit limited

Even though the WML standard is smaller than the HTML standard it is a little

more complicated to write correct WML pages The main conclusion is that WAP

works pretty well but the phones are a little non-stable

The push proxy gateway is configured and worked probably with virtual SMS

center and it is easy to switch to a real one

The system depends mainly on open sources (ie Linux and kannek)

The design and implementation of the push initiator work well with the kannel

gateway and it should work correctly with other gateways

Chapter 6 Conclusion

44

62 Further Work

The possibilities of wireless push are interesting enough that it has to be worth to know if

the security and conformance problems will be solved in WAP push If they are solved

and the technique is refined then there should be nothing to stop the great number of

services that will follow in its footsteps Therefore there is further work that should be

done and the most interesting parts are in my opinion these

621 Security Aspect

One of the problems today is that the phones supporting push does not have the detailed

security settings that a technique like this needs Therefore it would be interesting to look

into the possibility to add these without confusing the user I suggest furthering looking

into usability aspects of security in WAP Push for short

622 GPS integration possibility

This will provide location dependent delivery of WAP push it will have great

applications in telematic and ecommerce advertising

623 Conformance to Standards

An interesting project would be to examine if the main reason for the nonstandard

solutions in the existing WAP push software is the result of difficulties in

implementation Or if the main reason is that the manufacturers wants to provide

proprietary solutions A reason why one may want to know this is that if the problem is

depending on implementation problems then it might get better

45

Appendix A Abbreviations

CDMA Code Division Multiple Access

CO Cache Operation

DTD Document Type Definition

GSM Global System for Mobile

HTTP Hypertext Transfer Protocol

IP Internet Protocol

MSISDN Mobile Station International Subscriber Directory Number

OTA Over The Air

PAP Push Access Protocol

PushOTA Push Over The Air

PDA Personal Digital Assistant

P1 Push Initiator

PLMN Public Land Mobile Networks

PPG Push Proxy Gateway

SI Service Indication

SIA Session Initiation Application

SIR Session Initiation Request

SL Service Loading

SMPP Short Message Peer to Peer

SMS Short Message System

SMSC Short Message System Center

UCP Universal Computer Protocol

URI Uniform Resource Identifier

URL Uniform Resource Locator

UTC Universal Time Coordinated

WAP Wireless Application Protocol

WBXML WAP binary XML

WDP Wireless Datagram Protocol

WSP Wireless Session Protocol

WTLS Wireless Transport Layer Security

XML Extensible Mark-up Language

46

Appendix B Kannel gateway configurations

THIS IS A SAMPLE CONFIGURATION FOR KANNEL

group = core

admin-port = 13000

admin-password = admin

status-password = admin

admin-deny-ip =

admin-allow-ip = 127001172161455

log-file = tmpkannellog

log-level = 0

http-proxy-host = 172161411

http-proxy-port = 8080

http-proxy-exceptions = 127001

Smsbox related

smsbox-port = 13001

box-deny-ip =

box-allow-ip = 127001

bearerbox-host =localhost

Wapbox related

wapbox-port = 13002

udp-deny-ip =

udp-allow-ip = 127001

bearerbox-host =localhost

SMSC GSM

group = smsc

smsc = at

modemtype = auto

speed =9600

device = devttyS0

SMSC HTTP

group = smsc

smsc = http

system-type = kannel

port = 13016

connect-allow-ip = 127001

Appendix B

47

username = wappush

password = wappush

SMSBOX SETUP

group = smsbox

bearerbox-host = localhost

sendsms-port = 13013

sendsms-chars = 0123456789 +-

log-file = tmpsmsboxlog

log-level = 0

access-log = accesslog

white-list = 127001

black-list =

SEND-SMS USERS

group = sendsms-user

username = wappush

password = wappush

user-deny-ip =

user-allow-ip = 127001

PPG group

group = ppg

ppg-url = wappush

ppg-port = 8080

concurrent-pushes = 100

trusted-pi = true

users = 1024

service-name = ppg

ppg-smsbox-id = dlrbox

WAP PUSH USER

group = wap-push-user

wap-push-user = picom

ppg-username = wappush

ppg-password = wappush

allow-ip = localhost

48

Appendix C Selected Codes

Gateway Control Form

ltDOCTYPE HTML PUBLIC -W3CDTD HTML 32ENgt

lthtmlgt ltheadgt

lttitlegtGateway control formlttitlegt

ltheadgt

ltbody bgcolor=white text=black link=blue vlink=navy

alink=redgt

ltbase target=submitgt

ltscriptgt

function update_status()

if ( adminactionvalue == status )

adminaction = http + adminhostnamevalue +

+ adminportvalue + status +

adminstatusformatvalue

else

adminaction = http + adminhostnamevalue +

+ adminportvalue + + adminactionvalue

adminpasswordvalue = adminpasswordvalue

actiongovalue = GO GET +adminaction

ltscriptgt

lttable align=centergt

lttrgtltp align=centergtlth2gtGateway control

formlth2gtltpgtlttrgt

lttrgt lttdgtHostnamelttdgtlttdgtltinput type=text

name=adminhostname value=localhost

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPortlttdgtlttdgtltinput type=text

name=adminport value=13000

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPasswordlttdgtlttdgtltinput type=password

name=adminpassword value=

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtActionlttdgtlttdgtltselect name=adminaction

onChange=update_status()gt

ltoption value=statusgtStatusltoptiongt

ltoption value=suspendgtSuspendltoptiongt

ltoption value=isolategtIsolateltoptiongt

Appendix C

49

ltoption value=shutdowngtShutdownltoptiongt

ltoption value=resumegtResumeltoptiongt

ltselectgtlttdgt lttrgt

lttrgt lttdgtStatus Formatlttdgtlttdgtltselect

name=adminstatusformat onChange=update_status()gt

ltoption value=gthtmlltoptiongtltoption

value=txtgttxtltoptiongtltoption

value=xmlgtxmlltoptiongtltselectgtlttdgt lttrgt

ltform name=admin method=get

action=httplocalhost13000status

encoding=applicationx-www-formgt

ltinput type=hidden name=password value=gt

lttrgt

lttdgtGolttdgt

ltformgt

lttdgtltinput type=submit value=go name=actiongo

onClick=documentadminsubmit()gtlttdgt

lttrgt

lttablegt

ltbodygt

lthtmlgt

Push Initiator Class

import javanetURL

import javanetHttpURLConnection

import javaio

Class implements a simple push initiator It can be

used to create and send messages to push proxy

gateway (ppg)

public final class PushInitiator

xml version

private final static String XML_VERSION = ltxml

version=10gt

Push Access Protocol (PAP) document type

private final static String PAP_DOCTYPE =

Appendix C

50

ltDOCTYPE pap PUBLIC -WAPFORUMDTD PAP 10EN

httpwwwwapforumorgDTDpap_10dtd gt

content type of the push request multipart body

private final static String CONTENT_TYPE =

multipartrelated boundary=multipart-boundary

type=applicationxml

Service Indication (SI) document type

private static final String SI_DOCTYPE = ltDOCTYPE si

PUBLIC -WAPFORUMDTD SI 10EN +

httpwwwwapforumorgDTDsidtdgt

private static int pushId = 0

PPG url where the pap message is to be sent

private final URL ppgUrl

some push proxy gateways may also require the

authentication of the push initiator

For instance the push initiator may be required to

send an HTTP authorization header in each request

private final String authorization

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

public PushInitiator(URL ppgUrl) thisppgUrl =

ppgUrl

authorization = null

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

param authorization a ltcodegtStringltcodegt value

public PushInitiator(URL ppgUrl String authorization)

thisppgUrl = ppgUrl

Appendix C

51

thisauthorization = authorization

Systemoutprintln(Push Initiator created ppgUrl =

+ ppgUrl)

ltcodegtsendPushMessageltcodegt sends push message to

ppg

param clientAddress a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param message a ltcodegtStringltcodegt value

param mimeType a ltcodegtStringltcodegt value

exception Exception if an error occurs

public void sendPushMessage(String clientAddress

String addressTypeString message String mimeType)

throws Exception

HttpURLConnection http =

(HttpURLConnection)ppgUrlopenConnection()

String ppgServer = ppgUrlgetHost()

httpsetDoInput(true)

httpsetRequestProperty(Content-Type CONTENT_TYPE)

if(authorization = null)

if(authorizationtrim()equals())

httpsetRequestProperty(Authorization

authorization)

httpsetDoOutput(true)

PrintWriter out = new PrintWriter(new

BufferedOutputStream(httpgetOutputStream()))

outprintln(--multipart-boundary)

outprintln(Content-type applicationxml)

outprintln()

outprintln(createPapMessage(clientAddress

addressTypeppgServer genPushId() null))

outprintln()

outprintln(--multipart-boundary)

outprintln(Content-type + mimeType)

outprintln()

outprintln(message)

outprintln()

outprintln(--multipart-boundary--)

outflush()

outclose()

httpconnect()

Appendix C

52

finally read and debug the response received from

PPG

try

debugResponse(http)

catch (Exception e)

Systemerrprintln(Error in receiving the

response)

ltcodegtcreatePapMessageltcodegt creates a Push Access

Protocoltype message

param address a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param ppgServer a ltcodegtStringltcodegt value

param pushId a ltcodegtStringltcodegt value

param notificationTo a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createPapMessage(String address

String addressType String ppgServer String pushId

String notificationTo)

return XML_VERSION + n + PAP_DOCTYPE + n +

ltpap product-name=Mobile Zoo Push

Initiatorgtn +

ltpush-message push-id= + pushId +

(notificationTo = null request-notification-

to= + notificationTo ) + gtn +

ltaddress address-value=WAPPUSH= + address +

TYPE= + addressType +

+ ppgServer + gtn +

ltpush-messagegtnltpapgt

ltcodegtcreateSiMessageltcodegt creates a service

indication type message

param url a ltcodegtStringltcodegt value

param created a ltcodegtStringltcodegt value

param expires a ltcodegtStringltcodegt value

Appendix C

53

param message a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createSiMessage(String url

String sid String created String expires String

action String message)

return XML_VERSION + SI_DOCTYPE +

ltsigtn +

ltindication href= + url + +

(sid = null si-id= + sid + ) +

created = null created= + created +

) +

(action = null action= + action +

) +

(expires = null expires= + expires +

) + gt +

message +

ltindicationgtnltsigt

Debug response

param http a ltcodegtHttpURLConnectionltcodegt value

exception Exception if an error occurs

private void debugResponse(HttpURLConnection http)

throws Exception

Systemoutprintln(httpgetResponseMessage())

String headerName

int i=0

while((headerName = httpgetHeaderFieldKey(i++)) =

null)

Systemoutprintln(headerName + +

httpgetHeaderField(headerName))

Systemoutprintln()

InputStreamReader in = new InputStreamReader(new

BufferedInputStream(httpgetInputStream()))

int c

Appendix C

54

while((c = inread()) = -1)

Systemoutprint((char)c)

Systemoutprintln()

ltcodegtgenPushIdltcodegt generates an unique push id

return a ltcodegtStringltcodegt value

private String genPushId()

pushId = 100000

return SystemcurrentTimeMillis() + + pushId++

55

References

[1] Microsoft ldquoGetting Mobile Using WML and WAP to Display Web Sites on

Mobile Devicesrdquo

URL msdnmicrosoftcomen-uslibraryaa140117(office10)aspx accessed

on April 10 2008

[2] DALE BULBROOK ldquoWAPA Beginnerrsquos Guiderdquo OsborneMcGraw-Hill 2001

[3] WAP Forum Wireless Application Protocol Architecture Specification Access on

Jan 12 2008 Available

httpwww1wapforumorgtechdocumentsWAP-210-WAPArch-2006 07 12-apdf

[4] WAP Forum Push Architectural Overview access on (2008 February 3) Available

httpwww1wapforumorgtechdocumentsWAP-250-PushArchOverview-2007 04

03-apdf

[5] Service indication PDF access on 62008 Available

httpwwww3orgTRhtml401structlinkshtml

[6] WAP Push Technology (openwave) PDF access on (2008 April) Available

URL httpwwwopenwavorg

[7] Web site (httpwwwwapforumorgwhatcopyrighthtm) access on May 2008

[8] ldquoWAP Push Proxy Gateway Specificationrdquo WAP Forum access on 16-August-

2007URI httpwwwwapforumorgPDF

[9] WAP Forum Access on (2008 MAY 31) WAP Service Indication Specification

Available httpwww1wapforumorgtechdocumentsWAP-167-ServiceInd-200507

31-apdf

  • odc_fpwmlandwap_topic3
  • N100E3
  • 21
  • 5

42

Figure 57 SI details

52 Service load

The emulator correctly receives and interpreted the SL push the same as all of Nokia

phones we have tested

When a SL was pushed to the Ericsson phones it was not presented in the specified way

figure 58 I think that it is because of security reasons The reason for this assumption is

that the phones only supports on or off as security in their push configuration The

emulator on the other hand presents SL correctly Finally the Siemens phone did seem to

interpret SL but the current software was not very consistent It did load the SL without

user interference in the specified way when the user already where having an active

session If the user was offline the phone interface presented a symbol on the display

and did not load the service until the user clicked on the symbol

43

Chapter Six

6 conclusion and future work

In this chapter we will provide the conclusions and proposed future work for interested

individuals

61 Conclusions

In this project a WAP push system has been successfully designed and implemented It

provides a way to partially overcome the limitations encountered when accessing the

World Wide Web using handsets After comparing the proposed project objectives with

those accomplished the main goals are seen to be met

Phones from different manufactures all differ from the WAP-standard in some

ways One of the most obvious differences is the resolution of the display

During the work it has been noticed that the WML pages must be quite small We

have also noticed that the support for tables and some other tags are a bit limited

Even though the WML standard is smaller than the HTML standard it is a little

more complicated to write correct WML pages The main conclusion is that WAP

works pretty well but the phones are a little non-stable

The push proxy gateway is configured and worked probably with virtual SMS

center and it is easy to switch to a real one

The system depends mainly on open sources (ie Linux and kannek)

The design and implementation of the push initiator work well with the kannel

gateway and it should work correctly with other gateways

Chapter 6 Conclusion

44

62 Further Work

The possibilities of wireless push are interesting enough that it has to be worth to know if

the security and conformance problems will be solved in WAP push If they are solved

and the technique is refined then there should be nothing to stop the great number of

services that will follow in its footsteps Therefore there is further work that should be

done and the most interesting parts are in my opinion these

621 Security Aspect

One of the problems today is that the phones supporting push does not have the detailed

security settings that a technique like this needs Therefore it would be interesting to look

into the possibility to add these without confusing the user I suggest furthering looking

into usability aspects of security in WAP Push for short

622 GPS integration possibility

This will provide location dependent delivery of WAP push it will have great

applications in telematic and ecommerce advertising

623 Conformance to Standards

An interesting project would be to examine if the main reason for the nonstandard

solutions in the existing WAP push software is the result of difficulties in

implementation Or if the main reason is that the manufacturers wants to provide

proprietary solutions A reason why one may want to know this is that if the problem is

depending on implementation problems then it might get better

45

Appendix A Abbreviations

CDMA Code Division Multiple Access

CO Cache Operation

DTD Document Type Definition

GSM Global System for Mobile

HTTP Hypertext Transfer Protocol

IP Internet Protocol

MSISDN Mobile Station International Subscriber Directory Number

OTA Over The Air

PAP Push Access Protocol

PushOTA Push Over The Air

PDA Personal Digital Assistant

P1 Push Initiator

PLMN Public Land Mobile Networks

PPG Push Proxy Gateway

SI Service Indication

SIA Session Initiation Application

SIR Session Initiation Request

SL Service Loading

SMPP Short Message Peer to Peer

SMS Short Message System

SMSC Short Message System Center

UCP Universal Computer Protocol

URI Uniform Resource Identifier

URL Uniform Resource Locator

UTC Universal Time Coordinated

WAP Wireless Application Protocol

WBXML WAP binary XML

WDP Wireless Datagram Protocol

WSP Wireless Session Protocol

WTLS Wireless Transport Layer Security

XML Extensible Mark-up Language

46

Appendix B Kannel gateway configurations

THIS IS A SAMPLE CONFIGURATION FOR KANNEL

group = core

admin-port = 13000

admin-password = admin

status-password = admin

admin-deny-ip =

admin-allow-ip = 127001172161455

log-file = tmpkannellog

log-level = 0

http-proxy-host = 172161411

http-proxy-port = 8080

http-proxy-exceptions = 127001

Smsbox related

smsbox-port = 13001

box-deny-ip =

box-allow-ip = 127001

bearerbox-host =localhost

Wapbox related

wapbox-port = 13002

udp-deny-ip =

udp-allow-ip = 127001

bearerbox-host =localhost

SMSC GSM

group = smsc

smsc = at

modemtype = auto

speed =9600

device = devttyS0

SMSC HTTP

group = smsc

smsc = http

system-type = kannel

port = 13016

connect-allow-ip = 127001

Appendix B

47

username = wappush

password = wappush

SMSBOX SETUP

group = smsbox

bearerbox-host = localhost

sendsms-port = 13013

sendsms-chars = 0123456789 +-

log-file = tmpsmsboxlog

log-level = 0

access-log = accesslog

white-list = 127001

black-list =

SEND-SMS USERS

group = sendsms-user

username = wappush

password = wappush

user-deny-ip =

user-allow-ip = 127001

PPG group

group = ppg

ppg-url = wappush

ppg-port = 8080

concurrent-pushes = 100

trusted-pi = true

users = 1024

service-name = ppg

ppg-smsbox-id = dlrbox

WAP PUSH USER

group = wap-push-user

wap-push-user = picom

ppg-username = wappush

ppg-password = wappush

allow-ip = localhost

48

Appendix C Selected Codes

Gateway Control Form

ltDOCTYPE HTML PUBLIC -W3CDTD HTML 32ENgt

lthtmlgt ltheadgt

lttitlegtGateway control formlttitlegt

ltheadgt

ltbody bgcolor=white text=black link=blue vlink=navy

alink=redgt

ltbase target=submitgt

ltscriptgt

function update_status()

if ( adminactionvalue == status )

adminaction = http + adminhostnamevalue +

+ adminportvalue + status +

adminstatusformatvalue

else

adminaction = http + adminhostnamevalue +

+ adminportvalue + + adminactionvalue

adminpasswordvalue = adminpasswordvalue

actiongovalue = GO GET +adminaction

ltscriptgt

lttable align=centergt

lttrgtltp align=centergtlth2gtGateway control

formlth2gtltpgtlttrgt

lttrgt lttdgtHostnamelttdgtlttdgtltinput type=text

name=adminhostname value=localhost

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPortlttdgtlttdgtltinput type=text

name=adminport value=13000

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPasswordlttdgtlttdgtltinput type=password

name=adminpassword value=

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtActionlttdgtlttdgtltselect name=adminaction

onChange=update_status()gt

ltoption value=statusgtStatusltoptiongt

ltoption value=suspendgtSuspendltoptiongt

ltoption value=isolategtIsolateltoptiongt

Appendix C

49

ltoption value=shutdowngtShutdownltoptiongt

ltoption value=resumegtResumeltoptiongt

ltselectgtlttdgt lttrgt

lttrgt lttdgtStatus Formatlttdgtlttdgtltselect

name=adminstatusformat onChange=update_status()gt

ltoption value=gthtmlltoptiongtltoption

value=txtgttxtltoptiongtltoption

value=xmlgtxmlltoptiongtltselectgtlttdgt lttrgt

ltform name=admin method=get

action=httplocalhost13000status

encoding=applicationx-www-formgt

ltinput type=hidden name=password value=gt

lttrgt

lttdgtGolttdgt

ltformgt

lttdgtltinput type=submit value=go name=actiongo

onClick=documentadminsubmit()gtlttdgt

lttrgt

lttablegt

ltbodygt

lthtmlgt

Push Initiator Class

import javanetURL

import javanetHttpURLConnection

import javaio

Class implements a simple push initiator It can be

used to create and send messages to push proxy

gateway (ppg)

public final class PushInitiator

xml version

private final static String XML_VERSION = ltxml

version=10gt

Push Access Protocol (PAP) document type

private final static String PAP_DOCTYPE =

Appendix C

50

ltDOCTYPE pap PUBLIC -WAPFORUMDTD PAP 10EN

httpwwwwapforumorgDTDpap_10dtd gt

content type of the push request multipart body

private final static String CONTENT_TYPE =

multipartrelated boundary=multipart-boundary

type=applicationxml

Service Indication (SI) document type

private static final String SI_DOCTYPE = ltDOCTYPE si

PUBLIC -WAPFORUMDTD SI 10EN +

httpwwwwapforumorgDTDsidtdgt

private static int pushId = 0

PPG url where the pap message is to be sent

private final URL ppgUrl

some push proxy gateways may also require the

authentication of the push initiator

For instance the push initiator may be required to

send an HTTP authorization header in each request

private final String authorization

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

public PushInitiator(URL ppgUrl) thisppgUrl =

ppgUrl

authorization = null

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

param authorization a ltcodegtStringltcodegt value

public PushInitiator(URL ppgUrl String authorization)

thisppgUrl = ppgUrl

Appendix C

51

thisauthorization = authorization

Systemoutprintln(Push Initiator created ppgUrl =

+ ppgUrl)

ltcodegtsendPushMessageltcodegt sends push message to

ppg

param clientAddress a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param message a ltcodegtStringltcodegt value

param mimeType a ltcodegtStringltcodegt value

exception Exception if an error occurs

public void sendPushMessage(String clientAddress

String addressTypeString message String mimeType)

throws Exception

HttpURLConnection http =

(HttpURLConnection)ppgUrlopenConnection()

String ppgServer = ppgUrlgetHost()

httpsetDoInput(true)

httpsetRequestProperty(Content-Type CONTENT_TYPE)

if(authorization = null)

if(authorizationtrim()equals())

httpsetRequestProperty(Authorization

authorization)

httpsetDoOutput(true)

PrintWriter out = new PrintWriter(new

BufferedOutputStream(httpgetOutputStream()))

outprintln(--multipart-boundary)

outprintln(Content-type applicationxml)

outprintln()

outprintln(createPapMessage(clientAddress

addressTypeppgServer genPushId() null))

outprintln()

outprintln(--multipart-boundary)

outprintln(Content-type + mimeType)

outprintln()

outprintln(message)

outprintln()

outprintln(--multipart-boundary--)

outflush()

outclose()

httpconnect()

Appendix C

52

finally read and debug the response received from

PPG

try

debugResponse(http)

catch (Exception e)

Systemerrprintln(Error in receiving the

response)

ltcodegtcreatePapMessageltcodegt creates a Push Access

Protocoltype message

param address a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param ppgServer a ltcodegtStringltcodegt value

param pushId a ltcodegtStringltcodegt value

param notificationTo a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createPapMessage(String address

String addressType String ppgServer String pushId

String notificationTo)

return XML_VERSION + n + PAP_DOCTYPE + n +

ltpap product-name=Mobile Zoo Push

Initiatorgtn +

ltpush-message push-id= + pushId +

(notificationTo = null request-notification-

to= + notificationTo ) + gtn +

ltaddress address-value=WAPPUSH= + address +

TYPE= + addressType +

+ ppgServer + gtn +

ltpush-messagegtnltpapgt

ltcodegtcreateSiMessageltcodegt creates a service

indication type message

param url a ltcodegtStringltcodegt value

param created a ltcodegtStringltcodegt value

param expires a ltcodegtStringltcodegt value

Appendix C

53

param message a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createSiMessage(String url

String sid String created String expires String

action String message)

return XML_VERSION + SI_DOCTYPE +

ltsigtn +

ltindication href= + url + +

(sid = null si-id= + sid + ) +

created = null created= + created +

) +

(action = null action= + action +

) +

(expires = null expires= + expires +

) + gt +

message +

ltindicationgtnltsigt

Debug response

param http a ltcodegtHttpURLConnectionltcodegt value

exception Exception if an error occurs

private void debugResponse(HttpURLConnection http)

throws Exception

Systemoutprintln(httpgetResponseMessage())

String headerName

int i=0

while((headerName = httpgetHeaderFieldKey(i++)) =

null)

Systemoutprintln(headerName + +

httpgetHeaderField(headerName))

Systemoutprintln()

InputStreamReader in = new InputStreamReader(new

BufferedInputStream(httpgetInputStream()))

int c

Appendix C

54

while((c = inread()) = -1)

Systemoutprint((char)c)

Systemoutprintln()

ltcodegtgenPushIdltcodegt generates an unique push id

return a ltcodegtStringltcodegt value

private String genPushId()

pushId = 100000

return SystemcurrentTimeMillis() + + pushId++

55

References

[1] Microsoft ldquoGetting Mobile Using WML and WAP to Display Web Sites on

Mobile Devicesrdquo

URL msdnmicrosoftcomen-uslibraryaa140117(office10)aspx accessed

on April 10 2008

[2] DALE BULBROOK ldquoWAPA Beginnerrsquos Guiderdquo OsborneMcGraw-Hill 2001

[3] WAP Forum Wireless Application Protocol Architecture Specification Access on

Jan 12 2008 Available

httpwww1wapforumorgtechdocumentsWAP-210-WAPArch-2006 07 12-apdf

[4] WAP Forum Push Architectural Overview access on (2008 February 3) Available

httpwww1wapforumorgtechdocumentsWAP-250-PushArchOverview-2007 04

03-apdf

[5] Service indication PDF access on 62008 Available

httpwwww3orgTRhtml401structlinkshtml

[6] WAP Push Technology (openwave) PDF access on (2008 April) Available

URL httpwwwopenwavorg

[7] Web site (httpwwwwapforumorgwhatcopyrighthtm) access on May 2008

[8] ldquoWAP Push Proxy Gateway Specificationrdquo WAP Forum access on 16-August-

2007URI httpwwwwapforumorgPDF

[9] WAP Forum Access on (2008 MAY 31) WAP Service Indication Specification

Available httpwww1wapforumorgtechdocumentsWAP-167-ServiceInd-200507

31-apdf

  • odc_fpwmlandwap_topic3
  • N100E3
  • 21
  • 5

43

Chapter Six

6 conclusion and future work

In this chapter we will provide the conclusions and proposed future work for interested

individuals

61 Conclusions

In this project a WAP push system has been successfully designed and implemented It

provides a way to partially overcome the limitations encountered when accessing the

World Wide Web using handsets After comparing the proposed project objectives with

those accomplished the main goals are seen to be met

Phones from different manufactures all differ from the WAP-standard in some

ways One of the most obvious differences is the resolution of the display

During the work it has been noticed that the WML pages must be quite small We

have also noticed that the support for tables and some other tags are a bit limited

Even though the WML standard is smaller than the HTML standard it is a little

more complicated to write correct WML pages The main conclusion is that WAP

works pretty well but the phones are a little non-stable

The push proxy gateway is configured and worked probably with virtual SMS

center and it is easy to switch to a real one

The system depends mainly on open sources (ie Linux and kannek)

The design and implementation of the push initiator work well with the kannel

gateway and it should work correctly with other gateways

Chapter 6 Conclusion

44

62 Further Work

The possibilities of wireless push are interesting enough that it has to be worth to know if

the security and conformance problems will be solved in WAP push If they are solved

and the technique is refined then there should be nothing to stop the great number of

services that will follow in its footsteps Therefore there is further work that should be

done and the most interesting parts are in my opinion these

621 Security Aspect

One of the problems today is that the phones supporting push does not have the detailed

security settings that a technique like this needs Therefore it would be interesting to look

into the possibility to add these without confusing the user I suggest furthering looking

into usability aspects of security in WAP Push for short

622 GPS integration possibility

This will provide location dependent delivery of WAP push it will have great

applications in telematic and ecommerce advertising

623 Conformance to Standards

An interesting project would be to examine if the main reason for the nonstandard

solutions in the existing WAP push software is the result of difficulties in

implementation Or if the main reason is that the manufacturers wants to provide

proprietary solutions A reason why one may want to know this is that if the problem is

depending on implementation problems then it might get better

45

Appendix A Abbreviations

CDMA Code Division Multiple Access

CO Cache Operation

DTD Document Type Definition

GSM Global System for Mobile

HTTP Hypertext Transfer Protocol

IP Internet Protocol

MSISDN Mobile Station International Subscriber Directory Number

OTA Over The Air

PAP Push Access Protocol

PushOTA Push Over The Air

PDA Personal Digital Assistant

P1 Push Initiator

PLMN Public Land Mobile Networks

PPG Push Proxy Gateway

SI Service Indication

SIA Session Initiation Application

SIR Session Initiation Request

SL Service Loading

SMPP Short Message Peer to Peer

SMS Short Message System

SMSC Short Message System Center

UCP Universal Computer Protocol

URI Uniform Resource Identifier

URL Uniform Resource Locator

UTC Universal Time Coordinated

WAP Wireless Application Protocol

WBXML WAP binary XML

WDP Wireless Datagram Protocol

WSP Wireless Session Protocol

WTLS Wireless Transport Layer Security

XML Extensible Mark-up Language

46

Appendix B Kannel gateway configurations

THIS IS A SAMPLE CONFIGURATION FOR KANNEL

group = core

admin-port = 13000

admin-password = admin

status-password = admin

admin-deny-ip =

admin-allow-ip = 127001172161455

log-file = tmpkannellog

log-level = 0

http-proxy-host = 172161411

http-proxy-port = 8080

http-proxy-exceptions = 127001

Smsbox related

smsbox-port = 13001

box-deny-ip =

box-allow-ip = 127001

bearerbox-host =localhost

Wapbox related

wapbox-port = 13002

udp-deny-ip =

udp-allow-ip = 127001

bearerbox-host =localhost

SMSC GSM

group = smsc

smsc = at

modemtype = auto

speed =9600

device = devttyS0

SMSC HTTP

group = smsc

smsc = http

system-type = kannel

port = 13016

connect-allow-ip = 127001

Appendix B

47

username = wappush

password = wappush

SMSBOX SETUP

group = smsbox

bearerbox-host = localhost

sendsms-port = 13013

sendsms-chars = 0123456789 +-

log-file = tmpsmsboxlog

log-level = 0

access-log = accesslog

white-list = 127001

black-list =

SEND-SMS USERS

group = sendsms-user

username = wappush

password = wappush

user-deny-ip =

user-allow-ip = 127001

PPG group

group = ppg

ppg-url = wappush

ppg-port = 8080

concurrent-pushes = 100

trusted-pi = true

users = 1024

service-name = ppg

ppg-smsbox-id = dlrbox

WAP PUSH USER

group = wap-push-user

wap-push-user = picom

ppg-username = wappush

ppg-password = wappush

allow-ip = localhost

48

Appendix C Selected Codes

Gateway Control Form

ltDOCTYPE HTML PUBLIC -W3CDTD HTML 32ENgt

lthtmlgt ltheadgt

lttitlegtGateway control formlttitlegt

ltheadgt

ltbody bgcolor=white text=black link=blue vlink=navy

alink=redgt

ltbase target=submitgt

ltscriptgt

function update_status()

if ( adminactionvalue == status )

adminaction = http + adminhostnamevalue +

+ adminportvalue + status +

adminstatusformatvalue

else

adminaction = http + adminhostnamevalue +

+ adminportvalue + + adminactionvalue

adminpasswordvalue = adminpasswordvalue

actiongovalue = GO GET +adminaction

ltscriptgt

lttable align=centergt

lttrgtltp align=centergtlth2gtGateway control

formlth2gtltpgtlttrgt

lttrgt lttdgtHostnamelttdgtlttdgtltinput type=text

name=adminhostname value=localhost

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPortlttdgtlttdgtltinput type=text

name=adminport value=13000

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPasswordlttdgtlttdgtltinput type=password

name=adminpassword value=

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtActionlttdgtlttdgtltselect name=adminaction

onChange=update_status()gt

ltoption value=statusgtStatusltoptiongt

ltoption value=suspendgtSuspendltoptiongt

ltoption value=isolategtIsolateltoptiongt

Appendix C

49

ltoption value=shutdowngtShutdownltoptiongt

ltoption value=resumegtResumeltoptiongt

ltselectgtlttdgt lttrgt

lttrgt lttdgtStatus Formatlttdgtlttdgtltselect

name=adminstatusformat onChange=update_status()gt

ltoption value=gthtmlltoptiongtltoption

value=txtgttxtltoptiongtltoption

value=xmlgtxmlltoptiongtltselectgtlttdgt lttrgt

ltform name=admin method=get

action=httplocalhost13000status

encoding=applicationx-www-formgt

ltinput type=hidden name=password value=gt

lttrgt

lttdgtGolttdgt

ltformgt

lttdgtltinput type=submit value=go name=actiongo

onClick=documentadminsubmit()gtlttdgt

lttrgt

lttablegt

ltbodygt

lthtmlgt

Push Initiator Class

import javanetURL

import javanetHttpURLConnection

import javaio

Class implements a simple push initiator It can be

used to create and send messages to push proxy

gateway (ppg)

public final class PushInitiator

xml version

private final static String XML_VERSION = ltxml

version=10gt

Push Access Protocol (PAP) document type

private final static String PAP_DOCTYPE =

Appendix C

50

ltDOCTYPE pap PUBLIC -WAPFORUMDTD PAP 10EN

httpwwwwapforumorgDTDpap_10dtd gt

content type of the push request multipart body

private final static String CONTENT_TYPE =

multipartrelated boundary=multipart-boundary

type=applicationxml

Service Indication (SI) document type

private static final String SI_DOCTYPE = ltDOCTYPE si

PUBLIC -WAPFORUMDTD SI 10EN +

httpwwwwapforumorgDTDsidtdgt

private static int pushId = 0

PPG url where the pap message is to be sent

private final URL ppgUrl

some push proxy gateways may also require the

authentication of the push initiator

For instance the push initiator may be required to

send an HTTP authorization header in each request

private final String authorization

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

public PushInitiator(URL ppgUrl) thisppgUrl =

ppgUrl

authorization = null

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

param authorization a ltcodegtStringltcodegt value

public PushInitiator(URL ppgUrl String authorization)

thisppgUrl = ppgUrl

Appendix C

51

thisauthorization = authorization

Systemoutprintln(Push Initiator created ppgUrl =

+ ppgUrl)

ltcodegtsendPushMessageltcodegt sends push message to

ppg

param clientAddress a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param message a ltcodegtStringltcodegt value

param mimeType a ltcodegtStringltcodegt value

exception Exception if an error occurs

public void sendPushMessage(String clientAddress

String addressTypeString message String mimeType)

throws Exception

HttpURLConnection http =

(HttpURLConnection)ppgUrlopenConnection()

String ppgServer = ppgUrlgetHost()

httpsetDoInput(true)

httpsetRequestProperty(Content-Type CONTENT_TYPE)

if(authorization = null)

if(authorizationtrim()equals())

httpsetRequestProperty(Authorization

authorization)

httpsetDoOutput(true)

PrintWriter out = new PrintWriter(new

BufferedOutputStream(httpgetOutputStream()))

outprintln(--multipart-boundary)

outprintln(Content-type applicationxml)

outprintln()

outprintln(createPapMessage(clientAddress

addressTypeppgServer genPushId() null))

outprintln()

outprintln(--multipart-boundary)

outprintln(Content-type + mimeType)

outprintln()

outprintln(message)

outprintln()

outprintln(--multipart-boundary--)

outflush()

outclose()

httpconnect()

Appendix C

52

finally read and debug the response received from

PPG

try

debugResponse(http)

catch (Exception e)

Systemerrprintln(Error in receiving the

response)

ltcodegtcreatePapMessageltcodegt creates a Push Access

Protocoltype message

param address a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param ppgServer a ltcodegtStringltcodegt value

param pushId a ltcodegtStringltcodegt value

param notificationTo a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createPapMessage(String address

String addressType String ppgServer String pushId

String notificationTo)

return XML_VERSION + n + PAP_DOCTYPE + n +

ltpap product-name=Mobile Zoo Push

Initiatorgtn +

ltpush-message push-id= + pushId +

(notificationTo = null request-notification-

to= + notificationTo ) + gtn +

ltaddress address-value=WAPPUSH= + address +

TYPE= + addressType +

+ ppgServer + gtn +

ltpush-messagegtnltpapgt

ltcodegtcreateSiMessageltcodegt creates a service

indication type message

param url a ltcodegtStringltcodegt value

param created a ltcodegtStringltcodegt value

param expires a ltcodegtStringltcodegt value

Appendix C

53

param message a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createSiMessage(String url

String sid String created String expires String

action String message)

return XML_VERSION + SI_DOCTYPE +

ltsigtn +

ltindication href= + url + +

(sid = null si-id= + sid + ) +

created = null created= + created +

) +

(action = null action= + action +

) +

(expires = null expires= + expires +

) + gt +

message +

ltindicationgtnltsigt

Debug response

param http a ltcodegtHttpURLConnectionltcodegt value

exception Exception if an error occurs

private void debugResponse(HttpURLConnection http)

throws Exception

Systemoutprintln(httpgetResponseMessage())

String headerName

int i=0

while((headerName = httpgetHeaderFieldKey(i++)) =

null)

Systemoutprintln(headerName + +

httpgetHeaderField(headerName))

Systemoutprintln()

InputStreamReader in = new InputStreamReader(new

BufferedInputStream(httpgetInputStream()))

int c

Appendix C

54

while((c = inread()) = -1)

Systemoutprint((char)c)

Systemoutprintln()

ltcodegtgenPushIdltcodegt generates an unique push id

return a ltcodegtStringltcodegt value

private String genPushId()

pushId = 100000

return SystemcurrentTimeMillis() + + pushId++

55

References

[1] Microsoft ldquoGetting Mobile Using WML and WAP to Display Web Sites on

Mobile Devicesrdquo

URL msdnmicrosoftcomen-uslibraryaa140117(office10)aspx accessed

on April 10 2008

[2] DALE BULBROOK ldquoWAPA Beginnerrsquos Guiderdquo OsborneMcGraw-Hill 2001

[3] WAP Forum Wireless Application Protocol Architecture Specification Access on

Jan 12 2008 Available

httpwww1wapforumorgtechdocumentsWAP-210-WAPArch-2006 07 12-apdf

[4] WAP Forum Push Architectural Overview access on (2008 February 3) Available

httpwww1wapforumorgtechdocumentsWAP-250-PushArchOverview-2007 04

03-apdf

[5] Service indication PDF access on 62008 Available

httpwwww3orgTRhtml401structlinkshtml

[6] WAP Push Technology (openwave) PDF access on (2008 April) Available

URL httpwwwopenwavorg

[7] Web site (httpwwwwapforumorgwhatcopyrighthtm) access on May 2008

[8] ldquoWAP Push Proxy Gateway Specificationrdquo WAP Forum access on 16-August-

2007URI httpwwwwapforumorgPDF

[9] WAP Forum Access on (2008 MAY 31) WAP Service Indication Specification

Available httpwww1wapforumorgtechdocumentsWAP-167-ServiceInd-200507

31-apdf

  • odc_fpwmlandwap_topic3
  • N100E3
  • 21
  • 5

Chapter 6 Conclusion

44

62 Further Work

The possibilities of wireless push are interesting enough that it has to be worth to know if

the security and conformance problems will be solved in WAP push If they are solved

and the technique is refined then there should be nothing to stop the great number of

services that will follow in its footsteps Therefore there is further work that should be

done and the most interesting parts are in my opinion these

621 Security Aspect

One of the problems today is that the phones supporting push does not have the detailed

security settings that a technique like this needs Therefore it would be interesting to look

into the possibility to add these without confusing the user I suggest furthering looking

into usability aspects of security in WAP Push for short

622 GPS integration possibility

This will provide location dependent delivery of WAP push it will have great

applications in telematic and ecommerce advertising

623 Conformance to Standards

An interesting project would be to examine if the main reason for the nonstandard

solutions in the existing WAP push software is the result of difficulties in

implementation Or if the main reason is that the manufacturers wants to provide

proprietary solutions A reason why one may want to know this is that if the problem is

depending on implementation problems then it might get better

45

Appendix A Abbreviations

CDMA Code Division Multiple Access

CO Cache Operation

DTD Document Type Definition

GSM Global System for Mobile

HTTP Hypertext Transfer Protocol

IP Internet Protocol

MSISDN Mobile Station International Subscriber Directory Number

OTA Over The Air

PAP Push Access Protocol

PushOTA Push Over The Air

PDA Personal Digital Assistant

P1 Push Initiator

PLMN Public Land Mobile Networks

PPG Push Proxy Gateway

SI Service Indication

SIA Session Initiation Application

SIR Session Initiation Request

SL Service Loading

SMPP Short Message Peer to Peer

SMS Short Message System

SMSC Short Message System Center

UCP Universal Computer Protocol

URI Uniform Resource Identifier

URL Uniform Resource Locator

UTC Universal Time Coordinated

WAP Wireless Application Protocol

WBXML WAP binary XML

WDP Wireless Datagram Protocol

WSP Wireless Session Protocol

WTLS Wireless Transport Layer Security

XML Extensible Mark-up Language

46

Appendix B Kannel gateway configurations

THIS IS A SAMPLE CONFIGURATION FOR KANNEL

group = core

admin-port = 13000

admin-password = admin

status-password = admin

admin-deny-ip =

admin-allow-ip = 127001172161455

log-file = tmpkannellog

log-level = 0

http-proxy-host = 172161411

http-proxy-port = 8080

http-proxy-exceptions = 127001

Smsbox related

smsbox-port = 13001

box-deny-ip =

box-allow-ip = 127001

bearerbox-host =localhost

Wapbox related

wapbox-port = 13002

udp-deny-ip =

udp-allow-ip = 127001

bearerbox-host =localhost

SMSC GSM

group = smsc

smsc = at

modemtype = auto

speed =9600

device = devttyS0

SMSC HTTP

group = smsc

smsc = http

system-type = kannel

port = 13016

connect-allow-ip = 127001

Appendix B

47

username = wappush

password = wappush

SMSBOX SETUP

group = smsbox

bearerbox-host = localhost

sendsms-port = 13013

sendsms-chars = 0123456789 +-

log-file = tmpsmsboxlog

log-level = 0

access-log = accesslog

white-list = 127001

black-list =

SEND-SMS USERS

group = sendsms-user

username = wappush

password = wappush

user-deny-ip =

user-allow-ip = 127001

PPG group

group = ppg

ppg-url = wappush

ppg-port = 8080

concurrent-pushes = 100

trusted-pi = true

users = 1024

service-name = ppg

ppg-smsbox-id = dlrbox

WAP PUSH USER

group = wap-push-user

wap-push-user = picom

ppg-username = wappush

ppg-password = wappush

allow-ip = localhost

48

Appendix C Selected Codes

Gateway Control Form

ltDOCTYPE HTML PUBLIC -W3CDTD HTML 32ENgt

lthtmlgt ltheadgt

lttitlegtGateway control formlttitlegt

ltheadgt

ltbody bgcolor=white text=black link=blue vlink=navy

alink=redgt

ltbase target=submitgt

ltscriptgt

function update_status()

if ( adminactionvalue == status )

adminaction = http + adminhostnamevalue +

+ adminportvalue + status +

adminstatusformatvalue

else

adminaction = http + adminhostnamevalue +

+ adminportvalue + + adminactionvalue

adminpasswordvalue = adminpasswordvalue

actiongovalue = GO GET +adminaction

ltscriptgt

lttable align=centergt

lttrgtltp align=centergtlth2gtGateway control

formlth2gtltpgtlttrgt

lttrgt lttdgtHostnamelttdgtlttdgtltinput type=text

name=adminhostname value=localhost

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPortlttdgtlttdgtltinput type=text

name=adminport value=13000

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPasswordlttdgtlttdgtltinput type=password

name=adminpassword value=

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtActionlttdgtlttdgtltselect name=adminaction

onChange=update_status()gt

ltoption value=statusgtStatusltoptiongt

ltoption value=suspendgtSuspendltoptiongt

ltoption value=isolategtIsolateltoptiongt

Appendix C

49

ltoption value=shutdowngtShutdownltoptiongt

ltoption value=resumegtResumeltoptiongt

ltselectgtlttdgt lttrgt

lttrgt lttdgtStatus Formatlttdgtlttdgtltselect

name=adminstatusformat onChange=update_status()gt

ltoption value=gthtmlltoptiongtltoption

value=txtgttxtltoptiongtltoption

value=xmlgtxmlltoptiongtltselectgtlttdgt lttrgt

ltform name=admin method=get

action=httplocalhost13000status

encoding=applicationx-www-formgt

ltinput type=hidden name=password value=gt

lttrgt

lttdgtGolttdgt

ltformgt

lttdgtltinput type=submit value=go name=actiongo

onClick=documentadminsubmit()gtlttdgt

lttrgt

lttablegt

ltbodygt

lthtmlgt

Push Initiator Class

import javanetURL

import javanetHttpURLConnection

import javaio

Class implements a simple push initiator It can be

used to create and send messages to push proxy

gateway (ppg)

public final class PushInitiator

xml version

private final static String XML_VERSION = ltxml

version=10gt

Push Access Protocol (PAP) document type

private final static String PAP_DOCTYPE =

Appendix C

50

ltDOCTYPE pap PUBLIC -WAPFORUMDTD PAP 10EN

httpwwwwapforumorgDTDpap_10dtd gt

content type of the push request multipart body

private final static String CONTENT_TYPE =

multipartrelated boundary=multipart-boundary

type=applicationxml

Service Indication (SI) document type

private static final String SI_DOCTYPE = ltDOCTYPE si

PUBLIC -WAPFORUMDTD SI 10EN +

httpwwwwapforumorgDTDsidtdgt

private static int pushId = 0

PPG url where the pap message is to be sent

private final URL ppgUrl

some push proxy gateways may also require the

authentication of the push initiator

For instance the push initiator may be required to

send an HTTP authorization header in each request

private final String authorization

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

public PushInitiator(URL ppgUrl) thisppgUrl =

ppgUrl

authorization = null

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

param authorization a ltcodegtStringltcodegt value

public PushInitiator(URL ppgUrl String authorization)

thisppgUrl = ppgUrl

Appendix C

51

thisauthorization = authorization

Systemoutprintln(Push Initiator created ppgUrl =

+ ppgUrl)

ltcodegtsendPushMessageltcodegt sends push message to

ppg

param clientAddress a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param message a ltcodegtStringltcodegt value

param mimeType a ltcodegtStringltcodegt value

exception Exception if an error occurs

public void sendPushMessage(String clientAddress

String addressTypeString message String mimeType)

throws Exception

HttpURLConnection http =

(HttpURLConnection)ppgUrlopenConnection()

String ppgServer = ppgUrlgetHost()

httpsetDoInput(true)

httpsetRequestProperty(Content-Type CONTENT_TYPE)

if(authorization = null)

if(authorizationtrim()equals())

httpsetRequestProperty(Authorization

authorization)

httpsetDoOutput(true)

PrintWriter out = new PrintWriter(new

BufferedOutputStream(httpgetOutputStream()))

outprintln(--multipart-boundary)

outprintln(Content-type applicationxml)

outprintln()

outprintln(createPapMessage(clientAddress

addressTypeppgServer genPushId() null))

outprintln()

outprintln(--multipart-boundary)

outprintln(Content-type + mimeType)

outprintln()

outprintln(message)

outprintln()

outprintln(--multipart-boundary--)

outflush()

outclose()

httpconnect()

Appendix C

52

finally read and debug the response received from

PPG

try

debugResponse(http)

catch (Exception e)

Systemerrprintln(Error in receiving the

response)

ltcodegtcreatePapMessageltcodegt creates a Push Access

Protocoltype message

param address a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param ppgServer a ltcodegtStringltcodegt value

param pushId a ltcodegtStringltcodegt value

param notificationTo a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createPapMessage(String address

String addressType String ppgServer String pushId

String notificationTo)

return XML_VERSION + n + PAP_DOCTYPE + n +

ltpap product-name=Mobile Zoo Push

Initiatorgtn +

ltpush-message push-id= + pushId +

(notificationTo = null request-notification-

to= + notificationTo ) + gtn +

ltaddress address-value=WAPPUSH= + address +

TYPE= + addressType +

+ ppgServer + gtn +

ltpush-messagegtnltpapgt

ltcodegtcreateSiMessageltcodegt creates a service

indication type message

param url a ltcodegtStringltcodegt value

param created a ltcodegtStringltcodegt value

param expires a ltcodegtStringltcodegt value

Appendix C

53

param message a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createSiMessage(String url

String sid String created String expires String

action String message)

return XML_VERSION + SI_DOCTYPE +

ltsigtn +

ltindication href= + url + +

(sid = null si-id= + sid + ) +

created = null created= + created +

) +

(action = null action= + action +

) +

(expires = null expires= + expires +

) + gt +

message +

ltindicationgtnltsigt

Debug response

param http a ltcodegtHttpURLConnectionltcodegt value

exception Exception if an error occurs

private void debugResponse(HttpURLConnection http)

throws Exception

Systemoutprintln(httpgetResponseMessage())

String headerName

int i=0

while((headerName = httpgetHeaderFieldKey(i++)) =

null)

Systemoutprintln(headerName + +

httpgetHeaderField(headerName))

Systemoutprintln()

InputStreamReader in = new InputStreamReader(new

BufferedInputStream(httpgetInputStream()))

int c

Appendix C

54

while((c = inread()) = -1)

Systemoutprint((char)c)

Systemoutprintln()

ltcodegtgenPushIdltcodegt generates an unique push id

return a ltcodegtStringltcodegt value

private String genPushId()

pushId = 100000

return SystemcurrentTimeMillis() + + pushId++

55

References

[1] Microsoft ldquoGetting Mobile Using WML and WAP to Display Web Sites on

Mobile Devicesrdquo

URL msdnmicrosoftcomen-uslibraryaa140117(office10)aspx accessed

on April 10 2008

[2] DALE BULBROOK ldquoWAPA Beginnerrsquos Guiderdquo OsborneMcGraw-Hill 2001

[3] WAP Forum Wireless Application Protocol Architecture Specification Access on

Jan 12 2008 Available

httpwww1wapforumorgtechdocumentsWAP-210-WAPArch-2006 07 12-apdf

[4] WAP Forum Push Architectural Overview access on (2008 February 3) Available

httpwww1wapforumorgtechdocumentsWAP-250-PushArchOverview-2007 04

03-apdf

[5] Service indication PDF access on 62008 Available

httpwwww3orgTRhtml401structlinkshtml

[6] WAP Push Technology (openwave) PDF access on (2008 April) Available

URL httpwwwopenwavorg

[7] Web site (httpwwwwapforumorgwhatcopyrighthtm) access on May 2008

[8] ldquoWAP Push Proxy Gateway Specificationrdquo WAP Forum access on 16-August-

2007URI httpwwwwapforumorgPDF

[9] WAP Forum Access on (2008 MAY 31) WAP Service Indication Specification

Available httpwww1wapforumorgtechdocumentsWAP-167-ServiceInd-200507

31-apdf

  • odc_fpwmlandwap_topic3
  • N100E3
  • 21
  • 5

45

Appendix A Abbreviations

CDMA Code Division Multiple Access

CO Cache Operation

DTD Document Type Definition

GSM Global System for Mobile

HTTP Hypertext Transfer Protocol

IP Internet Protocol

MSISDN Mobile Station International Subscriber Directory Number

OTA Over The Air

PAP Push Access Protocol

PushOTA Push Over The Air

PDA Personal Digital Assistant

P1 Push Initiator

PLMN Public Land Mobile Networks

PPG Push Proxy Gateway

SI Service Indication

SIA Session Initiation Application

SIR Session Initiation Request

SL Service Loading

SMPP Short Message Peer to Peer

SMS Short Message System

SMSC Short Message System Center

UCP Universal Computer Protocol

URI Uniform Resource Identifier

URL Uniform Resource Locator

UTC Universal Time Coordinated

WAP Wireless Application Protocol

WBXML WAP binary XML

WDP Wireless Datagram Protocol

WSP Wireless Session Protocol

WTLS Wireless Transport Layer Security

XML Extensible Mark-up Language

46

Appendix B Kannel gateway configurations

THIS IS A SAMPLE CONFIGURATION FOR KANNEL

group = core

admin-port = 13000

admin-password = admin

status-password = admin

admin-deny-ip =

admin-allow-ip = 127001172161455

log-file = tmpkannellog

log-level = 0

http-proxy-host = 172161411

http-proxy-port = 8080

http-proxy-exceptions = 127001

Smsbox related

smsbox-port = 13001

box-deny-ip =

box-allow-ip = 127001

bearerbox-host =localhost

Wapbox related

wapbox-port = 13002

udp-deny-ip =

udp-allow-ip = 127001

bearerbox-host =localhost

SMSC GSM

group = smsc

smsc = at

modemtype = auto

speed =9600

device = devttyS0

SMSC HTTP

group = smsc

smsc = http

system-type = kannel

port = 13016

connect-allow-ip = 127001

Appendix B

47

username = wappush

password = wappush

SMSBOX SETUP

group = smsbox

bearerbox-host = localhost

sendsms-port = 13013

sendsms-chars = 0123456789 +-

log-file = tmpsmsboxlog

log-level = 0

access-log = accesslog

white-list = 127001

black-list =

SEND-SMS USERS

group = sendsms-user

username = wappush

password = wappush

user-deny-ip =

user-allow-ip = 127001

PPG group

group = ppg

ppg-url = wappush

ppg-port = 8080

concurrent-pushes = 100

trusted-pi = true

users = 1024

service-name = ppg

ppg-smsbox-id = dlrbox

WAP PUSH USER

group = wap-push-user

wap-push-user = picom

ppg-username = wappush

ppg-password = wappush

allow-ip = localhost

48

Appendix C Selected Codes

Gateway Control Form

ltDOCTYPE HTML PUBLIC -W3CDTD HTML 32ENgt

lthtmlgt ltheadgt

lttitlegtGateway control formlttitlegt

ltheadgt

ltbody bgcolor=white text=black link=blue vlink=navy

alink=redgt

ltbase target=submitgt

ltscriptgt

function update_status()

if ( adminactionvalue == status )

adminaction = http + adminhostnamevalue +

+ adminportvalue + status +

adminstatusformatvalue

else

adminaction = http + adminhostnamevalue +

+ adminportvalue + + adminactionvalue

adminpasswordvalue = adminpasswordvalue

actiongovalue = GO GET +adminaction

ltscriptgt

lttable align=centergt

lttrgtltp align=centergtlth2gtGateway control

formlth2gtltpgtlttrgt

lttrgt lttdgtHostnamelttdgtlttdgtltinput type=text

name=adminhostname value=localhost

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPortlttdgtlttdgtltinput type=text

name=adminport value=13000

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPasswordlttdgtlttdgtltinput type=password

name=adminpassword value=

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtActionlttdgtlttdgtltselect name=adminaction

onChange=update_status()gt

ltoption value=statusgtStatusltoptiongt

ltoption value=suspendgtSuspendltoptiongt

ltoption value=isolategtIsolateltoptiongt

Appendix C

49

ltoption value=shutdowngtShutdownltoptiongt

ltoption value=resumegtResumeltoptiongt

ltselectgtlttdgt lttrgt

lttrgt lttdgtStatus Formatlttdgtlttdgtltselect

name=adminstatusformat onChange=update_status()gt

ltoption value=gthtmlltoptiongtltoption

value=txtgttxtltoptiongtltoption

value=xmlgtxmlltoptiongtltselectgtlttdgt lttrgt

ltform name=admin method=get

action=httplocalhost13000status

encoding=applicationx-www-formgt

ltinput type=hidden name=password value=gt

lttrgt

lttdgtGolttdgt

ltformgt

lttdgtltinput type=submit value=go name=actiongo

onClick=documentadminsubmit()gtlttdgt

lttrgt

lttablegt

ltbodygt

lthtmlgt

Push Initiator Class

import javanetURL

import javanetHttpURLConnection

import javaio

Class implements a simple push initiator It can be

used to create and send messages to push proxy

gateway (ppg)

public final class PushInitiator

xml version

private final static String XML_VERSION = ltxml

version=10gt

Push Access Protocol (PAP) document type

private final static String PAP_DOCTYPE =

Appendix C

50

ltDOCTYPE pap PUBLIC -WAPFORUMDTD PAP 10EN

httpwwwwapforumorgDTDpap_10dtd gt

content type of the push request multipart body

private final static String CONTENT_TYPE =

multipartrelated boundary=multipart-boundary

type=applicationxml

Service Indication (SI) document type

private static final String SI_DOCTYPE = ltDOCTYPE si

PUBLIC -WAPFORUMDTD SI 10EN +

httpwwwwapforumorgDTDsidtdgt

private static int pushId = 0

PPG url where the pap message is to be sent

private final URL ppgUrl

some push proxy gateways may also require the

authentication of the push initiator

For instance the push initiator may be required to

send an HTTP authorization header in each request

private final String authorization

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

public PushInitiator(URL ppgUrl) thisppgUrl =

ppgUrl

authorization = null

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

param authorization a ltcodegtStringltcodegt value

public PushInitiator(URL ppgUrl String authorization)

thisppgUrl = ppgUrl

Appendix C

51

thisauthorization = authorization

Systemoutprintln(Push Initiator created ppgUrl =

+ ppgUrl)

ltcodegtsendPushMessageltcodegt sends push message to

ppg

param clientAddress a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param message a ltcodegtStringltcodegt value

param mimeType a ltcodegtStringltcodegt value

exception Exception if an error occurs

public void sendPushMessage(String clientAddress

String addressTypeString message String mimeType)

throws Exception

HttpURLConnection http =

(HttpURLConnection)ppgUrlopenConnection()

String ppgServer = ppgUrlgetHost()

httpsetDoInput(true)

httpsetRequestProperty(Content-Type CONTENT_TYPE)

if(authorization = null)

if(authorizationtrim()equals())

httpsetRequestProperty(Authorization

authorization)

httpsetDoOutput(true)

PrintWriter out = new PrintWriter(new

BufferedOutputStream(httpgetOutputStream()))

outprintln(--multipart-boundary)

outprintln(Content-type applicationxml)

outprintln()

outprintln(createPapMessage(clientAddress

addressTypeppgServer genPushId() null))

outprintln()

outprintln(--multipart-boundary)

outprintln(Content-type + mimeType)

outprintln()

outprintln(message)

outprintln()

outprintln(--multipart-boundary--)

outflush()

outclose()

httpconnect()

Appendix C

52

finally read and debug the response received from

PPG

try

debugResponse(http)

catch (Exception e)

Systemerrprintln(Error in receiving the

response)

ltcodegtcreatePapMessageltcodegt creates a Push Access

Protocoltype message

param address a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param ppgServer a ltcodegtStringltcodegt value

param pushId a ltcodegtStringltcodegt value

param notificationTo a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createPapMessage(String address

String addressType String ppgServer String pushId

String notificationTo)

return XML_VERSION + n + PAP_DOCTYPE + n +

ltpap product-name=Mobile Zoo Push

Initiatorgtn +

ltpush-message push-id= + pushId +

(notificationTo = null request-notification-

to= + notificationTo ) + gtn +

ltaddress address-value=WAPPUSH= + address +

TYPE= + addressType +

+ ppgServer + gtn +

ltpush-messagegtnltpapgt

ltcodegtcreateSiMessageltcodegt creates a service

indication type message

param url a ltcodegtStringltcodegt value

param created a ltcodegtStringltcodegt value

param expires a ltcodegtStringltcodegt value

Appendix C

53

param message a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createSiMessage(String url

String sid String created String expires String

action String message)

return XML_VERSION + SI_DOCTYPE +

ltsigtn +

ltindication href= + url + +

(sid = null si-id= + sid + ) +

created = null created= + created +

) +

(action = null action= + action +

) +

(expires = null expires= + expires +

) + gt +

message +

ltindicationgtnltsigt

Debug response

param http a ltcodegtHttpURLConnectionltcodegt value

exception Exception if an error occurs

private void debugResponse(HttpURLConnection http)

throws Exception

Systemoutprintln(httpgetResponseMessage())

String headerName

int i=0

while((headerName = httpgetHeaderFieldKey(i++)) =

null)

Systemoutprintln(headerName + +

httpgetHeaderField(headerName))

Systemoutprintln()

InputStreamReader in = new InputStreamReader(new

BufferedInputStream(httpgetInputStream()))

int c

Appendix C

54

while((c = inread()) = -1)

Systemoutprint((char)c)

Systemoutprintln()

ltcodegtgenPushIdltcodegt generates an unique push id

return a ltcodegtStringltcodegt value

private String genPushId()

pushId = 100000

return SystemcurrentTimeMillis() + + pushId++

55

References

[1] Microsoft ldquoGetting Mobile Using WML and WAP to Display Web Sites on

Mobile Devicesrdquo

URL msdnmicrosoftcomen-uslibraryaa140117(office10)aspx accessed

on April 10 2008

[2] DALE BULBROOK ldquoWAPA Beginnerrsquos Guiderdquo OsborneMcGraw-Hill 2001

[3] WAP Forum Wireless Application Protocol Architecture Specification Access on

Jan 12 2008 Available

httpwww1wapforumorgtechdocumentsWAP-210-WAPArch-2006 07 12-apdf

[4] WAP Forum Push Architectural Overview access on (2008 February 3) Available

httpwww1wapforumorgtechdocumentsWAP-250-PushArchOverview-2007 04

03-apdf

[5] Service indication PDF access on 62008 Available

httpwwww3orgTRhtml401structlinkshtml

[6] WAP Push Technology (openwave) PDF access on (2008 April) Available

URL httpwwwopenwavorg

[7] Web site (httpwwwwapforumorgwhatcopyrighthtm) access on May 2008

[8] ldquoWAP Push Proxy Gateway Specificationrdquo WAP Forum access on 16-August-

2007URI httpwwwwapforumorgPDF

[9] WAP Forum Access on (2008 MAY 31) WAP Service Indication Specification

Available httpwww1wapforumorgtechdocumentsWAP-167-ServiceInd-200507

31-apdf

  • odc_fpwmlandwap_topic3
  • N100E3
  • 21
  • 5

46

Appendix B Kannel gateway configurations

THIS IS A SAMPLE CONFIGURATION FOR KANNEL

group = core

admin-port = 13000

admin-password = admin

status-password = admin

admin-deny-ip =

admin-allow-ip = 127001172161455

log-file = tmpkannellog

log-level = 0

http-proxy-host = 172161411

http-proxy-port = 8080

http-proxy-exceptions = 127001

Smsbox related

smsbox-port = 13001

box-deny-ip =

box-allow-ip = 127001

bearerbox-host =localhost

Wapbox related

wapbox-port = 13002

udp-deny-ip =

udp-allow-ip = 127001

bearerbox-host =localhost

SMSC GSM

group = smsc

smsc = at

modemtype = auto

speed =9600

device = devttyS0

SMSC HTTP

group = smsc

smsc = http

system-type = kannel

port = 13016

connect-allow-ip = 127001

Appendix B

47

username = wappush

password = wappush

SMSBOX SETUP

group = smsbox

bearerbox-host = localhost

sendsms-port = 13013

sendsms-chars = 0123456789 +-

log-file = tmpsmsboxlog

log-level = 0

access-log = accesslog

white-list = 127001

black-list =

SEND-SMS USERS

group = sendsms-user

username = wappush

password = wappush

user-deny-ip =

user-allow-ip = 127001

PPG group

group = ppg

ppg-url = wappush

ppg-port = 8080

concurrent-pushes = 100

trusted-pi = true

users = 1024

service-name = ppg

ppg-smsbox-id = dlrbox

WAP PUSH USER

group = wap-push-user

wap-push-user = picom

ppg-username = wappush

ppg-password = wappush

allow-ip = localhost

48

Appendix C Selected Codes

Gateway Control Form

ltDOCTYPE HTML PUBLIC -W3CDTD HTML 32ENgt

lthtmlgt ltheadgt

lttitlegtGateway control formlttitlegt

ltheadgt

ltbody bgcolor=white text=black link=blue vlink=navy

alink=redgt

ltbase target=submitgt

ltscriptgt

function update_status()

if ( adminactionvalue == status )

adminaction = http + adminhostnamevalue +

+ adminportvalue + status +

adminstatusformatvalue

else

adminaction = http + adminhostnamevalue +

+ adminportvalue + + adminactionvalue

adminpasswordvalue = adminpasswordvalue

actiongovalue = GO GET +adminaction

ltscriptgt

lttable align=centergt

lttrgtltp align=centergtlth2gtGateway control

formlth2gtltpgtlttrgt

lttrgt lttdgtHostnamelttdgtlttdgtltinput type=text

name=adminhostname value=localhost

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPortlttdgtlttdgtltinput type=text

name=adminport value=13000

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPasswordlttdgtlttdgtltinput type=password

name=adminpassword value=

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtActionlttdgtlttdgtltselect name=adminaction

onChange=update_status()gt

ltoption value=statusgtStatusltoptiongt

ltoption value=suspendgtSuspendltoptiongt

ltoption value=isolategtIsolateltoptiongt

Appendix C

49

ltoption value=shutdowngtShutdownltoptiongt

ltoption value=resumegtResumeltoptiongt

ltselectgtlttdgt lttrgt

lttrgt lttdgtStatus Formatlttdgtlttdgtltselect

name=adminstatusformat onChange=update_status()gt

ltoption value=gthtmlltoptiongtltoption

value=txtgttxtltoptiongtltoption

value=xmlgtxmlltoptiongtltselectgtlttdgt lttrgt

ltform name=admin method=get

action=httplocalhost13000status

encoding=applicationx-www-formgt

ltinput type=hidden name=password value=gt

lttrgt

lttdgtGolttdgt

ltformgt

lttdgtltinput type=submit value=go name=actiongo

onClick=documentadminsubmit()gtlttdgt

lttrgt

lttablegt

ltbodygt

lthtmlgt

Push Initiator Class

import javanetURL

import javanetHttpURLConnection

import javaio

Class implements a simple push initiator It can be

used to create and send messages to push proxy

gateway (ppg)

public final class PushInitiator

xml version

private final static String XML_VERSION = ltxml

version=10gt

Push Access Protocol (PAP) document type

private final static String PAP_DOCTYPE =

Appendix C

50

ltDOCTYPE pap PUBLIC -WAPFORUMDTD PAP 10EN

httpwwwwapforumorgDTDpap_10dtd gt

content type of the push request multipart body

private final static String CONTENT_TYPE =

multipartrelated boundary=multipart-boundary

type=applicationxml

Service Indication (SI) document type

private static final String SI_DOCTYPE = ltDOCTYPE si

PUBLIC -WAPFORUMDTD SI 10EN +

httpwwwwapforumorgDTDsidtdgt

private static int pushId = 0

PPG url where the pap message is to be sent

private final URL ppgUrl

some push proxy gateways may also require the

authentication of the push initiator

For instance the push initiator may be required to

send an HTTP authorization header in each request

private final String authorization

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

public PushInitiator(URL ppgUrl) thisppgUrl =

ppgUrl

authorization = null

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

param authorization a ltcodegtStringltcodegt value

public PushInitiator(URL ppgUrl String authorization)

thisppgUrl = ppgUrl

Appendix C

51

thisauthorization = authorization

Systemoutprintln(Push Initiator created ppgUrl =

+ ppgUrl)

ltcodegtsendPushMessageltcodegt sends push message to

ppg

param clientAddress a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param message a ltcodegtStringltcodegt value

param mimeType a ltcodegtStringltcodegt value

exception Exception if an error occurs

public void sendPushMessage(String clientAddress

String addressTypeString message String mimeType)

throws Exception

HttpURLConnection http =

(HttpURLConnection)ppgUrlopenConnection()

String ppgServer = ppgUrlgetHost()

httpsetDoInput(true)

httpsetRequestProperty(Content-Type CONTENT_TYPE)

if(authorization = null)

if(authorizationtrim()equals())

httpsetRequestProperty(Authorization

authorization)

httpsetDoOutput(true)

PrintWriter out = new PrintWriter(new

BufferedOutputStream(httpgetOutputStream()))

outprintln(--multipart-boundary)

outprintln(Content-type applicationxml)

outprintln()

outprintln(createPapMessage(clientAddress

addressTypeppgServer genPushId() null))

outprintln()

outprintln(--multipart-boundary)

outprintln(Content-type + mimeType)

outprintln()

outprintln(message)

outprintln()

outprintln(--multipart-boundary--)

outflush()

outclose()

httpconnect()

Appendix C

52

finally read and debug the response received from

PPG

try

debugResponse(http)

catch (Exception e)

Systemerrprintln(Error in receiving the

response)

ltcodegtcreatePapMessageltcodegt creates a Push Access

Protocoltype message

param address a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param ppgServer a ltcodegtStringltcodegt value

param pushId a ltcodegtStringltcodegt value

param notificationTo a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createPapMessage(String address

String addressType String ppgServer String pushId

String notificationTo)

return XML_VERSION + n + PAP_DOCTYPE + n +

ltpap product-name=Mobile Zoo Push

Initiatorgtn +

ltpush-message push-id= + pushId +

(notificationTo = null request-notification-

to= + notificationTo ) + gtn +

ltaddress address-value=WAPPUSH= + address +

TYPE= + addressType +

+ ppgServer + gtn +

ltpush-messagegtnltpapgt

ltcodegtcreateSiMessageltcodegt creates a service

indication type message

param url a ltcodegtStringltcodegt value

param created a ltcodegtStringltcodegt value

param expires a ltcodegtStringltcodegt value

Appendix C

53

param message a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createSiMessage(String url

String sid String created String expires String

action String message)

return XML_VERSION + SI_DOCTYPE +

ltsigtn +

ltindication href= + url + +

(sid = null si-id= + sid + ) +

created = null created= + created +

) +

(action = null action= + action +

) +

(expires = null expires= + expires +

) + gt +

message +

ltindicationgtnltsigt

Debug response

param http a ltcodegtHttpURLConnectionltcodegt value

exception Exception if an error occurs

private void debugResponse(HttpURLConnection http)

throws Exception

Systemoutprintln(httpgetResponseMessage())

String headerName

int i=0

while((headerName = httpgetHeaderFieldKey(i++)) =

null)

Systemoutprintln(headerName + +

httpgetHeaderField(headerName))

Systemoutprintln()

InputStreamReader in = new InputStreamReader(new

BufferedInputStream(httpgetInputStream()))

int c

Appendix C

54

while((c = inread()) = -1)

Systemoutprint((char)c)

Systemoutprintln()

ltcodegtgenPushIdltcodegt generates an unique push id

return a ltcodegtStringltcodegt value

private String genPushId()

pushId = 100000

return SystemcurrentTimeMillis() + + pushId++

55

References

[1] Microsoft ldquoGetting Mobile Using WML and WAP to Display Web Sites on

Mobile Devicesrdquo

URL msdnmicrosoftcomen-uslibraryaa140117(office10)aspx accessed

on April 10 2008

[2] DALE BULBROOK ldquoWAPA Beginnerrsquos Guiderdquo OsborneMcGraw-Hill 2001

[3] WAP Forum Wireless Application Protocol Architecture Specification Access on

Jan 12 2008 Available

httpwww1wapforumorgtechdocumentsWAP-210-WAPArch-2006 07 12-apdf

[4] WAP Forum Push Architectural Overview access on (2008 February 3) Available

httpwww1wapforumorgtechdocumentsWAP-250-PushArchOverview-2007 04

03-apdf

[5] Service indication PDF access on 62008 Available

httpwwww3orgTRhtml401structlinkshtml

[6] WAP Push Technology (openwave) PDF access on (2008 April) Available

URL httpwwwopenwavorg

[7] Web site (httpwwwwapforumorgwhatcopyrighthtm) access on May 2008

[8] ldquoWAP Push Proxy Gateway Specificationrdquo WAP Forum access on 16-August-

2007URI httpwwwwapforumorgPDF

[9] WAP Forum Access on (2008 MAY 31) WAP Service Indication Specification

Available httpwww1wapforumorgtechdocumentsWAP-167-ServiceInd-200507

31-apdf

  • odc_fpwmlandwap_topic3
  • N100E3
  • 21
  • 5

Appendix B

47

username = wappush

password = wappush

SMSBOX SETUP

group = smsbox

bearerbox-host = localhost

sendsms-port = 13013

sendsms-chars = 0123456789 +-

log-file = tmpsmsboxlog

log-level = 0

access-log = accesslog

white-list = 127001

black-list =

SEND-SMS USERS

group = sendsms-user

username = wappush

password = wappush

user-deny-ip =

user-allow-ip = 127001

PPG group

group = ppg

ppg-url = wappush

ppg-port = 8080

concurrent-pushes = 100

trusted-pi = true

users = 1024

service-name = ppg

ppg-smsbox-id = dlrbox

WAP PUSH USER

group = wap-push-user

wap-push-user = picom

ppg-username = wappush

ppg-password = wappush

allow-ip = localhost

48

Appendix C Selected Codes

Gateway Control Form

ltDOCTYPE HTML PUBLIC -W3CDTD HTML 32ENgt

lthtmlgt ltheadgt

lttitlegtGateway control formlttitlegt

ltheadgt

ltbody bgcolor=white text=black link=blue vlink=navy

alink=redgt

ltbase target=submitgt

ltscriptgt

function update_status()

if ( adminactionvalue == status )

adminaction = http + adminhostnamevalue +

+ adminportvalue + status +

adminstatusformatvalue

else

adminaction = http + adminhostnamevalue +

+ adminportvalue + + adminactionvalue

adminpasswordvalue = adminpasswordvalue

actiongovalue = GO GET +adminaction

ltscriptgt

lttable align=centergt

lttrgtltp align=centergtlth2gtGateway control

formlth2gtltpgtlttrgt

lttrgt lttdgtHostnamelttdgtlttdgtltinput type=text

name=adminhostname value=localhost

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPortlttdgtlttdgtltinput type=text

name=adminport value=13000

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPasswordlttdgtlttdgtltinput type=password

name=adminpassword value=

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtActionlttdgtlttdgtltselect name=adminaction

onChange=update_status()gt

ltoption value=statusgtStatusltoptiongt

ltoption value=suspendgtSuspendltoptiongt

ltoption value=isolategtIsolateltoptiongt

Appendix C

49

ltoption value=shutdowngtShutdownltoptiongt

ltoption value=resumegtResumeltoptiongt

ltselectgtlttdgt lttrgt

lttrgt lttdgtStatus Formatlttdgtlttdgtltselect

name=adminstatusformat onChange=update_status()gt

ltoption value=gthtmlltoptiongtltoption

value=txtgttxtltoptiongtltoption

value=xmlgtxmlltoptiongtltselectgtlttdgt lttrgt

ltform name=admin method=get

action=httplocalhost13000status

encoding=applicationx-www-formgt

ltinput type=hidden name=password value=gt

lttrgt

lttdgtGolttdgt

ltformgt

lttdgtltinput type=submit value=go name=actiongo

onClick=documentadminsubmit()gtlttdgt

lttrgt

lttablegt

ltbodygt

lthtmlgt

Push Initiator Class

import javanetURL

import javanetHttpURLConnection

import javaio

Class implements a simple push initiator It can be

used to create and send messages to push proxy

gateway (ppg)

public final class PushInitiator

xml version

private final static String XML_VERSION = ltxml

version=10gt

Push Access Protocol (PAP) document type

private final static String PAP_DOCTYPE =

Appendix C

50

ltDOCTYPE pap PUBLIC -WAPFORUMDTD PAP 10EN

httpwwwwapforumorgDTDpap_10dtd gt

content type of the push request multipart body

private final static String CONTENT_TYPE =

multipartrelated boundary=multipart-boundary

type=applicationxml

Service Indication (SI) document type

private static final String SI_DOCTYPE = ltDOCTYPE si

PUBLIC -WAPFORUMDTD SI 10EN +

httpwwwwapforumorgDTDsidtdgt

private static int pushId = 0

PPG url where the pap message is to be sent

private final URL ppgUrl

some push proxy gateways may also require the

authentication of the push initiator

For instance the push initiator may be required to

send an HTTP authorization header in each request

private final String authorization

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

public PushInitiator(URL ppgUrl) thisppgUrl =

ppgUrl

authorization = null

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

param authorization a ltcodegtStringltcodegt value

public PushInitiator(URL ppgUrl String authorization)

thisppgUrl = ppgUrl

Appendix C

51

thisauthorization = authorization

Systemoutprintln(Push Initiator created ppgUrl =

+ ppgUrl)

ltcodegtsendPushMessageltcodegt sends push message to

ppg

param clientAddress a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param message a ltcodegtStringltcodegt value

param mimeType a ltcodegtStringltcodegt value

exception Exception if an error occurs

public void sendPushMessage(String clientAddress

String addressTypeString message String mimeType)

throws Exception

HttpURLConnection http =

(HttpURLConnection)ppgUrlopenConnection()

String ppgServer = ppgUrlgetHost()

httpsetDoInput(true)

httpsetRequestProperty(Content-Type CONTENT_TYPE)

if(authorization = null)

if(authorizationtrim()equals())

httpsetRequestProperty(Authorization

authorization)

httpsetDoOutput(true)

PrintWriter out = new PrintWriter(new

BufferedOutputStream(httpgetOutputStream()))

outprintln(--multipart-boundary)

outprintln(Content-type applicationxml)

outprintln()

outprintln(createPapMessage(clientAddress

addressTypeppgServer genPushId() null))

outprintln()

outprintln(--multipart-boundary)

outprintln(Content-type + mimeType)

outprintln()

outprintln(message)

outprintln()

outprintln(--multipart-boundary--)

outflush()

outclose()

httpconnect()

Appendix C

52

finally read and debug the response received from

PPG

try

debugResponse(http)

catch (Exception e)

Systemerrprintln(Error in receiving the

response)

ltcodegtcreatePapMessageltcodegt creates a Push Access

Protocoltype message

param address a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param ppgServer a ltcodegtStringltcodegt value

param pushId a ltcodegtStringltcodegt value

param notificationTo a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createPapMessage(String address

String addressType String ppgServer String pushId

String notificationTo)

return XML_VERSION + n + PAP_DOCTYPE + n +

ltpap product-name=Mobile Zoo Push

Initiatorgtn +

ltpush-message push-id= + pushId +

(notificationTo = null request-notification-

to= + notificationTo ) + gtn +

ltaddress address-value=WAPPUSH= + address +

TYPE= + addressType +

+ ppgServer + gtn +

ltpush-messagegtnltpapgt

ltcodegtcreateSiMessageltcodegt creates a service

indication type message

param url a ltcodegtStringltcodegt value

param created a ltcodegtStringltcodegt value

param expires a ltcodegtStringltcodegt value

Appendix C

53

param message a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createSiMessage(String url

String sid String created String expires String

action String message)

return XML_VERSION + SI_DOCTYPE +

ltsigtn +

ltindication href= + url + +

(sid = null si-id= + sid + ) +

created = null created= + created +

) +

(action = null action= + action +

) +

(expires = null expires= + expires +

) + gt +

message +

ltindicationgtnltsigt

Debug response

param http a ltcodegtHttpURLConnectionltcodegt value

exception Exception if an error occurs

private void debugResponse(HttpURLConnection http)

throws Exception

Systemoutprintln(httpgetResponseMessage())

String headerName

int i=0

while((headerName = httpgetHeaderFieldKey(i++)) =

null)

Systemoutprintln(headerName + +

httpgetHeaderField(headerName))

Systemoutprintln()

InputStreamReader in = new InputStreamReader(new

BufferedInputStream(httpgetInputStream()))

int c

Appendix C

54

while((c = inread()) = -1)

Systemoutprint((char)c)

Systemoutprintln()

ltcodegtgenPushIdltcodegt generates an unique push id

return a ltcodegtStringltcodegt value

private String genPushId()

pushId = 100000

return SystemcurrentTimeMillis() + + pushId++

55

References

[1] Microsoft ldquoGetting Mobile Using WML and WAP to Display Web Sites on

Mobile Devicesrdquo

URL msdnmicrosoftcomen-uslibraryaa140117(office10)aspx accessed

on April 10 2008

[2] DALE BULBROOK ldquoWAPA Beginnerrsquos Guiderdquo OsborneMcGraw-Hill 2001

[3] WAP Forum Wireless Application Protocol Architecture Specification Access on

Jan 12 2008 Available

httpwww1wapforumorgtechdocumentsWAP-210-WAPArch-2006 07 12-apdf

[4] WAP Forum Push Architectural Overview access on (2008 February 3) Available

httpwww1wapforumorgtechdocumentsWAP-250-PushArchOverview-2007 04

03-apdf

[5] Service indication PDF access on 62008 Available

httpwwww3orgTRhtml401structlinkshtml

[6] WAP Push Technology (openwave) PDF access on (2008 April) Available

URL httpwwwopenwavorg

[7] Web site (httpwwwwapforumorgwhatcopyrighthtm) access on May 2008

[8] ldquoWAP Push Proxy Gateway Specificationrdquo WAP Forum access on 16-August-

2007URI httpwwwwapforumorgPDF

[9] WAP Forum Access on (2008 MAY 31) WAP Service Indication Specification

Available httpwww1wapforumorgtechdocumentsWAP-167-ServiceInd-200507

31-apdf

  • odc_fpwmlandwap_topic3
  • N100E3
  • 21
  • 5

48

Appendix C Selected Codes

Gateway Control Form

ltDOCTYPE HTML PUBLIC -W3CDTD HTML 32ENgt

lthtmlgt ltheadgt

lttitlegtGateway control formlttitlegt

ltheadgt

ltbody bgcolor=white text=black link=blue vlink=navy

alink=redgt

ltbase target=submitgt

ltscriptgt

function update_status()

if ( adminactionvalue == status )

adminaction = http + adminhostnamevalue +

+ adminportvalue + status +

adminstatusformatvalue

else

adminaction = http + adminhostnamevalue +

+ adminportvalue + + adminactionvalue

adminpasswordvalue = adminpasswordvalue

actiongovalue = GO GET +adminaction

ltscriptgt

lttable align=centergt

lttrgtltp align=centergtlth2gtGateway control

formlth2gtltpgtlttrgt

lttrgt lttdgtHostnamelttdgtlttdgtltinput type=text

name=adminhostname value=localhost

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPortlttdgtlttdgtltinput type=text

name=adminport value=13000

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtPasswordlttdgtlttdgtltinput type=password

name=adminpassword value=

onKeyUp=update_status()

onChange=update_status()gtlttdgt lttrgt

lttrgt lttdgtActionlttdgtlttdgtltselect name=adminaction

onChange=update_status()gt

ltoption value=statusgtStatusltoptiongt

ltoption value=suspendgtSuspendltoptiongt

ltoption value=isolategtIsolateltoptiongt

Appendix C

49

ltoption value=shutdowngtShutdownltoptiongt

ltoption value=resumegtResumeltoptiongt

ltselectgtlttdgt lttrgt

lttrgt lttdgtStatus Formatlttdgtlttdgtltselect

name=adminstatusformat onChange=update_status()gt

ltoption value=gthtmlltoptiongtltoption

value=txtgttxtltoptiongtltoption

value=xmlgtxmlltoptiongtltselectgtlttdgt lttrgt

ltform name=admin method=get

action=httplocalhost13000status

encoding=applicationx-www-formgt

ltinput type=hidden name=password value=gt

lttrgt

lttdgtGolttdgt

ltformgt

lttdgtltinput type=submit value=go name=actiongo

onClick=documentadminsubmit()gtlttdgt

lttrgt

lttablegt

ltbodygt

lthtmlgt

Push Initiator Class

import javanetURL

import javanetHttpURLConnection

import javaio

Class implements a simple push initiator It can be

used to create and send messages to push proxy

gateway (ppg)

public final class PushInitiator

xml version

private final static String XML_VERSION = ltxml

version=10gt

Push Access Protocol (PAP) document type

private final static String PAP_DOCTYPE =

Appendix C

50

ltDOCTYPE pap PUBLIC -WAPFORUMDTD PAP 10EN

httpwwwwapforumorgDTDpap_10dtd gt

content type of the push request multipart body

private final static String CONTENT_TYPE =

multipartrelated boundary=multipart-boundary

type=applicationxml

Service Indication (SI) document type

private static final String SI_DOCTYPE = ltDOCTYPE si

PUBLIC -WAPFORUMDTD SI 10EN +

httpwwwwapforumorgDTDsidtdgt

private static int pushId = 0

PPG url where the pap message is to be sent

private final URL ppgUrl

some push proxy gateways may also require the

authentication of the push initiator

For instance the push initiator may be required to

send an HTTP authorization header in each request

private final String authorization

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

public PushInitiator(URL ppgUrl) thisppgUrl =

ppgUrl

authorization = null

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

param authorization a ltcodegtStringltcodegt value

public PushInitiator(URL ppgUrl String authorization)

thisppgUrl = ppgUrl

Appendix C

51

thisauthorization = authorization

Systemoutprintln(Push Initiator created ppgUrl =

+ ppgUrl)

ltcodegtsendPushMessageltcodegt sends push message to

ppg

param clientAddress a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param message a ltcodegtStringltcodegt value

param mimeType a ltcodegtStringltcodegt value

exception Exception if an error occurs

public void sendPushMessage(String clientAddress

String addressTypeString message String mimeType)

throws Exception

HttpURLConnection http =

(HttpURLConnection)ppgUrlopenConnection()

String ppgServer = ppgUrlgetHost()

httpsetDoInput(true)

httpsetRequestProperty(Content-Type CONTENT_TYPE)

if(authorization = null)

if(authorizationtrim()equals())

httpsetRequestProperty(Authorization

authorization)

httpsetDoOutput(true)

PrintWriter out = new PrintWriter(new

BufferedOutputStream(httpgetOutputStream()))

outprintln(--multipart-boundary)

outprintln(Content-type applicationxml)

outprintln()

outprintln(createPapMessage(clientAddress

addressTypeppgServer genPushId() null))

outprintln()

outprintln(--multipart-boundary)

outprintln(Content-type + mimeType)

outprintln()

outprintln(message)

outprintln()

outprintln(--multipart-boundary--)

outflush()

outclose()

httpconnect()

Appendix C

52

finally read and debug the response received from

PPG

try

debugResponse(http)

catch (Exception e)

Systemerrprintln(Error in receiving the

response)

ltcodegtcreatePapMessageltcodegt creates a Push Access

Protocoltype message

param address a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param ppgServer a ltcodegtStringltcodegt value

param pushId a ltcodegtStringltcodegt value

param notificationTo a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createPapMessage(String address

String addressType String ppgServer String pushId

String notificationTo)

return XML_VERSION + n + PAP_DOCTYPE + n +

ltpap product-name=Mobile Zoo Push

Initiatorgtn +

ltpush-message push-id= + pushId +

(notificationTo = null request-notification-

to= + notificationTo ) + gtn +

ltaddress address-value=WAPPUSH= + address +

TYPE= + addressType +

+ ppgServer + gtn +

ltpush-messagegtnltpapgt

ltcodegtcreateSiMessageltcodegt creates a service

indication type message

param url a ltcodegtStringltcodegt value

param created a ltcodegtStringltcodegt value

param expires a ltcodegtStringltcodegt value

Appendix C

53

param message a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createSiMessage(String url

String sid String created String expires String

action String message)

return XML_VERSION + SI_DOCTYPE +

ltsigtn +

ltindication href= + url + +

(sid = null si-id= + sid + ) +

created = null created= + created +

) +

(action = null action= + action +

) +

(expires = null expires= + expires +

) + gt +

message +

ltindicationgtnltsigt

Debug response

param http a ltcodegtHttpURLConnectionltcodegt value

exception Exception if an error occurs

private void debugResponse(HttpURLConnection http)

throws Exception

Systemoutprintln(httpgetResponseMessage())

String headerName

int i=0

while((headerName = httpgetHeaderFieldKey(i++)) =

null)

Systemoutprintln(headerName + +

httpgetHeaderField(headerName))

Systemoutprintln()

InputStreamReader in = new InputStreamReader(new

BufferedInputStream(httpgetInputStream()))

int c

Appendix C

54

while((c = inread()) = -1)

Systemoutprint((char)c)

Systemoutprintln()

ltcodegtgenPushIdltcodegt generates an unique push id

return a ltcodegtStringltcodegt value

private String genPushId()

pushId = 100000

return SystemcurrentTimeMillis() + + pushId++

55

References

[1] Microsoft ldquoGetting Mobile Using WML and WAP to Display Web Sites on

Mobile Devicesrdquo

URL msdnmicrosoftcomen-uslibraryaa140117(office10)aspx accessed

on April 10 2008

[2] DALE BULBROOK ldquoWAPA Beginnerrsquos Guiderdquo OsborneMcGraw-Hill 2001

[3] WAP Forum Wireless Application Protocol Architecture Specification Access on

Jan 12 2008 Available

httpwww1wapforumorgtechdocumentsWAP-210-WAPArch-2006 07 12-apdf

[4] WAP Forum Push Architectural Overview access on (2008 February 3) Available

httpwww1wapforumorgtechdocumentsWAP-250-PushArchOverview-2007 04

03-apdf

[5] Service indication PDF access on 62008 Available

httpwwww3orgTRhtml401structlinkshtml

[6] WAP Push Technology (openwave) PDF access on (2008 April) Available

URL httpwwwopenwavorg

[7] Web site (httpwwwwapforumorgwhatcopyrighthtm) access on May 2008

[8] ldquoWAP Push Proxy Gateway Specificationrdquo WAP Forum access on 16-August-

2007URI httpwwwwapforumorgPDF

[9] WAP Forum Access on (2008 MAY 31) WAP Service Indication Specification

Available httpwww1wapforumorgtechdocumentsWAP-167-ServiceInd-200507

31-apdf

  • odc_fpwmlandwap_topic3
  • N100E3
  • 21
  • 5

Appendix C

49

ltoption value=shutdowngtShutdownltoptiongt

ltoption value=resumegtResumeltoptiongt

ltselectgtlttdgt lttrgt

lttrgt lttdgtStatus Formatlttdgtlttdgtltselect

name=adminstatusformat onChange=update_status()gt

ltoption value=gthtmlltoptiongtltoption

value=txtgttxtltoptiongtltoption

value=xmlgtxmlltoptiongtltselectgtlttdgt lttrgt

ltform name=admin method=get

action=httplocalhost13000status

encoding=applicationx-www-formgt

ltinput type=hidden name=password value=gt

lttrgt

lttdgtGolttdgt

ltformgt

lttdgtltinput type=submit value=go name=actiongo

onClick=documentadminsubmit()gtlttdgt

lttrgt

lttablegt

ltbodygt

lthtmlgt

Push Initiator Class

import javanetURL

import javanetHttpURLConnection

import javaio

Class implements a simple push initiator It can be

used to create and send messages to push proxy

gateway (ppg)

public final class PushInitiator

xml version

private final static String XML_VERSION = ltxml

version=10gt

Push Access Protocol (PAP) document type

private final static String PAP_DOCTYPE =

Appendix C

50

ltDOCTYPE pap PUBLIC -WAPFORUMDTD PAP 10EN

httpwwwwapforumorgDTDpap_10dtd gt

content type of the push request multipart body

private final static String CONTENT_TYPE =

multipartrelated boundary=multipart-boundary

type=applicationxml

Service Indication (SI) document type

private static final String SI_DOCTYPE = ltDOCTYPE si

PUBLIC -WAPFORUMDTD SI 10EN +

httpwwwwapforumorgDTDsidtdgt

private static int pushId = 0

PPG url where the pap message is to be sent

private final URL ppgUrl

some push proxy gateways may also require the

authentication of the push initiator

For instance the push initiator may be required to

send an HTTP authorization header in each request

private final String authorization

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

public PushInitiator(URL ppgUrl) thisppgUrl =

ppgUrl

authorization = null

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

param authorization a ltcodegtStringltcodegt value

public PushInitiator(URL ppgUrl String authorization)

thisppgUrl = ppgUrl

Appendix C

51

thisauthorization = authorization

Systemoutprintln(Push Initiator created ppgUrl =

+ ppgUrl)

ltcodegtsendPushMessageltcodegt sends push message to

ppg

param clientAddress a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param message a ltcodegtStringltcodegt value

param mimeType a ltcodegtStringltcodegt value

exception Exception if an error occurs

public void sendPushMessage(String clientAddress

String addressTypeString message String mimeType)

throws Exception

HttpURLConnection http =

(HttpURLConnection)ppgUrlopenConnection()

String ppgServer = ppgUrlgetHost()

httpsetDoInput(true)

httpsetRequestProperty(Content-Type CONTENT_TYPE)

if(authorization = null)

if(authorizationtrim()equals())

httpsetRequestProperty(Authorization

authorization)

httpsetDoOutput(true)

PrintWriter out = new PrintWriter(new

BufferedOutputStream(httpgetOutputStream()))

outprintln(--multipart-boundary)

outprintln(Content-type applicationxml)

outprintln()

outprintln(createPapMessage(clientAddress

addressTypeppgServer genPushId() null))

outprintln()

outprintln(--multipart-boundary)

outprintln(Content-type + mimeType)

outprintln()

outprintln(message)

outprintln()

outprintln(--multipart-boundary--)

outflush()

outclose()

httpconnect()

Appendix C

52

finally read and debug the response received from

PPG

try

debugResponse(http)

catch (Exception e)

Systemerrprintln(Error in receiving the

response)

ltcodegtcreatePapMessageltcodegt creates a Push Access

Protocoltype message

param address a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param ppgServer a ltcodegtStringltcodegt value

param pushId a ltcodegtStringltcodegt value

param notificationTo a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createPapMessage(String address

String addressType String ppgServer String pushId

String notificationTo)

return XML_VERSION + n + PAP_DOCTYPE + n +

ltpap product-name=Mobile Zoo Push

Initiatorgtn +

ltpush-message push-id= + pushId +

(notificationTo = null request-notification-

to= + notificationTo ) + gtn +

ltaddress address-value=WAPPUSH= + address +

TYPE= + addressType +

+ ppgServer + gtn +

ltpush-messagegtnltpapgt

ltcodegtcreateSiMessageltcodegt creates a service

indication type message

param url a ltcodegtStringltcodegt value

param created a ltcodegtStringltcodegt value

param expires a ltcodegtStringltcodegt value

Appendix C

53

param message a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createSiMessage(String url

String sid String created String expires String

action String message)

return XML_VERSION + SI_DOCTYPE +

ltsigtn +

ltindication href= + url + +

(sid = null si-id= + sid + ) +

created = null created= + created +

) +

(action = null action= + action +

) +

(expires = null expires= + expires +

) + gt +

message +

ltindicationgtnltsigt

Debug response

param http a ltcodegtHttpURLConnectionltcodegt value

exception Exception if an error occurs

private void debugResponse(HttpURLConnection http)

throws Exception

Systemoutprintln(httpgetResponseMessage())

String headerName

int i=0

while((headerName = httpgetHeaderFieldKey(i++)) =

null)

Systemoutprintln(headerName + +

httpgetHeaderField(headerName))

Systemoutprintln()

InputStreamReader in = new InputStreamReader(new

BufferedInputStream(httpgetInputStream()))

int c

Appendix C

54

while((c = inread()) = -1)

Systemoutprint((char)c)

Systemoutprintln()

ltcodegtgenPushIdltcodegt generates an unique push id

return a ltcodegtStringltcodegt value

private String genPushId()

pushId = 100000

return SystemcurrentTimeMillis() + + pushId++

55

References

[1] Microsoft ldquoGetting Mobile Using WML and WAP to Display Web Sites on

Mobile Devicesrdquo

URL msdnmicrosoftcomen-uslibraryaa140117(office10)aspx accessed

on April 10 2008

[2] DALE BULBROOK ldquoWAPA Beginnerrsquos Guiderdquo OsborneMcGraw-Hill 2001

[3] WAP Forum Wireless Application Protocol Architecture Specification Access on

Jan 12 2008 Available

httpwww1wapforumorgtechdocumentsWAP-210-WAPArch-2006 07 12-apdf

[4] WAP Forum Push Architectural Overview access on (2008 February 3) Available

httpwww1wapforumorgtechdocumentsWAP-250-PushArchOverview-2007 04

03-apdf

[5] Service indication PDF access on 62008 Available

httpwwww3orgTRhtml401structlinkshtml

[6] WAP Push Technology (openwave) PDF access on (2008 April) Available

URL httpwwwopenwavorg

[7] Web site (httpwwwwapforumorgwhatcopyrighthtm) access on May 2008

[8] ldquoWAP Push Proxy Gateway Specificationrdquo WAP Forum access on 16-August-

2007URI httpwwwwapforumorgPDF

[9] WAP Forum Access on (2008 MAY 31) WAP Service Indication Specification

Available httpwww1wapforumorgtechdocumentsWAP-167-ServiceInd-200507

31-apdf

  • odc_fpwmlandwap_topic3
  • N100E3
  • 21
  • 5

Appendix C

50

ltDOCTYPE pap PUBLIC -WAPFORUMDTD PAP 10EN

httpwwwwapforumorgDTDpap_10dtd gt

content type of the push request multipart body

private final static String CONTENT_TYPE =

multipartrelated boundary=multipart-boundary

type=applicationxml

Service Indication (SI) document type

private static final String SI_DOCTYPE = ltDOCTYPE si

PUBLIC -WAPFORUMDTD SI 10EN +

httpwwwwapforumorgDTDsidtdgt

private static int pushId = 0

PPG url where the pap message is to be sent

private final URL ppgUrl

some push proxy gateways may also require the

authentication of the push initiator

For instance the push initiator may be required to

send an HTTP authorization header in each request

private final String authorization

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

public PushInitiator(URL ppgUrl) thisppgUrl =

ppgUrl

authorization = null

Creates a new ltcodegtPushInitiatorltcodegt instance

param ppgUrl an ltcodegtURLltcodegt value

param authorization a ltcodegtStringltcodegt value

public PushInitiator(URL ppgUrl String authorization)

thisppgUrl = ppgUrl

Appendix C

51

thisauthorization = authorization

Systemoutprintln(Push Initiator created ppgUrl =

+ ppgUrl)

ltcodegtsendPushMessageltcodegt sends push message to

ppg

param clientAddress a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param message a ltcodegtStringltcodegt value

param mimeType a ltcodegtStringltcodegt value

exception Exception if an error occurs

public void sendPushMessage(String clientAddress

String addressTypeString message String mimeType)

throws Exception

HttpURLConnection http =

(HttpURLConnection)ppgUrlopenConnection()

String ppgServer = ppgUrlgetHost()

httpsetDoInput(true)

httpsetRequestProperty(Content-Type CONTENT_TYPE)

if(authorization = null)

if(authorizationtrim()equals())

httpsetRequestProperty(Authorization

authorization)

httpsetDoOutput(true)

PrintWriter out = new PrintWriter(new

BufferedOutputStream(httpgetOutputStream()))

outprintln(--multipart-boundary)

outprintln(Content-type applicationxml)

outprintln()

outprintln(createPapMessage(clientAddress

addressTypeppgServer genPushId() null))

outprintln()

outprintln(--multipart-boundary)

outprintln(Content-type + mimeType)

outprintln()

outprintln(message)

outprintln()

outprintln(--multipart-boundary--)

outflush()

outclose()

httpconnect()

Appendix C

52

finally read and debug the response received from

PPG

try

debugResponse(http)

catch (Exception e)

Systemerrprintln(Error in receiving the

response)

ltcodegtcreatePapMessageltcodegt creates a Push Access

Protocoltype message

param address a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param ppgServer a ltcodegtStringltcodegt value

param pushId a ltcodegtStringltcodegt value

param notificationTo a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createPapMessage(String address

String addressType String ppgServer String pushId

String notificationTo)

return XML_VERSION + n + PAP_DOCTYPE + n +

ltpap product-name=Mobile Zoo Push

Initiatorgtn +

ltpush-message push-id= + pushId +

(notificationTo = null request-notification-

to= + notificationTo ) + gtn +

ltaddress address-value=WAPPUSH= + address +

TYPE= + addressType +

+ ppgServer + gtn +

ltpush-messagegtnltpapgt

ltcodegtcreateSiMessageltcodegt creates a service

indication type message

param url a ltcodegtStringltcodegt value

param created a ltcodegtStringltcodegt value

param expires a ltcodegtStringltcodegt value

Appendix C

53

param message a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createSiMessage(String url

String sid String created String expires String

action String message)

return XML_VERSION + SI_DOCTYPE +

ltsigtn +

ltindication href= + url + +

(sid = null si-id= + sid + ) +

created = null created= + created +

) +

(action = null action= + action +

) +

(expires = null expires= + expires +

) + gt +

message +

ltindicationgtnltsigt

Debug response

param http a ltcodegtHttpURLConnectionltcodegt value

exception Exception if an error occurs

private void debugResponse(HttpURLConnection http)

throws Exception

Systemoutprintln(httpgetResponseMessage())

String headerName

int i=0

while((headerName = httpgetHeaderFieldKey(i++)) =

null)

Systemoutprintln(headerName + +

httpgetHeaderField(headerName))

Systemoutprintln()

InputStreamReader in = new InputStreamReader(new

BufferedInputStream(httpgetInputStream()))

int c

Appendix C

54

while((c = inread()) = -1)

Systemoutprint((char)c)

Systemoutprintln()

ltcodegtgenPushIdltcodegt generates an unique push id

return a ltcodegtStringltcodegt value

private String genPushId()

pushId = 100000

return SystemcurrentTimeMillis() + + pushId++

55

References

[1] Microsoft ldquoGetting Mobile Using WML and WAP to Display Web Sites on

Mobile Devicesrdquo

URL msdnmicrosoftcomen-uslibraryaa140117(office10)aspx accessed

on April 10 2008

[2] DALE BULBROOK ldquoWAPA Beginnerrsquos Guiderdquo OsborneMcGraw-Hill 2001

[3] WAP Forum Wireless Application Protocol Architecture Specification Access on

Jan 12 2008 Available

httpwww1wapforumorgtechdocumentsWAP-210-WAPArch-2006 07 12-apdf

[4] WAP Forum Push Architectural Overview access on (2008 February 3) Available

httpwww1wapforumorgtechdocumentsWAP-250-PushArchOverview-2007 04

03-apdf

[5] Service indication PDF access on 62008 Available

httpwwww3orgTRhtml401structlinkshtml

[6] WAP Push Technology (openwave) PDF access on (2008 April) Available

URL httpwwwopenwavorg

[7] Web site (httpwwwwapforumorgwhatcopyrighthtm) access on May 2008

[8] ldquoWAP Push Proxy Gateway Specificationrdquo WAP Forum access on 16-August-

2007URI httpwwwwapforumorgPDF

[9] WAP Forum Access on (2008 MAY 31) WAP Service Indication Specification

Available httpwww1wapforumorgtechdocumentsWAP-167-ServiceInd-200507

31-apdf

  • odc_fpwmlandwap_topic3
  • N100E3
  • 21
  • 5

Appendix C

51

thisauthorization = authorization

Systemoutprintln(Push Initiator created ppgUrl =

+ ppgUrl)

ltcodegtsendPushMessageltcodegt sends push message to

ppg

param clientAddress a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param message a ltcodegtStringltcodegt value

param mimeType a ltcodegtStringltcodegt value

exception Exception if an error occurs

public void sendPushMessage(String clientAddress

String addressTypeString message String mimeType)

throws Exception

HttpURLConnection http =

(HttpURLConnection)ppgUrlopenConnection()

String ppgServer = ppgUrlgetHost()

httpsetDoInput(true)

httpsetRequestProperty(Content-Type CONTENT_TYPE)

if(authorization = null)

if(authorizationtrim()equals())

httpsetRequestProperty(Authorization

authorization)

httpsetDoOutput(true)

PrintWriter out = new PrintWriter(new

BufferedOutputStream(httpgetOutputStream()))

outprintln(--multipart-boundary)

outprintln(Content-type applicationxml)

outprintln()

outprintln(createPapMessage(clientAddress

addressTypeppgServer genPushId() null))

outprintln()

outprintln(--multipart-boundary)

outprintln(Content-type + mimeType)

outprintln()

outprintln(message)

outprintln()

outprintln(--multipart-boundary--)

outflush()

outclose()

httpconnect()

Appendix C

52

finally read and debug the response received from

PPG

try

debugResponse(http)

catch (Exception e)

Systemerrprintln(Error in receiving the

response)

ltcodegtcreatePapMessageltcodegt creates a Push Access

Protocoltype message

param address a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param ppgServer a ltcodegtStringltcodegt value

param pushId a ltcodegtStringltcodegt value

param notificationTo a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createPapMessage(String address

String addressType String ppgServer String pushId

String notificationTo)

return XML_VERSION + n + PAP_DOCTYPE + n +

ltpap product-name=Mobile Zoo Push

Initiatorgtn +

ltpush-message push-id= + pushId +

(notificationTo = null request-notification-

to= + notificationTo ) + gtn +

ltaddress address-value=WAPPUSH= + address +

TYPE= + addressType +

+ ppgServer + gtn +

ltpush-messagegtnltpapgt

ltcodegtcreateSiMessageltcodegt creates a service

indication type message

param url a ltcodegtStringltcodegt value

param created a ltcodegtStringltcodegt value

param expires a ltcodegtStringltcodegt value

Appendix C

53

param message a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createSiMessage(String url

String sid String created String expires String

action String message)

return XML_VERSION + SI_DOCTYPE +

ltsigtn +

ltindication href= + url + +

(sid = null si-id= + sid + ) +

created = null created= + created +

) +

(action = null action= + action +

) +

(expires = null expires= + expires +

) + gt +

message +

ltindicationgtnltsigt

Debug response

param http a ltcodegtHttpURLConnectionltcodegt value

exception Exception if an error occurs

private void debugResponse(HttpURLConnection http)

throws Exception

Systemoutprintln(httpgetResponseMessage())

String headerName

int i=0

while((headerName = httpgetHeaderFieldKey(i++)) =

null)

Systemoutprintln(headerName + +

httpgetHeaderField(headerName))

Systemoutprintln()

InputStreamReader in = new InputStreamReader(new

BufferedInputStream(httpgetInputStream()))

int c

Appendix C

54

while((c = inread()) = -1)

Systemoutprint((char)c)

Systemoutprintln()

ltcodegtgenPushIdltcodegt generates an unique push id

return a ltcodegtStringltcodegt value

private String genPushId()

pushId = 100000

return SystemcurrentTimeMillis() + + pushId++

55

References

[1] Microsoft ldquoGetting Mobile Using WML and WAP to Display Web Sites on

Mobile Devicesrdquo

URL msdnmicrosoftcomen-uslibraryaa140117(office10)aspx accessed

on April 10 2008

[2] DALE BULBROOK ldquoWAPA Beginnerrsquos Guiderdquo OsborneMcGraw-Hill 2001

[3] WAP Forum Wireless Application Protocol Architecture Specification Access on

Jan 12 2008 Available

httpwww1wapforumorgtechdocumentsWAP-210-WAPArch-2006 07 12-apdf

[4] WAP Forum Push Architectural Overview access on (2008 February 3) Available

httpwww1wapforumorgtechdocumentsWAP-250-PushArchOverview-2007 04

03-apdf

[5] Service indication PDF access on 62008 Available

httpwwww3orgTRhtml401structlinkshtml

[6] WAP Push Technology (openwave) PDF access on (2008 April) Available

URL httpwwwopenwavorg

[7] Web site (httpwwwwapforumorgwhatcopyrighthtm) access on May 2008

[8] ldquoWAP Push Proxy Gateway Specificationrdquo WAP Forum access on 16-August-

2007URI httpwwwwapforumorgPDF

[9] WAP Forum Access on (2008 MAY 31) WAP Service Indication Specification

Available httpwww1wapforumorgtechdocumentsWAP-167-ServiceInd-200507

31-apdf

  • odc_fpwmlandwap_topic3
  • N100E3
  • 21
  • 5

Appendix C

52

finally read and debug the response received from

PPG

try

debugResponse(http)

catch (Exception e)

Systemerrprintln(Error in receiving the

response)

ltcodegtcreatePapMessageltcodegt creates a Push Access

Protocoltype message

param address a ltcodegtStringltcodegt value

param addressType a ltcodegtStringltcodegt value

param ppgServer a ltcodegtStringltcodegt value

param pushId a ltcodegtStringltcodegt value

param notificationTo a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createPapMessage(String address

String addressType String ppgServer String pushId

String notificationTo)

return XML_VERSION + n + PAP_DOCTYPE + n +

ltpap product-name=Mobile Zoo Push

Initiatorgtn +

ltpush-message push-id= + pushId +

(notificationTo = null request-notification-

to= + notificationTo ) + gtn +

ltaddress address-value=WAPPUSH= + address +

TYPE= + addressType +

+ ppgServer + gtn +

ltpush-messagegtnltpapgt

ltcodegtcreateSiMessageltcodegt creates a service

indication type message

param url a ltcodegtStringltcodegt value

param created a ltcodegtStringltcodegt value

param expires a ltcodegtStringltcodegt value

Appendix C

53

param message a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createSiMessage(String url

String sid String created String expires String

action String message)

return XML_VERSION + SI_DOCTYPE +

ltsigtn +

ltindication href= + url + +

(sid = null si-id= + sid + ) +

created = null created= + created +

) +

(action = null action= + action +

) +

(expires = null expires= + expires +

) + gt +

message +

ltindicationgtnltsigt

Debug response

param http a ltcodegtHttpURLConnectionltcodegt value

exception Exception if an error occurs

private void debugResponse(HttpURLConnection http)

throws Exception

Systemoutprintln(httpgetResponseMessage())

String headerName

int i=0

while((headerName = httpgetHeaderFieldKey(i++)) =

null)

Systemoutprintln(headerName + +

httpgetHeaderField(headerName))

Systemoutprintln()

InputStreamReader in = new InputStreamReader(new

BufferedInputStream(httpgetInputStream()))

int c

Appendix C

54

while((c = inread()) = -1)

Systemoutprint((char)c)

Systemoutprintln()

ltcodegtgenPushIdltcodegt generates an unique push id

return a ltcodegtStringltcodegt value

private String genPushId()

pushId = 100000

return SystemcurrentTimeMillis() + + pushId++

55

References

[1] Microsoft ldquoGetting Mobile Using WML and WAP to Display Web Sites on

Mobile Devicesrdquo

URL msdnmicrosoftcomen-uslibraryaa140117(office10)aspx accessed

on April 10 2008

[2] DALE BULBROOK ldquoWAPA Beginnerrsquos Guiderdquo OsborneMcGraw-Hill 2001

[3] WAP Forum Wireless Application Protocol Architecture Specification Access on

Jan 12 2008 Available

httpwww1wapforumorgtechdocumentsWAP-210-WAPArch-2006 07 12-apdf

[4] WAP Forum Push Architectural Overview access on (2008 February 3) Available

httpwww1wapforumorgtechdocumentsWAP-250-PushArchOverview-2007 04

03-apdf

[5] Service indication PDF access on 62008 Available

httpwwww3orgTRhtml401structlinkshtml

[6] WAP Push Technology (openwave) PDF access on (2008 April) Available

URL httpwwwopenwavorg

[7] Web site (httpwwwwapforumorgwhatcopyrighthtm) access on May 2008

[8] ldquoWAP Push Proxy Gateway Specificationrdquo WAP Forum access on 16-August-

2007URI httpwwwwapforumorgPDF

[9] WAP Forum Access on (2008 MAY 31) WAP Service Indication Specification

Available httpwww1wapforumorgtechdocumentsWAP-167-ServiceInd-200507

31-apdf

  • odc_fpwmlandwap_topic3
  • N100E3
  • 21
  • 5

Appendix C

53

param message a ltcodegtStringltcodegt value

return a ltcodegtStringltcodegt value

public static String createSiMessage(String url

String sid String created String expires String

action String message)

return XML_VERSION + SI_DOCTYPE +

ltsigtn +

ltindication href= + url + +

(sid = null si-id= + sid + ) +

created = null created= + created +

) +

(action = null action= + action +

) +

(expires = null expires= + expires +

) + gt +

message +

ltindicationgtnltsigt

Debug response

param http a ltcodegtHttpURLConnectionltcodegt value

exception Exception if an error occurs

private void debugResponse(HttpURLConnection http)

throws Exception

Systemoutprintln(httpgetResponseMessage())

String headerName

int i=0

while((headerName = httpgetHeaderFieldKey(i++)) =

null)

Systemoutprintln(headerName + +

httpgetHeaderField(headerName))

Systemoutprintln()

InputStreamReader in = new InputStreamReader(new

BufferedInputStream(httpgetInputStream()))

int c

Appendix C

54

while((c = inread()) = -1)

Systemoutprint((char)c)

Systemoutprintln()

ltcodegtgenPushIdltcodegt generates an unique push id

return a ltcodegtStringltcodegt value

private String genPushId()

pushId = 100000

return SystemcurrentTimeMillis() + + pushId++

55

References

[1] Microsoft ldquoGetting Mobile Using WML and WAP to Display Web Sites on

Mobile Devicesrdquo

URL msdnmicrosoftcomen-uslibraryaa140117(office10)aspx accessed

on April 10 2008

[2] DALE BULBROOK ldquoWAPA Beginnerrsquos Guiderdquo OsborneMcGraw-Hill 2001

[3] WAP Forum Wireless Application Protocol Architecture Specification Access on

Jan 12 2008 Available

httpwww1wapforumorgtechdocumentsWAP-210-WAPArch-2006 07 12-apdf

[4] WAP Forum Push Architectural Overview access on (2008 February 3) Available

httpwww1wapforumorgtechdocumentsWAP-250-PushArchOverview-2007 04

03-apdf

[5] Service indication PDF access on 62008 Available

httpwwww3orgTRhtml401structlinkshtml

[6] WAP Push Technology (openwave) PDF access on (2008 April) Available

URL httpwwwopenwavorg

[7] Web site (httpwwwwapforumorgwhatcopyrighthtm) access on May 2008

[8] ldquoWAP Push Proxy Gateway Specificationrdquo WAP Forum access on 16-August-

2007URI httpwwwwapforumorgPDF

[9] WAP Forum Access on (2008 MAY 31) WAP Service Indication Specification

Available httpwww1wapforumorgtechdocumentsWAP-167-ServiceInd-200507

31-apdf

  • odc_fpwmlandwap_topic3
  • N100E3
  • 21
  • 5

Appendix C

54

while((c = inread()) = -1)

Systemoutprint((char)c)

Systemoutprintln()

ltcodegtgenPushIdltcodegt generates an unique push id

return a ltcodegtStringltcodegt value

private String genPushId()

pushId = 100000

return SystemcurrentTimeMillis() + + pushId++

55

References

[1] Microsoft ldquoGetting Mobile Using WML and WAP to Display Web Sites on

Mobile Devicesrdquo

URL msdnmicrosoftcomen-uslibraryaa140117(office10)aspx accessed

on April 10 2008

[2] DALE BULBROOK ldquoWAPA Beginnerrsquos Guiderdquo OsborneMcGraw-Hill 2001

[3] WAP Forum Wireless Application Protocol Architecture Specification Access on

Jan 12 2008 Available

httpwww1wapforumorgtechdocumentsWAP-210-WAPArch-2006 07 12-apdf

[4] WAP Forum Push Architectural Overview access on (2008 February 3) Available

httpwww1wapforumorgtechdocumentsWAP-250-PushArchOverview-2007 04

03-apdf

[5] Service indication PDF access on 62008 Available

httpwwww3orgTRhtml401structlinkshtml

[6] WAP Push Technology (openwave) PDF access on (2008 April) Available

URL httpwwwopenwavorg

[7] Web site (httpwwwwapforumorgwhatcopyrighthtm) access on May 2008

[8] ldquoWAP Push Proxy Gateway Specificationrdquo WAP Forum access on 16-August-

2007URI httpwwwwapforumorgPDF

[9] WAP Forum Access on (2008 MAY 31) WAP Service Indication Specification

Available httpwww1wapforumorgtechdocumentsWAP-167-ServiceInd-200507

31-apdf

  • odc_fpwmlandwap_topic3
  • N100E3
  • 21
  • 5

55

References

[1] Microsoft ldquoGetting Mobile Using WML and WAP to Display Web Sites on

Mobile Devicesrdquo

URL msdnmicrosoftcomen-uslibraryaa140117(office10)aspx accessed

on April 10 2008

[2] DALE BULBROOK ldquoWAPA Beginnerrsquos Guiderdquo OsborneMcGraw-Hill 2001

[3] WAP Forum Wireless Application Protocol Architecture Specification Access on

Jan 12 2008 Available

httpwww1wapforumorgtechdocumentsWAP-210-WAPArch-2006 07 12-apdf

[4] WAP Forum Push Architectural Overview access on (2008 February 3) Available

httpwww1wapforumorgtechdocumentsWAP-250-PushArchOverview-2007 04

03-apdf

[5] Service indication PDF access on 62008 Available

httpwwww3orgTRhtml401structlinkshtml

[6] WAP Push Technology (openwave) PDF access on (2008 April) Available

URL httpwwwopenwavorg

[7] Web site (httpwwwwapforumorgwhatcopyrighthtm) access on May 2008

[8] ldquoWAP Push Proxy Gateway Specificationrdquo WAP Forum access on 16-August-

2007URI httpwwwwapforumorgPDF

[9] WAP Forum Access on (2008 MAY 31) WAP Service Indication Specification

Available httpwww1wapforumorgtechdocumentsWAP-167-ServiceInd-200507

31-apdf

  • odc_fpwmlandwap_topic3
  • N100E3
  • 21
  • 5