Mobile Computing & Application: Tansen Patel

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 77

MOBILE COMPUTING & APPLICATION

TANSEN PATEL
ASST. PROFESSOR
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING
SSIPMT, RAIPUR (CG)

TANSEN PATEL @ CSE @ SSIPMT @ RAIPUR


MOBILE COMPUTING & APPLICATION

UNIT- 4
MOBILE NETWORK & TRANSPORT LAYER
2

TANSEN PATEL
ASST. PROFESSOR
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING
SSIPMT, RAIPUR (CG)

TANSEN PATEL @ CSE @ SSIPMT @ RAIPUR


Mobile IP
3

TANSEN PATEL @CSE @SSIPMT @ RAIPUR


 Stationary Host
 Mobile Host

4 TANSEN PATEL @ CSE @ SSIPMT


Figure Home address and care-of address

5 TANSEN PATEL @ CSE @ SSIPMT


Note

Mobile IP has two addresses for a mobile


host: one home address and
one care-of address.

The home address is permanent;


the care-of address changes as the
mobile host moves from one
network to another.

6 TANSEN PATEL @ CSE @ SSIPMT


AGENTS

To make the change of address transparent to the


rest of the Internet requires a home agent and a
foreign agent.

7 TANSEN PATEL @ CSE @ SSIPMT


Topics
 Home Agent
 Foreign Agent

8 TANSEN PATEL @ CSE @ SSIPMT


Figure Home agent and foreign agent

9 TANSEN PATEL @ CSE @ SSIPMT


THREE PHASES

To communicate with a remote host, a mobile host


goes through three phases:

• Agent discovery

• Registration

• Data transfer.

10 TANSEN PATEL @ CSE @ SSIPMT


Figure Remote host and mobile host configuration

11 TANSEN PATEL @ CSE @ SSIPMT


Figure Data transfer

4
2

12 TANSEN PATEL @ CSE @ SSIPMT


Note

The movement of the mobile host is


transparent to the rest of the Internet.

13 TANSEN PATEL @ CSE @ SSIPMT


INEFFICIENCY IN MOBILE IP

Communication involving mobile IP can be


inefficient. The inefficiency can be severe or
moderate. The severe case is called double crossing
. The moderate case is called triangle routing .

14 TANSEN PATEL @ CSE @ SSIPMT


Figure Double crossing

15 TANSEN PATEL @ CSE @ SSIPMT


Figure Triangle routing

16 TANSEN PATEL @ CSE @ SSIPMT


DHCP:
Dynamic Host Configuration Protocol
DHCP
18
 Application
 simplification of installation and maintenance of networked
computers
 supplies systems with all necessary information, such as IP address,
DNS server address, domain name, subnet mask, default router etc.
 enables automatic integration of systems into an Intranet or the
Internet, can be used to acquire a COA for Mobile IP
 Client/Server-Model
 the client sends via a MAC broadcast a request to the DHCP server
(might be via a DHCP relay) DHCPDISCOVER

DHCPDISCOVER
server client

client relay

TANSEN PATEL @CSE @SSIPMT @ RAIPUR


DHCP - protocol mechanisms
19
server client server
(not selected) initialization (selected)
DHCPDISCOVER DHCPDISCOVER
determine the determine the
configuration configuration
DHCPOFFER DHCPOFFER
collection of replies

selection of configuration
DHCPREQUEST DHCPREQUEST
(reject) (options) confirmation of
configuration
DHCPACK
initialization completed

release
DHCPRELEASE delete context

TANSEN PATEL @CSE @SSIPMT @ RAIPUR


DHCP characteristics
20

 Server
 several servers can be configured for DHCP, coordination not
yet standardized (i.e., manual configuration)
 Renewal of configurations
 IP addresses have to be requested periodically, simplified
protocol
 Options
 available for routers, subnet mask, NTP (network time
protocol) timeserver, SLP (service location protocol) directory,
DNS (domain name system)

