MC Unit 4
MC Unit 4
Objectives
To make the student understand the concept of mobile computing paradigm, Its novel
applications and limitations.
To understand the typical mobile networking Infrastructure through a popular GSM
protocol
To understand the issues and solutions of various layers of mobile networks, namely
MAC layer, Network Layer & Transport Layer
To understand the database issues Wi mobile environments & data delivery models.
UNIT- IV
Data Dissemination and Synchronization: Communications Asymmetry. Classification of Data Delivery
Mechanisms. Data Dissemination, Broadcast Models. Selective Tuning and Indexing Methods. Data
Synchronization – Introduction. Software, and Protocols.
UNIT- V
Mobile Ad hoc Networks (MANETs): Introduction, Applications a Challenges of a MANET Routing,
Classification of Routing Algorithms. Algorithms such as DSR. AODV. DSDV. etc. , Mobile Agents.
Service Discovery.
Protocols and Platforms for Mobile Computing :WAP, Bluetooth. XML. J2ME. JavaCard. PaImOS,
Windows CE. SymbianOS. Unux for Mobile Devices. Android.
TEXT BOOKS
Joctien Schuller, Mobile Communication. Addison-Wesley. Second Edition, 2009.
Raj Kamal. MoblIe Computing’. Oxford University Press, 2007. ISBN: 0195686772
REFERENCE BOOKS
Jochen Sdiiler. “Mobdo Communications”. Addison-Wesley. Second Edition. 2004.
Stomenovlc and Cacute, Handbook of Wireless Networks and Mobile Computing.
Wiley. 2002. ISBN 0471419028.
Reza Behravanfar. Mobile Computing Principles: Designing and Developing Mobile Applications with UML
andXML.
ISBN:0521817331. Cambridge University Press. 2004.
Outcomes
Able to think and develop new mobile application.
Able to take any new technical issue related to s new paradigm and come up with a solution(s).
Able to develop new ad hoc network applications and/or/ algorithms/ protocols.
Able to understand & develop any existing or new protocol related to mobile environment.
Mobile Transport Layer Mobile Computing
Unit-4
Unit-4: Mobile Transport Layer: Traditional TCP ,Indirect TCP ,Snooping TCP
,Mobile TCP, Transaction oriented TCP,Wireless Application Protocols-Architecture-
WDP-WTLS-WTP-WSP-WAE-WML-WML Script
Traditional TCP
The Transmission Control Protocol (TCP) is one of the core protocols of the Internet protocol
suite, often simply referred to as TCP/IP. TCP is reliable, guarantees in-order delivery of data
and incorporates congestion control and flow control mechanisms.
TCP supports many of the Internet's most
popular application protocols and resulting
applications, including the World Wide Web,
e-mail, File Transfer Protocol and Secure Shell.
In the Internet protocol suite, TCP is the
intermediate layer between the Internet layer
and application layer.
The major responsibilities of TCP in an active
session are to:
• Provide reliable in-order transport of data:
to not allow losses of data.
• Control congestions in the networks: to not
allow degradation of the network
performance,
• Control a packet flow between the
transmitter and the receiver: to not exceed
the receiver's capacity.
TCP uses a number of mechanisms to achieve high performance and avoid 'congestion
collapse', where network performance can fall by several orders of magnitude. These
mechanisms control the rate of data entering the network, keeping the data flow below a rate
that would trigger collapse. There are several mechanisms of TCP that influence the efficiency
of TCP in a mobile environment. Acknowledgments for data sent, or lack of acknowledgments,
are used by senders to implicitly interpret network conditions between the TCP sender and
receiver.
Mobile Transport Layer Mobile Computing
Unit-3
Congestion Control
A transport layer protocol such as TCP has been designed for fixed networks with fixed
end- systems. Congestion may appear from time to time even in carefully designed networks.
The packet buffers of a router are filled and the router cannot forward the packets fast enough
because the sum of the input rates of packets destined for one output link is higher than the
capacity of the output link. The only thing a router can do in this situation is to drop packets. A
dropped packet is lost for the transmission, and the receiver notices a gap in the packet stream.
Now the receiver does not directly tell the sender which packet is missing, but continues to
acknowledge all in-sequence packets up to the missing one.
The sender notices the missing acknowledgement for the lost packet and assumes a
packet loss due to congestion. Retransmitting the missing packet and continuing at full sending
rate would now be unwise, as this might only increase the congestion. To mitigate congestion,
TCP slows down the transmission rate dramatically. All other TCP connections experiencing the
same congestion do exactly the same so the congestion is soon resolved.
Slow start
TCP’s reaction to a missing acknowledgement is quite drastic, but it is necessary to get rid of
congestion quickly. The behavior TCP shows after the detection of congestion is called slow
start. The sender always calculates a congestion window for a receiver. The start size of the
congestion window is one segment (TCP packet). The sender sends one packet and waits for
acknowledgement. If this acknowledgement arrives, the sender increases the congestion
window by one, now sending two packets (congestion window = 2). This scheme doubles the
congestion window every time the acknowledgements come back, which takes one round trip
time (RTT). This is called the exponential growth of the congestion window in the slow start
mechanism.
But doubling the congestion window
is too dangerous. The exponential
growth stops at the congestion
threshold. As soon as the congestion
window reaches the congestion
threshold, further increase of the
transmission rate is only linear by
adding 1 to the congestion window
each time the acknowledgements
come back.
2
Mobile Transport Layer Mobile Computing
Unit-3
Linear increase continues
until a time-out at the
sender occurs due to a
missing acknowledgement,
or until the sender detects a
gap in transmitted data
because of continuous
acknowledgements for the
same packet. In either case
the sender sets the
congestion threshold to half
of the current congestion
window. The congestion window itself is set to one segment and the sender starts sending a
single segment. The exponential growth starts once more up to the new congestion threshold,
then the window grows in linear fashion.
Fast retransmit/fast recovery
The congestion threshold can be reduced because of two reasons. First one is if the sender
receives continuous acknowledgements for the same packet. It informs the sender that the
receiver has got all the packets upto the acknowledged packet in the sequence and also the
receiver is receiving something continuously from the sender. The gap in the packet stream is
not due to congestion, but a simple packet loss due to a transmission error. The sender can
now retransmit the missing packet(s) before the timer expires. This behavior is called fast
retransmit. It is an early enhancement for preventing slow-start to trigger on losses not caused
by congestion. The receipt of acknowledgements shows that there is no congestion to justify a
slow start. The sender can continue with the current congestion window. The sender performs
a fast recovery from the packet loss. This mechanism can improve the efficiency of TCP
dramatically. The other reason for activating slow start is a time-out due to a missing
acknowledgement. TCP using fast retransmit/fast recovery interprets this congestion in the
network and activates the slow start mechanism.
The advantage of this method is its simplicity. Minor changes in the MH’s software
results in performance increase. No changes are required in FA or CH.
The disadvantage of this scheme is insufficient isolation of packet losses. It mainly
focuses on problems regarding Handover. Also it effects the efficiency when a CH
transmits already delivered packets.
Mobile Transport Layer Mobile Computing
Unit-3
Problems with Traditional TCP in wirelessenvironments
Slow Start mechanism in fixed networks decreases the efficiency of TCP if used with
mobile receivers or senders.
Error rates on wireless links are orders of magnitude higher compared to fixed fiber or
copper links. This makes compensation for packet loss by TCP quite difficult.
Mobility itself can cause packet loss. There are many situations where a soft handover
from one access point to another is not possible for a mobile end-system.
Standard TCP reacts with slow start if acknowledgements are missing, which does not
help in the case of transmission errors over wireless links and which does not really help
during handover. This behavior results in a severe performance degradation of an
unchanged TCP if used together with wireless links or mobilenodes
Standard TCP is used between the fixed computer and the access point. No computer in
the internet recognizes any changes to TCP. Instead of the mobile host, the access point now
terminates the standard TCP connection, acting as a proxy. This means that the access point is
now seen as the mobile host for the fixed host and as the fixed host for the mobile host.
Between the access point and the mobile host, a special TCP, adapted to wireless links, is used.
However, changing TCP for the wireless link is not a requirement. A suitable place for
segmenting the connection is at the foreign agent as it not only controls the mobility of the
mobile host anyway and can also hand over the connection to the next foreign agent when the
mobile host moves on.
Mobile Transport Layer Mobile Computing
Unit-3
The foreign agent acts as a proxy and relays all data in both directions. If CH
(correspondent host) sends a packet to the MH, the FA acknowledges it and forwards it to the
MH. MH acknowledges on successful reception, but this is only used by the FA. If a packet is lost
on the wireless link, CH doesn’t observe it and FA tries to retransmit it locally to maintain
reliable data transport. If the MH sends a packet, the FA acknowledges it and forwards it to CH.
If the packet is lost on the wireless link, the mobile hosts notice this much faster due to the
lower round trip time and can directly retransmit the packet. Packet loss in the wired network is
now handled by the foreign agent.
Advantages of I-TCP
No changes in the fixed network necessary, no changes for the hosts (TCP protocol)
necessary, all current optimizations to TCP still work
Simple to control, mobile TCP is used only for one hop between, e.g., a foreign agent and
mobile host
1. transmission errors on the wireless link do not propagate into the fixed network
2. therefore, a very fast retransmission of packets is possible, the short delay on the
mobile hop s known
It is always dangerous to introduce new mechanisms in a huge network without knowing
exactly how they behave.
New optimizations can be tested at the last hop, without jeopardizing the stability of
the Internet.
It is easy to use different protocols for wired and wireless networks.
Disadvantages of I-TCP
Loss of end-to-end semantics:- an acknowledgement to a sender no longer means that
a receiver really has received a packet, foreign agents might crash.
Higher latency possible:- due to buffering of data within the foreign agent and forwarding
to a new foreign agent
Security issue:- The foreign agent must be a trusted entity
Snooping TCP
The main drawback of I-TCP is the segmentation of the single TCP connection into two TCP
connections, which loses the original end-to-end TCP semantic. A new enhancement, which
leaves the TCP connection intact and is completely transparent, is Snooping TCP. The main
function is to buffer data close to the mobile host to perform fast local retransmission in case of
packet loss.
8
Mobile Transport Layer Mobile Computing
Unit-3
TCP that can recover from packet loss much faster. This modified TCP does not use slow start,
thus, M-TCP needs a bandwidth manager to implement fair sharing over the wireless link.
Advantages of M-TCP:
It maintains the TCP end-to-end semantics. The SH does not send any ACK itself but
forwards the ACKs from the MH.
If the MH is disconnected, it avoids useless retransmissions, slow starts or breaking
connections by simply shrinking the sender’s window to 0.
As no buffering is done as in I-TCP, there is no need to forward buffers to a new SH. Lost
packets will be automatically retransmitted to the SH.
Disadvantages of M-TCP:
As the SH does not act as proxy as in I-TCP, packet loss on the wireless link due to bit errors
is propagated to the sender. M-TCP assumes low bit error rates, which is not always a valid
assumption.
A modified TCP on the wireless link not only requires modifications to the MH protocol
software but also new network elements like the bandwidth manager.
Transmission/time-out freezing
Often, MAC layer notices connection problems even before the connection is actually
interrupted from a TCP point of view and also knows the real reason for the interruption. The
MAC layer can inform the TCP layer of an upcoming loss of connection or that the current
interruption is not caused by congestion. TCP can now stop sending and ‘freezes’ the current
state of its congestion window and further timers. If the MAC layer notices the upcoming
interruption early enough, both the mobile and correspondent host can be informed. With a
fast interruption of the wireless link, additional mechanisms in the access point are needed to
inform the correspondent host of the reason for interruption. Otherwise, the correspondent
host goes into slow start assuming congestion and finally breaks the connection.
As soon as the MAC layer detects connectivity again, it signals TCP that it can resume
operation at exactly the same point where it had been forced to stop. For TCP time simply does
not advance, so no timers expire.
Advantages:
It offers a way to resume TCP connections even after long interruptions of the connection.
It can be used together with encrypted data as it is independent of other TCP mechanisms
such as sequence no or acknowledgements
Disadvantages:
Lots of changes have to be made in software of MH, CH and FA.
Mobile Transport Layer Mobile Computing
Unit-3
Selective retransmission
A very useful extension of TCP is the use of selective retransmission. TCP acknowledgements
are cumulative, i.e., they acknowledge in-order receipt of packets up to a certain packet. A
single acknowledgement confirms reception of all packets upto a certain packet. If a single
packet is lost, the sender has to retransmit everything starting from the lost packet (go-back-n
retransmission). This obviously wastes bandwidth, not just in the case of a mobile network, but
for any network.
Using selective retransmission, TCP can indirectly request a selective retransmission of
packets. The receiver can acknowledge single packets, not only trains of in-sequence packets.
The sender can now determine precisely which packet is needed and can retransmit it. The
advantage of this approach is obvious: a sender retransmits only the lost packets. This lowers
bandwidth requirements and is extremely helpful in slow wireless links. The disadvantage is
that a more complex software on the receiver side is needed. Also more buffer space is needed
to resequence data and to wait for gaps to befilled.
Transaction-oriented TCP
Assume an application running on the mobile host that sends a short request to a server from
time to time, which responds with a short message and it requires reliable TCP transport of the
packets. For it to use normal TCP, it is inefficient because of the overhead involved. Standard
TCP is made up of three phases: setup, data transfer and
release. First, TCP uses a three-way handshake to
establish the connection. At least one additional packet
is usually needed for transmission of the request, and
requires three more packets to close the connection via a
three-way handshake. So, for sending one data packet,
TCP may need seven packets altogether. This kind of
overhead is acceptable for long sessions in fixed
networks, but is quite inefficient for short messages or
sessions in wireless networks. This led to the
development of transaction-oriented TCP (T/TCP).
T/TCP can combine packets for connection establishment and
connection release with user data packets. This can reduce the
number of packets down to two instead of seven. The obvious
advantage for certain applications is the reduction in the overhead
which standard TCP has for connection setup and connection release.
Disadvantage is that it requires changes in the software in mobile host
Mobile Transport Layer Mobile Computing
Unit-3
and all correspondent hosts. This solution does not hide mobility anymore. Also, T/TCP exhibits
several security problems.
Database Hoarding
Database hoarding may be done at the application tier itself. The following figure shows a
simple architecture in which a mobile device API directly retrieves the data from a database. It
also shows another simple architecture in which a mobile device API directly retrieves the data
from a database through a program, for ex: IBM DB2 Everyplace (DB2e).
(a) API at mobile device sending queries and retrieving data from local database (Tier 1)
(b) API at mobile device retrieving data from database using DB2e (Tier 1)
Mobile Computing Database Issues
Both the two architectures belong to the class of one-tier database architecture because the
databases are specific to a mobile device, not meant to be distributed to multiple devices, not
synchronized with the new updates, are stored at the device itself. Some examples are
downloaded ringtones, music etc. IBM DB2 Everyplace (DB2e) is a relational database engine
which has been designed to reside at the device. It supports J2ME and most mobile device
operating systems. DB2e synchronizes with DB2 databases at the synchronization, application,
or enterprise server
The database architecture shown below is for two-tier or multi-tier databases. Here, the
databases reside at the remote servers and the copies of these databases are cached at the
client tiers. This is known as client-server computing architecture.
A cache is a list or database of items or records stored at the device. Databases are
hoarded at the application or enterprise tier, where the database server uses business logic and
connectivity for retrieving the data and then transmitting it to the device. The server provides
and updates local copies of the database at each mobile device connected to it. The computing
API at the mobile device (first tier) uses the cached local copy. At first tier (tier 1), the API uses
the cached data records using the computing architecture as explained above. From tier 2 or
tier 3, the server retrieves and transmits the data records to tier 1 using business logic and
synchronizes the local copies at the device. These local copies function as devicecaches.
Mobile Computing Database Issues
UNIT- III
The advantage of hoarding is that there is no access latency (delay in retrieving the
queried record from the server over wireless mobile networks). The client device API has
instantaneous data access to hoarded or cached data. After a device caches the data
distributed by the server, the data is hoarded at the device. The disadvantage of hoarding is
that the consistency of the cached data with the database at the server needs to be
maintained.
Data Caching
Hoarded copies of the databases at the servers are distributed or transmitted to the mobile
devices from the enterprise servers or application databases. The copies cached at the devices are
equivalent to the cache memories at the processors in a multiprocessor system with a shared
main memory and copies of the main memory data stored at different locations.
Cache Access Protocols: A client device caches the pushed (disseminated) data records from a
server. Caching of the pushed data leads to a reduced access interval as compared to the pull (on-
demand) mode of data fetching. Caching of data records can be-based on pushed 'hot records'
(the most needed database records at the client device). Also, caching can be based on the ratio
of two parameters—access probability (at the device) and pushing rates (from the server) for each
record. Thismethod is called cost-based data replacement or caching.
Pre-fetching: Pre-fetching is another alternative to caching of disseminated data. The process of
pre- fetching entails requesting for and pulling records that may be required later. The client
devicecan pre-fetch instead of caching from the pushed records keeping future needs in view. Pre-
fetching reduces server load. Further, the cost of cache-misses can thus be reduced. The term 'cost
of cache-misses' refers to the time taken in accessing a record at the server in case that record is not
found in the device database when required by the deviceAPI.
Assume that a device needs a data-record during an application. A request must be sent to the
server for the data record (this mechanism is called pulling). The time taken for the application
software to access a particular record is known as access latency. Caching and hoarding the
record at the device reduces access latency to zero. Therefore, data cache maintenance is
necessary in a mobile environment to overcome accesslatency.
Data cache inconsistency means that data records cached for applications are not invalidated at
the device when modified at the server but not modified at the device. Data cache consistency
can be maintained by the three methods givenbelow:
I. Cache invalidation mechanism (server-initiated case): the server sends invalidation reports
on invalidation of records (asynchronous) or at regular intervals (synchronous).
II. Polling mechanism (client-initiated case): Polling means checking from the server, the state
of data record whether the record is in the valid, invalid, modified, or exclusive state. Each
cached record copy is polled whenever required by the application software during computation.
If the record is found to be modified or invalidated, then the device requests for the modified
data and replaces the earlier cached record copy.
III. Time-to-live mechanism (client-initiated case): Each cached record is assigned a TTL (time-to-live).
The TTL assignment is adaptive (adjustable) previous update intervals of that record. After the
end of the TTL, the cached record copy is polled. If it is modified, then the device requests the
server to replace the invalid cached record with the modified data. When TTL is set to 0, the
TTL mechanism is equivalent to the polling mechanism.
Web Cache Maintenance in Mobile Environments
The mobile devices or their servers can be connected to a web server (e.g., traffic information
server or train information server). Web cache at the device stores the web server data and
maintains it in a manner similar to the cache maintenance for server data described above. If an
application running at the device needs a data record from the web which is not at the web cache,
then there is access latency. Web cache maintenance is necessary in a mobile environment to
overcome access latency in downloading from websites due to disconnections. Web cache
consistency can be maintained by two methods. These are:
Mobile Computing Database Issues
UNIT- III
I. Time-to-live (TTL) mechanism (client-initiated case) : The method is identical to the one
discussed for data cache maintenance.
II. Power-aware computing mechanism (client-initiated case): Each web cache maintained at
the device can also store the CRC (cyclic redundancy check) bits. Assume that there are N
cached bits and n CRC bits. N is much greater than n. Similarly at the server, n CRC bits are
stored. As long as there is consistency between the server and device records, the CRC bits
at both are identical. Whenever any of the records cached at the server is modified, the
corresponding CRC bits at the server are also modified. After the TTL expires or on-
demand for the web cache records by the client API, the cached record CRC is polled and
obtained from the website server. If the n CRC bits at server are found to be modified and
the change is found to be much higher than a given threshold (i.e., a significant change),
then the modified part of the website hypertext or database is retrieved by the clientdevice
for use by the API. However, if the change is minor, then the API uses the previous cache.
Since N » n, the power dissipated in the web cache maintenance method (in which
invalidation reports and all invalidated record bits are transmitted) is much greater than
that in the present method (in which the device polls for the significant change in the CRC
bits at server and the records are transmitted only when there is a significant change in the
CRC bits).
Client-Server Computing
Client-server computing is a distributed computing architecture, in which there are two types of
nodes, i.e., the clients and the servers. A server is defined as a computing system, which responds
to requests from one or more clients. A client is defined as a computing system, which requests
the server for a resource or for executing a task. The client can either access the data records at
the server or it can cache these records at the client device. The data can be accessed either on
client request or through broadcasts or distribution from theserver.
The client and the server can be on the same computing system or on different computing
systems. Client-server computing can have N-tier architecture (N= 1, 2 ...). When the client and the
server are on the same computing system then the number of tiers, N = 1. When the client and the
server are on different computing systems on the network, then N = 2. A command interchange
protocol (e.g., HTTP) is used for obtaining the client requests at the server or the server responses
at the client.
The following subsections describe client-server computing in 2, 3, or N-tier architectures.
Each tier connects to the other with a connecting, synchronizing, data, or command interchange
protocol.
Mobile Computing Database Issues
UNIT- III
Two-tier Client-Server Architecture
The following figure shows the application server at the second tier. The data records are
retrieved using business logic and a synchronization server in the application server synchronizes
with the local copies at the mobile devices. Synchronization means that when copies of records at
the server-end are modified, the copies cached at the client devices should also be accordingly
modified. The APIs are designed independent of hardware and software platforms as far as
possible as different devices may have different platforms.
Three-tier Client-Server Architecture
In a three-tier computing architecture, the application interface, the functional logic, and the
database are maintained at three different layers. The database is associated with the enterprise
server tier (tier 3) and only local copies of the database exist at mobile devices. The database
connects to the enterprise server through a connecting protocol. The enterprise server connects the
complete databases on different platforms, for example, Oracle, XML, and IBM DB2.
Mobile Computing Database Issues
UNIT- III
Data records at tier 3 are sent to tier 1 as shown in the figure through a synchronization-cum-
application server at tier 2. The synchronization-cum-application server has synchronization and
server programs, which retrieves data records from the enterprise tier (tier 3) using business logic.
There is an in-between server, called synchronization server, which sends and synchronizes the
copies at the multiple mobile devices. The figure shows that local copies 1 to j of databases are
hoarded at the mobile devices for the applications 1 to j.
Mobile Computing Database Issues
UNIT- III
N-tier Client-Server Architecture
When N is greater than 3, then the database is presented at the client through in-between
layers. For example, the following figure shows a four-tier architecture in which a client device
connects to a data-presentation server at tier 2.
The presentation server then connects to the application server tier 3. The application server can
connect to the database using the connectivity protocol and to the multimedia server using Java or
XML API at tier 4. The total number of tiers can be counted by adding 2 to the number of in-
between servers between the database and the client device. The presentation, application, and
enterprise servers can establish connectivity using RPC, Java RMI, JNDI, or HOP. These servers may
also use HTTP or HTTPS in case the server at a tier j connects to tier j+1 using the Internet.
The data formats of data transmitted from the synchronization server and those required for the
device database and device APIs are different in different cases, there are two adapters at a
mobile device—an adapter for standard data format for synchronization at the mobile device and
another adapter for the backend database copy, which is in a different data format for the API at the
mobile device. An adapter is software to get data in one format or data governed by one protocol
and convert it to another format or to data governed by another protocol.
Mobile Computing Database Issues
UNIT- III
Figure shows an API, database, and adapters at a mobile device and the
adaptersat the synchronization, application, or enterprise servers. Here the adapters are
an addition used for interchangebetweenstandarddataformatsand dataformatsforthe
API.
Context-aware Computing
The context of a mobile device represents the circumstances, situations, applications, or
physical environment under which the device is being used. For example, let us assume that a
mobile phone is operating in a busy, congested area. If the device is aware of the surrounding
noises, then during the conversation, it can raise the speaker volume by itself and when the user
leaves that area, the device can again reduce the volume. Also, if there is intermittent loss of
connectivity during the conversation, the device can introduce background noises by itself so that
the user does not feel discomfort due to intermittent periods of silence. This is one example in
which the computing system is aware of the surrounding physical context in which the
conversation is taking place.
A context-aware computing system is one which has user, device, and application
interfaces such that, using these, the system remains aware of the past and present surrounding
situations, circumstances, or actions such as the present mobile network, surrounding devicesor
systems, changes in the state of the connecting network, physical parameters such as present time
of the day, presently remaining memory and battery power, presently available nearest connectivity,
past sequence of actions of the device user, past sequence of application or applications, and
previously cached data records, and takesthese intoaccountduring computations.
Mobile Computing Database Issues
UNIT- III
Context
The term 'context' refers to the interrelated conditions in which a collection of elements, records,
components, or entities exists or occurs. Each message, data record, element, or entity has a
meaning. But when these are considered along with the conditions that relate them to each other
and to the environment, then they have a wider meaning. Understanding of the context in which a
device is meant to operate, results in better, more efficient computing strategies.
Structural Context: To explain what is meant by structural context let us consider a few
examples of records with structural arrangement. The fields name, address, experience, and
achievements of a person have an individual meaning. However, when put together to form a
resume, these fields acquire a significance beyond their individual meanings. This significance
comes from the fact that they are now arranged in a structure which indicates an interrelationship
between them. The structure of the resume includes the records and their interrelationship and
thus defines a context for these records. Whereby, the records have a new meaning in the context
of the resume (which is a structure). Contexts such as the context of the resume of an individual are
called structural contexts. The context in such cases comes from the structure or format in which
the records in a database areorganized.
Consider another example, this time that of a line in a telephone directory. It has a
sequence of records including a name, an address, and a 10-digit number. Each record has an
individual meaning. But a collection of these records shows an interrelationship and thus defines
a context, i.e., a telephone directory.
Implicit and Explicit Contexts Context may be implicit or explicit. Implicit context
provides for omissions by leaving out unimportant details, takes independent world-views, and
performs alterations in order to cope with incompatible protocols, interfaces, or APIs by
transparently changing the messages. Implicit context uses history to examine call history, to
manage omissions, or to determine recipients and performs contextual message alterations.
Consider the context 'Contacts' which has a set of contacts. The name, e-mail ID, and telephone
number are implicit in a contact in the context Contacts. When a computing device uses a contact to
call a number using a name record, the system takes independent view and uses the telephone
number implicitly and deploys CDMA or GSM protocols for connecting to the mobile network
implicitly. Context CDMA is implicit in defining the records 'Contact'. When a computing system
uses a contact to send an e-mail using a name record, the use of the e-mail ID record is implicit to
the system and the use of SMTP (simple mail transfer protocol) or other mail sending protocol is
also implicit. Name gets automatically altered to e-mail ID when the context is sending of e-mail.
The implicit context also copes with incompatible interfaces, for example, mail sending and receiving
software handling data in different formats. Consider the context document. In document
context, the contact or personal information is an extrinsic context. In context to processing of a
Mobile Computing Database Issues
UNIT- III
document, the existence of document author contact information is extrinsic. The contacts
context is imported into the document context to establish interrelationship between
document and contact.
Context-aware Computing
Context-aware computing leads to application-aware computing. This is so because the APIs are
part of the context (implicit or explicit contexts). For example, if context is a contact, the phone-
talk application will adapt itself to use of the telephone number from the 'contact' and to the
use of GSM or CDMA communication.
Use of context in computing helps in reducing possibility of errors. It helps in reducing the
ambiguity in the action(s). It helps in deciding the expected system response on computations.
For example, if name is input in personal biodata context, then the address, experience, and
achievements, which correspond to that name, are also required for computations. This is
because all four are related and needed in biodata context. When name is input in telephone
directory context, then the address and phone number, which correspond to that name, are
also required for computations. This is because all three are related in context to telephone
directory. The name in two different contexts (personal biodata and telephone directory)
during computations needs computations to perform different actions.
The five types of contexts that are important in context-aware computing are-physical context,
computing context, user context, temporal context, and structural context.
Physical Context: The context can be that of the physical environment. The
parameters for defining a physical context are service disconnection, light level,
noise level, and signal strength. For example, if there is service disconnection during a
conversation, the mobile device can sense the change in the physical conditions and
it interleaves background noise so that the listener does not feel the effects of the
disconnection. Also, the mobile device can sense the light levels, so during daytime
the display brightness is increased and during night time or in poor light conditions,
the device display brightness is reduced. The physical context changes and the
device display is adjusted accordingly.
Computing Context: The context in a context-aware computing environment may also be
computing context. Computing context is defined by interrelationships and conditions of the
networkconnectivityprotocolin use(Bluetooth,ZigBee, GSM, GPRS,orCDMA),bandwidth,and
availableresources. Examples of resources are keypad, display unit, printer, and cradle. A
cradle is the unit on which the mobile device lies in order to connect to a computer in the
vicinity. Consider a mobile device lying on a cradle. It discovers the computing context and
uses ActiveSync to synchronizeanddownloadfrom the computer. Whena mobile
devicelies in the
Mobile Computing Database Issues
UNIT- III
vicinity of a computer with a Bluetooth interface, it discovers another computing context
resource and uses wireless Bluetooth for connecting to the computer. When it functions
independently and connects to a mobile network, it discovers another computing context and
uses a GSM, CDMA, GPRS, or EDGE connection. The response of the system is as per the
computing context, i.e., the network connectivity protocol.
User Context: Theusercontext is defineduserlocation, userprofiles, andpersonsnear
theuser. Reza B'Far defines user-interfaces contextstatesasfollows—'within
therealm of user interfaces, we can define context as the sum of the relationships
betweenthe user interfacecomponents, the condition of the user, theprimary intent
of thesystem, andall of the other elements that allow users and computing systems to
communicate.
Temporal Context: Temporal context defines the interrelation between time and the
occurrence of an event or action. A group of interface components have an intrinsic or
extrinsic temporal context. For example, assume that at an instant the user presses the
switch for dial in a mobile device. At the next instant the device seeks a number as an
input. Then user will consider it in the context of dialling and input the number to be dialled.
Now, assume that at another time the user presses the switch to add a contact in the
mobile device. The device again prompts the user to enter a number as an input. The user
will consider it in context of the number to be added in the contacts and stored in the
device for future use. The device then seeks the name of the contact as the input. Response
of the system in such cases is as per the temporal context. The context for the VUI (voice
user interface) elements also defines a temporal context (depending upon the instances
and sequences in which these occur).
Structural Context: Structural context defines a sequence and structure formed by
the elements or records. Graphic user interface (GUI) elements have structural
context. Structural context may also be extrinsic for some other type of context.
Interrelation amongthe GUIelementsdepends on structuralpositions on the
displayscreen. When time is the context, then the hour and minute elements.
Transaction Models
A transaction is the execution of interrelated instructions in a sequence for a specific operation
on a database. Database transaction models must maintain data integrity and must enforce a
set of rules called ACID rules. These rules are as follows:
Atomicity: All operations of a transaction must be complete. In case, a transaction cannot
be completed; it must be undone (rolled back). Operations in a transaction are assumed to
be one indivisible unit (atomic unit).
Mobile Computing Database Issues
UNIT- III
Consistency: A transaction must be such that it preserves the integrity constraints and
follows the declared consistency rules for a given database. Consistency means the data is
not in a contradictory state after the transaction.
Isolation: If two transactions are carried out simultaneously, there should not be any
interference between the two. Further, any intermediate results in a transaction should be
invisible to any other transaction.
Durability: After a transaction is completed, it must persist and cannot be aborted or
discarded. For example, in a transaction entailing transfer of a balance from account A to
account B, once the transfer is completed and finished there should be no roll back.
Consider a base class library included in Microsoft.NET. It has a set of computer software
components called ADO.NET (ActiveX Data Objects in .NET). These can be used to access the
data and data services including for access and modifying the data stored in relational database
systems. The ADO.NET transaction model permits three transaction commands:
1. BeginTransaction: It is used to begin a transaction. Any operation after
BeginTransaction is assumed to be a part of the transaction till the
CommitTransaction command or the RollbackTransaction
command. An example of a command is as follows:
connectionA.open();
transA = connectionA.BeginTransaction();
Here connectionA and transA are two distinct objects.
A DBMS may provide for auto-commit mode. Auto-commit mode means the transaction
finished automatically even if an error occurs in between.
Query Processing
Query processing means making a correct as well as efficient execution strategy by query
decomposition and query-optimization. A relational-algebraic equation defines a set of
operations needed during query processing. Either of the two equivalent relational-algebraic
equations given below can be used.
Mobile Computing Database Issues
UNIT- III
This means that in first series of step, crosscheck all rows of Contacts and
DialledNumbers and select, after AND operation, the rows in which
Contacts.firstchar = “R” and Contacts.cTelNum =
DialledNumbers.dTelNum. Then in the next step project cName and cTelNum
form the selected records.
Efficient utilization of wireless bandwidth and battery power are two of the most
important problems facing software designed for mobile computing. Broadcast channels are
attractive in tackling these two problems in wireless data dissemination. Data disseminated
through broadcast channels can be simultaneously accessed by an arbitrary number of mobile
users, thus increasing the efficiency of bandwidth usage.
Communications Asymmetry
One key aspect of dissemination-based applications is their inherent communications
asymmetry. That is, the communication capacity or data volume in the downstream direction
(from servers-to-clients) is much greater than that in the upstream direction (from clients-to-
servers). Content delivery is an asymmetric process regardless of whether it is performed overa
symmetric channel such as the internet or over an asymmetric one, such as cable television
(CATV) network. Techniques and system architectures that can efficiently support asymmetric
applications will therefore be a requirement for futureuse.
Communication asymmetry in uplink and downlink and participation of device APIs and distributed
computing systemswhenanapplication runs
The above figure shows communication asymmetry in uplink and downlink in a mobile network.
The participation of device APIs and distributed computing systems in the running of an
application is also shown.
Push-based Mechanisms
The server pushes data records from a set of distributed computing systems. Examples are
advertisers or generators of traffic congestion, weather reports, stock quotes, and news reports.
The following figure shows a push-based data-delivery mechanism in which a server orcomputing
system pushes the data records from a set of distributed computing systems. The data records
are pushed to mobile devices by broadcasting without any demand. The push mode is also
known as publish-subscribe mode in which the data is pushed as per the subscription for a push
service by a user. The subscribed query for a data record is taken as perpetual query till the user
unsubscribe to that service. Data can also be pushed without user subscription.
Push-baseddata-delivery mechanism
The application-distribution system of the service provider uses these algorithms and adopts
bandwidths as per the number of subscribers for the published data records. On the device
handoff, the subscription cancels or may be passed on to new service provider system.
Advantagesof Pushbasedmechanisms:
The user-device or computing system pulls the data records from the service provider's
application database server or from a set of distributed computing systems. Examples are music
album server, ring tones server, video clips server, or bank account activity server. Records are
pulled by the mobile devices on demand followed by the selective response from the server.
Selective response means that server transmits data packets as response selectively, for
example, after client-authentication, verification, or subscription account check. The pull mode
is also known as the on-demand mode. The following figure shows a pull-based data-delivery
mechanism in which a device pulls (demands) from a server or computing system, the data
records generated by a set of distributed computing systems.
Mobile Computing Unit-4
Data Dissemination
PullbasedDelivery Mechanism
1. The bandwidth used for the uplink channel depends upon the number of pull requests.
2. A pull threshold is selected. This threshold limits the number of pull requests in a given
period of time. This controls the number of server interruptions.
3. A mechanism is adopted to prevent the device from pulling from a cell,
which has handed over the concerned device to another cell. On device
handoff, the subscription is cancelled or passed on to the new service provider
cell
In pull-based mechanisms the user-device receives data records sent by server on demand only.
Advantagesof Pullbasedmechanisms:
With pull-based mechanisms, no unsolicited or irrelevant data arrives at the device and
the relevant data is disseminated only when the user asks for it.
Pull-based mechanisms are the best option when the server has very little contention
and is able to respond to many device requests within expected timeintervals.
Disadvantages:
The server faces frequent interruptions and queues of requests at the server may cause
congestion in cases of sudden rise in demand for certain data record.
In on-demand mode, another disadvantage is the energy and bandwidth required for
sending the requests for hot items and temporal records
Mobile Computing Unit-4
Data Dissemination
Hybrid Mechanisms
A hybrid data-delivery mechanism integrates pushes and pulls. The hybrid mechanism is
also known as interleaved-push-and-pull (IPP) mechanism. The devices use the back channel to
send pull requests for records, which are not regularly pushed by the front channel. The front
channel uses algorithms modeled as broadcast disks and sends the generated interleaved responses
to the pull requests. The user device or computing system pulls as well receives the pushes of
the data records from the service provider's application server or database server or from a set
of distributed computing systems. Best example would be a system for advertising and selling
music albums. The advertisements are pushed and the mobile devices pull for buying the
album.
Hybrid interleaved push-pull-based data-delivery mechanism
The above figure shows a hybrid interleaved, push-pull-based data-delivery mechanism in
which a device pulls (demands) from a server and the server interleaves the responses along
with the pushes of the data records generated by a set of distributed computing systems.
Hybrid mechanisms function in the following manner:
1. There are two channels, one for pushes by front channel and the other for pulls by back
channel.
2. Bandwidth is shared and adapted between the two channels depending upon the
number of active devices receiving data from the server and the number of devices
requesting data pulls from the server.
3. An algorithm can adaptively chop the slowest level of the scheduled pushes successively
The data records at lower level where the records are assigned lower priorities can have
long push intervals in a broadcasting model.
Mobile Computing Unit-4
Data Dissemination
The number of server interruptions and queued requests are significantly reduced.
Disadvantages:
IPP does not eliminate the typical server problems of too many interruptions and
queued requests.
Another disadvantage is that adaptive chopping of the slowest level of scheduled pushes.
Selective tuning is a process by which client device selects only the required pushed
buckets or records, tunes to them, and caches them. Tuning means getting ready for caching at
those instants and intervals when a selected record of interest broadcasts. Broadcast data has a
structure and overhead. Data broadcast from server, which is organized into buckets, is
interleaved. The server prefixes a directory, hash parameter (from which the device finds the
key), or index to the buckets. These prefixes form the basis of different methods of selective tuning.
Access time (taccess) is the time interval between pull request from device and reception of
response from broadcasting or data pushing or responding server. Two important factors affect
taccess – (i) number and size of the records to be broadcast and (ii) directory- or cache-miss factor (if
there is a miss then the response from the server can be received only in subsequent broadcast
cycle or subsequent repeat broadcast in the cycle).
Directory Method
One of the methods for selective tuning involves broadcasting a directory as overhead at the
beginning of each broadcast cycle. If the interval between the start of the broadcast cycles is T,
then directory is broadcast at each successive intervals of T. A directory can be provided which
Mobile Computing Unit-4
Data Dissemination
specifies when a specific record or data item appears in data being broadcasted. For example, a
directory (at header of the cycle) consists of directory start sign, 10, 20, 52, directory end sign.
It means that after the directory end sign, the 10th, 20th and 52nd buckets contain the data
items in response to the device request. The device selectively tunes to these buckets from the
broadcast data.
A device has to wait for directory consisting of start sign, pointers for locating buckets or
records, and end sign. Then it has to wait for the required bucket or record before it can get
tuned to it and, start caching it. Tuning time ttune is the time taken by the device for selection of
records. This includes the time lapse before the device starts receiving data from the server. In
other words, it is the sum of three periods—time spent in listening to the directory signs and
pointers for the record in order to select a bucket or record required by the device, waiting for
the buckets of interest while actively listening (getting the incoming record wirelessly), and caching
the broadcast data record or bucket.
The device selectively tunes to the broadcast data to download the records of interest.
When a directory is broadcast along with the data records, it minimizes ttune and taccess. The
device saves energy by remaining active just for the periods of caching the directory and the data
buckets. For rest of the period (between directory end sign and start of the required bucket), it
remains idle or performs application tasks. Without the use of directory for tuning, ttune = taccess
and the device is not idle during any time interval.
Hash-Based Method
Hash is a result of operations on a pair of key and record. Advantage of broadcasting a hash is that
it contains a fewer bits compared to key and record separately. The operations are done by a
hashing function. From the server end the hash is broadcasted and from the device end a key
is extracted by computations from the data in the record by operating the data with a function
called hash function (algorithm). This key is called hash key.
Hash-based method entails that the hash for the hashing parameter (hash key) is
broadcasted. Each device receives it and tunes to the record as per the extracted key. In this
method, the records that are of interest to a device or those required by it are cached from the
broadcast cycle by first extracting and identifying the hash key which provides the location of
the record. This helps in tuning of the device. Hash-based method can be described asfollows:
record or remaining part of the record relative to the location of hash and,
thus, the time interval for wait before the record can be tuned and cached.
3. Assume that a broadcast cycle pushes the hashing parameters H(Rí) [H and
S] and record Rí. The functions H and S help in tuning to the H( Rí) and
hence to Rí as follows—H gives a key which in turn gives the location of
H(Rí) in the broadcast data. In case H generates a key that does not provide
the location of H(Rí) by itself, then the device computes the location from S
after the location of H(Rí). That location has the sequential records Rí and
the devices tunes to the records from these locations.
4. In case the device misses the record in first cycle, it tunes and caches that in
next or some other cycle.
Index-Based Method
Indexing is another method for selective tuning. Indexes temporarily map the location of the
buckets. At each location, besides the bits for the bucket in record of interest data, an offset
value may also be specified there. While an index maps to the absolute location from the
beginning of a broadcast cycle, an offset index is a number which maps to the relative location
after the end of present bucket of interest. Offset means a value to be used by the device along
with the present location and calculate the wait period for tuning to the next bucket. All
buckets have an offset to the beginning of the next indexed bucket or item.
Indexing is a technique in which each data bucket, record, or record block of interest is
assigned an index at the previous data bucket, record, or record block of interest to enable the
device to tune and cache the bucket after the wait as per the offset value. The server transmits
this index at the beginning of a broadcast cycle as well as with each bucket corresponding to
data of interest to the device. A disadvantage of using index is that it extends the broadcast cycle
and hence increases taccess.
The index I has several offsets and the bucket type and flag information. A typical index may
consist of the following:
1.
Ioffset(1) which defines the offset to first bucket of nearest index.
2.
Additional information about Tb, which is the time required for caching the
bucket bits in full after the device tunes to and starts caching the bucket.
This enables transmission of buckets of variable lengths.
3.
Ioffset (next) which is the index offset of next bucket record of interest.
Mobile Computing Unit-4
Data Dissemination
4.
Ioffset(end) which is the index offset for the end of broadcast cycle and the
start of next cycle. This enables the device to look for next index I after the
time interval as per Ioffset(end). This also permits a broadcast cycle to consist
of variable number of buckets.
5.
Itype, which provides the specification of the type of contents of next bucket
to be tuned, that is, whether it has an index value or data.
6.
A flag called dirty flag which contains the information whether the indexed
buckets defined by Ioffset(1) and Ioffset(next) are dirty or not. An indexed
bucket being dirty means that it has been rewritten at the server with new
values. Therefore, the device should invalidate the previous caches of these
buckets and update them by tuning to and caching them.
The advantage of having an index is that a device just reads it and selectively tunes to the
data buckets or records of interest instead of reading all the data records and then discarding
those which are not required by it. During the time intervals in which data which is not of
interest is being broadcast, the device remains in idle or power down mode.
Transmission of an index I only once with every broadcast cycle increases access latency of
a record as follows: This is so because if an index is lost during a push due to transmission loss,
then the device must wait for the next push of the same index-record pair. The data tuning time
now increases by an interval equal to the time required for one broadcast cycle. An index
assignment strategy (I, m) is now described. (I, m) indexing means an index I is transmitted m
times during each push of a record. An algorithm is used to adapt a value of m such that it
minimizes access (caching) latency in a given wireless environment which may involve frequent or
less frequent loss of index or data. Index format is adapted to (I, m) with a suitable value of m
chosen as per the wireless environment. This decreases the probability of missing I and hence
the caching of the record of interest
Indexing reduces the time taken for tuning by the client devices and thus conserves their power
resources. Indexing increases access latency because the number of items pushed is more
(equals m times index plus n records).
Distributed index-based method is an improvement on the (I, m) method. In this method, there
is no need to repeat the complete index again and again. Instead of replicating the whole index
m times, each index segment in a bucket describes only the offset I' of data items which
immediately follow. Each index I is partitioned into two parts—I' and I". I" consists of
Mobile Computing Unit-4
Data Dissemination
unrepeated k levels (sub-indexes), which do not repeat and I' consists of top I repeated levels
(sub-indexes).
Assume that a device misses I(includes I' and I' once) transmitted at the beginning of the
broadcast cycle. As I' is repeated m - I times after this, it tunes to the pushes by using I', The
access latency is reduced as I' has lesser levels.
Assume that a broadcast cycle has number of data segments with each of the segments
having a variable set of records. For example, let n records, Ro to Rn-1, be present in four data
segments, R() to Ri-1, Ri to Rj-1 , Rj to Rj-1 and Rk to Rn-1. Some possible index parameters are ( i )
Iseg, having just 2 bits for the offset, to specify the location of a segment in a broadcast cycle, (ii)
Irec, having just 6 bits for the offset, to specify the location of a record of interest within a
segment of the broadcast cycle, (iii) Ib, having just 4 bits for the offset, to specify the location of a
bucket of interest within a record present in one of the segments of the broadcast cycle. Flexible
indexing method provides dual use of the parameters (e.g., use of I seg or Irec in an index
segment to tune to the record or buckets of interest) or multi-parameter indexing (e.g., use of
Iseg, Irec, or Ib in an index segment to tune to the bucket of interest).
Assume that broadcast cycle has m sets of records (called segments). A set of binary bits
defines the index parameter Iseg,. A local index is then assigned to the specific record (or bucket).
Only local index (Irec or Ib) is used in (Iloc, m) based data tuning which corresponds to the case of
flexible indexing method being discussed. The number of bits in a local index is much smaller
than that required when each record is assigned an index. Therefore, the flexible indexing
method proves to bebeneficial.
Alternative Methods
Temporal Addressing Temporal addressing is a technique used for pushing in which
instead of repeating I several times, a temporal value is repeated before a data record is
transmitted. When temporal information contained in this value is used instead of address,
there can be effective synchronization of tuning and caching of the record of interest in case of
non- uniform time intervals between the successive bits. The device remains idle and starts tuning
by synchronizing as per the temporal (time)-information for the pushed record. Temporal
information gives the time at which cache is scheduled. Assume that temporal address is 25675
and each address corresponds to wait of 1 ms, the device waits and starts synchronizing the
record after 25675 ms.
Mobile Computing Unit-4
Data Dissemination
Use of Headers: A server can broadcast a data in multiple versions or ways. An index or
address only specifies where the data is located for the purpose of tuning. It does not specify
the details of data at the buckets. An alternative is to place a header or a header with an
extension with a data object before broadcasting. Header is used along with the pushed record.
The device uses header part in place of the index / and in case device finds from the header
that the record is of interest, it selects the object and caches it. The header can be useful, for
example it can give information about the type, version, and content modification data or
application for which it is targeted.
Mobile Computing Unit-4
Data Dissemination
The client’s access protocol for retrieving objects with key value
k is as follows:
1. Tune into the current bucket on the broadcast channel. Get the offset to the next index
segment.
2. Go to the doze mode and tune in at the broadcast of the next index segment.
3. Examine the tuple in the first bucket of the index segment. If the target object has been
missed, obtain the offset to the beginning of the next bcast and goto 2; otherwise goto
4.
4. Traverse the index and determine the offset to the target data bucket. This may be
accomplished by successive probes, by following the pointers in the multi-level index.
The client may doze off between two probes.
5. Tune in when the desired bucket is broadcast, and download it(and subsequent ones as
long as their key is k).
Advantage:
1. The index is entirely replicated m times; this increases the length of the broadcast cycle
and hence the average access time.
1/2
The optimal m value that gives minimal average access time is (data file size/index size) .
Mobile Computing Unit-4
Data Dissemination
There is actually no need to replicate the complete index between successive data blocks. It is
sufficient to make available only the portion of index related to the data buckets which follow
it. This is the approach adopted in all the subsequent indexing schemes.
Essentially, each index subtree whose root is a non-replicated root will appear once in
the whole bcast just in front of the set of data segments it indexes. On the other hand, the
nodes at the replicated levels are replicated at the beginning of the first broadcast of each of its
children nodes.
To facilitate selective tuning, each node contains meta-data that help in the traversal of
the trees. All non-replicated buckets contain pointers that will direct the search to the next
copy of its replicated ancestors. On the other hand, all replicated index buckets contain two
tuples that can direct the search to continue in the appropriate segments. The first tuple is a
pair(x, ptrbegin) that indicates that key values less than x have been missed and so search must
continue from the beginning of the next bcast(which is ptr begin buckets away). The second pair
(y, ptr) indicates that key values greater than or equal to y can be found ptr offset away. Clearly,
if the desired object has key value between x and y, the search can continue as in conventional
search operation.
Mobile Computing Unit-4
Data Dissemination
The client’s access protocol for retrieving objects with key value
k is as follows:
1. Tune to the current bucket of the bcast. Get the offset to the next index bucket, and
doze off.
2. Tune to the beginning of the designated bucket and examine the meta-data.
If the desired object has been missed, doze off till the beginning of the next
bcast. Goto 2.
If the desired object is not within the data segment covered by the index bucket,
doze off to the next higher level index bucket. Goto 3.
If the desired object is within the data segment covered by the index bucket,
goto 3.
3. Probe the designated index bucket and follow a sequence of pointers to determine
when the data bucket containing the target object will be broadcast. The client may
doze off in between two probes.
4. Tune in again when the bucket containing objects with key k is broadcast, and download
the bucket (and all subsequent buckets as long as they contain objects with key k).
Advantage:
1. Compared to (1, m) index scheme this scheme has lower access time and its tuning time
is also comparable to that of (1, m) index scheme.
Mobile Computing Unit-4
Data Dissemination
Suppose the file is organized into p segments. Then the global index at a segment, says,
has [log2i] (key, ptr) pairs, where i the number of segments in front of and including segment s,
key is an object key, and ptr is an offset. For the first entry, key is the key value of the first data
item in segment s and ptr is the offset to the beginning of the next version. Bold examining this
th
pair, the client will know if it has missed the data and if so wait till the next bcast. For the j
j-1 th
entry (j>1), key is the key value of the first data item in the ([log 2i/2 ] +1) segment following
segment s and ptr is the offset to the first data bucket of that segment.
The local index consists of m(key, ptr) pairs that essentially partition each segment
further into m+1 sections. For the first entry, key is the key value of the first data item of
section m+1 and ptr is the offset to that section. For the jth pair, key is the key value of the first
data item of section (m+1-j) and ptr is the offset to the first bucket of that section.
Hence, it is clear that the number of segments and the number of sections per segment
can affect the performance of the scheme. Increasing the number of segments or sections will
increase the length of the broadcast cycle and reduce the tuning time, and vice versa. Thus, the
scheme is flexible in the sense it can be tuned to fit an application’sneeds.
Mobile Computing Unit-4
Data Dissemination
The client’s access protocol for retrieving objects with key value
k is as follows:
1. Tune into the channel for a bucket, obtain the offset to the next index segment.
Doze off until the next index segment is broadcast.
2. Examine the global index entries. If the target object belongs to another segment,
get the offset; doze off for appropriate amount of time and goto 2.
3. Examine the local index entries. Obtain the offset to the section where the target data
is stored. Switch to doze mode for appropriate amount of time.
4. Examine objects in the data bucket for the desired object, and download the object.
ASSIGNMENT QUESTIONS
in
MANET’s.
Mobile Ad hoc NETworks (MANETs) are wireless networks which are characterized by dynamic
topologies and no fixed infrastructure. Each node in a MANET is a computer that may be
required to act as both a host and a router and, as much, may be required to forward packets
between nodes which cannot directly communicate with one another. Each MANET node has
much smaller frequency spectrum requirements that that for a node in a fixed infrastructure
network. A MANET is an autonomous collection of mobile users that communicate over
relatively bandwidth constrained wireless links. Since the nodes are mobile, the network
topology may change rapidly and unpredictably over time. The network is decentralized, where
all network activity including discovering the topology and delivering messages must be
executed by the nodes themselves, i.e., routing functionality will be incorporated into mobile
nodes.
A mobile ad hoc network is a collection of wireless nodes that can dynamically be set up
anywhere and anytime without using any pre-existing fixed networkinfrastructure.
MANET- Characteristics
Dynamic network topology
Bandwidth constraints and variable link capacity
Energy constrained nodes
Multi-hop communications
Limited security
Autonomous terminal
Distributed operation
Light-weight terminals
1
Mobile Computing Unit-5
Mobile Ad Hoc Networks (MANETs)
Properties of MANETs
MANET enables fast establishment of networks. When anew network is to be established,
the only requirement is to provide a new set of nodes with limited wireless communication
range. A node has limited capability, that is, it can connect only to the nodes which are
nearby. Hence it consumes limited power.
A MANET node has the ability to discover a neighboring node and service. Using a service
discovery protocol, a node discovers the service of a nearby node and communicates to a
remote node in the MANET.
MANET nodes have peer-to-peer connectivity among themselves.
MANET nodes have independent computational, switching (or routing), and communication
capabilities.
The wireless connectivity range in MANETs includes only nearest node connectivity.
The failure of an intermediate node results in greater latency in communicating with the
remote server.
Limited bandwidth available between two intermediate nodes becomes a constraint for the
MANET. The node may have limited power and thus computations need to be energy-
efficient.
There is no access-point requirement in MANET. Only selected access points are provided
for connection to other networks or other MANETs.
MANET nodes can be the iPods, Palm handheld computers, Smartphones, PCs, smart labels,
smart sensors, and automobile-embedded systems\
MANET nodes can use different protocols, for example, IrDA, Bluetooth, ZigBee, 802.11,
GSM, and TCP/IP.MANET node performs data caching, saving, andaggregation.
MANET mobile device nodes interact seamlessly when they move with the nearby wireless
nodes, sensor nodes, and embedded devices in automobiles so that the seamless connectivity
is maintained between the devices.
2
Mobile Computing Unit-5
Mobile Ad Hoc Networks (MANETs)
MANET challenges
To design a good wireless ad hoc network, various challenges have to be taken into account:
Dynamic Topology: Nodes are free to move in an arbitrary fashion resulting in the topology
changing arbitrarily. This characteristic demands dynamic configuration of the network.
Limited security: Wireless networks are vulnerable to attack. Mobile ad hoc networks are
more vulnerable as by design any node should be able to join or leave the network at any
time. This requires flexibility and higher openness.
Limited Bandwidth: Wireless networks in general are bandwidth limited. In an ad hoc
network, it is all the more so because there is no backbone to handle or multiplex higher
bandwidth
Routing: Routing in a mobile ad hoc network is complex. This depends on many factors,
including finding the routing path, selection of routers, topology, protocol etc.
Applications of MANETS
The set of applications for MANETs is diverse, ranging from small, static networks that are
constrained by power sources, to large-scale, mobile, highly dynamic networks. The design of
network protocols for these networks is a complex issue. Regardless of the application, MANETs
need efficient distributed algorithms to determine network organization, link scheduling, and
routing. Some of the main application areas of MANET’s are:
Military battlefield– soldiers, tanks, planes. Ad- hoc networking would allow the military
to take advantage of commonplace network technology to maintain an information
network between the soldiers, vehicles, and military information headquarters.
Mobile Computing Unit-5
Mobile Ad Hoc Networks (MANETs)
Routing in MANET’s
Routing in Mobile Ad hoc networks is an important issue as these networks do not have
fixed infrastructure and routing requires distributed and cooperative actions from all nodes in
the network. MANET’s provide point to point routing similar to Internet routing. The major
difference between routing in MANET and regular internet is the route discovery mechanism.
Internet routing protocols such as RIP or OSPF have relatively long converge times, which is
acceptable for a wired network that has infrequent topology changes. However, a MANET has
a rapid topology changes due to node mobility making the traditional internet routing protocols
inappropriate. MANET-specific routing protocols have been proposed, that handle topology
changes well, but they have large control overhead and are not scalable for large networks.
Another major difference in the routing is the network address. In internet routing, the network
address (IP address) is hierarchical containing a network ID and a computer ID on that network.
In contrast, for most MANET’s the network address is simply an ID of the node in the network
and is not hierarchical. The routing protocol must use the entire address to decide the next
hop.
Mobile Computing Unit-5
Mobile Ad Hoc Networks (MANETs)
• Reactive algorithms: maintain routes to destinations only when they are needed.
Examples are Dynamic Source Routing (DSR), Ad hoc-On demand distance Vector
(AODV), Temporally ordered Routing Algorithm (TORA), Associativity-Based Routing
(ABR) etc
only obtain route information when needed
Advantages: no overhead from periodic update, scalability as long as there is
only light traffic and low mobility.
Disadvantages: high route latency, route caching can reduce latency
• Hybrid algorithms: maintain routes to nearby nodes even if they are not needed and
maintain routes to far away nodes only when needed. Example is Zone Routing Protocol
(ZRP).
Which approach achieves a better trade-off depends on the traffic and mobilitypatterns.
6
Mobile Computing Unit-5
Mobile Ad Hoc Networks (MANETs)
7
Mobile Computing Unit-5
Mobile Ad Hoc Networks (MANETs)
The Dynamic Source Routing protocol (DSR) is a simple and efficient routing protocol designed
specifically for use in multi-hop wireless ad hoc networks of mobile nodes. DSR allows the
network to be completely self-organizing and self-configuring, without the need for any existing
network infrastructure or administration. The protocol is composed of the two main
mechanisms of "Route Discovery" and "Route Maintenance", which work together to allow
nodes to discover and maintain routes to arbitrary destinations in the ad hoc network. All
aspects of the protocol operate entirely on-demand, allowing the routing packet overhead of
DSR to scale automatically to only that needed to react to changes in the routes currently in
use.
Route discovery. If the source does not have a route to the destination in its route cache, it
broadcasts a route request (RREQ) message specifying the destination node for which the route
is requested. The RREQ message includes a route record which specifies the sequence of nodes
traversed by the message. When an intermediate node receives a RREQ, it checks to see if it is
already in the route record. If it is, it drops the message. This is done to prevent routing loops. If
the intermediate node had received the RREQ before, then it also drops the message. The
intermediate node forwards the RREQ to the next hop according to the route specified in the
header. When the destination receives the RREQ, it sends back a route reply message. If the
destination has a route to the source in its route cache, then it can send a route response
(RREP) message along this route. Otherwise, the RREP message can be sent along the reverse
route back to the source. Intermediate nodes may also use their route cache to reply to RREQs.
If an intermediate node has a route to the destination in its cache, then it can append the route
to the route record in the RREQ, and send an RREP back to the source containing this route.
This can help limit flooding of the RREQ. However, if the cached route is out-of-date, it can
result in the source receiving stale routes.
Route maintenance. When a node detects a broken link while trying to forward a packet to the
next hop, it sends a route error (RERR) message back to the source containing the link in error.
When an RERR message is received, all routes containing the link in error are deleted at that
node.
As an example, consider the following MANET, where a node S wants to send a packet to D, but
does not know the route to D. So, it initiates a route discovery. Source node S floods Route
Request (RREQ). Each node appends its own identifier when forwarding RREQ as shown below.
8
Mobile Computing Unit-5
Mobile Ad Hoc Networks (MANETs)
9
Mobile Computing Unit-5
Mobile Ad Hoc Networks (MANETs)
Destination D on receiving the first RREQ, sends a Route Reply (RREP). RREP is sent on a route
obtained by reversing the route appended to received RREQ. RREP includes the route from S to
D on which RREQ was received by node D.
Route Reply can be sent by reversing the route in Route Request (RREQ) only if links are
guaranteed to be bi-directional. If Unidirectional (asymmetric) links are allowed, then RREP may
need a route discovery from S to D. Node S on receiving RREP, caches the route included in the
RREP. When node S sends a data packet to D, the entire route is included in the packet header
{hence the name source routing}. Intermediate nodes use the source route included in a packet
to determine to whom a packet should be forwarded.
10
Mobile Computing Unit-5
Mobile Ad Hoc Networks (MANETs)
J sends a route error to S along route J-F-E-S when its attempt to forward the data packet S
(with route SEFJD) on J-D fails. Nodes hearing RERR update their route cache to remove link J-D
Advantages of DSR:
Routes maintained only between nodes who need to communicate-- reduces overhead
of route maintenance
Route caching can further reduce route discovery overhead
A single route discovery may yield many routes to the destination, due to intermediate
nodes replying from local caches
Disadvantages of DSR:
Packet header size grows with route length due to source routing
Flood of route requests may potentially reach all nodes in the network
Care must be taken to avoid collisions between route requests propagated by
neighboring nodes -- insertion of random delays before forwarding RREQ
Increased contention if too many route replies come back due to nodes replying using
their local cache-- Route Reply Storm problem. Reply storm may be eased by preventing
a node from sending RREP if it hears another RREP with a shorter route
An intermediate node may send Route Reply using a stale cached route, thus polluting
other caches
An optimization for DSR can be done called as Route Caching. Each node caches a new route it
learns by any means. In the above example, When node S finds route [S,E,F,J,D] to node D,
node S also learns route [S,E,F] to node F. When node K receives Route Request [S,C,G]
destined for node, node K learns route [K,G,C,S] to node S. When node F forwards Route Reply
RREP [S,E,F,J,D], node F learns route [F,J,D] to node D. When node E forwards Data [S,E,F,J,D] it
learns route [E,F,J,D] to node D. A node may also learn a route when it overhears Data packets.
Usage of Route cache can speed up route discovery and can also reduce propagation of route
11
Mobile Computing Unit-5
Mobile Ad Hoc Networks (MANETs)
requests. The disadvantages are, stale caches can adversely affect performance. With passage
of time and host mobility, cached routes may become invalid.
12
Mobile Computing Unit-5
Mobile Ad Hoc Networks (MANETs)
Mobile Computing Unit-5
Mobile Ad Hoc Networks (MANETs)
14
Mobile Computing Unit-5
Mobile Ad Hoc Networks (MANETs)
An intermediate node (not the destination) may also send a Route Reply (RREP) provided that it
knows a more recent path than the one previously known to sender S. To determine whether
the path known to an intermediate node is more recent, destination sequence numbers are
used. The likelihood that an intermediate node will send a Route Reply when using AODV is not
as high as DSR. A new Route Request by node S for a destination is assigned a higher
destination sequence number. An intermediate node which knows a route, but with a smaller
sequence number, cannot send Route Reply
When node X is unable to forward packet P (from node S to node D) on link (X,Y), it generates a
RERR message Node X increments the destination sequence number for D cached at node X.
The incremented sequence number N is included in the RERR. When node S receives the RERR,
it initiates a new route discovery for D using destination sequence number at least as large as
N. When node D receives the route request with destination sequence number N, node D will
set its sequence number to N, unless it is already larger than N.
15
Mobile Computing Unit-5
Mobile Ad Hoc Networks (MANETs)
Sequence numbers are used in AODV to avoid using old/broken routes and to determine which
route is newer. Also, it prevents formation of loops.
Assume that A does not know about failure of link C-D because
RERR sent by C is lost.
Now C performs a route discovery for D. Node A receives the
RREQ (say, via path C-E-A)
Neighboring nodes periodically exchange hello message and absence of hello message indicates
a link failure. When node X is unable to forward packet P (from node S to node D) on link (X,Y),
it generates a RERR message. Node X increments the destination sequence number for D
cached at node X. The incremented sequence number N is included in the RERR. When node S
receives the RERR, it initiates a new route discovery for D using destination sequence number
at least as large as N. When node D receives the route request with destination sequence
number N, node D will set its sequence number to N, unless it is already larger than N.
Another example for AODV protocol:
Assume node-1 want to send a msg to node-14 and does not know the route. So, it broadcasts
(floods) route request message, shown in red.
Node from which RREQ was received defines a reverse route to the source. (reverse routing
table entries shown in blue).
The route request is flooded through the network. Destination managed sequence number, ID
prevent looping. Also, flooding is expensive and creates broadcast collision problem.
16
Mobile Computing Unit-5
Mobile Ad Hoc Networks (MANETs)
Route request arrives at the destination node-14. Upon receiving, destination sends route reply
by setting a sequence number(shown in pink)
Routing table now contains forward route to the destination. Route reply follows reverse route
back to the source.
17
Mobile Computing Unit-5
Mobile Ad Hoc Networks (MANETs)
The route reply sets the forward table entries on its way back to the source.
Once the route reply reaches the source, it adopts the destination sequence number. Traffic
flows along the forward route. Forward route is refreshed and the reverse routes get timed out.
Suppose there has been a failure in one of the links. The node sends a return error message to
the source with incrementing the sequence number.
Once the source receives the route error, it re-initiates the route discoveryprocess.
18
Mobile Computing Unit-5
Mobile Ad Hoc Networks (MANETs)
A routing table entry maintaining a reverse path is purged after a timeout interval. Timeout
should be long enough to allow RREP to come back. A routing table entry maintaining a forward
path is purged if not used for a active_route_timeout interval. If no data is being sent using a
particular routing table entry, that entry will be deleted from the routing table (even if the
route may actually still be valid).
Cluster-head Gateway Switch Routing (CGSR)
The cluster-head gateway switch routing (CGSR) is a hierarchical routing protocol. It is a proactive
protocol. When a source routes the packets to destination, the routing tables are already
available at the nodes. A cluster higher in hierarchy sends the packets to the cluster lower in
hierarchy. Each cluster can have several daughters I and forms a tree-like structure in CGSR. CGSR
forms a cluster structure. The nodes aggregate into clusters using an appropriate algorithm.
The algorithm defines a cluster-head, the node used for connection to other clusters. It also
defines a gateway node which provides switching (communication) between two or more cluster-
heads. There will thus be three types of nodes— (i) internal nodes in a cluster which transmit
and receive the messages and packets through a cluster-head, (ii) cluster-head in each cluster
such that there is a cluster-head which dynamically schedules the route paths. It controls a
group of ad-hoc hosts, monitors broadcasting within the cluster, and forwards the messages to
another cluster-head, and (iii) gateway node to carry out transmission and reception of
messages and packets between cluster-heads of two clusters.
The cluster structure leads to a higher performance of the routing protocol as compared to
other protocols because it provides gateway switch-type traffic redirections and clusters
provide an effective membership of nodes for connectivity.
CGSR works as follow:
periodically, every nodes sends a hello message containing its ID and a monotonically
increasing sequence number
19
Mobile Computing Unit-5
Mobile Ad Hoc Networks (MANETs)
Using these messages, every cluster-head maintains a table containing the IDs of nodes
belonging to it and their most recent sequence numbers.
Cluster-heads exchange these tables with each other through gateways; eventually, each
node will have an entry in the affiliation table of each cluster-head. This entry shows the
node’s ID & cluster-head of that node.
Each cluster-head and each gateway maintains a routing table with an entry for every
cluster-head that shows the next gateway on the shortest path to that cluster head.
Disadvantages:
The same disadvantage common to all hierarchal algorithms related to cluster formation
and maintenance.
Hierarchal State Routing (HSR)
A hierarchal link state routing protocol that solves the location management problem found in
MMWN by using the logical subnets. A logical subnet is : a group of nodes that have common
characteristics (e.g. the subnet of students, the subnet of profs , employees etc. ). Nodes of the
same subnet do not have to be close to each other in the physical distance.
HSR procedure:
1. Based on the physical distance, nodes are grouped into clusters that are supervised by
cluster-heads. There are more than one level of clustering.
2. Every node has two addresses :
I. a hierarchal-ID ,(HID), composed of the node’s MAC address prefixed by the IDs
of its parent clusters.
II. a logical address in the form <subnet,host>.
3. Every logical subnet has a home agent, i.e. a node that keeps track of the HID of all
members of that subnet.
4. The HIDs of the home agents are known to all the cluster-heads, and the cluster-head
can translate the subnet part of the node’s logical address to the HID of the
corresponding home agent.
5. when a node moves to a new cluster, the head of the cluster detects it and informs the
node’s home agents about node’s new HID.
6. When a home agent moves to a new cluster, the head of the cluster detects it and
informs all other cluster-heads about the home agent’s new HID.
To start a session:
1. The source node informs its cluster-head about the logical address of the destination
node.
20
Mobile Computing Unit-5
Mobile Ad Hoc Networks (MANETs)
2. The cluster-head looks up the HID of the destination node’s home agent and uses it
to send query to the home agent asking about the destination's HID.
3. After knowing the destination’s HID, the cluster-head uses its topology map to
find a route to the destination’s cluster-head.
Disadvantages: cluster formation and maintenance.
The multipoint relays of each node, (MPR), is the minimal set of 1-hop
nodes that covers all 2- hop points.
The members of the MPR are the only nodes that can retransmit the link state
information in an attempt to limit the flood.
Security in MANET’s
Securing wireless ad-hoc networks is a highly challenging issue. Understanding possible form
of attacks is always the first step towards developing good security solutions. Security of
communication in MANET is important for secure transmission of information. Absence of
any central co-ordination mechanism and shared wireless medium makes MANET more
vulnerable
21
Mobile Computing Unit-5
Mobile Ad Hoc Networks (MANETs)
to digital/cyber attacks than wired network there are a number of attacks that affect MANET.
These attacks can be classified into two types:
1. External Attack: External attacks are carried out by nodes that do not belong to the network.
It causes congestion sends false routing information or causes unavailability of services.
2. Internal Attack: Internal attacks are from compromised nodes that are part of the network.
In an internal attack the malicious node from the network gains unauthorized access and
impersonates as a genuine node. It can analyze traffic between other nodes and may
participate in other network activities.
Denial of Service attack: This attack aims to attack the availability of a node or the entire
network. If the attack is successful the services will not be available. The attacker generally
uses radio signal jamming and the battery exhaustion method.
Impersonation: If the authentication mechanism is not properly implemented a malicious
node can act as a genuine node and monitor the network traffic. It can also send fake
routing packets, and gain access to some confidential information.
Eavesdropping: This is a passive attack. The node simply observes the confidential
information. This information can be later used by the malicious node. The secret
information like location, public key, private key, password etc. can be fetched by
eavesdropper.
Routing Attacks: The malicious node makes routing services a target because it’s an
important service in MANETs. There are two flavors to this routing attack. One is attack on
routing protocol and another is attack on packet forwarding or delivery mechanism. The
first is aimed at blocking the propagation of routing information to a node. The latter is
aimed at disturbing the packet delivery against a predefined path.
Black hole Attack:: In this attack, an attacker advertises a zero metric for all destinations
causing all nodes around it to route packets towards it.[9] A malicious node sends fake
routing information, claiming that it has an optimum route and causes other good nodes to
route data packets through the malicious one. A malicious node drops all packets that it
receives instead of normally forwarding those packets. An attacker listen the requests in a
flooding based protocol.
Wormhole Attack: In a wormhole attack, an attacker receives packets at one point in the
network, ―tunnels them to another point in the network, and then replays them into the
network from that point. Routing can be disrupted when routing control message are
tunnelled. This tunnel between two colluding attacks is known as a wormhole.
Replay Attack: An attacker that performs a replay attack are retransmitted the valid data
repeatedly to inject the network routing traffic that has been captured previously. This
attack usually targets the freshness of routes, but can also be used to undermine poorly
designed security solutions.
Mobile Computing Unit-5
Mobile Ad Hoc Networks (MANETs)
The Wireless Application Protocol (WAP) is an open, global specification that empowers mobile
users with wireless devices to easily access and interact with information and services instantly.
WAP is a global standard and is not controlled by any single company. Ericsson, Nokia,
Motorola, and Unwired Planet founded the WAP Forum in the summer of 1997 with the initial
purpose of defining an industry-wide specification for developing applications over wireless
communications networks. The WAP specifications define a set of protocols in application,
session, transaction, security, and transport layers, which enable operators, manufacturers, and
applications providers to meet the challenges in advanced wireless service differentiation and
fast/flexible service creation.
reliable, i.e., provision of a consistent and predictable platform for deploying services;
and
secure, i.e., preservation of the integrity of user data, protection of devices and services
from security problems.
Why Choose WAP?
In the past, wireless Internet access has been limited by the capabilities of handheld devices
and wireless networks.
WAP utilizes Internet standards such as XML, user datagram protocol (UDP), and Internet
protocol (IP). Many of the protocols are based on Internet standards such as hypertext
transfer protocol (HTTP) and TLS but have been optimized for the unique constraints of the
wireless environment: low bandwidth, high latency, and less connection stability.
Internet standards such as hypertext markup language (HTML), HTTP, TLS and transmission
control protocol (TCP) are inefficient over mobile networks, requiring large amounts of
mainly text-based data to be sent. Standard HTML content cannot be effectively displayed
on the small-size screens of pocket-sized mobile phones and pagers.
WAP utilizes binary transmission for greater compression of data and is optimized for long
latency and low bandwidth. WAP sessions cope with intermittent coverage and can operate
over a wide variety of wireless transports.
WML and wireless markup language script (WML Script) are used to produce WAP content.
They make optimum use of small displays, and navigation may be performed with one
hand. WAP content is scalable from a two-line text display on a basic device to a full graphic
screen on the latest smart phones and communicators.
The lightweight WAP protocol stack is designed to minimize the required bandwidth and
maximize the number of wireless network types that can deliver WAP content. Multiple
networks will be targeted, with the additional aim of targeting multiple networks. These
include global system for mobile communications (GSM) 900, 1,800, and 1,900 MHz; interim
standard (IS)–136; digital European cordless communication (DECT); time-division multiple
access (TDMA), personal communications service (PCS), FLEX, and code division multiple
access (CDMA). All network technologies and bearers will also be supported, including short
message service (SMS), USSD, circuit-switched cellular data (CSD), cellular digital packet
data (CDPD), and general packet radio service (GPRS).
As WAP is based on a scalable layered architecture, each layer can develop independently
of the others. This makes it possible to introduce new bearers or to use new transport
protocols without major changes in the other layers.
Mobile Computing Wireless Application Protocol (WAP)
Unit-5 Bluetooth, J2ME
WAP will provide multiple applications, for business and customer markets such as banking,
corporate database access, and a messaging interface.
WAP Architecture
The following figure gives an overview of the WAP architecture, its protocols and components,
and compares this architecture with the typical internet architecture when using the World
Wide Web. The basis for transmission of data is formed by different bearer services. WAP does
not specify bearer services, but uses existing data services and will integrate further services.
Examples are message services, such as short message service (SMS) of GSM, circuit-switched
data, such as high-speed circuit switched data (HSCSD) in GSM, or packet switched data, such as
general packet radio service (GPRS) in GSM. Many other bearers are supported, such as CDPD,
IS-136, PHS.
WDP: The WAP datagram protocol (WDP) and the additional Wireless control message protocol
(WCMP) is the transport layer that sends and receives messages via any available bearer
network, including SMS, USSD, CSD, CDPD, IS–136 packet data, and GPRS. The transport layer
Mobile Computing Wireless Application Protocol (WAP)
Unit-5 Bluetooth, J2ME
service access point (T-SAP) is the common interface to be used by higher layers independent
of the underlying network.
WTLS: The next higher layer, the security layer with its wireless transport layer security protocol
WTLS offers its service at the security SAP (SEC-SAP). WTLS is based on transport layer security
(TLS, formerly SSL, secure sockets layer). WTLS has been optimized for use in wireless networks
with narrow-band channels. It can offer data integrity, privacy, authentication, and (some)
denial-of-service protection.
WTP: The WAP transaction protocol (WTP) layer provides transaction support, adding reliability
to the datagram service provided by WDP at the transaction SAP(TR-SAP).
WSP: The session layer with the wireless session protocol (WSP) currently offers two services at
the session-SAP (S-SAP), one connection-oriented and one connectionless if used directly on
top of WDP. A special service for browsing the web (WSP/B) has been defined that offers
HTTP/1.1 functionality, long-lived session state, session suspend and resume, session migration
and other features needed for wireless mobile access to the web.
WAE: The application layer with the wireless application environment (WAE) offers a
framework for the integration of different www and mobile telephony applications.
Working of WAP
WAP does not always force all applications to use the whole protocol architecture. Applications
can use only a part of the architecture. For example, if an application does not require security
but needs the reliable transport of data, it can directly use a service of the transaction layer.
Simple applications can directly use WDP.
Mobile Computing Wireless Application Protocol (WAP)
Unit-5 Bluetooth, J2ME
Different scenarios are possible for the integration of WAP components into existing wireless
and fixed networks. On the left side, different fixed networks, such as the traditional internet
and the public switched telephone network (PSTN), are shown. One cannot change protocols
and services of these existing networks so several new elements will be implemented between
these networks and the WAP-enabled wireless, mobile devices in a wireless network on the
right-hand side.
WDP offers a consistent service at the Transport Service Access Point to the upper layer
protocol of WAP. This consistency of service allows for applications to operate transparently
over different available bearer services. WDP can be mapped onto different bearers, with
different characteristics. In order to optimise the protocol with respect to memory usage and
radio transmission efficiency, the protocol performance over each bearer may vary.
Mobile Computing Wireless Application Protocol (WAP)
Unit-5 Bluetooth, J2ME
WDP offers source and destination port numbers used for multiplexing and demultiplexing of
data respectively. The service primitive to send a datagram is TDUnitdata. req with the
destination address (DA), destination port (DP), Source address (SA), source port (SP), and
user data (UD) as mandatory parameters. Destination and source address are unique
addresses for the receiver and sender of the user data. These could be MSISDNs (i.e., a
telephone number), IP addresses, or any other unique identifiers. The T-DUnitdata.ind service
primitive indicates the reception of data. Here destination address and port are only optional
parameters.
Before data can be exchanged via WTLS, a secure session has to be established. This session
establishment consists of several steps: The following figure illustrates the sequence of service
primitives needed for a so-called ‘full handshake’.
The first step is to initiate the session with the SEC-Create primitive. Parameters are source
address (SA), source port (SP) of the originator, destinationaddress (DA), destination port
(DP) of the peer. The originator proposes a key exchange suite (KES) (e.g., RSA, DH, ECC), a
cipher suite (CS) (e.g., DES, IDEA ), and a compression method (CM). The peer answers with
parameters for the sequence number mode (SNM), the key refresh cycle (KR) (i.e., how
often keys are refreshed within this secure session), the session identifier (SID) (which is
unique with each peer), and the selected key exchange suite (KES’), cipher suite (CS’),
compression method (CM’). The peer also issues a SEC-Exchange primitive. This indicates
that the peer wishes to perform public-key authentication with the client, i.e., the peer
Mobile Computing Wireless Application Protocol (WAP)
Unit-5 Bluetooth, J2ME
requests a client certificate (CC) from the originator. The first step of the secure session
creation, the negotiation of the security parameters and suites, is indicated on the originator’s
side, followed by the request for a certificate. The originator answers with its certificate and
issues a SEC-Commit.req primitive. This primitive indicates that the handshake is completed
for the originator’s side and that the originator now wants to switch into the newly negotiated
connection state. The certificate is delivered to the peer side and the SEC-Commit is indicated.
The WTLS layer of the peer sends back a confirmation to the originator. This concludes the full
handshake for secure session setup.
The PDUs exchanged between two WTP entities for normal transactions are the invoke PDU,
ack PDU, and result PDU. A special feature of WTP is its ability to provide a user
acknowledgement or, alternatively, an automatic acknowledgement by the WTPentity.
WTP Class 0
Class 0 offers an unreliable transaction service without a result message. The transaction is
stateless and cannot be aborted. The service is requested with the TR-Invoke.req primitive as
shown below. Parameters are same as in WDP.
Additionally, with the A flag, the user of this service can determine, if the responder WTP entity
should generate an acknowledgement or if a user acknowledgement should be used. The WTP
layer will transmit the user data (UD) transparently to its destination. The class type C
indicates here class 0. Finally, the transaction handle H provides a simple index to uniquely
Mobile Computing Wireless Application Protocol (WAP)
Unit-5 Bluetooth, J2ME
identify the transaction and is an alias for the tuple (SA, SP, DA, DP), i.e., a socket pair, with only
local significance. The WTP entity at the initiator sends an invoke PDU which the responder
receives. The WTP entity at the responder then generates a TR-Invoke.ind primitive with the
same parameters as on the initiator’s side, except for H’ which is now the local handle for the
transaction on the responder’s side. WTP class 0 augments the transaction service with a simple
datagram like service for occasional use by higher layers.
WTP Class 1
Class 1 offers a reliable transaction service but without a result message. Again, the initiator
sends an invoke PDU after a TR-Invoke.req from a higher layer. This time, class equals ‘1’, and
no user acknowledgement has been selected as shown below.
The responder signals the incoming invoke PDU via the TR-Invoke.ind primitive to the higher
layer and acknowledges automatically without user intervention. For the initiator the
transaction ends with the reception of the acknowledgement. The responder keeps the
transaction state for some time to be able to retransmit the acknowledgement if it receives the
same invoke PDU again indicating a loss of the acknowledgement.
If a user of the WTP class 1 service on the initiator’s side requests a user acknowledgement on
the responder’s side, the sequence diagram looks like the following figure.
Mobile Computing Wireless Application Protocol (WAP)
Unit-5 Bluetooth, J2ME
Now the WTP entity on the responder’s side does not send an acknowledgement automatically,
but waits for the TR-Invoke.res service primitive from the user. This service primitive must
have the appropriate local handle H’ for identification of the right transaction. The WTP entity
can now send the ack PDU. Typical uses for this transaction class are reliable push services.
WTP Class 2
class 2 transaction service provides the classic reliable request/response transaction known
from many client/server scenarios. Depending on user requirements, many different scenarios
are possible for initiator/responder interaction. Three examples are presented below.
Example-1 scenario is shown below. A user on the initiator’s side requests the service and the
WTP entity sends the invoke PDU to the responder. The WTP entity on the responder’s side
indicates the request with the TR-Invoke.ind primitive to a user. The responder now waits for
the processing of the request, the user on the responder’s side can finally give the result UD* to
the WTP entity on the responder side using TR-Result.req. The result PDU can now be sent
back to the initiator, which implicitly acknowledges the invoke PDU.
The initiator can indicate the successful transmission of the invoke message and the result with
the two service primitives TR-Invoke.cnf and TR-Result.ind. A user may respond to this result
with TR-Result.res. An acknowledgement PDU is then generated which finally triggers the TR-
Result.cnf primitive on the responder’s side. This example clearly shows the combination of
Mobile Computing Wireless Application Protocol (WAP)
Unit-5 Bluetooth, J2ME
In example-2, the user on the responder’s side now explicitly responds to the Invoke PDU using
the TR-Invoke.res primitive, which triggers the TR-Invoke.cnf on the initiator’s side via an
ack PDU. The transmission of the result is also a confirmed service, as indicated by the next
four service primitives. This service will likely be the most common in standard
request/response scenarios as, e.g., distributedcomputing.
If the calculation of the result takes some time, the responder can put the initiator on “hold on”
to prevent a retransmission of the invoke PDU as the initiator might assume packet loss if no
result is sent back within a certain timeframe, which is shown above. After a time-out, the
responder automatically generates an acknowledgement for the Invoke PDU. This shows the
initiator that the responder is still alive and currently busy processing the request. After more
time, the result PDU can be sent to the initiator.
Session management: WSP introduces sessions that can be established from a client to
a server and may be long lived. Sessions can also be released in an orderly manner. The
capabilities of suspending and resuming a session are important to mobile applications.
Capability negotiation: Clients and servers can agree upon a common level of protocol
functionality during session establishment. Example parameters to negotiate are
maximum client SDU size, maximum outstanding requests, protocol options, and server
SDU size.
Content encoding: WSP also defines the efficient binary encoding for the content it
transfers. WSP offers content typing and composite objects, as explained for web
browsing.
While WSP is a general-purpose session protocol, WAP has specified the wireless session
protocol/browsing (WSP/B) which comprises protocols and services most suited for browsing-
type applications, which offers the following features adapted to web browsing.
existing session context, and a non-confirmed data push without an existing session
context.
Asynchronous requests: Optionally, WSP/B supports a client that can send multiple
requests to a server simultaneously. This improves efficiency for the requests and
replies can now be coalesced into fewer messages.
The first example of session establishment of WSP/B using WTS class 2 transactions is shown
below:
With the S-Connect.req primitive, a client can request a new session. Parameters are the
server address (SA), the client address (CA), and the optional client header (CH) and
requested capabilities (RC). The session layer directly uses the addressing scheme of the layer
below. WTP transfers the connect PDU to the server S-SAP where an S-Connect.ind primitive
indicates a new session. Parameters are the same, but now the capabilities are mandatory. If
the server accepts the new session it answers with an S-Connect.res, parameters are an
optional server header (SH) with the same function as the client header and the negotiated
capabilities (NC) needed for capability negotiation. WTP now transfers the connreply PDU
back to the client; S-Connect.cnf confirms the session establishment and includes the server
header (if present) and the negotiated capabilities from the server. WSP/B includes several
procedures to refuse a session or to abort session establishment.
Mobile Computing Wireless Application Protocol (WAP)
Unit-5 Bluetooth, J2ME
A very useful feature of WSP/B session suspension and session resume is shown below. A client
can suspend the session because of several reasons. Session suspension will automatically
abort all data transmission and freeze the current state of the session on the client and server
side. A client suspends a session with S-Suspend.req, WTP transfers the suspend PDU to the
server with a class 0 transaction, i.e., unconfirmed and unreliable. WSP/B will signal the
suspension with S-Suspend.ind on the client and server side. The only parameter is the reason
R for suspension. Reasons can be a user request or a suspension initiated by the service
provider.
Terminating a session is done by using the S-Disconnect.req service primitive as shown below.
This primitive aborts all current method or push transactions used to transfer data.
Disconnection is indicated on both sides using S-Disconnect.ind. The reason R for
disconnection can be, e.g., network error, protocol error, peer request, congestion, and
maximum SDU size exceeded.
The S-MethodInvoke primitive is used to request that an operation is executed by the server.
The result, if any, is sent back using the S-MethodResult primitive as shownbelow:
On the server’s side, S-MethodInvoke.ind indicates the request. In this case, a server
transaction identifier STID distinguishes between pending transactions. The server confirms
the request, so WSP/B does not generate a new PDU but relies on the lower WTP layer.
Similarly, the result of the request is sent back to the client using the SMethodResult primitive.
Additional parameters are now the status (S), the response header (RH), and the response
body (RB).
Mobile Computing Wireless Application Protocol (WAP)
Unit-5 Bluetooth, J2ME
WSP does not introduce PDUs or service primitives just for the sake of symmetric and aesthetic
protocol architecture. The following figure shows how WSP (thus also WSP/B) uses the
underlying WTP services for its purposes. The S-MethodInvoke.req primitive triggers the TR-
Invoke.req primitive, the parameters of the WSP layer are the user data of the WTP layer. The
invoke PDU of the WTP layer carries the method PDU of the WSP layer inside.
For the confirmation of its service primitives the WSP layer has none of its own PDUs but uses
the acknowledgement PDUs of the WTP layer. S-MethodInvoke.res triggers TR-Invoke.res,
the ack PDU is transferred to the initiator, here TR-Invoke.cnf confirms the invoke service
and triggers the S-MethodInvoke.cnf primitive which confirms the method invocation service.
This mingling of layers saves a lot of redundant data flow but still allows a separation of the
tasks between the two layers.
With the help of push primitives, a server can push data towards a client if allowed. The
simplest push mechanism is the non-confirmed push as shown below.
Mobile Computing Wireless Application Protocol (WAP)
Unit-5 Bluetooth, J2ME
The server sends unsolicited data with the S-Push.req primitive to the client. Parameters are
the push header (PH) and the push body (PB) again, these are the header and the body
known from HTTP. The unreliable, unconfirmed WTP class 0 transaction service transfers the
push PDU to the client where S-Push.ind indicates the push event.
A more reliable push service offers the S-ConfirmedPush primitive as shown below.
Here the server has to determine the push using a server push identifier (SPID). This helps to
distinguish between different pending pushes. The reliable WTP class 1 transaction service is
now used to transfer the confpush PDU to the client. On the client’s side a client push
identifier (CPID) is used to distinguish between different pendingpushes.
WSP/B as connectionless session service
WSP/B could be run on top of the connectionless, unreliable WDP service. As an alternative to
WDP, WTLS can always be used if security is required. The service primitives are directly
mapped onto each other. The following figure shows the three service primitives available for
connectionless session service: S-Unit-MethodInvoke.req to request an operation on a server,
S-Unit-MethodResult.req to return results to a client, and S-Unit-Push.req to push data onto
a client. Transfer of the PDUs (method, reply and push) is done with the help of the standard
unreliable datagram transfer service of WDP.
Besides the server address (SA), the client address (CA), the method (M), and the
request URI (RU), the user of the S-Unit-MethodInvoke.req primitive can determine a
transaction identifier (TID) to distinguish between different transactions on the user level. TID
is communicated transparently from service user to service user.
Mobile Computing Wireless Application Protocol (WAP)
Unit-5 Bluetooth, J2ME
The function of the S-Unit-MethodResult primitive remains the same as explained above: the
status (S), response header (RH), and response body (RB) represent the result of the
operation. The S-Unit-Push primitive has the parameters client address (CA), server address
(SA), push identifier (PID), push header (PH), and push body (PB).
The origin servers will respond to the request. The gateway now encodes the response
and its content (if there is any) and transfers the encoded response with the content to the
client. The WAE logical model not only includes this standard request/response scheme, but it
also includes push services. Then an origin server pushes content to the gateway. The gateway
encodes the pushed content and transmits the encoded push content to the client. Several user
agents can reside within a client. User agents include such items as: browsers, phonebooks,
message editors etc. WAE does not specify the number of user agents or their functionality, but
assumes a basic WML user agent that supports WML, WMLscript, or both (i.e., a ‘WML
browser’). However, one more user agent has been specified with its fundamental services, the
WTA user agent. This user agent handles access to, and interaction with, mobile telephone
features (such as call control). As over time many vendor dependent user agents may develop,
the standard defines a user agent profile (UAProf), which describes the capabilities of a user
agent.
WML follows a deck and card metaphor. A WML document is made up of multiple cards. Cards
can be grouped together into a deck. A WML deck is similar to an HTML page, in that it is
identified by a URL and is the unit of content transmission. A user navigates with the WML
browser through a series of WML cards, reviews the contents, enters requested data, makes
choices etc. The WML browser fetches decks as required from origin servers. Either these decks
can be static files on the server or they can be dynamically generated.WML describes the intent
of interaction in an abstract manner. The user agent on a handheld device has to decide how to
Mobile Computing Wireless Application Protocol (WAP)
Unit-5 Bluetooth, J2ME
best present all elements of a card. This presentation depends much on the capabilities of the
device.
WML script
WMLScript complements to WML and provides a general scripting capability in the WAP
architecture. While all WML content is static (after loading on the client), WMLScript offers
several capabilities not supported by WML:
Validity check of user input: before user input is sent to a server, WMLScript can check
the validity and save bandwidth and latency in case of an error.
Access to device facilities: WMLScript offers functions to access hardware components and
software functions of the device.
Local user interaction: Without introducing round-trip delays, WMLScript can directly and
locally interact with a user, show messages or prompt for input.
Extensions to the device software: With the help of WMLScript a device can be configured
and new functionality can be added even after deployment.
BLUETOOTH
"Bluetooth" was the nickname of Harald Blåtland II, king of Denmark from 940 to 981, who
united all of Denmark and part of Norway under his rule. Bluetooth is a proprietary open
wireless technology standard for exchanging data over short distances (using short wavelength
radio transmissions in the ISM band from 2400-2480 MHz) from fixed and mobile devices,
creating personal area networks (PANs) with high levels of security. The Bluetooth technology
aims at so-called ad-hoc piconets, which are local area networks with a very limited coverage
and without the need for an infrastructure.
Bluetooth Features
Bluetooth is wireless and automatic. You don't have to keep track of cables, connectors, and
connections, and you don't need to do anything special to initiate communications. Devices
find each other automatically and start conversing without user input, expect where
authentication is required; for example, users must log in to use their email accounts.
Bluetooth is inexpensive. Market analysts peg the cost to incorporate Bluetooth technology
into a PDA, cell phone, or other product at a minimum cost.
The ISM band that Bluetooth uses is regulated, but unlicensed. Governments have
converged on a single standard, so it's possible to use the same devices virtually wherever
you travel, and you don't need to obtain legal permission in advance to begin using the
technology.
Bluetooth handles both data and voice. Its ability to handle both kinds of transmissions
simultaneously makes possible such innovations as a mobile hands-free headset for voice
with applications that print to fax, and that synchronize the address books on your PDA,
your laptop, and your cell phone.
Signals are omni-directional and can pass through walls and briefcases. Communicating
devices don't need to be aligned and don't need an unobstructed line of sight like infrared.
Bluetooth uses frequency hopping. Its spread spectrum approach greatly reduces the risk
that communications will be intercepted.
Bluetooth Applications
File transfer.
Ad-hoc networking: Communicating devices can spontaneously form a community of
networks that persists only as long as it's needed
Mobile Computing Wireless Application Protocol (WAP)
Unit-5 Bluetooth, J2ME
The 802.11b protocol is designed to connect relatively large devices with lots of power and
speed, such as desktops and laptops, where devices communicate at up to 11 Mbit/sec, at
greater distances (up to 300 feet, or 100 meters). By contrast, Bluetooth is designed to connect
small devices like PDAs, mobile phones, and peripherals at slower speeds (1 Mbit/sec), within a
shorter range (30 feet, or 10 meters), which reduces power requirements. Another major
difference is that 802.11b wasn't designed for voice communications, while any Bluetooth
connection can support both data and voice communications.
User scenarios
Many different user scenarios can be imagined for wireless piconets or WPANs:
Connection of peripheral devices: Today, most devices are connected to a desktop computer
via wires (e.g., keyboard, mouse, joystick, headset, speakers). This type of connection has
several disadvantages: each device has its own type of cable, different plugs are needed, wires
block office space. In a wireless network, no wires are needed for data transmission. However,
batteries now have to replace the power supply, as the wires not only transfer data but also
supply the peripheral devices with power.
Support of ad-hoc networking: Imagine several people coming together, discussing issues,
exchanging data (schedules, sales figures etc.). For instance, students might join a lecture, with
the teacher distributing data to their personal digital assistants (PDAs). Wireless networks can
support this type of interaction; small devices might not have WLAN adapters following the IEEE
802.11 standard, but cheaper Bluetooth chips built in.
Bridging of networks: Using wireless piconets, a mobile phone can be connected to a PDA or
laptop in a simple way. Mobile phones will not have full WLAN adapters built in, but could have
a Bluetooth chip. The mobile phone can then act as a bridge between the local piconet and,
e.g., the global GSM network.
Mobile Computing Wireless Application Protocol (WAP)
Unit-5 Bluetooth, J2ME
Networking in Bluetooth
Bluetooth operates on 79 channels in the 2.4 GHz band with 1 MHz carrier spacing. Each device
performs frequency hopping with 1,600 hops/s in a pseudo random fashion. A piconet is a
collection of Bluetooth devices which are synchronized to the same hopping sequence. One
device in the piconet can act as master (M), all other devices connected to the master must act
as slaves (S). The master determines the hopping pattern in the piconet and the slaves have to
synchronize to this pattern. Each piconet has a unique hopping pattern. If a device wants to
participate it has to synchronize to this. A typical piconet is shown below:
Parked devices (P) can not actively participate in the piconet (i.e., they do not have a
connection), but are known and can be reactivated within some milliseconds. Devices in stand-
by (SB) do not participate in the piconet. Each piconet has exactly one master and up to seven
simultaneous slaves. More than 200 devices can be parked. The first step in forming a piconet
involves a master sending its clock and device ID. All the Bluetooth devices have the same
capability to become a master or a slave and two or three devices are sufficient to form a
piconet. The unit establishing the piconet automatically becomes the master, all other devices
will be slaves. The hopping pattern is determined by the device ID, a 48-bit worldwide unique
identifier.
The phase in the hopping pattern is determined by the master’s clock. After adjusting
the internal clock according to the master a device may participate in the piconet. All active
devices are assigned a 3-bit active member address (AMA). All parked devices use an 8-bit
parked member address (PMA). Devices in stand-by do not need an address.
Mobile Computing Wireless Application Protocol (WAP)
Unit-5 Bluetooth, J2ME
A device in one piconet can communicate to another device in another piconet, forming a
scatternet. A master in one piconet may be a slave in another piconet. Both piconets use a
different hopping sequence, always determined by the master of the piconet. Bluetooth applies
FH-CDMA for separation of piconets. A collision occurs if two or more piconets use the same
carrier frequency at the same time. This
will probably happen as the hopping
sequences are not coordinated. If a device
wants to participate in more than one
piconet, it has to synchronize to the
hopping sequence of the piconet it wants
to take part in. If a device acts as slave in
one piconet, it simply starts to
synchronize with the hopping sequence of
the piconet it wants to join. After
synchronization, it acts as a slave in this
piconet and no longer participates in its
former piconet. To enable
synchronization, a slave has to know the
identity of the master that determines the
hopping sequence of a piconet. Before
leaving one piconet, a slave informs the current master that it will be unavailable for a certain
amount of time. The remaining devices in the piconet continue to communicate as usual.
Bluetooth Protocol Stack
The Bluetooth protocol stack can be divided into a core specification, which describes the
protocols from physical layer to the data link control together with management functions, and
profile specifications describing many protocols and functions needed to adapt the wireless
Bluetooth technology to legacy and new applications.
A high-level view of the architecture is shown. The responsibilities of the layers in this stack are
as follows:
The radio layer is the physical wireless connection. To avoid interference with other devices
that communicate in the ISM band, the modulation is based on fast frequency hopping.
Bluetooth divides the 2.4 GHz frequency band into 79 channels 1 MHz apart (from 2.402 to
2.480 GHz), and uses this spread spectrum to hop from one channel to another, up to 1600
Mobile Computing Wireless Application Protocol (WAP)
Unit-5 Bluetooth, J2ME
Bluetooth
Protocol Stack
The baseband layer is responsible for controlling and sending data packets over the radio
link. It provides transmission channels for both data and voice. The baseband layer
maintains Synchronous Connection-Oriented (SCO) links for voice and Asynchronous
Connectionless (ACL) links for data. SCO packets are never retransmitted but ACL packets
are, to ensure data integrity. SCO links are point-to-point symmetric connections, where
time slots are reserved to guarantee timely transmission. A slave device is allowed to
respond during the time slot immediately following an SCO transmission from the master. A
master can support up to three SCO links to a single slave or to multiple slaves, and a single
slave can support up to two SCO links to different slaves. Data transmissions on ACL links,
on the other hand, are established on a per-slot basis (using slots not reserved for SCO
links). ACL links support point-to-multipoint transmissions. After an ACL transmission from
the master, only a slave addressed specifically may respond during the next time slot; if no
device is addressed, the message is treated as a broadcast.
The Link Manager Protocol (LMP) uses the links set up by the baseband to establish
connections and manage piconets. Responsibilities of the LMP also include authentication
and security services, and monitoring of service quality.
The Host Controller Interface (HCI) is the dividing line between software and hardware. The
L2CAP and layers above it are currently implemented in software, and the LMP and lower
layers are in hardware. The HCI is the driver interface for the physical bus that connects
these two components. The HCI may not be required. The L2CAP may be accessed directly
Mobile Computing Wireless Application Protocol (WAP)
Unit-5 Bluetooth, J2ME
by the application, or through certain support protocols provided to ease the burden on
application programmers.
The Logical Link Control and Adaptation Protocol (L2CAP) receives application data and
adapts it to the Bluetooth format. Quality of Service (QoS) parameters are exchanged at this
layer.
Link Manager Protocol
The link manager protocol (LMP) manages various aspects of the radio link between a master
and a slave and the current parameter setting of the devices. LMP enhances baseband
functionality, but higher layers can still directly access the baseband. The following groups of
functions are covered by the LMP:
Bluetooth defines several low-power states for a device. The following figure shows the major
states of a Bluetooth device and typical transitions. Every device, which is currently not
participating in a piconet (and not switched off), is in standby mode. This is a low-power mode
where only the native clock is running. The next step towards the inquiry mode can happen in
two different ways. Either a device wants to establish a piconet or a device just wants to listen
to see if something is going on.
If the inquiry was successful, a device enters the page mode. The inquiry phase is not
coordinated, so it may take a while before the inquiry is successful. After a while, a Bluetooth
device sees all the devices in its radio range.
Mobile Computing Wireless Application Protocol (WAP)
Unit-5 Bluetooth, J2ME
During the page state two different roles are defined. After finding all required devices the
master is able to set up connections to each device, i.e., setting up a piconet. As soon as a
device synchronizes to the hopping pattern of the piconet it also enters the connection state.
The connection state comprises the active state and the low power states: park, sniff, and hold.
In the active state the slave participates in the piconet by listening, transmitting, and receiving.
ACL and SCO links can be used. A master periodically synchronizes with all slaves. All devices
being active must have the 3-bit active member address (AMA). To save battery power, a
Bluetooth device can go into one of three low power states:
Sniff state: The sniff state has the highest power consumption of the low power states.
Here, the device listens to the piconet at a reduced rate (not on every other slot as is the
case in the active state). The interval for listening into the medium can be programed and is
application dependent. The master designates a reduced number of slots for transmission
to slaves in sniff state. However, the device keeps its AMA.
Hold state: The device does not release its AMA but stops ACL transmission. A slave may
still exchange SCO packets. If there is no activity in the piconet, the slave may either reduce
power consumption or participate in another piconet.
Park state: In this state the device has the lowest duty cycle and the lowest power
consumption. The device releases its AMA and receives a parked member address (PMA).
The device is still a member of the piconet, but gives room for another device to become
active (AMA is only 3 bit, PMA 8 bit). Parked devices are still FH synchronized and wake up
at certain beacon intervals for re-synchronization. All PDUs sent to parked slaves are
broadcast.
L2CAP
The logical link control and adaptation protocol (L2CAP) is a data link control protocol on top of
the baseband layer offering logical channels between Bluetooth devices with QoS properties.
L2CAP is available for ACLs only.
L2CAP provides three different types of logical channels that are transported via the ACL
between master and slave:
Connectionless: These unidirectional channels are typically used for broadcasts from a
master to its slave(s).
Connection-oriented: Each channel of this type is bi-directional and supports QoS flow
specifications for each direction. These flow specs follow RFC 1363 and define average/peak
data rate, maximum burst size, latency, and jitter.
Mobile Computing Wireless Application Protocol (WAP)
Unit-5 Bluetooth, J2ME
Signaling: This third type of logical channel is used to exchanging signaling messages
between L2CAP entities.
Each channel can be identified by its channel identifier (CID). Signaling channels always use a
CID value of 1, a CID value of 2 is reserved for connectionless channels. For connection-oriented
channels a unique CID (>= 64) is dynamically assigned at each end of the channel to identify the
connection.
The following figure shows the three packet types belonging to the three logical channel types.
The length field indicates the length of the payload (plus PSM for connectionless PDUs). The
CID has the multiplexing/demultiplexing function. For connectionless PDUs a protocol/service
multiplexor (PSM) field is needed to identify the higher layer recipient for the payload. For
connection-oriented PDUs the CID already fulfills this function. Several PSM values have been
defined, e.g., 1 (SDP), 3 (RFCOMM), 5 (TCS-BIN). Values above 4096 can be assigned
dynamically. The payload of the signaling PDU contains one or more commands. Each
command has its own code (e.g., for command reject, connection request, disconnection
response etc.) and an ID that matches a request with its reply. The length field indicates the
length of the data field for this command.
Besides protocol multiplexing, flow specification, and group management, the L2CAP layer also
provides segmentation and reassembly functions. Depending on the baseband capabilities,
large packets have to be chopped into smaller segments.
Mobile Computing Wireless Application Protocol (WAP)
Unit-5 Bluetooth, J2ME
Security
The main security features offered by Bluetooth include a challenge response routine for
authentication, a stream cipher for encryption, and a session key generation. Each connection
may require a one-way, two-way, or no authentication using the challenge-response routine.
The security algorithms use the public identity of a device, a secret private user key, and an
internally generated random key as input parameters. For each transaction, a new random
number is generated on the Bluetooth chip. Key management is left to higher layer software.
The following figure shows several steps in the security architecture of Bluetooth.
Based on the link key, and again a random number an encryption key is generated
during the encryption stage of the security architecture. This key has a maximum size of 128
bits and can be individually generated for each transmission. Based on the encryption key, the
device address and the current clock a payload key is generated for ciphering user data. The
payload key is a stream of pseudo-random bits. The ciphering process is a simple XOR of the
user data and the payload key.
All Bluetooth-enabled devices must implement the Generic Access Profile, which contains all
the Bluetooth protocols and possible devices. This profile defines a security model that includes
three security modes:
Though Bluetooth offers a better security than WER in 802.11, it has several limitations. The
PIN’s are often fixed and some keys are permanently stored on the devices. The quality of the
random number generators has not been specified.
SDP
To find new services available in the radio proximity, Bluetooth defined the service discovery
protocol (SDP). SDP defines only the discovery of services, not their usage. Discovered services
can be cached and gradual discovery is possible. All the information an SDP server has about a
service is contained in a service record. This consists of a list of service attributes and is
identified by a 32-bit service record handle.
A service attribute consists of an attribute ID and an attribute value. The 16-bit attribute
ID distinguishes each service attribute from other service attributes within a service record. The
attribute ID also identifies the semantics of the associated attribute value. The attribute value
can be an integer, a UUID (universally unique identifier), a string, a Boolean, a URL (uniform
resource locator) etc.
Mobile Computing Wireless Application Protocol (WAP)
Unit-5 Bluetooth, J2ME
Bluetooth Profiles
Bluetooth profiles are intended to ensure interoperability among Bluetooth-enabled devices
and applications from different manufacturers and vendors. A profile defines the roles and
capabilities for specific types of applications. Profiles represent default solutions for a certain
usage model. They use a selection of protocols and parameter set to form a basis for
interoperability. Protocols can be seen as horizontal layers while profiles are vertical slices as
shown below:
The following basic profiles have been specified: generic access, service discovery, cordless
telephony, intercom, serial port, headset, dialup networking, fax, LAN access, generic object
exchange, object push, file transfer, and synchronization. Additional profiles are: advanced
audio distribution, PAN, audio video remote control, basic printing, basic imaging, extended
service discovery, generic audio video distribution, hands-free, and hardcopy cable
replacement. Some of the profiles are given below:
The Generic Access Profile defines connection procedures, device discovery, and link
management. It also defines procedures related to use of different security models and
common format requirements for parameters accessible on the user interface level. At a
minimum all Bluetooth devices must support this profile.
The Service Discovery Application and Profile defines the features and procedures for an
application in a Bluetooth device to discover services registered in other Bluetooth devices,
and retrieves information related to the services.
The Serial Port Profile defines the requirements for Bluetooth devices that need to set up
connections that emulate serial cables and use the RFCOMM protocol.
The LAN Access Profile defines how Bluetooth devices can access the services of a LAN using
PPP, and shows how PPP mechanisms can be used to form a network consisting of
Bluetooth devices.
Mobile Computing Wireless Application Protocol (WAP)
Unit-5 Bluetooth, J2ME
The Synchronization Profile defines the application requirements for Bluetooth devices that
need to synchronize data on two or more devices.
While connected consumer devices such as cell phones, pagers, personal organizers and set-top
boxes have many things in common, they are also diverse in form, function and features.
Information appliances tend to be special-purpose, limited-function devices. To address this
diversity, an essential requirement for J2ME is not only small size but also modularity and
customizability. The J2ME architecture is modular and scalable so that it can support the kinds
of flexible deployment demanded by the consumer and embedded markets. To support this
kind of customizability and extensibility, two essential concepts are defined by J2ME:
class libraries that are far more domain-specific than the class libraries provided in a
configuration.
Configurations
A configuration is a subset of profile. A configuration defines a Java platform for a “horizontal”
category or grouping of devices with similar requirements on total memory budget and other
hardware capabilities. More specifically, aconfiguration:
is used with the C virtual machine (CVM) and is used for 32-bit architectures requiring more
than 2 MB of memory.
J2ME Universe
Mobile Computing Wireless Application Protocol (WAP)
Unit-5 Bluetooth, J2ME
Profiles
The J2ME framework provides the concept of a profile to make it possible to define Java
platforms for specific vertical markets. Profiles can serve two distinct portability requirements:
A profile provides a complete toolkit for implementing applications for a particular kind
of device, such as a pager, set-top box, cell phone, washing machine, or interactive
electronic toy.
A profile may also be created to support a significant, coherent group of applications
that might be hosted on several categories of devices.
Foundation profile contains APIs of J2SE without GUIs. PersonalProfile is profile for embedded
devices. Two profiles have been defined for J2ME and are built on CLDC: KJava and Mobile
Information Device Profile (MIDP). These profiles are geared toward smaller devices.
MIDP 3.0 is the latest profile version, which is a profile for special-featured phones and
handheld devices. It provides improved UI’s, UI extensibility and interoperability between the
devices. It supports multiple network interfaces in a device, IPv6, large display devices and high
performance games. Development tools are used to develop MIDP applications. MIDP
applications are composed of two parts:
JAR File – Contains all of the classes and resources used by the application
JAD File – Application descriptor, describes how to run the MIDP application
1 Java.lang standard java types and classes for String, Integer, Math, Thread,
Security and Exception
2 Java.io Standard java types and classes for input and output streams
4 Javax.microedition.rms A record management system (RMS) API to retrieve and save data
and limited querying capability
K Virtual Machine
The KVM is a compact, portable Java virtual machine specifically designed from
the ground up for small, resource-constrained devices. The high-level design goal
for the KVM was to create the smallest possible “complete” Java virtual machine
that would maintain all the central aspects of the Java programming language, but
would run in a resource-constrained device with only a few hundred kilobytes total
memory budget. More specifically, the KVM was designed to be:
small, with a static memory footprint of the virtual machine core in the
range of 40 kilobytes to 80 kilobytes (depending on compilation options and
the target platform,)
clean, well-commented, and highly portable,
modular and customizable, as “complete” and “fast” as possible without
sacrificing the other design goals.
The “K” in KVM stands for “kilo.” It was so named because its memory budget is
measured in kilobytes (whereas desktop systems are measured in megabytes). KVM
is suitable for 16/32-bit RISC/CISC microprocessors with a total memory budget of
no more than a few hundred kilobytes (potentially less than 128 kilobytes). This
typically applies to digital cellular phones, pagers, personal organizers, and small
retail payment terminals.
ASSIGNMENT QUESTIONS
4. Explain Bluetooth