Docsity

mobile computing mobile computing mobile computing mobile computing v v v , Lecture notes of Computer Science

Toggle sidebar
bg1
IT1402 -MOBILE COMPUTING
UNIT V
TRANSPORT AND APPLICATION LAYERS
Traditional TCP – Classical TCP improvements – WAP, WAP 2.0.
TRADITIONAL TCP
TCP is an alternative transport layer protocol over IP.
•TCP provides:
•Connection-oriented
•Reliable
•Full-duplex
•Byte-Stream
Connection-Oriented
•Connection oriented means that a virtual connection is established before any user data is transferred.
•If the connection cannot be established - the user program is notified.
•If the connection is ever interrupted - the user program(s) is notified.
Reliable
•Reliable means that every transmission of data is acknowledged by the receiver.
•If the sender does not receive acknowledgement within a specified amount of time, the sender retransmits
the data
Byte Stream
•Stream means that the connection is treated as a stream of bytes.
•The user application does not need to package data in individual datagrams (as with UDP).
Buffering
•TCP is responsible for buffering data and determining when it is time to send a datagram.
•It is possible for an application to tell TCP to send the data it has buffered without waiting for a buffer to fill
up.
Full Duplex
•TCP provides transfer in both directions.
•To the application program these appear as 2 unrelated data streams, although TCP can piggyback control
and data communication by providing control information (such as an ACK) along with user data.
TCP Ports
•Interprocess communication via TCP is achieved with the use of ports (just like UDP).
PAGE 12
Vasantha Kumar .V Lecturer CSE
pf3
pf4
pf5
pf8
pf9
pfa
pfd

Partial preview of the text

Download mobile computing mobile computing mobile computing mobile computing v v v and more Lecture notes Computer Science in PDF only on Docsity!

IT1402 -MOBILE COMPUTING

UNIT V

TRANSPORT AND APPLICATION LAYERS

Traditional TCP – Classical TCP improvements – WAP, WAP 2.0.

TRADITIONAL TCP

TCP is an alternative transport layer protocol over IP.

• TCP provides:

• Connection-oriented

• Reliable

• Full-duplex

• Byte-Stream

Connection-Oriented

• Connection oriented means that a virtual connection is established before any user data is transferred.

• If the connection cannot be established - the user program is notified.

• If the connection is ever interrupted - the user program(s) is notified.

Reliable

• Reliable means that every transmission of data is acknowledged by the receiver.

• If the sender does not receive acknowledgement within a specified amount of time, the sender retransmits

the data

Byte Stream

• Stream means that the connection is treated as a stream of bytes.

• The user application does not need to package data in individual datagrams (as with UDP ).

Buffering

• TCP is responsible for buffering data and determining when it is time to send a datagram.

• It is possible for an application to tell TCP to send the data it has buffered without waiting for a buffer to fill

up.

Full Duplex

• TCP provides transfer in both directions.

• To the application program these appear as 2 unrelated data streams, although TCP can piggyback control

and data communication by providing control information (such as an ACK) along with user data.

TCP Ports

• Interprocess communication via TCP is achieved with the use of ports (just like UDP).

PAGE 12

• UDP ports have no relation to TCP ports (different name spaces).

TCP Segments

• The chunk of data that TCP asks IP to deliver is called a TCP segment.

• Each segment contains:

• data bytes from the byte stream

• control information that identifies the data bytes

TCP Lingo

• When a client requests a connection it sends a “SYN” segment (a special TCP segment) to the server port.

• SYN stands for synchronize. The SYN message includes the client’s ISN.

• ISN is Initial Sequence Number.

• Every TCP segment includes a Sequence Number that refers to the first byte of data included in the

segment.

• Every TCP segment includes an Acknowledgement Number that indicates the byte number of the next data

that is expected to be received.

• All bytes up through this number have already been received.

• There are a bunch of control flags:

• URG: urgent data included.

• ACK: this segment is (among other things) an acknowledgement.

• RST: error – connection must be reset.

• SYN: synchronize Sequence Numbers (setup)

• FIN: polite connection termination

• MSS: Maximum segment size (A TCP option)

• Window: Every ACK includes a Window field that tells the sender how many bytes it can send before the

receiver will have to toss it away (due to fixed buffer size).

CLASSICAL TCP IMPROVEMENTS

TCP Connection Creation

• Programming details later - for now we are concerned with the actual communication.

• A server accepts a connection.

• Must be looking for new connections!

• A client requests a connection.

• Must know where the server is!

Client Starts

• A client starts by sending a SYN segment with the following information:

• Client’s ISN (generated pseudo-randomly)

• Maximum Receive Window for client.