TANSEN PATEL @CSE @SSIPMT @ RAIPUR


Ad hoc Wireless Networks
Definition
22

“Ad Hoc network is a self-organizing multi-hop


wireless network, which relies neither on fixed
infrastructure nor on predetermined connectivity ”.

TANSEN PATEL@CSE@RAIPUR
Types of Wireless Networks
23

 Infrastructure based(Cellular Network).

 Infrastructureless Network(Mobile Ad hoc


NETwork) (MANET).

TANSEN PATEL@CSE@RAIPUR
Manet: Mobile Ad-hoc Networking
24

Mobile
Router

Manet

Mobile
Devices

Mobile IP,
DHCP

Fixed
Network

Router End system

TANSEN PATEL@CSE@RAIPUR
Characteristics of an Ad-hoc network
25

 Collection of mobile nodes forming a temporary


network

 Network topology changes frequently and


unpredictably

 No centralized administration or standard


support services

 Host is also function as router

TANSEN PATEL@CSE@RAIPUR
Why is Routing Different in Ad Hoc ???
26

 Host mobility
 Dynamic topology

 link failure/repair due to mobility

 Distributed Environment

 Bandwidth constrained

 Energy constrained

TANSEN PATEL@CSE@RAIPUR
Categorization of Ad-Hoc Routing Protocols
27

TANSEN PATEL@CSE@RAIPUR
Table Driven Routing Protocol
Destination-Sequenced Distance Vector Protocol
(DSDV)
29

 Basic Routing Protocol


 Based on Bellman ford routing algorithm with some
improvement
 Each node maintains a list of all destinations and
number of hops to each destination.
 Each entry is marked with a sequence number.
 Periodically send table to all neighbors to maintain
topology
 Two ways to update neighbors:
 Full dump
 Incremental update

TANSEN PATEL@CSE@RAIPUR
Example of DSDV

A’s Routing Table Before Change A’s Routing Table After Change

Destination Next Hop Distance Sequence Number Destination Next Hop Distance Sequence Number

A A 0 S205_A A A 0 S304_A

B B 1 S334_B B D 3 S424_B

C C 1 S198_C C C 1 S297_C

D D 1 S567_D D D 1 S687_D

E D 2 S767_E E D 2 S868_E

F D 2 S45_F F D 2 S164_F
Source Initiated On demand routing protocol
Ad hoc On-demand Distance Vector Routing
(AODV)
32

 Pure on-demand protocol


 Node does not need to maintain knowledge of another
node unless it communicates with it
 AODV includes route discovery and route maintenance.
 AODV minimizes the number of broadcasts by creating
routes on-demand
 AODV uses only symmetric links because the route
reply packet follows the reverse path of route request
packet
 AODV uses hello messages to know its neighbors and
to ensure symmetric links
TANSEN PATEL@CSE@RAIPUR
Path discovery
33

 In the path discovery (RREQ) phase, source broadcasts RREQ


message.

 Intermediate nodes record in their route tables the address of


neighbor from which RREQ is received to establish a reverse path.

 When RREQ reaches destination or an intermediate node responds


by unicasting a route reply (RREP) back to neighbor.

TANSEN PATEL@CSE@RAIPUR
Path maintenance
34

 If source node moves, reestablish the path.

 If destination or intermediate node moves,


send link failure notification message to each
of its active upstream.

 Then reinitiate path discovery .

TANSEN PATEL@CSE@RAIPUR
AODV : Route discovery (1)
35

F K
H
Q A

S E G D P
J

B M
R
I
L
C
N

TANSEN PATEL@CSE@RAIPUR
AODV : Route discovery (2)
36

F K
H
Q A

S E G D P
J

B M
R
I
L
C
N

: Route Request (RREQ) Note: if one of the intermediate nodes (e.g., A)


TANSEN PATEL@CSE@RAIPUR knows a route to D, it responds immediately to S
AODV : Route discovery (3)
37

F K
H
Q A

S E G D P
J

B M
R
I
L
C
N

