Mobile IP
Outline Outline Introduction to mobile IP
Operation
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
Internet Protocol
• The IP addresses are designed to work with stationary hosts because part of the address defines the network to which the host is attached.
• Mobile networking should not be confused with portable networking
2
portable networking- Portable networking requires connection to same ISP(Internet Service Provider)
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
Portable Networking Technology
• Cellular systems– Cellular Digital Packet Data (CDPD)
– 3G
3
• Bluetooth– Low cost, short range radio links between mobile devices
• Wireless Ethernet (802.11)– Widely used wireless MAC layer technology
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
Mobile IP• Mobile IP was developed as a means for transparently dealing
with problems of mobile users– Enables hosts to stay connected to the Internet regardless of
their location– Enables hosts to be tracked without needing to change their IP
address– Requires no changes to software of non-mobile hosts/routers
4
– Requires no changes to software of non-mobile hosts/routers– Requires addition of some infrastructure– Has no geographical limitations– Requires no modifications to IP addresses or IP address format– Supports security
• Could be even more important than physically connected routin
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
Mobile IP Entities• Mobile Node (MN)
– The entity that may change its point of attachment from network to network in the Internet
• Detects it has moved and registers with “best” FA
– Assigned a permanent IP called its home address to which other hosts send packets regardless of MN’s location
• Since this IP doesn’t change it can be used by long-lived applications as MN’s
5
• Since this IP doesn’t change it can be used by long-lived applications as MN’s location changes
• Home Agent (HA)– This is router with additional functionality– Located on home network of MN– Does mobility binding of MN’s IP with its COA– Forwards packets to appropriate network when MN is away
• Does this through encapsulation
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
Mobile IP Entities contd.• Foreign Agent (FA)
– Another router with enhanced functionality– If MN is away from HA the it uses an FA to send/receive data to/from HA– Advertises itself periodically– Forward’s MN’s registration request
6
– Forward’s MN’s registration request– Decapsulates messages for delivery to MN
• Care-of-address (COA)– Address which identifies MN’s current location– Sent by FA to HA when MN attaches– Usually the IP address of the FA
• Correspondent Node (CN)– End host to which MN is corresponding (eg. a web server)
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
Home address and care-of address
Mobile IP has two addresses for a mobile host: one home address and one care-of address. The home address is permanent; the care-of address
changes as the mobile host moves from one network to another.
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
AGENTSTo make the change of address transparent to the rest of the Internet requires a home agent and a foreign agent.The specific function of an agent is performed in the application layer.
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
Mobile IP Support Services
• Agent Discovery– HA’s and FA’s broadcast their presence on each network to which they are
attached• Beacon messages via ICMP Router Discovery Protocol (IRDP)
– MN’s listen for advertisement and then initiate registration– MN’s listen for advertisement and then initiate registration
• Registration– When MN is away, it registers its COA with its HA
• Typically through the FA with strongest signal
– Registration control messages are sent via UDP to well known port
• Encapsulation – just like standard IP only with COA• Decapsulation – again, just like standard IP
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
When the mobile host and the foreign agent are the same, the care-of address is called a co-located care-of address.is called a co-located care-of address.
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
Mobile IP Operation• A MN listens for agent advertisement and then initiates registration
– If responding agent is the HA, then mobile IP is not necessary
• After receiving the registration request from a MN, the HA acknowledges and registration is complete– Registration happens as often as MN changes networks
11
– Registration happens as often as MN changes networks
• HA intercepts all packets destined for MN– This is simple unless sending application is on or near the same network as
the MN
– HA masquerades as MN
– There is a specific lifetime for service before a MN must re-register
– There is also a de-registration process with HA if an MN returns home
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
Mobile IP does not use a new packet type for agent advertisement; it uses the router advertisement packet of ICMP, router advertisement packet of ICMP, and appends an agent advertisement
message.
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
Agent advertisement
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
Table Table Code bitsCode bits
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
Mobile IP does not use a new packet type for agent solicitation; it uses the router solicitation packet of ICMP.
Note:Note:
router solicitation packet of ICMP.
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
Registration request and reply
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
Figure 24.6 Registration request format
Checksum
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
Registration request flag field bitsRegistration request flag field bits
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
Registration reply format
Checksum
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
Registration Process
20
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
Tables maintained on routers
• Mobility Binding Table– Maintained on HA of MN
– Maps MN’s home address with its current COA
21
• Visitor List– Maintained on FA serving an
MN
– Maps MN’s home address to its MAC address and HA address
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
Mobile IP Operation contd.• HA then encapsulates all packets addressed to MN and
forwards them to FA– IP tunneling
• FA decapsulates all packets addressed to MN and forwards them via hardware address (learned as part of
22
forwards them via hardware address (learned as part of registration process)
• NOTE that the MN can perform FA functions if it acquires an IP address eg. via DHCP
• Bidirectional communications require tunneling in each direction
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
Mobile IP Tunneling
23
Across Internet
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
Security in Mobile IP
• Authentication can be performed by all parties– Only authentication between MN and HA is required
– Keyed MD5 is the default
24
• Replay protection– Timestamps are mandatory
– Random numbers on request reply packets are optional
• HA and FA do not have to share any security information.
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
Problems with Mobile IP
• Suboptimal “triangle” routing– What if MN is in same subnetwork as the node to which it is
communicating and HA is on the other side of the world?• It would be nice if we could directly route packets
25
• It would be nice if we could directly route packets
– Solution: Let the CN know the COA of MN• Then the CN can create its own tunnel to MN
• CN must be equipped with software to enable it to learn the COA
• Initiated by HA who notifies CN via “binding update”
• Binding table can become stale
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
Other Mobile IP Problems
• Single HA model is fragile– Possible solution – have multiple HA
• Frequent reports to HA if MN is moving
26
– Possible solution – support of FA clustering
• Security– Connection hijacking, snooping…
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
Wireless Application Protocol(WAP)(WAP)
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
Outline• Mobile applications
• How are mobile/wireless environments different?
• What is WAP?
• WAP Architecture• WAP Architecture
• WAE (WML/WMLScript)
• WTA Framework
• WAP Protocol Stack
• Hype v/s Reality
• References and Resources
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
Variability of the Mobile Environment
Mobility• stationary• nomadic (pedestrian speed)• mobile (vehicular speed)• roaming (mobile across networks)
Connectivity• connected• semi-connected
(asymmetric)• weakly connected• disconnected
Mobile Device Capability• form factor• GUI• multimedia• real-time multimedia
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
World Wide Web and MobilityHTTP/HTML have not been designed for mobile applications/devices
• HTTP 1.0 characteristics– designed for large bandwidth, low delay
– stateless, client/server, request/response communication
– connection oriented, one connection per request
– TCP 3-way handshake, DNS lookup overheads– TCP 3-way handshake, DNS lookup overheads
– big protocol headers, uncompressed content transfer
– primitive caching (often disabled, dynamic objects)
– security problems (using SSL/TLS with proxies)
• HTML characteristics– designed for computers with “high” performance, color
high-resolution display, mouse, hard disk
– typically, web pages optimized for design, not for communication; ignore end-system characteristics
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
Wireless Application Protocol (WAP)
• Empowers mobile users with wireless devices to easily access and interact with information and services.
• A “standard” created by wireless and Internet companies to enable Internet access from a cellular phone
• wapforum.org: – co-founded by Ericsson, Motorola, Nokia, Phone.com– co-founded by Ericsson, Motorola, Nokia, Phone.com– 450 members in 2000, comprise of Handset manufacturers, Wireless
service providers, ISPs, Software companies in the wireless industry– Goals
• deliver Internet services to mobile devices• enable applications to scale across a variety of transport options
and device types• independence from wireless network standards• GSM, CDMA IS-95, TDMA IS-136, 3G systems (UMTS, W-
CDMA)
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
System Support for Mobile WWW
• Enhanced browsers– client-aware support for mobility
• Proxies– Client proxy: pre-fetching, caching, off-line use– Network proxy: adaptive content transformation for
connections connections – Client and network proxy
• Enhanced servers– server-aware support for mobility– serve the content in multiple ways, depending on client
capabilities• New protocols/languages
– WAP/WML
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
WAP: Main Features
• Browser– “Micro browser”, similar to existing web browsers
• Markup language– Similar to HTML, adapted to mobile devices
• Script language– Similar to Javascript, adapted to mobile devices – Similar to Javascript, adapted to mobile devices
• Gateway– Transition from wireless to wired world
• Server– “Wap/Origin server”, similar to existing web servers
• Protocol layers– Transport layer, security layer, session layer etc.
• Telephony application interface– Access to telephony functions
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
Internet Model
HTMLHTTP
TCP/IPTCP/IP
The Common Gateway Interface (CGI) is an RFC 3875 standard for web server software to delegate the generation of web pages to executable files. Such files are known as CGI scripts; they are programs, often stand-alone applications, usually written in a scripting language
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
Web ServerWAP Gateway
Client
WAP Architecture
Content
CGIScripts
etc.
WM
L D
ecks
with
WM
L-S
crip
t
WAP Gateway
WML Encoder
WMLScriptCompiler
Protocol Adapters
WML
WML-Script
WTAI
Etc.
HTTPWSP/WTP
Source: WAP Forum
Proxy Server
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
WAP ArchitectureKey Components
• Origin/Web Server• WAP Gateway/Proxy• WAP Protocol Stack• Micro Browser• WML/WML Script• Transcoders• Transcoders• WTA
Source: WAP Forum
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
WAP: Network Elements
wireless networkfixed network
WAPproxy
filter/WAP
filterInternet
Binary WML
Binary WML
HTML
HTML WML
WMLHTML
WTAserver
WAPproxyweb
server
PSTN
Binary WML: binary file format for clients
Binary WML
HTML
Source: Schiller
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
WAP StackMicroBrowser (WML, WMLScript, WTA, WTAI)
Runs on top of WDPProvided lightweight X-oriented service• Unreliable 1-way request• Reliable 1-way/2-way req./response
Lightweight SSLUses WIM/PKI-CardsUses WIM/PKI-Cards
Datagram service on different bearersConvergence between bearer services
Different Wireless Tech.
Source: WAP Forum
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
WAP Stack• WAE (Wireless Application Environment):
– Architecture: application model, browser, gateway, server– WML: XML-Syntax, based on card stacks, variables, ...– WTA: telephone services, such as call control, phone book etc.
• WSP (Wireless Session Protocol):– Provides HTTP 1.1 functionality – Supports session management, security, etc.
• WTP (Wireless Transaction Protocol):• WTP (Wireless Transaction Protocol):– Provides reliable message transfer mechanisms– Based on ideas from TCP/RPC
• WTLS (Wireless Transport Layer Security):– Provides data integrity, privacy, authentication functions– Based on ideas from TLS/SSL
• WDP (Wireless Datagram Protocol):– Provides transport layer functions– Based on ideas from UDP
Content encoding, optimized for low-bandwidth channels, simple devices
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
WHY WAP?• Wireless networks and phones
– have specific needs and requirements– not addressed by existing Internet technologies
• WAP – Enables any data transport
• TCP/IP, UDP/IP, GUTS (IS-135/6), SMS, or USSD.– Optimizes the content and air-link protocols– Optimizes the content and air-link protocols– Utilizes plain Web HTTP 1.1 servers
• leverages existing development methodologies• utilizes standard Internet markup language technology (XML) • all WML content is accessed via HTTP 1.1 requests
– WML UI components map well onto existing mobile phone user interfaces• no re-education of the end-users• leveraging market penetration of mobile devices
– Several modular entities together form a fully compliant Internet entity
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
Why is HTTP/HTML not enough?Big pipe - small pipe syndrome
Wireless network<HTML><HEAD><TITLE>NNN Interactive</TITLE><META HTTP-EQUIV="Refresh" CONTENT="1800, URL=/index.html"></HEAD><BODY BGCOLOR="#FFFFFF" BACKGROUND="/images/9607/bgbar5.gif" LINK="#0A3990" ALINK="#FF0000" VLINK="#FF0000" TEXT="000000" ONLOAD="if(parent.frames.length!=0)top.location= 'http://nnn.com';">
Internet
<WML><CARD><DO TYPE="ACCEPT"><GO URL="/submit?Name=$N"/></DO>Enter name:
HTTP/HTML WAP(WML)
'http://nnn.com';"> <A NAME="#top"></A><TABLE WIDTH=599 BORDER="0"><TR ALIGN=LEFT><TD WIDTH=117 VALIGN=TOP ALIGN=LEFT>
<HTML><HEAD><TITLE>NNN Interactive</TITLE><META HTTP-EQUIV="Refresh" CONTENT="1800, URL=/index.html">
Enter name:<INPUT TYPE="TEXT" KEY="N"/></CARD></WML>
010011010011110110010011011011011101010010011010
Content encoding
Source: WAP Forum
BinaryWML
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
WAP Applications• Location-based services
– Real-time traffic reporting, Event/restaurant recommendation
• Enterprise solutions– Email access, Database access, “global” intranet access– Information updates “pushed” to WAP devices
• Financial services– Banking, Bill-paying, Stock trading, Funds transfers
• Travel services– Schedules and rescheduling, Reservations
• Gaming and Entertainment– Online, real-time, multi-player games– Downloadable horoscopes, cartoons, quotes, advice
• M-Commerce– Shopping on the go– Instant comparison shopping– Location-based special offers and sales
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
Wireless Application Environment (WAE)
• Goals– device and network independent application environment
– for low-bandwidth, wireless devices– for low-bandwidth, wireless devices
– considerations of slow links, limited memory, low computing power, small display, simple user interface (compared to desktops)
– integrated Internet/WWW programming model
– high interoperability
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
WAE Components• Architecture
– Application model, Microbrowser, Gateway, Server
• User Agents– WML/WTA/Others
– content formats: vCard, vCalendar, Wireless Bitmap, – content formats: vCard, vCalendar, Wireless Bitmap, WML, ...
• WML– XML-Syntax, based on card stacks, variables, ...
• WMLScript– procedural, loops, conditions, ... (similar to JavaScript)
• WTA– telephone services, such as call control, text messages,
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
WAP Microbrowser
• Optimized for wireless devices
• Minimal RAM, ROM, Display, CPU and keyskeys
• Provides consistent service UI across devices
• Provides Internet compatibility
• Enables wide array of available content and applications
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
WML: Wireless Markup Language• Tag-based browsing language:
– Screen management (text, images)– Data input (text, selection lists, etc.)– Hyperlinks & navigation support
• Takes into account limited display, navigation capabilities of devices
• XML-based language
Content (XML)
XSL Processor– describes only intent of interaction
in an abstract manner– presentation depends upon device
capabilities
• Cards and Decks– document consists of many cards– User interactions are split into cards– Explicit navigation between cards– cards are grouped to decks– deck is similar to HTML page, unit
of content transmission
• Events, variables and state mgmt
XSL Processor
HTTP Browser
HTML StyleSheet
WML Browsers
WML Stylesheet
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
WML• The basic unit is a card. Cards are grouped together into Decks Document ~
Deck (unit of transfer)• All decks must contain
– Document prologue• XML & document type declaration
– <WML> element• Must contain one or more cards
<?xml version="1.0"?><!DOCTYPE WML PUBLIC "-//WAPFORUM//DTD WML 1.0//EN"
"http://www.wapforum.org/DTD/wml.xml">
<WML>...
</WML>
WML File Structure
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
WML Example
CardNavigation
<WML><CARD><DO TYPE=“ACCEPT”><GO URL=“#eCard”/>
</DOWelcome!
</CARD><CARD NAME=“eCard”>
InputElements
DeckVariables
<CARD NAME=“eCard”><DO TYPE=“ACCEPT”>
<GO URL=“/submit?N=$(N)&S=$(S)”/></DO>Enter name: <INPUT KEY=“N”/>Choose speed:<SELECT KEY=“S”><OPTION VALUE=“0”>Fast</OPTION><OPTION VALUE=“1”>Slow</OPTION>
</SELECT></CARD>
</WML>
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
<WML><CARD>
<DO TYPE="ACCEPT" LABEL="Next"><GO URL="#card2"/>
</DO>Acme Inc.<BR/>Directory
</CARD>
A Deck of Cards
Acme Inc.Directory_____________Next
<CARD NAME="card2"><DO TYPE="ACCEPT">
<GO URL="?send=$type"/></DO>Services<SELECT KEY="type">
<OPTION VALUE="em">Email</OPTION><OPTION VALUE="ph">Phone</OPTION><OPTION VALUE="fx">Fax</OPTION>
</SELECT></CARD>
</WML>
Services1>Email2 Phone____________OK
Source: WAP Forum
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
The DO Element• Binds a task to a user action
– Action type: ACCEPT, OPTIONS, HELPPREV, DELETE, RESET
– Label: Text string or image (optional)– Task: GO
PREV, REFRESH, NOOP– Destination: URL
<DO TYPE="ACCEPT" LABEL="Next"><GO URL="http://www.mysite.com/myapp.wml"/>
</DO>
– Destination: URL– Post data: if METHOD=POST
Source: WAP Forum
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
Anchored Links
• Bind a task to the ACCEPT action, when cursor points to a link– TITLE= sets the label string (default = “Link”)
– Links are not allowed in select list options
<CARD>Please visit our <A TITLE="Visit"><GO URL="home.wml"/>home page</A>
for details.</CARD>
Please visitour home
page for____________Visit
Source: WAP Forum
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
<WML><TEMPLATE>
<DO TYPE="OPTIONS" LABEL="Main"><GO URL="main_menu.wml"/>
</DO>
The TEMPLATE Element• Defines actions & events for all cards in a deck
First story…
</DO></TEMPLATE><CARD NAME="msg1">
<DO TYPE="ACCEPT" LABEL="Next"><GO URL="#msg2"/>
</DO>First story
</CARD><CARD NAME="msg2">
Second story</CARD>
</WML>
_____________Next Main
Second story...
_____________OK Main
Source: WAP Forum
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
Handling User Input
• Select lists– Choose from a list of options
• Input fields• Input fields– Enter a string of text or numbers
• KEY variables– Set by SELECT and INPUT elements– How user input is passed to other cards and the
application server
Source: WAP Forum
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
The SELECT Element• Display a list of options
– Each option may set the KEY variable and/or bind a task to the ACCEPT key
– TITLE= dynamically sets the label string
– MULTIPLE=“TRUE”: Allows user to pick multiple items
<CARD><DO TYPE="ACCEPT" LABEL="View">
<GO URL="getcity.cgi?location=$city"/></DO>Forecast<SELECT KEY="city">
<OPTION VALUE="ber">Berlin</OPTION><OPTION VALUE="rom">Rome</OPTION><OPTION TITLE="Find" ONCLICK="find.cgi">New City</OPTION>
</SELECT></CARD>
Forecast1 Berlin2 Rome3>New City____________Find
items
Source: WAP Forum
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
The INPUT Element• Prompts user to enter a string of text
– DEFAULT=key_value; Default KEY variable (displayed to user)
– FORMAT=format_specifier; If omitted, free-form entry is allowed
– EMPTYOK="TRUE“; Browser will accept null input
– TYPE="PASSWORD“; Special entry mode handled by the browser
– MAXLENGTH=number; Maximum number of allowed characters
<CARD><DO TYPE="ACCEPT">
<GO URL="?get=person"METHOD="POST" POSTDATA="userid=$ssn"/>
</DO>Soc Security:<INPUT KEY="ssn" FORMAT="NNN\-NN\-NNNN"/>
</CARD>
Soc. Security:
287-33- _____________
NUM
Soc. Security:
287-33- 7629____________OK
Source: WAP Forum
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
WML Content Formats• Common interchange formats, for interoperability• Formats:
– Business cards: IMC vCard standard– Calendar: IMC vCalendar standard– Images: WBMP (Wireless BitMaP)– Compiled WML, WMLScript
• Newly defined formats:• Newly defined formats:– WML text and tokenized format– WMLScript text and byte code format– WBMP image format
• Binary format for size reduction– Byte codes/tokens for common values and operators– Compressed headers– Data compression (e.g. images)
• General-purpose transport compression can still be applied
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
<CARD>
Displaying Images• Insert app images or local icons within display text
– 1-bit BMP format
• Images are ignored by non-bitmapped devices– Check HTTP_ACCEPT for “image/bmp”
<CARD><DO TYPE="ACCEPT"> <GO URL="#c2"/>
</DO> Continue <IMG LOCALSRC="righthand"
ALT="forward..."/></CARD>
<CARD NAME="c2"> <IMG SRC="../images/logo.wbmp"
ALT="Unwired Planet"/><BR/>Welcome!
</CARD>
Source: WAP Forum
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
WMLScript• Complement to WML
– Derived from JavaScript• Provides general scripting capabilities
– Procedural logic, loops, conditionals, etc.– Optimized for small-memory, small-CPU devices
• Features
– local user interaction, validity check of user input– access to device facilities (phone call, address book
etc.)– extensions to the device software
• configure device, download new functionality after deployment
• Byte code-based virtual machine (Binary format)
– Stack-oriented design, ROM-able– Designed for simple, low-impact implementation
• WML Script resides in the network along with WML but in a separate
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
WMLScript Libraries
• Lang - VM constants, general-purpose math functionality, etc.
• String - string processing functions
• URL - URL processing
• Browser - WML browser interface
• Dialog - simple user interface
• Float - floating point functions
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
Functions
WMLScript Example
Variables
function currencyConvertor(currency, exchRate) {return currency*exchangeRate;
}
function myDay(sunShines) {
ProgrammingConstructs
Variablesfunction myDay(sunShines) {
var myDay;if (sunShines) {
myDay = “Good”;} else {
myDay = “Not so good”;};return myDay;
}
Source: WAP Forum
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
Wireless Telephony Application (WTA)• Collection of telephony specific extensions
– designed primarily for network operators
• Example– calling a number (WML)– calling a number (WML)wtai://wp/mc;07216086415
– calling a number (WMLScript)WTAPublic.makeCall("07216086415");
• Implementation– Extension of basic WAE application model– Extensions added to standard WML/WMLScript
browser
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
WTA Features• Extension of basic WAE application model
– network model for interaction• client requests to server• event signaling: server can push content to the client
– event handling• table indicating how to react on certain events from the network• client may now be able to handle unknown events
– telephony functions– telephony functions• some application on the client may access telephony functions
• WTAI includes:– Call control– Network text messaging– Phone book interface– Event processing
• Security model: segregation– Separate WTA browser– Separate WTA port
WTA Interface(WTAI)•generic, high-level interface to mobile’s telephony functions •setting up phone calls, reading and writing entries in phonebook .,etc.
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
Placing an outgoing call with WTAI:
<WML><CARD><DO TYPE=“ACCEPT”>
WTA Example (WML)
Input Element
WTAI Call<DO TYPE=“ACCEPT”><GO URL=“wtai:cc/mc;$(N)”/>
</DO>Enter phone number:<INPUT TYPE=“TEXT” KEY=“N”/>
</CARD></WML>
Source: WAP Forum
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
Placing an outgoing call with WTAI:
function checkNumber(N) {
WTA Example (WMLScript)
WTAI Call
function checkNumber(N) {if (Lang.isInt(N))
WTAI.makeCall(N);else
Dialog.alert(“Bad phone number”);}
Source: WAP Forum
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
<WML><CARD><DO TYPE="ACCEPT“ TASK="GO”URL="#vote"/>Please vote for your champion!</CARD>
<CARD NAME="vote"><DO TYPE="ACCEPT"
TASK="GO" URL="wtai://cc/sc;$voteNo;1"/>Please choose:<SELECT KEY="voteNo">
<WML><CARD><DO TYPE="ACCEPT"TASK="GO”URL="#vote"/>Please vote for your champion!</CARD>
<CARD NAME="vote"><DO TYPE="ACCEPT"
TASK="GO" URL="/script#voteCall($voteNo)"/>Please choose:<SELECT KEY="voteNo">
WTA Application Example (using WML)
WTA Application Example WML and WMLScript
<SELECT KEY="voteNo">
<OPTION VALUE="6086415">Vinay</OPTION>
<OPTION VALUE="6086416">Vivek</OPTION>
<OPTION VALUE="6086417">Viswa</OPTION>
</SELECT></CARD>
</WML>
<OPTION VALUE="608645”>Vinay</OPTION>
<OPTION VALUE="6086416">Vivek</OPTION>
<OPTION VALUE="6086417">Viswa</OPTION>
</SELECT></CARD>
<CARD NAME="showResult">Status of your call: $Message $No</CARD></WML>
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
WAE Summary• WML
– analogous to HTML (optimized for wireless)– event based, microbrowser user agent
• WMLScript– analogous to JavaScript – features of compiler in the network
• WTA• WTA– WTAI: different access rights for different applications/agents– WTA User Agent (analogy with operating systems)
• Context – Activation Record• Channel – Interrupt Handler• Resource – Shared routines invoked by interrupt handlers• Repository – Library of interrupt handlers
– feature of dynamically pushing the interrupt handler before the event
• Push– no analogy in Internet. Used for MMS , SMS , Multicasting messages.
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
WAP: Protocol Stack
Session Layer (WSP)
Application Layer (WAE)HTML, Java
HTTP
Internet WAP
Transaction Layer (WTP)
additional services and applications
A-SAP
S-SAP
TR-SAP
Source: Schiller
Bearers (GSM, CDPD, ...)
Security Layer (WTLS)
Transport Layer (WDP)TCP/IP,UDP/IP,media
SSL/TLS
WAE comprises WML (Wireless Markup Language), WML Script, WTAI etc.
Transaction Layer (WTP)
WCMP
SEC-SAP
T-SAP
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
WSP - Wireless Session Protocol• Goals
– HTTP 1.1 functionality• Request/reply, content type negotiation, ...
– support of client/server transactions, push technology– key management, authentication, Internet security services
• WSP Services– provides shared state between client and server, optimizes content transfer– provides shared state between client and server, optimizes content transfer– session management (establish, release, suspend, resume)– efficient capability negotiation– content encoding– push
• WSP/B (Browsing)– HTTP/1.1 functionality - but binary encoded– exchange of session headers– push and pull data transfer– asynchronous requests
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
HTTP 1.1 and WSP• HTTP 1.1
– extensible request/reply methods
– extensible request/reply headers
– content typing
– composite objects
– asynchronous requests
• WSP enhancements beyond HTTP– binary header encoding– binary header encoding
– session headers
– confirmed and non-confirmed data push
– capability negotiation
– suspend and resume
– fully asynchronous requests
– connectionless service
• Why Not HTTP?– encoding not compact enough, inefficient capability negotiation
– no push facility
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
WSP Overview
• Header Encoding– compact binary encoding of headers, content type identifiers and other
well-known textual or structured values
– reduces the data actually sent over the network
• Capabilities (are defined for):– message size, client and server
– protocol options: Confirmed Push Facility, Push Facility, Session Suspend – protocol options: Confirmed Push Facility, Push Facility, Session Suspend Facility, Acknowledgement headers
– maximum outstanding requests
– extended methods
– header code pages
• Suspend and Resume– server knows when client can accept a push– multi-bearer devices– dynamic addressing– allows the release of underlying bearer resources
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
WSP Sessions
• Session Context and Push– push can take advantage of session headers
– server knows when client can accept a push
• Connection-mode– long-lived communication, benefits of the session state,
reliability
• Connectionless-mode– stateless applications, no session creation overhead, no
reliability overhead
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
WSP/B session establishment
S-Connect.req(SA, CA, CH, RC) S-Connect.ind
(SA, CA, CH, RC)
clientS-SAP
serverS-SAP
S-Connect.res(SH, NC)
S-Connect.cnfS-Connect.cnf(SH, NC)
WTP Class 2transaction
Source: Schiller
CH: Client Header
RC: Requested Capabilities
SH: Server Header
NC: Negotiated Capabilities
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
WSP/B session suspend/resume
S-Suspend.req S-Suspend.ind(R)
clientS-SAP
serverS-SAP
S-Suspend.ind(R)
~ ~S-Resume.req
WTP Class 0transaction
R: Reason for disconnection
S-Resume.res
WTP Class 2transaction
~ ~S-Resume.req(SA, CA) S-Resume.ind
(SA, CA)
S-Resume.cnf
Source: Schiller
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
WSP/B Active session termination
S-Disconnect.ind(RC,RS,RA,EH,EB)
clientS-SAP
serverS-SAP
S-Disconnect.ind(RC,RS,RA,EH,EB)
S-Disconnect.req(RC,RS,RA,EH,EB)
(RC,RS,RA,EH,EB)
Source: Schiller
RC - Reason CodeRS - Redirect SecurityRA - Redirect AddressEH - Error HeaderEB - Error Body
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
WSP/B method invoke
S-MethodInvoke.req(CTID, M, RU,RH,RB) S-MethodInvoke.ind
(STID, M, RU,RH,RB)
clientS-SAP
serverS-SAP
S-MethodInvoke.res(STID)
S-MethodInvoke.cnf(CTID) S-MethodResult.req
(STID, S, RH, RB)S-MethodResult.indS-MethodResult.ind(CTID, S, RH, RB)
S-MethodResult.res(CTID) S-MethodResult.cnf
(STID)CTID: Client Transaction ID
M: Method Invoked
RU: Request URI
STID: Server Transaction ID
S: Response Status
RH: Response Header
RB: Response Body
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
WSP/B - confirmed/non-confirmed push
S-Push.req(PH, PB)
clientS-SAP
serverS-SAP
S-Push.ind(PH, PB)
WTP Class 0transaction
client server
PH: Push Header
PB: Push Body
SPID: Server Push ID
CPID: Client Push ID
Sending unsolicited info from client to server
WTP Class 1transaction
S-ConfirmedPush.res(CPID)
S-ConfirmedPush.ind(CPID, PH, PB)
S-ConfirmedPush.req(SPID, PH, PB)
S-SAP S-SAP
S-ConfirmedPush.cnf(SPID)
Source: Schiller
CPID: Client Push ID
Connectionless session provides only nonconf .capability.
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
WSP - PDU
TID Type Type-Specific Contents
The WSP PDU will be sent to the WTP and will be encapsulated in the WTP Packet on the Client side
Transaction Identifier
Type of PDU(Service Primitive)
Contains all info. in response to the
Service Primitive used
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
WTP: Wireless Transaction Protocol• Goals
– different transaction services i.e., requests and responses between the user agents – enable applications to select reliability, efficiency levels– low memory requirements, suited to simple devices (< 10kbyte )– efficiency for wireless transmission
• WTP– supports peer-to-peer, client/server and multicast applications– efficient for wireless transmission– support for different communication scenarios– class 0: unreliable message transfer– class 0: unreliable message transfer
• unconfirmed Invoke message with no Result message• a datagram that can be sent within the context of an existing Session• Unreliable push operation
– class 1: reliable message transfer without result message• confirmed Invoke message with no Result message• used for data push, where no response from the destination is expected
– class 2: reliable message transfer with exactly one reliable result message• confirmed Invoke message with one confirmed Result message• a single request produces a single reply
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
WTP Services and Protocols• WTP (Transaction)
– provides reliable data transfer based on request/reply paradigm• no explicit connection setup or tear down• optimized setup (data carried in first packet of protocol exchange)• seeks to reduce 3-way handshake on initial request
– supports• header compression• segmentation /re-assembly• segmentation /re-assembly• retransmission of lost packets• selective-retransmission• port number addressing (UDP ports numbers)• flow control
– message oriented (not stream)– supports an Abort function for outstanding requests– supports concatenation of PDUs– supports User acknowledgement or Stack acknowledgement option
• acks may be forced from the WTP user (upper layer)• default is stack ack
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
Client Server(PDUs)
WTP Services and Protocols• uses the service primitives
– T-TRInvoke.req .cnf. .ind .res
– T-TRResult.req .cnf .ind .res
– T-Abort.req .ind
Invoke
Ack
Result
Ack
T-TRInvoke.req
T-TRResult.ind
T-TRInvoke.cnf
T-TRResult.res
(PDUs)
T-TRInvoke.ind
T-TRResult.req
T-TRInvoke.res
T-TRResult.cnf
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
WTP Class 0 TransactioninitiatorTR-SAP
responderTR-SAP
TR-Invoke.reqTR-Invoke.ind
Source: Schiller
A: Acknowledgement Type (WTP/User)
C: Class (0,1,2)
H: Handle (socket alias)
class 0: unreliable message transfer•unconfirmed Invoke message with no Result message•a datagram that can be sent within the context of an existing Session•Unreliable push operation
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
WTP Class 1 Transaction, no user ack & user ack
TR-Invoke.req
TR-Invoke.ind
initiatorTR-SAP
responderTR-SAP
TR-Invoke.res
TR-Invoke.cnfTR-Invoke.cnf
Source: Schiller
class 1: reliable message transfer without result message•confirmed Invoke message with no Result message•used for data push, where no response from the destination is expected
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
WTP Class 2 Transaction, no user ack, no hold on
TR-Invoke.req
TR-Invoke.ind
initiatorTR-SAP
responderTR-SAP
TR-Result.reqTR-Invoke.cnf
TR-Result.req
TR-Result.ind
TR-Invoke.cnf
TR-Result.res
TR-Result.cnf
Source: Schiller
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
WTP Class 2 Transaction, user “hold on”ack
TR-Invoke.req
TR-Invoke.ind
initiatorTR-SAP
responderTR-SAP
TR-Invoke.res
TR-Invoke.cnf
TR-Result.ind
TR-Invoke.cnfTR-Result.req
TR-Result.res
TR-Result.cnf
Source: Schiller
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
WSP/B and WTP - method invocation
S-MethodInvoke.req
S-MethodInvoke.ind
S-MethodInvoke.res
S-MethodInvoke.cnf
TR-Invoke.req
TR-Invoke.cnf
TR-Invoke.ind
TR-Invoke.res
WSP Client WTP ClientProvider
WTP ServerWSP Server
S-MethodInvoke.cnfS-MethodResult.req
S-MethodResult.ind
S-MethodResult.res
S-MethodResult.cnf
TR-Result.ind
TR-Invoke.cnf
TR-Result.res
TR-Result.req
TR-Result.cnf
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
WTLS:Wireless Transport Layer Security• Goals
– Provide mechanisms for secure transfer of content, for applications needing privacy, identification, message integrity and non-repudiation
– Provide support for protection against denial-of-service attacks
• WTLS – is based on the TLS/SSL (Transport Layer Security) protocol– is based on the TLS/SSL (Transport Layer Security) protocol– optimized for low-bandwidth communication channels– provides
• privacy (encryption)• data integrity (Message Authentication Code ‘s -MAC)• authentication (public-key and symmetric-digital certificates)
– Employs special adapted mechanisms for wireless usage• Long lived secure sessions• Optimised handshake procedures• Provides simple data reliability for operation over datagram bearers
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
Record Protocol
Handshake Protocol
Alert Protocol
Application Protocol
Change Cipher Spec Protocol
Transaction Protocol (WTP)
WTLS
Record protocol
WTLS Internal Architecture
Record Protocol
Datagram Protocol (WDP/UDP)
Bearer networks
Record protocol
Source: WAP Forum
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
WTLS Record Protocol Operation
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
WDP: Wireless Datagram Protocol• Goals
– create a worldwide interoperable transport system by adapting WDP to the different underlying technologies
– transmission services, such as SMS in GSM might change, new services can replace the old ones
• WDP• WDP– Transport layer protocol within the WAP architecture
– uses the Service Primitive
• T-UnitData.req .ind
– uses transport mechanisms of different bearer technologies
– offers a common interface for higher layer protocols
– allows for transparent communication despite different technologies
– addressing uses port numbers
– WDP over IP is UDP/IP
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
WDP: Service Primitives
T-SAP T-SAP
T-DUnitdata.req(DA, DP, SA, SP, UD) T-DUnitdata.ind
(SA, SP, UD) T-DUnitdata.req(DA, DP, SA, SP, UD)
T-DError.indT-DError.ind(EC)
SAP: Service Access Point
DA: Destination Address
DP: Destination Port
SA: Source Address
SP: Source Port
UD: User Data
EC: Error Code
Source: Schiller
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
WAP Over GSM Circuit-Switched
WSP
WAE
WSP
WAE Apps onOther Servers
WAP Proxy/Server
Mobile
ISP/RAS
Service, Protocol, and Bearer Example
RAS - Remote Access ServerIWF - InterWorking Function
WSP
Subnetwork
IP
WSP
CSD-RF
PPP
IP
IWF
PSTNCircuit
CSD-RF
ISP/RAS
SubnetworkPSTNCircuit
PPP
IP
WTP
UDP
WTP
UDP
Source: WAP Forum
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
WAP Over GSM Short Message Service
WSP
WAE
WSP
WAE Apps onother servers
WAP Proxy/ServerMobile
Service, Protocol, and Bearer Example
SMS
WDP
WTP
SMS
Subnetwork
WDP
WDP Tunnel Protocol
Subnetwork
WDP TunnelProtocol
WTPSMSC
under development
Source: WAP Forum
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
WAP Stack Summary
• WDP– functionality similar to UDP in IP networks
• WTLS– functionality similar to SSL/TLS (optimized for wireless)
• WTP– Class 0: analogous to UDP
– Class 1: analogous to TCP (without connection setup overheads)
– Class 2: analogous to RPC (remote procedure call) (optimized for wireless)
– features of “user acknowledgement”, “hold on”
• WSP– WSP/B: analogous to http 1.1 (add features of suspend/resume)
– method: analogous to RPC/RMI
– features of asynchronous invocations, push (confirmed/unconfirmed)
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
WAP: Ongoing Work• WDP
– Tunnel to support WAP where no (end-to-end) IP bearer available
• WTLS– support for end-to-end security (extending WTLS endpoint beyond WAP
Gateway)– interoperable between WAP and Internet (public key infrastructure)– integrating Smart Cards for security functions
• WTP• WTP– efficient transport over wireless links (wireless TCP)– bearer selection/switching– quality of service definitions
• WSP– quality of service parameters– multicast data, multimedia support
• WAE– User agent profiles: personalize for device characteristics, preferences etc– Push architecture, asynchronous applications– Billing
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net