• Optionally (but usually) MSS (largest datagram accepted).

• No payload! (Only TCP headers)

PAGE 12

ACKs

• A receiver doesn’t have to ACK every segment (it can ACK many segments with a single ACK segment).

• Each ACK can also contain outgoing data (piggybacking).

• If a sender doesn’t get an ACK after some time limit, it resends the data.

TCP Segment Order

• Most TCP implementations will accept out-of-order segments (if there is room in the buffer).

• Once the missing segments arrive, a single ACK can be sent for the whole thing.

• Remember: IP delivers TCP segments, and IP is not reliable - IP datagrams can be lost or arrive out of order.

Termination

• The TCP layer can send a RST segment that terminates a connection if something is wrong.

• Usually the application tells TCP to terminate the connection politely with a FIN segment.

TCP Sockets Programming

• Creating a passive mode (server) socket.

• Establishing an application-level connection.

• Sending/receiving data.

• Terminating a connection.

Establishing a passive mode TCP socket

Passive mode:

• Address already determined.

• Tell the kernel to accept incoming connection requests directed at the socket address.

• 3-way handshake

• Tell the kernel to queue incoming connections for us.

Accepting an incoming connection

• Once we start listening on a socket, the O.S. will queue incoming connections

• Handles the 3-way handshake

• Queues up multiple connections.

• When our application is ready to handle a new connection, we need to ask the O.S. for the next connection.

Terminating a TCP connection

• Either end of the connection can call the close() system call.

• If the other end has closed the connection, and there is no buffered data, reading from a TCP socket returns

0 to indicate EOF

PAGE 12

Client Code

• TCP clients can connect to a server, which:

• takes care of establishing an endpoint address for the client socket.

• don’t need to call bind first, the O.S. will take care of assigning the local endpoint address

(TCP port number, IP address).

• Attempts to establish a connection to the specified server.

• 3-way handshake

Reading from a TCP socket

• By default read() will block until data is available.

• Reading from a TCP socket may return less than max bytes (whatever is available).

• You must be prepared to read data 1 byte at a time!

WIRELESS APPLICATION PROTOCOL (WAP)

• Empowers mobile users with wireless devices to easily access and interact with information and services.

• A “standard” created by wireless and Internet companies to enable Internet access from a cellular phone

WAP: Main Features

• Browser

• “Micro browser”, similar to existing web browsers

• Markup language

• Similar to HTML, adapted to mobile devices

• Script language

• Similar to Javascript, adapted to mobile devices

• Gateway

• Transition from wireless to wired world

• Server

• “Wap/Origin server”, similar to existing web servers

• Protocol layers

• Transport layer, security layer, session layer etc.

• Telephony application interface

• Access to telephony functions

I

PAGE 12

WAP Stack

• WAE (Wireless Application Environment):

• Architecture: application model, browser, gateway, server

• WML: XML-Syntax, based on card stacks, variables, ...

• WTA: telephone services, such as call control, phone book etc.

• WSP (Wireless Session Protocol):

• Provides HTTP 1.1 functionality

• Supports session management, security, etc.

• WTP (Wireless Transaction Protocol):

• Provides reliable message transfer mechanisms

• Based on ideas from TCP/RPC

• WTLS (Wireless Transport Layer Security):

• Provides data integrity, privacy, authentication functions

• Based on ideas from TLS/SSL

• WDP (Wireless Datagram Protocol):

• Provides transport layer functions

• Based on ideas from UDP

WHY WAP?

• Wireless networks and phones

• have specific needs and requirements

• not addressed by existing Internet technologies

• WAP

• Enables any data transport

• TCP/IP, UDP/IP, GUTS (IS-135/6), SMS, or USSD.

• Optimizes the content and air-link protocols

• Utilizes plain Web HTTP 1.1 servers

• leverages existing development methodologies

• utilizes standard Internet markup language technology (XML)

• all WML content is accessed via HTTP 1.1 requests

• WML UI components map well onto existing mobile phone user interfaces

• no re-education of the end-users

• leveraging market penetration of mobile devices

• Several modular entities together form a fully compliant Internet entity

PAGE 12

WAP: “Killer” Applications

• Location-based services

• Real-time traffic reporting, Event/restaurant recommendation

• Enterprise solutions

• Email access, Database access, “global” intranet access

• Information updates “pushed” to WAP devices

• Financial services

• Banking, Bill-paying, Stock trading, Funds transfers

• Travel services

• Schedules and rescheduling, Reservations

• Gaming and Entertainment

• Online, real-time, multi-player games

• Downloadable horoscopes, cartoons, quotes, advice

• M-Commerce

• Shopping on the go

• Instant comparison shopping