TANSEN:PATEL@CSE@RAIPUR
represents a link on the reverse path
AODV : Route discovery (4)
38

F K
H
Q A

S E G D P
J

B M
R
I
L
C
N

TANSEN PATEL@CSE@RAIPUR
AODV : Route discovery (5)
39

F K
H
Q A

S E G D P
J

B M
R
I
L
C
N

TANSEN PATEL@CSE@RAIPUR
AODV : Route discovery (6)
40

F K
H
Q A

S E G D P
J

B M
R
I
L
C
N

TANSEN PATEL@CSE@RAIPUR
AODV : Route discovery (7)
41

F K
H
Q A

S E G D P
J

B M
R
I
L
C
N

TANSEN PATEL@CSE@RAIPUR
AODV : Route reply and setup of the forward path
42

F K
H
Q A

S E G D P
J

B M
R
I
L
C
N

: Link over which the RREP is transmitted


TANSEN PATEL@CSE@RAIPUR
: Forward path
Route reply in AODV
43

 In case it knows a path more recent than the one


previously known to sender S, an intermediate node
may also send a route reply (RREP)
 The freshness of a path is assessed by means of
destination sequence numbers
 Both reverse and forward paths are purged at the
expiration of appropriately chosen timeout intervals

TANSEN PATEL@CSE@RAIPUR
AODV : Data delivery
44

F K
H
Q A

Data
S E G D P
J

B M
R
I
L
C
N

The route is not included in the packet header


TANSEN PATEL@CSE@RAIPUR
AODV : Route maintenance (1)
45

F K
H
Q A

Data
S E G D P
X J

B M
R
I
L
C
N

TANSEN PATEL@CSE@RAIPUR
AODV : Route maintenance (2)
46

F K
H
Q A

RERR(G-J)
S E G D P
X J

B M
R
I
L
C
N

When receiving the Route Error message (RERR),


S removes the broken link from its cache.
TANSEN PATEL@CSE@RAIPUR It then initializes a new route discovery.
Dynamic Source Routing Protocol
(DSR)
47

 on-demand
 A node maintains route cache containing the
routes it knows
 Two main phases
 Route discovery
 Route maintenance
 Basic Operation is similar to AODV.
 Main difference
 To use routing cache for link failure.
 When route discovery phase, node send route request message
with its own address.

TANSEN PATEL@CSE@RAIPUR
DSR: Route discovery (1)
48

F K
H
Q A

S E G D P
J

B M
R
I
L
C
N

TANSEN PATEL@CSE@RAIPUR
DSR: Route discovery (2)
49

F K
H
Q A

S E G D P
(S)
J

B M
R
I
L
C
N

TANSEN PATEL@CSE@RAIPUR
DSR: Route discovery (3)
50

(S,A) K
F H
Q A

(S,E)
S E G D P
J

B M
R
I
L
C
N

TANSEN PATEL@CSE@RAIPUR
DSR: Route discovery (4)
51

F K
H
Q A

S E G (S,E,G) D P
J

B M
R
I
L
C
(S,B,C) N

TANSEN PATEL@CSE@RAIPUR
DSR: Route discovery (5)
52

(S,A,F,H)
F K
H
Q A

S E G (S,E,G,J) D P
J

B M
R
I
L
C
N

TANSEN PATEL@CSE@RAIPUR
DSR: Route discovery (6)
53

F K
H (S,A,F,H,K)
Q A

S E G D P
J

B M
R
I
L
C
N

TANSEN PATEL@CSE@RAIPUR
DSR: Route discovery (7)
54

F K
H
Q A

S E G D P
J (S,A,F,H,K,P)

B M
R
I
L
C
N

TANSEN PATEL@CSE@RAIPUR
DSR: Route discovery (8)
55

F K
H
Q A

S E G D P
J RREP(S,E,G,J,D)

B M
R
I
L
C
N

TANSEN PATEL@CSE@RAIPUR
DSR: Route Discovery (9)
56

 Route reply by reversing the route (as illustrated)


