You are here: > Documents > WAP

Introduction to WAP

The name "Wireless Application Protocol" (WAP) is misleading. WAP is not actually a protocol at all, in the sense that HTTP and IP are protocols. In fact, WAP involves multiple protocols and a complete network architecture for delivery of wireless content.

What Exactly Is WAP?

In 1997, several companies organized an industry group called the WAP Forum. This group produces the WAP specification, a (long and detailed) series of technical documents that define standards for implementing wireless network applications. Hundreds of industry firms have given strong backing to the WAP Forum, so the technology should become widely adopted, and it is already well-hyped.

WAP specifies an architecture based on layers that follows the OSI model fairly closely. The WAP model, or stack as it is commonly known, is illustrated below

Application Layer

WAP's application layer is the Wireless Application Environment (WAE). WAE directly supports WAP application development with Wireless Markup Language (WML) instead of HTML and WMLScript instead of JavaScript. WAE also includes the Wireless Telephony Application Interface (WTAI, or WTA for short) that provides a programming interface to telephones for initiating calls, sending text messages, and other networking capability.

Session Layer

WAP's session layer is the Wireless Session Protocol (WSP). WSP is the equivalent to HTTP for WAP browsers. WAP involves browsers and servers just like the Web, but HTTP was not a practical choice for WAP because of its relative inefficiency on the wire. WSP conserves precious bandwidth on wireless links; in particular, WSP works with relatively compact binary data where HTTP works mainly with text data.

Transaction, Security, and Transport Layers

These three protocols can be thought of as "glue layers" in WAP:

  • Wireless Transaction Protocol (WTP);
  • Wireless Transaction Layer Security (WTLS);
  • Wireless Datagram Protocol (WDP).

WTP provides transaction-level services for both reliable and unreliable transports. It prevents duplicate copies of packets from being received by a destination, and it supports retransmission, if necessary, in cases where packets are dropped. In this respect, WTP is analogous to TCP. However, WTP also differs from TCP. WTP is essentially a pared-down TCP that squeezes some extra performance from the network.

WTLS provides authentication and encryption functionality analogous to Secure Sockets Layer (SSL) in Web networking. Like SSL, WTLS is optional and used only when the content server requires it.

WDP implements an abstraction layer to lower-level network protocols; it performs functions similar to UDP. WDP is the bottom layer of the WAP stack, but it does not implement physical or data link capability. To build a complete network service, the WAP stack must be implemented on some low-level legacy interface not technically part of the model. These interfaces, called bearer services or bearers, can be IP-based or non-IP based.

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 Service (SMS) and General Packet Radio System (GPRS). SMS passes text and binary data between digital phones. GPRS is a relatively new technology that implements faster, "always-on" connections for wireless devices; GPRS actually runs on top of IP.


The single most popular component of WAP is undoubtedly Wireless Markup Language (WML). WML allows developers to specify how content will be presented to a WAP browser. WML can be compared to HTML in terms of its syntax and functionality, but many differences between the two exist.

In general, HTML (especially in combination with JavaScript) requires more memory and processing power to support a browser than is desirable for a wireless device like a cell phone or PDA. WML strives to be a more viable alternative by stripping out the unneeded features of HTML and enforcing conventions that make pages easier to parse.

WML Syntax

WML supports a tag-based syntax just like HTML. Many tags with the same name can be found in both languages, although the behavior of these tags may differ:


WML attempts to improve on the inconsistent syntax seen in much of today's HTML. WML generally requires stricter conformance to standards -- specifically the inclusion of end-tags or closed empty-element tags. For example, the <p> tag must always be followed by a matching </p> tag (or else the page will not display). Tags without a matching end tag, such as br, must incorporate the ending slash as follows:


Because WML is a subet of XML designed for XML parsers, the top of every WML page includes the following header information to specify the Document Type Description (DTD):

<?xml version="1.0">

WML Cards and Decks