• Location-based special offers and sales

Wireless Application Environment (WAE)

• Goals

• device and network independent application environment

• for low-bandwidth, wireless devices

• considerations of slow links, limited memory, low computing power, small display, simple user

interface (compared to desktops)

• integrated Internet/WWW programming model

• high interoperability

WAE Components

• Architecture

• Application model, Microbrowser, Gateway, Server

• User Agents

• WML/WTA/Others

• content formats: vCard, vCalendar, Wireless Bitmap, WML, ...

• WML

• XML-Syntax, based on card stacks, variables, ...

• WMLScript

• procedural, loops, conditions, ... (similar to JavaScript)

• WTA

• telephone services, such as call control, text messages, phone book, ... (accessible from WML/

WMLScript)

• Proxy (Method/Push)

WAE: Logical Model

WML: Wireless Markup Language

• Tag-based browsing language:

PAGE 12

• Complement to WML

• Derived from JavaScript™

• Provides general scripting capabilities

• Procedural logic, loops, conditionals, etc.

• Optimized for small-memory, small-cpu devices

• Features

• local user interaction, validity check of user input

• access to device facilities (phone call, address book etc.)

• extensions to the device software

• configure device, download new functionality after deployment

• Bytecode-based virtual machine

• Stack-oriented design, ROM-able

• Designed for simple, low-impact implementation

• WMLScript compiler resides in the network

WMLScript Libraries

• Lang - VM constants, general-purpose math functionality, etc.

• String - string processing functions

• URL - URL processing

• Browser - WML browser interface

• Dialog - simple user interface

• Float - floating point functions

Wireless Telephony Application (WTA)

• Collection of telephony specific extensions

• designed primarily for network operators

• Example

• calling a number (WML)

wtai://wp/mc;

• calling a number (WMLScript)

WTAPublic.makeCall("07216086415");

• Implementation

• Extension of basic WAE application model

• Extensions added to standard WML/WMLScript browser

• Exposes additional API (WTAI)

WTA Features

• Extension of basic WAE application model

• network model for interaction

• client requests to server

• event signaling: server can push content to the client

• event handling

• table indicating how to react on certain events from the network

• client may now be able to handle unknown events

• telephony functions

• some application on the client may access telephony functions

PAGE 12

• WTAI includes:

• Call control

• Network text messaging

• Phone book interface

• Event processing

• Security model: segregation

• Separate WTA browser

• Separate WTA port

WAP Push Services

• Web push

• Scheduled pull by client (browser)

• example: Active Channels

• no real-time alerting/response

• example: stock quotes

• Wireless push

• accomplished by using the network itself

• example: SMS

• limited to simple text, cannot be used as starting point for service

• example: if SMS contains news, user cannot request specific news item

• WAP push

• Network supported push of WML content

• example: Alerts or service indications

• Pre-caching of data (channels/resources)

Push Access Protocol

• Based on request/response model

• Push initiator is the client

• Push proxy is the server

• Initiator uses HTTP POST to send push message to proxy

• Initiator sends control information as an XML document, and content for mobile (as WML)

• Proxy sends XML entity in response indicating submission status

• Initiator can

• cancel previous push

• query status of push

• query status/capabilities of device

Push Proxy Gateway

• WAP stack (communication with mobile device)

• TCP/IP stack (communication with Internet push initiator)

• Proxy layer does

• control information parsing

• content transformation

• session management

• client capabilities

• store and forward

• prioritization

• address resolution

• management function

PAGE 12

• message size, client and server

• protocol options: Confirmed Push Facility, Push Facility, Session Suspend Facility,

Acknowledgement headers

• maximum outstanding requests

• extended methods

• header code pages

• Suspend and Resume

• server knows when client can accept a push

• multi-bearer devices

• dynamic addressing

• allows the release of underlying bearer resources

• Session Context and Push

• push can take advantage of session headers

• server knows when client can accept a push

• Connection-mode

• long-lived communication, benefits of the session state, reliability

• Connectionless-mode

• stateless applications, no session creation overhead, no reliability overhead

WAP: Ongoing Work

• WDP

• Tunnel to support WAP where no (end-to-end) IP bearer available

• WTLS

• support for end-to-end security (extending WTLS endpoint beyond WAP Gateway)

• interoperable between WAP and Internet (public key infrastructure)

• integrating Smart Cards for security functions

• WTP

• efficient transport over wireless links (wireless TCP)

• bearer selection/switching

• quality of service definitions

• WSP

• quality of service parameters

• multicast data, multimedia support

• WAE

• User agent profiles: personalize for device characteristics, preferences etc

• Push architecture, asynchronous applications

• Billing

PAGE 12