works only if all the links along the route are
bidirectional
 If unidirectional links are allowed, then RREP may
need a route discovery from D to S
 Note: IEEE 802.11 assumes that links are
bidirectional

TANSEN PATEL@CSE@RAIPUR
DSR: Data delivery
57

F K
H
Q A

DATA(S,E,G,J,D)
S E G D P
J

B M
R
I
L
C
N

TANSEN PATEL@CSE@RAIPUR
DSR: Route maintenance (1)
58

F K
H
Q A

DATA(S,E,G,J,D)
S E G D P
X J

B M
R
I
L
C
N

TANSEN PATEL@CSE@RAIPUR
DSR: Route maintenance (2)
59

F K
H
Q A

RERR(G-J)
S E G D P
X J

B M
R
I
L
C
N When receiving the Route Error message (RERR),
S removes the broken link from its cache.
It then tries another route stored in its cache; if none,
TANSEN PATEL@CSE@RAIPUR it initializes a new route discovery
DSR: Optimization of route discovery: route caching
60

 Principle: each node caches a new route it learns by any


means
 Examples
 When node S finds route (S, E, G, J, D) to D, it also learns route (S,
E, G) to node G
 In the same way, node E learns the route to D
 Same phenomenon when transmitting route replies
 Moreover, routes can be overheard by nodes in the
neighbourhood
 However, route caching has its downside: stale caches
can severely hamper the performance of the network

TANSEN PATEL@CSE@RAIPUR
Comparison
61

Parameters On Demand Table Driven

Availability of routing Available when Always available regardless


information needed of need

Routing philosophy Flat Mostly flat, except for


CGSR
Periodic route updates Not required Required

Coping with mobility Use localized route Inform other nodes to achie
discovery ve a consistent routing
table

Signaling traffic generated Grows with Greater than that of on


increasing mobility demand routing

TANSEN PATEL@CSE@RAIPUR
Mobile Transport Layer
 MOTIVATION  Additional optimizations
 TCP-  Fast retransmit/recovery
MECHANISMS
 Transmission freezing
 CLASSICAL
APPROACHES  Selective retransmission
 Indirect TCP  Transaction oriented TCP
 Snooping TCP
 Mobile TCP
Transport Layer
E.g. HTTP (used by web services)
typically uses TCP
Client Server
 Reliable transport between client and TCP SYN
server required
TCP TCP SYN/ACK Connection
 Steam oriented, not transaction
oriented
setup
TCP ACK
 Network friendly: time-out
 congestion HTTP request
 slow down transmission
Data
Well known – TCP guesses quite often HTTP response
wrong in wireless and mobile networks
transmission
 Packet loss due to transmission errors >15 s
 Packet loss due to change of network
no data
Result
GPRS: 500ms! Connection
 Severe performance degradation
release

TANSEN PATEL@ CSE @SSIPMT @ RAIPUR


Motivation I

Transport protocols typically designed for


 Fixed end-systems
 Fixed, wired networks

Research activities
 Performance
 Congestion control
 Efficient retransmissions

TCP congestion control


 packet loss in fixed networks typically due to (temporary) overload
situations
 router have to discard packets as soon as the buffers are full
 TCP recognizes congestion only indirect via missing acknowledgements,
retransmissions unwise, they would only contribute to the congestion and
make it even worse
 slow-start algorithm as reaction TANSEN PATEL@ CSE @SSIPMT
@ RAIPUR
Motivation II

TCP slow-start algorithm


 sender calculates a congestion window for a receiver
 start with a congestion window size equal to one segment
 exponential increase of the congestion window up to the congestion
threshold, then linear increase
 missing acknowledgement causes the reduction of the congestion threshold
to one half of the current congestion window
 congestion window starts again with one segment
TCP fast retransmit/fast recovery
 TCP sends an acknowledgement only after receiving a packet
 if a sender receives several acknowledgements for the same packet, this is
