computaÇÃo ubÍqua e mÓvel - fernando pessoa university
TRANSCRIPT
COMPUTAÇÃO UBÍQUA E MÓVEL
Rui Silva Moreira11/5/2012
1Mobile and Ubiquitous Computing
Obectivos do Seminário
� Sistemas Ubíquos e Móveis
� Definição e evolução histórica
� Características e objectivos
� Exemplos UbiCom
� Comunicações sem Fios
� Codificação e Transmissão
� Multiplexagem & Canais & Células
� Normas
� Wi-Fi - 802.11a/b/g/n
� Bluetooth – 802.15.1
� ZigBee – 802.15.4
� Protocolos e Redes Móveis
� Pilha protocolos
� Redes ad hoc
� IP & Integração de Serviços (IMS)
� Localização e Contextualização
� Métodos & tecnologias localização
� Modelização do contexto
� Adaptação dinâmica local/contexto
� Requisitos de Sistema
� Modos/perfis de funcionamento (e.g., poupança de energia)
� Segurança e privacidade em ambientes móveis
11/5/2012
2
Mobile and Ubiquitous Computing
Protocol Layers
Routing Algorithms
IP Protocols and Networks
11/5/2012
3
Mobile and Ubiquitous Computing
Protocol Layers
11/5/2012Mobile and Ubiquitous Computing
4
Application Layer(DHCP, DNS, FTP, HTTP)
Transport Layer(TCP, UDP)
Network/Internet Layer(IP, OSPF, ARP, ICMP)
Data Link Layer(Ethernet, Wi-Fi, ZigBee, GPRS/UMTS)
Physical Layer(UTP/STP, Optical Fiber, Coaxial)
Domain Name System (DNS)
11/5/2012Mobile and Ubiquitous Computing
5
� Internet users memorize and use names & routing uses IP addresses, hence this requires translating (or resolving) names to IP address and vice-versa;
� DNS service converts names into IP address(es) and IP addresses into names
� hierarchical organization which allows for sub-delegation of name spaces to other DNS servers
Dynamic Host Configuration Protocol
11/5/2012Mobile and Ubiquitous Computing
6
� DHCP service dynamically attributes an available IP addresses to each host connecting to the network
� Works on local or access network, avoid static IP configuration
Packets at Different Levels
11/5/2012Mobile and Ubiquitous Computing
7
Ethernet
Header Layer 2 (pt-tp link)
Network
Header Layer 3
Ethernet - LANs
11/5/2012Mobile and Ubiquitous Computing
8
� Ethernet does not scale� Limited distance
� Flat addresses
� No hop count
� Missing features� neighbor discovery� Fragmentation� error messages� congestion feedback
… hence, we need IP
Basic Pt-Pt Layers (OSI Model)
11/5/2012Mobile and Ubiquitous Computing
9
Layer Description
Data Link Transform raw bits into stream of bits without errors;Sender bracks data into data frames (100..200 bytes);Tx data frames sequentially – framming;Reliable service – ack from receiver for each frame;Flow regulation – buffer adapt tx rate between emitter/receiver;Error handling – timers and sequence numbers;Medium Control Access (MAC sublayer) - broadcast networks & shared channels;
Physical Tx data bits over communication channel;Voltage representation for 0/1;Duration of bits (nanoseconds);Physical medium (UTP, air, optical fibers, water);Electrical/light/sound signals; Timings;
Layer Chained by Routers
11/5/2012Mobile and Ubiquitous Computing
10
Layer Description
Network Controls operation of subnet;Packets routed from source to destination address;Static routing tables (reflect structure of network);Dynamic routing tables;Congestion control;QoS (delay, jitter)Allow different operation of differetn networks (map addressing, map protocols, map packets);
Layers End-to-End (OSI Model)
11/5/2012Mobile and Ubiquitous Computing
11
Layer Description
Session Session establishment;Dialog control (keep track of whose turn to talk);Token managment (prevent use of same critical operation at sametime);Synchronization (tx checkpoint log to allow continuation);
Transport Split data into small units and pass them to network layer;Guarantee all pieces arrive correctly (sequenced/ordered);Type of transport connection (e.g., error-free pt-pt channel(ordered), broadcast message, etc.);End-to-End layer – source process talks to destination process withpre-defined headers and message control;
TCP/IP Reference Model
11/5/2012Mobile and Ubiquitous Computing
12
Layer Description
Application Higher-level protocols (e.g., FTP, SMTP, HTTP, etc.)
Transport Allow peer enteties on source and destination hosts to carry outconversation;~ Transport Layers (OSI Reference Model)2 end-to-end protocols:
- Transmission Control Protocol (TCP): reliable connection protocol, i.e., tx bytes without errors; byte stream fragmented into discrete packetsand passed to Internet layer; receiver TCP process reassembles packetsinto stream; handles flow control – tx speed;
- User Datagram Protocol (UDP): unreliable connection protocol for applications that require no sequencing nor flow control;
Internet Packet-switching network – connectioless internetwork layer;Defines packet format and IP protocol;Deliver IP packets to destination (routing) and avoid congestion;~ Network Layer (OSI Reference Model)
Host-to-network Connect to network using a variaty of adapters/cards
Connectiviy
11/5/2012Mobile and Ubiquitous Computing
13
� Connectionless
� IPv4, IPv6
� Connection-oriented
� X25
� Connection-oriented (datagram)
� ATM, MPLS
Circuit versus Packet Switching
� Connection-oriented
� End-to-end circuit
� Connection setup stores route in router tables
� Each packet carries ID of virtual circuit (notdestination address)
� Connectioless service� No setup is required� Packets are routed
independently(datagrams)
� Routing algorithm maychange router tables
� Each packet carriesdestination address (IP)
11/5/2012
14
Mobile and Ubiquitous Computing
Circuit switching Packet switching
Routing
11/5/2012
15
Mobile and Ubiquitous Computing
Network Layer (revisited)…
11/5/2012Mobile and Ubiquitous Computing
16
� Route packets from source to destination throughhops on intermediate routers;
� Routers need to know subnet topology to chooseappropriate paths and avoid overloading paths;
� Store-and-forward packet switching:
� host/router tx packet to nearest router;
� packet stored until fully arrived (check sum verified);
� then tx to next router… until it gets to destination;
� Bridges deal with different networks;
Routing Algorithms
11/5/2012Mobile and Ubiquitous Computing
17
� Two processes:
� Update: dynamically exchange information about all network paths and fill routing tables
� Forward: handle incoming packets and lookup outgoingline in router table
� Properties:
� Correctness and simplicity
� Robusteness and stability
� Fairness and optimallity
Goals of Routing Algorithms
11/5/2012Mobile and Ubiquitous Computing
18
� Minimizing mean packet delay
� Maximizing total network throughput
� Minimizing number of hops (improve delay and reduce bandwidth)
� Two groups of routing algorithms:
� Non-adaptive - static routing
� route decisions computed in advance/offline and downloaded to routers at bootstrap
� Adaptive – dynamic routing
� route decisions may change to reflect topology changes, trafficmeasurements, etc.;
� differences are in the place where to get info, e.g., locally, adjacentneighbours, all routers, etc.
Basic Routing Algorithm
11/5/2012Mobile and Ubiquitous Computing
19
� Distance Vector: calculate direction and distance (hops)
� Vector: choosing forwarding direction/next hop, i.e., interface through which to send out the incoming packet
� Distance: based on the cost of reaching a destination (e.g., RIP - hop count, IGRP - node delay and bandwidth)
� Count-to-infinit problem (loops)
� Link State: calculate metric based on type and status of router links
� how fast are the links
� how are the links state, i.e., up or down
Distance Vector (e.g., RIP)
11/5/2012Mobile and Ubiquitous Computing
20
� Ford-Fulkerson and Bellman-Ford distributedalgorithm (cf. routing loop problem)
� Routers do not have entire path to a destination
� Route table contains:
� best distance & direction to each destination
� Table updates propagation:
� each node exchanges info with neighbours (cf. confidance problem & convergence problem)
Link State (e.g., OSPF)
11/5/2012Mobile and Ubiquitous Computing
21
� Every node builds connectivity graph (network map)� node measures delay/cost to each neighbour
� periodically/link failure trigger Link State Packet (LSP):� sequence number + itself + list of pairs (neighbor, cost)
� broadcasts LSPs to all routers
� each router stores latest LSP (with new sequence nº) from other routers and forwards to neighbors - flood
� Based on net map, each node calculates best paths from self to every destinations – routing table� shortest path - Dijkstra’s Algorithm
Example – From C to All
11/5/2012Mobile and Ubiquitous Computing
22
A
B
D
E
C
F
G
2
2
6
1
2
2
4
5
1
A
B 6
D 2
D
A 2
E 2
E
B 1
D 2
F 4
F
C 4
E 4
G 1
C
B 2
F 2
G 5
B
A 6
C 2
E 1
G
C 5
F 1
C(0)
B(2) F(2) G(5)
E(4) G(3)
E(3)A(8)
D(5)
A(7)
Shortest Path Algorithm
11/5/2012Mobile and Ubiquitous Computing
23
� Build graph of subnet� each node = router;
� each arc = communication line/link
� Choose route based on metrics� number of hops
� bandwidth/average traffic
� measured delay
� communication cost
� mean queue length
� geographic distance (Km)
Shortest path - Dijkstra
11/5/2012Mobile and Ubiquitous Computing
24
� Uses tree to store visited nodes
� Uses list of nodes to visit
� Add itself to the tree and then loop until list is null:� All node neighbors added to the visiting list (except nodes
already in the tree or list)
� One at a time, each node in visiting list is transferred to tree –attached to appropriate neighbor
� Tree contains all network nodes – shortest path = tree search (e.g., bread-first)
� Routing table built from node sequences in shortest paths
Routing Table
11/5/2012Mobile and Ubiquitous Computing
25
• Network Destination and Netmask describe the Network ID
e.g. 192.168.1.0 & 255.255.255.0 => Net ID 192.168.1.0/24(1st net address & 24 bits net prefix & 8 bits host addressing)
• Gateway = Next hop (i.e., gateway to reach network)• Interface = NIC IP to destination (e.g., use192.168.1.65 to LAN 192.168.1.0/24) • Metric indicates = cost of route (efficiency of routes)
Distance Vector vs Link State
11/5/2012Mobile and Ubiquitous Computing
26
� Memory: DV smaller than LS
� Simplicity: DV simpler than LS
� Convergence: LS faster than DV
� Functionality: LS better than DV
� Hierarchical networks
� troubleshooting
� sabotage-proof routing
Flooding Algorithm
11/5/2012Mobile and Ubiquitous Computing
27
� Static algorithm
� Every incomig packet is sent out on every outgoingline (except the one from it came)
� Avoid infinit duplication (loops)
� Use hop counter decremented in each hop
� Drop packet when hop counter reaches 0
Mobile IP
11/5/2012
28
Mobile and Ubiquitous Computing
Node Mobility with IP
11/5/2012Mobile and Ubiquitous Computing
29
� Nomadic nodes� Mobile user carries his computer to another network,
changing the attachment point;
� Mobile IP allows a mobile node to use two IP addresses:� home-address – used to identify TCP connections to where
the mobile node “lives”;� care-of-address – the new mobile node’s address in the
foreign network where the mobile node is plugged;� whenever the mobile node moves it registers care-of-
address with its home agent� home agent “tunnels” packet from the home-address to the
care-of-address
Mobile IP
11/5/2012Mobile and Ubiquitous Computing
30
Mobile IP
11/5/2012Mobile and Ubiquitous Computing
31
IP and Services Integration:
IP Multimedia Subsystem (IMS)
References:� Thomas Magedanz, IP Multimedia System (IMS): Principles, Architecture and
Applications, Fraunhofer FOKUS, 2006.
� Gonzalo Caramillo & Miguel Garcia-Martim, The 3G IP Multimedia System (IMS): Merging the Internet and the Cellular Networks, McGraw Hill, 2008.
� Travis Russel, The IP Multimedia System (IMS): Session control and other network operations, McGraw Hill, 2008.
IP Protocols and Networks
11/5/2012
32
Mobile and Ubiquitous Computing
Convergence (FMC) & Integration
11/5/2012Mobile and Ubiquitous Computing
33
Network Convergence
11/5/2012Mobile and Ubiquitous Computing
34
Past Market Evolution
� Decrease in PSTN revenues – overcomedby VoIP
� Counter measures:
� ISP launch their ownVoIP services
� Introduce added valuehigh-end SIP-services
� Develop convergencesolutions
11/5/2012
35
Mobile and Ubiquitous Computing
IP Multimedia SubSystem
11/5/2012Mobile and Ubiquitous Computing
36
� Generic and sclalable architecture
� VoIP, MMoIP, IM, Presence, etc.
� Support for several access types
� IP on top of ADSL, Fiber, Cable, etc.
� Horizontal architecture used by ISPs
� Basic protocols:
� SIP (session initiation)
� Diameter (AAA)
Next Generation Network
11/5/2012
37
Mobile and Ubiquitous Computing
� Services: independentservice layer; servicesblunding;
� Control: signalingprotocols for sessioncontrol (SIP) andaccounting (Diameter);
� Transport: conveysignaling and media; multiple accesstechnologies; same core
IMS Layered Architecture
11/5/2012Mobile and Ubiquitous Computing
38
IMS Layered Architecture
11/5/2012Mobile and Ubiquitous Computing
39
Flexible Services Provision
11/5/2012Mobile and Ubiquitous Computing
40
Vertical vs Horizontal Integration
11/5/2012
41
Mobile and Ubiquitous Computing
Pre IMS Comm (service islands) IMS Comm (service combination)
Services Interoperability
11/5/2012
42
Mobile and Ubiquitous Computing
Replication of agreements Reuse of agreements
Cost saving & Speeds development
11/5/2012
43
Mobile and Ubiquitous Computing
Vertical islands – slowdeployment
Horizontal convergence – speeds
development
Component Functional Overview
11/5/2012Mobile and Ubiquitous Computing
44
Overlay Session/Service Control Arch.
11/5/2012Mobile and Ubiquitous Computing
45
� IMS Core
� S-CSCF (Serving Call Session Control Function): IS anker point in home network
� I-CSCF (Interrogating Call Session Control Function): topology hiding
� P-CSCF (Proxy Call Session Control Function): entrypoint into IMS world
� MS (Media Server): Media Server hosting special resources
� MGF (Media Gateway): interworking with legacy networks
� PDF (Policy Decision Function): QoS Control using Polícies (COPS)
� IMS Application Layer
� HSS (Home Subscriber System): maintaining subscriber & AS profiles
� AS (Application Server Function): hosting applications
� IMS enablers (e.g. Presence, Group Mgt.): specific ASs with generic functions
� IMS end system (IMS Client)
� plays an important role - real multimedia / IMS services
IMS Components
11/5/2012Mobile and Ubiquitous Computing
46
� Call Session Control Function (CSCF)� registration of the endpoints
� routing SIP signaling messages to appropriate app server
� works with interworking and transport layer to guarantee QoS across all services
� roles of CSCF servers:� Serving (S-CSCF): session control entity for endpoint devices� Proxy (P-CSCF): entry point to IMS for devices� Interrogating (I-CSCF): entry point to IMS from other
networks
IMS Components
11/5/2012Mobile and Ubiquitous Computing
47
� Breakout Gateway Control Function (BGCF)� in IP-PSTN breakout it selects MGCF to receive SIP signaling
� in IP-IP networks it becomes the peering control point between boundary points
� Media gateway control function (MGCF)� manages the distribution of sessions across multiple media
gateways
� Media Server Function Control (MSCF)� manages the use of resources on media servers
� SIP Applications Server (SIP-AS)
Convergence Architecture
11/5/2012Mobile and Ubiquitous Computing
48
� support plethora of services over fixed and mobile access networks
� single unified network supporting all major access technologies
� single set of services that:
� apply network-wide
� available anytime, anyplace, anywhere
Convergence Network
11/5/2012Mobile and Ubiquitous Computing
49
ISP - Get Control of IP Services
11/5/2012
50
Mobile and Ubiquitous Computing
IP networks allow freecommunication between endpoints
IMS allows controlling services on IP networks (QoS, Security, Charging)
Standard Interfaces
� IMS is based onstandard Internet protocols:
� SIP (session control)
� DIAMETER (AAA)
� COPS for QoS
� RTP (media stream)
11/5/2012
51
Mobile and Ubiquitous Computing
Session Initiation Protocol (SIP)
11/5/2012Mobile and Ubiquitous Computing
52
� Protocol to initiate, terminate, and modify service sessions� Voice and Multimedia sessions; Point-to-point and multiparty
� Support for� registration and modification of multiple user location information
� caller and callee authentication / call authorization
� privacy for call signaling and media streams
� Media path with ensured QoS
� Flexible service creation� support through SIP servers (located inside and outside the network)
� Extensible protocol to cover new communication aspects� e.g., presence and instant messaging
� Used together with Session Description Protocol� No Bearer support (RTP and RTCP are used for that)
� Developed and maintained by IETF (MMUSIC and SIP WGs)
� RFC 3261: www.ietf.org/html.charters/sip-charter.html
Local SIP Architecture
11/5/2012Mobile and Ubiquitous Computing
53
SIP Requests
11/5/2012Mobile and Ubiquitous Computing
54
� REGISTER: allows clients to register their current location (one or more addresses)
� INVITE: used by client to initiate a call� ACK: sent by client to confirm reception of final
response from server, e.g., 200 OK� BYE: sent either by calling or caller agent to abort a
call� CANCEL: sent to abort a request that was sent
previously as long as the server has not yet sent a final response
� OPTIONS: allows clients to learn servers capabilities; server sends back list of supported methods
More SIP Requests
11/5/2012Mobile and Ubiquitous Computing
55
� SUBSCRIBE: starts/stops session or user supervision (event monitoring)
� NOTIFY: informs subscribed entity about occurred events
� PUBLISH: enables entity to modify presence information� MESSAGE: allows to send an instant message� REFER: informs recipient to contact dedicated SIP user
(e.g. MWI)� PRACK: PRovisional ACKnowledgement� UPDATE: Change of media (SDP) during session setup� INFO: Exchange of application layer info (e.g. DTMF)
SIP Responses
11/5/2012Mobile and Ubiquitous Computing
56
� SIP Responses defined as (HTTP-style):� Status-Line = SIP-Version SP Status-Code SP Reason-Phrase CRLF
(SP=Space, CRLF=Carriage Return & Line Feed)
e.g., SIP/2.0 404 Not Found
� First digit gives Class of response:
SIP Message Body
11/5/2012Mobile and Ubiquitous Computing
57
� Message body can be any protocol
� In most implementations it is SDP (Session DiscriptionProtocol)
� RFC 2327 4/98, http://www.ietf.org/rfc/rfc2327.txt
� Specify info about a multi-media session.
� SDP fields have a required order
� For RTP (Real Time Protocol Sessions)� RTP Audio/Video Profile (RTP/AVP) payload descriptions
are often used
SIP – enabler converged comm
11/5/2012Mobile and Ubiquitous Computing
58
Diameter Protocol (AAA)
11/5/2012Mobile and Ubiquitous Computing
59
� Protocol for Authentication, Authorization and Accounting (AAA)� RFC 3588 DIAMETER Base Protocol (2003)
� Development based on 3G network operators
� Used in 3GPP IMS for HSS access
� Extends RADIUS functionalities:� Introduction of Agent roles (cf. proxy, relay, redirect & translation)
� Enables server-initiated messages
� Uses UDP, TCP and SCTP protocol for reliable message transport
� Backward compatible to RADIUS by using translation agents
� Explicit modular structure => extendible
Wireless Ad Hoc Networks / Mobile Ad Hoc Networks (MANETs)
Ad Hoc = for a particular end or case
E. Royer, Chai-Keong Toh, A Review of Current Protocols for Ad Hoc Mobile WirelessNetworks, IEEE Personal Communications, April 1999
IP Protocols and Networks
11/5/2012
60
Mobile and Ubiquitous Computing
Wireless Networks
11/5/2012Mobile and Ubiquitous Computing
61
� Topologies with organized infrastructure
� Fixed and wired routers/gateways
� Disperse Base stations (BS): bridges used by mobile nodes to access wired infrastructure
� Handoff: transfer node communication from one BS to another BS
� Limitations
� Requires a domain entity for structuring/managing network
� Static organization and coverage area
� Topologies with Ad Hoc organization
� No fixed routers/gateways
� Arbitrary dynamic connections through existing mobile nodes
Wireless Mesh Networks
11/5/2012Mobile and Ubiquitous Computing
62
� Similar to Mobile Ad hoc NETworks (MANETs) but where nodes are standing (do not move)� MANETs must deal also with route mobility
� Communication is accomplished through routing protocols or flooding schemes
� Usually there are several alternative paths between different nodes
� Self healing characteristics that allow routing in the presence of bad links or node malfunction
� ZigBee is a low “cost-power-bandwidth” standard supporting both star and tree wireless mesh networks
Ad Hoc Routing
� Pro-active routing process that periodically refreshes list of all routes (regardless of usage)
� Nodes maintain consistent/up-to-date routing information
� Each node keeps 1+ tables that store routing info to all nodes
� Consistency maintenance => update messages overload net traffic
� Reactive routing discovery and maintenance
� Demand-driven protocols => source node triggers Route Discovery process (RRequest) when needed
� Lazy route maintenance => reduces traffic overload
� High latency/reaction to changes on net topology
11/5/2012
63
Mobile and Ubiquitous Computing
Table Drive Source-Initiated On-Demand
Ad Hoc Routing Protocols
11/5/2012Mobile and Ubiquitous Computing
64
Ad Hoc
Routing Protocols
Table Driven
Destination-Sequenced Distance-
Vector (DSDV)
Clusterhead Gateway Switch Routing
(CGSR)
Wireless RoutingProtocol (WRP)
Source-Initiated On-Demand
Ad Hoc On-DemandDistance Vector
(AODV)
Dynamic SourceRouting (DSR)
Lightweight Mobile Routing (LMR)
Temporally OrderedRouting Algorithm
(TORA)
Associativity BasedRouting (ABR)
Signal StabilityRouting (SSR)
Table Driven Protocols
11/5/2012Mobile and Ubiquitous Computing
65
DSDV
CGSR
WRP
� Maintain consistent (up-to-date) routing information
� Each node keeps 1+ tables that store routing info� e.g., routes from each node to every other node
� Changes in the network topology originate propagation updates to maintain consistent net view
� Protocols differ essentially in:� Number of routing tables� Methods by which topology changes are
broadcasted
DSDV (Destination-Sequenced Distance-Vector)
11/5/2012Mobile and Ubiquitous Computing
66
� Uses improved version of Bellman-Ford algorithm to achieve free-loop routing tables
� Every mobile node maintains routing table:� All possible destinations in the network� Number of hops to each routing table� Each entry marked with sequence number assigned by destination node
– distinguish stable from new routes
� Route table updates transmitted periodically (table consistency)� Uses 2 types of packets (avoid traffic overload):
� FULL DUMP: carries all available routing info (may require several Network Protocol Data Units)
� INCREMENTAL: relay only info that changed since last FULL DUMP (each update fits into 1 standard-size NPDU)
DSDV (Destination-Sequenced Distance-Vector)
11/5/2012Mobile and Ubiquitous Computing
67
� New Route broadcasts contain:� Address of destination� Number of hops to reach destination� Sequence number of info received regarding destination� Sequence number unique to the broadcast
� Choose route with� Most recent sequence number� For same sequence number choose smaller metric (shortest
path)
� Mobile nodes keep track of Settling Time (ST) of routes� Used to delay route updates = ST (reduce broadcasts if
better route discovered in near future)
CGSR (Clusterhead Gateway Switch Routing)
11/5/2012Mobile and Ubiquitous Computing
68
� Uses different type of addressing and net organization scheme� Instead of flat net it uses clustered multi-hop structure� Clusterhead node
� elected by peer nodes (e.g., bully, ring)� controls group of ad hoc nodes
� Advantages: code separation among clusters; Bandwidth allocation; Channel access; Use of routing heuristics
� Disadvantages: frequent changes can adversely affect routing performance (successive elections diminish node capacity for packet relay)
� Uses Least Cluster Change (LCC) algorithm - clusterhead changes only when:� i) 2 clusterheads come into contact� ii) node moves out of contact of all clusterheads
CGSR (Clusterhead Gateway Switch Routing)
11/5/2012Mobile and Ubiquitous Computing
69
� Uses underlying DSDV routing scheme but with hierarchical clusterhead-to-gateway routing scheme
� Gateway:� node within communication range of 2+ clusterheads
� Packet sent by mobile node: 1st goes to clusterhead; 2nd goes to gateway; goes to another clusterhead (until reaches destiny)
� Each node has Cluster Member Table (CMT): stores destination clusterhead for each mobile node - broadcasted periodically
� Each node maintains also a Routing Table (RT): determine next hop in order to reach destination
� When node receives packet:� 1st checks CMT to determine nearest clusterhead to destination;� 2nd checks RT to determine next hop to reach selected clusterhead
CGSR Example
11/5/2012Mobile and Ubiquitous Computing
70
1
4
2
3
5
6
7
8
N G
H
Clusterhead (H)Gateway (G)Node (N)
H
G
H
N
N
WRP (Wireless Routing Protocol)
11/5/2012Mobile and Ubiquitous Computing
71
� Maintains routing info among all nodes
� Each node responsible for 4 tables:� Distance Table (DT)
� Routing Table (RT)
� Link-Cost Table (LCT)
� Message Retransmission List (MRL) Table� Sequence number of update message� Retransmissions counter� ACK message flag vector (1 entry per-neighbor)� List of updates sent in update message
WRP (Wireless Routing Protocol)
11/5/2012Mobile and Ubiquitous Computing
72
� MRL Table records
� which update (in an update message) needs to be reTX
� which neighbor should ACK reTX
� Mobile nodes inform each other of link changes through update messages between neighbors
� Update contains:� list of updates (destination, distance to destination,
predecessor of destination)
� list of responses (which nodes should ACK update)
WRP (Wireless Routing Protocol)
11/5/2012Mobile and Ubiquitous Computing
73
� Mobile nodes send update package after:� processing update from neighbor
� detecting lost link to neighbor
� Update message to neighbors for:� Modifying their Distance Tables
� Checking new paths through other nodes
� New paths/routes relayed back to original node
� Nodes learn existence of neighbors through their:� ACK packages
� HELLO packages (TX periodically when no ACKs necessary)
WRP (Wireless Routing Protocol)
11/5/2012Mobile and Ubiquitous Computing
74
� Mobile nodes receives HELLO message and:
� Adds neighbor to Routing Table (RT)
� Replies copy of RT
� Nodes TX Distance and Second-to-Last hop info for each destination
� WRP is path find algorithm
� Avoids Count-to-infinite problem / loop freedom� Forces each node to perform consistency checks of
predecessor info reported by all nodes
Source-Initiated On-Demand
11/5/2012Mobile and Ubiquitous Computing
75
AODV
DSR
LMR
TORA
ABR
SSR
� Demand-driven protocols
� Source node creates route only when necessary� Route Discover: process through which a
route to a node is found or all possible route permutations have been examined
� Route Maintenance: procedure repeated until:� destination becomes inaccessible along every
path from source� Route no longer desired
AODV (Ad-Hoc On-Demand Distance Vector)76
� Improves DSDV algorithm:� Does not maintain complete list of routes� Builds routes only when necessary – diminishes number of broadcasts� Routes that are not on the selected path do not maintain routing info neither
exchange table info
� Path discovery process initiated by source node� Route Request (RREQ):
� Source node broadcasts RREQ packet to neighbor nodes� Each node records previous node ID (and broadcast ID) of node that sent RREQ
� Info used to forward back RREP afterwards (reverse path record)� Info deleted if no RREP received after given timeout
� Each node forwards RREQ to neighbors until reaches destination or intermediate node aware of path
� Route Reply (RREP):� Destination or intermediate node replies back (unicast) with RREP packet� Each node forwards RREP back to previously recorded neighbor ID (using reverse path)� Each node records previous node ID that sent RREP (forward path record – routing next
data packets)� Source may receive several RREP but uses shortest path (less hops)
AODV Example
11/5/2012Mobile and Ubiquitous Computing
77
1
3
4
5
6
7
8
Source
2
RREQ
AODV (Ad-Hoc On-Demand Distance Vector)78
� Uses destination sequence number (DSN) to ensure loop-free routes and identify most recent route (higher DSN => more up-to-date)
� Each node maintains its own:� Sequence number used on transmitted packets (as source on RREQ/destination on
RREP)� Broadcast ID (incremented for every initiated RREQ)
� RREQ carries:� Source ID + Destiny ID� Source Sequence Number (SSN)� Destination Sequence Number (DSN)
� The higher is the DSN the more up-to-date is the route� If intermediate node has route to destination with DSN >= DSN of RREQ then
replies/unicast RREP
� Broadcast ID� Nodes only forward unique RREQs (discard RREQ with repeated Source ID + Broadcast ID)
� Time-to-Live (TTL)� TTL limits number of retransmissions for each RREQ
� RREQ can only be issued after 2xT (where T = timeout of previous RREQ)
AODV (Ad-Hoc On-Demand Distance Vector)
11/5/2012Mobile and Ubiquitous Computing
79
� Route Maintenance:� Source node moves => it reinitiates route discovery
� Intermediate node moves => noticing neighbor propagates link failure message (RREQ with infinite metric) through neighbors� when reaches source it may reinitiate route discovery
� Liveliness:� HELLO messages used periodically to inform neighbors
� Nodes listen neighbor retransmission (forward) of data packets => ensure next hop is alive/reachable
DSR (Dynamic Source Routing)
11/5/2012Mobile and Ubiquitous Computing
80
TORA (Temporarily Ordered Routing Algorithm)
11/5/2012Mobile and Ubiquitous Computing
81
ABR (Associatitivy-Based Routing)
11/5/2012Mobile and Ubiquitous Computing
82
SSR (Signal Stability Routing)
11/5/2012Mobile and Ubiquitous Computing
83
LMR (Lightweight Mobile Routing)
11/5/2012Mobile and Ubiquitous Computing
84