The most apparent difference between WML and HTML source files is the concept of WML cards and the <card> tag. Cards effectively implement multiple WML screens within a single page. WAP browsers display only one card at a time, but they load a page file (called a deck) that contains multiple cards in one transaction.

Loading multiple cards at once caches potential screen views locally on the WAP browser to reduce the need for network requests. In addition, one network request to fetch a file the size of a typical HTML page will generally execute faster than a series of requests for much smaller pieces of the file. In these ways, WAP’s implementation of cards and desks is a clever optimization of the limited bandwidth on today’s wireless networks.

Is WML A Programming Language?

Most software developers agree that HTML (by itself, without JavaScript) is only a markup language and not a true programming language. HTML lacks variable assignments, control flow statements, and conditionals. WML, however, is much closer to a programming language if not squarely in that camp.

WML supports variables. The <setvar> tag assigns a value to an alphanumeric name as follows:

  <setvar name="index" value="1">

Accessing a variable in WML is similar to Perl:

  <a href="page_$(index).wml">Next page</a>

WML supports control flow through tasks. It also supports events including timer events with the <timer> tag. These features make things like form validation in the browser easier for developers to implement in WML than HTML. Validating form data in the browser saves bandwidth over the alternative of sending data to the server for validation.

WAP Applications

The way in which mobile wireless devices are used differs dramatically from the way we use PCs. On a PC we may spend hours constantly connected to the Web hunting for information at work or playing complex, immersive games at home. On a wireless device, we tend to be away from home and "online" for relatively brief and unpredictable periods of time.

The wireless industry hopes that WAP devices will become popular for ecommerce applications like online banking in the not-so-distant future. In the short term, it is more likely that useful WAP applications will simply extend the functions of telephone and allow us to answer a phone message with an email, for example. The early WAP applications have featured news feeds, stock quotes, and weather forecasts -- hardly compelling content. Significant backlash against the hype and optimism surrounding WAP has certianly occured as a result of the uncertainly about its future.

Google and WAP Gateways

The popular search engine Google claims that fewer than one percent of Web sites include WML published-content today. Nevertheless, Google offers a slimmed-down version of its engine and an index of “WAP only” sites, and it also implements a service that translates pages from HTML to WML on request.

So-called WAP gateways like Google's are currently a fashionable way to provide content on wireless networks. A WAP browser sends requests to a WAP gateway that in turn forwards the request to a true Web server. The WAP gateway generates WML based on the HTML pages delivered from the Web server. Then, the gateway sends decks back to the browser.

The Long-Term Future of WAP

WAP today is tied to the Web mindset in many people's minds. These people see WAP as just a technology that gives mobile devices access to the Net directly or through gateways. They find it confusing that so many new network protocols, similar but different from the Web protocols, have been developed. However, it is possible that WAP will enable a new and completely different kind of content network in the more distant future.


In responding to the backlash against WAP, advocates are quick to point out that WAP technology exists today in a very early, primitive form compared to how it will evolve.

WAP defines an alternative to the Web for content delivery networks. The WAP model was optimized for the following constraints, that are very different from the constraints found on today's Web:

  • Wireless devices like cell phones and pagers have relatively small displays. Some displays support graphics but some only support text;
  • Wireless devices usually have no mouse and a limited keyboard; keyboards are often used one-handed;
  • Wireless devices contain relatively little memory and processing power;
  • Wireless networks tend to have intermittent network connectivity -- dropping connections due to temporary signal loss, for example;
  • Wireless networks ofen feature limited bandwidth (9600 bps or less) and long latencies (delays between requests and replies);
  • Wireless networks may or may not support IP;
  • As wireless devices grow in power, it is possible that someday the WAP and Web models will merge into a single standard. It is also likely the models will diverge, as the way in which we use small mobile network devices will probably always be specialized. Because WAP is based on a layered design, it should be more easily adapted to future needs -- whatever they may be.