due to a gap in received packets at the receiver
 however, the receiver got all packets up to the gap and is actually receiving
packets
 therefore, packet loss is not due to congestion, continue with current
congestion window (do not use slow-start)
TANSEN PATEL@ CSE @SSIPMT
@ RAIPUR
Influences of mobility on TCP-mechanisms

TCP assumes congestion if packets are dropped


 typically wrong in wireless networks, here we often have packet loss due to
transmission errors
 furthermore, mobility itself can cause packet loss, if e.g. a mobile node
roams from one access point (e.g. foreign agent in Mobile IP) to another
while there are still packets in transit to the wrong access point and
forwarding is not possible

The performance of an unchanged TCP degrades


severely
 however, TCP cannot be changed fundamentally due to the large base of
installation in the fixed network, TCP for mobility has to remain compatible
 the basic TCP mechanisms keep the whole Internet together

TANSEN PATEL@ CSE @SSIPMT


@ RAIPUR
Early approach: Indirect TCP I

Indirect TCP or I-TCP segments the connection


 no changes to the TCP protocol for hosts connected to the wired Internet,
millions of computers use (variants of) this protocol
 optimized TCP protocol for mobile hosts

 splitting of the TCP connection at, e.g., the foreign agent into 2 TCP
connections, no real end-to-end connection any longer
 hosts in the fixed part of the net do not notice the characteristics of the
wireless
mobile hostpart
access point
(foreign agent) „wired“ Internet

„wireless“ TCP standard TCP

TANSEN PATEL@ CSE @SSIPMT


@ RAIPUR
I-TCP socket and state migration

access point1

socket migration
and state transfer Internet

access point2
mobile host

TANSEN PATEL@ CSE @SSIPMT


@ RAIPUR
Indirect TCP II
Advantages
 no changes in the fixed network necessary, no changes for the hosts
(TCP protocol) necessary, all current optimizations to TCP still work
 transmission errors on the wireless link do not propagate into the fixed
network
 simple to control, mobile TCP is used only for one hop between, e.g., a
foreign agent and mobile host
 therefore, a very fast retransmission of packets is possible, the short
delay on the mobile hop is known

Disadvantages
 loss of end-to-end semantics, an acknowledgement to a sender does now
not any longer mean that a receiver really got 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

TANSEN PATEL@ CSE @SSIPMT


@ RAIPUR
Early approach: Snooping TCP I

„Transparent“ extension of TCP within the foreign


agent
 buffering of packets sent to the mobile host
 lost packets on the wireless link (both directions!) will be retransmitted
immediately by the mobile host or foreign agent, respectively (so called
“local” retransmission)
 the foreign agent therefore “snoops” the packet flow and recognizescorrespondent
local retransmission
acknowledgements in both directions,
foreignit also filters ACKs host
 agent agent
changes of TCP only within the foreign
„wired“ Internet

snooping of ACKs buffering of data


mobile
host end-to-end TCP connection

TANSEN PATEL@ CSE @SSIPMT


@ RAIPUR
Snooping TCP II

Data transfer to the mobile host


 FA buffers data until it receives ACK of the MH, FA detects packet loss via
duplicated ACKs or time-out
 fast retransmission possible, transparent for the fixed network

Data transfer from the mobile host


 FA detects packet loss on the wireless link via sequence numbers, FA
answers directly with a NACK to the MH
 MH can now retransmit data with only a very short delay

Integration of the MAC layer


 MAC layer often has similar mechanisms to those of TCP
 thus, the MAC layer can already detect duplicated packets due to
retransmissions and discard them

Problems
 snooping TCP does not isolate the wireless link as good as PATEL@
TANSEN I-TCP CSE @SSIPMT
@ RAIPUR
Early approach: Mobile TCP
Special handling of lengthy and/or frequent
disconnections
M-TCP splits as I-TCP does
 unmodified TCP fixed network to supervisory host (SH)
 optimized TCP SH to MH

Supervisory host
 no caching, no retransmission
 monitors all packets, if disconnection detected
 set sender window size to 0
 sender automatically goes into persistent mode
 old or new SH reopen the window

Advantages
 maintains semantics, supports disconnection, no buffer forwarding

Disadvantages
 TANSEN PATEL@ CSE @SSIPMT
loss on wireless link propagated into fixed network
@ RAIPUR
Fast retransmit/fast recovery

Change of foreign agent often results in packet loss


 TCP reacts with slow-start although there is no congestion

Forced fast retransmit


 as soon as the mobile host has registered with a new foreign agent, the MH
sends duplicated acknowledgements on purpose
 this forces the fast retransmit mode at the communication partners
 additionally, the TCP on the MH is forced to continue sending with the
actual window size and not to go into slow-start after registration

Advantage
 simple changes result in significant higher performance

Disadvantage
 further mix of IP and TCP, no transparent approach

TANSEN PATEL@ CSE @SSIPMT


@ RAIPUR
Transmission/time-out freezing

Mobile hosts can be disconnected for a longer time


 no packet exchange possible, e.g., in a tunnel, disconnection due to
overloaded cells or mux. with higher priority traffic
 TCP disconnects after time-out completely

TCP freezing
 MAC layer is often able to detect interruption in advance
 MAC can inform TCP layer of upcoming loss of connection
 TCP stops sending, but does now not assume a congested link
 MAC layer signals again if reconnected

Advantage
 scheme is independent of data

Disadvantage
 TCP on mobile host has to be changed, mechanism depends on MAC layer
TANSEN PATEL@ CSE @SSIPMT
@ RAIPUR
Selective retransmission

TCP acknowledgements are often cumulative


 ACK n acknowledges correct and in-sequence receipt of packets up to n
 if single packets are missing quite often a whole packet sequence beginning
at the gap has to be retransmitted (go-back-n), thus wasting bandwidth

Selective retransmission as one solution


 RFC2018 allows for acknowledgements of single packets, not only
acknowledgements of in-sequence packet streams without gaps
 sender can now retransmit only the missing packets

Advantage
 much higher efficiency

Disadvantage
 more complex software in a receiver, more buffer needed at the receiver

TANSEN PATEL@ CSE @SSIPMT


@ RAIPUR
Transaction oriented TCP

TCP phases
 connection setup, data transmission, connection release
 using 3-way-handshake needs 3 packets for setup and release, respectively
 thus, even short messages need a minimum of 7 packets!

Transaction oriented TCP


 RFC1644, T-TCP, describes a TCP version to avoid this overhead
 connection setup, data transfer and connection release can be combined
 thus, only 2 or 3 packets are needed

Advantage
 efficiency

Disadvantage
 requires changed TCP
 mobility not longer transparent
TANSEN PATEL@ CSE @SSIPMT
@ RAIPUR
Comparison of different approaches for a “mobile” TCP
Approach Mechanism Advantages Disadvantages
Indirect TCP splits TCP connection isolation of wireless loss of TCP semantics,
into two connections link, simple higher latency at
handover
Snooping TCP “snoops” data and transparent for end-to- problematic with
acknowledgements, local end connection, MAC encryption, bad isolation
retransmission integration possible of wireless link
M-TCP splits TCP connection, Maintains end-to-end Bad isolation of wireless
chokes sender via semantics, handles link, processing
window size long term and frequent overhead due to
disconnections bandwidth management
Fast retransmit/ avoids slow-start after simple and efficient mixed layers, not
fast recovery roaming transparent
Transmission/ freezes TCP state at independent of content changes in TCP
time-out freezing disconnect, resumes or encryption, works for required, MAC
after reconnection longer interrupts dependant
Selective retransmit only lost data very efficient slightly more complex
retransmission receiver software, more
buffer needed
Transaction combine connection Efficient for certain changes in TCP
oriented TCP setup/release and data applications required, not transparent
transmission

TANSEN PATEL@ CSE @SSIPMT @ RAIPUR

You might also like