Mobile and wireless network Dan LI CS Department
Mobile and wireless network Dan LI CS Department, Tsinghua University 2021/12/13 1
Today’s Lecture ß Introduction and Challenges ß Internet Mobility ß IPv 6 Mobility Support ß Ad hoc Network ß Mobile System Framework ß Rethinking about Mobility ß Reading List 2021/12/13 2
Goal of Wireless Networking and Mobile Computing “People and their machines should be able to access information and communicate with each other easily and securely, in any medium or combination of media – voice, data, image, video, or multimedia – any time, anywhere, in a timely, cost-effective way. ” Dr. G. H. Heilmeier, Oct 1992 2021/12/13 3
Enabling Technologies ß Development and deployment of wireless/mobile technology and infrastructure Þ ß ß in-room, in-building, on-campus, in-the-field, MAN, WAN Miniaturization of computing machinery. . . -> PCs -> laptop -> PDAs/smart phones -> embedded computers/sensors Improving device capabilities/software development environments, e. g. , Þ Þ Þ 2021/12/13 andriod: http: //code. google. com/android/ iphone: http: //developer. apple. com/iphone/ windows mobile 4
Pervasive Use of Mobile Wireless Devices ß There are ~4 billion mobile phones Þ Þ ß Over 50 countries have mobile phone subscription penetration rates higher than that of the population (Infoma 2007) http: //en. wikipedia. org/wiki/Mobile_phone_penetr ation_rate The mobile device will be the primary connection tool to the Internet for most people in the world in 2020. PEW Internet and American Life Project, Dec. 2008 2021/12/13 5
At Home Wi. Fi 802. 11 g/n satellit e Wi. Fi UWB bluetooth Wi. Fi cellular 2021/12/13 6
At Home 2021/12/13 7 Source: http: //teacher. scholastic. com/activities/science/wireless_interactives. htm
At Home: Last-Mile ß Many users still don’t have broadband Þ ß Broadband speed is still limited Þ Þ Þ 2021/12/13 8 reasons: out of service area; some consider expensive DSL: 1 -6 Mbps download, and 100 -768 Kbps upload Cable modem: depends on your neighbors Insufficient for several applications (e. g. , highquality video streaming)
On the Move Source: 2021/12/13 http: //www. ece. uah. edu/~jovanov/whrms/ 9
On the Road GSM/UMTS, cdma. One/cdma 2000, WLAN, GPS DAB, TETRA, . . . ad c o h road condition, weather, location-based services, emergency 2021/12/13 10
Example: Intelli. Drive (Vehicle Infrastructure Integration) ß ß Traffic crashes resulted in more than 41, 000 lives lost in 2007 Establishing vehicle-tovehicle (V 2 V), vehicle-toinfrastructure (V 2 I) and vehicle-to-hand-held-devices (V 2 D) communications safety: e. g. , intersection collision avoidance/violation warning/turn conflict warning, curve warning Þ mobility: e. g. , crash data, weather/road surface data, construction zones, emergency vehicle signal pre-emption 11 2021/12/13 Þ
Collision Avoidance : V 2 V Networks stalled vehicle warning blind spots http: //www. gm. com/company/gmability/safety/news_issues/releases/sixthsense_10 2405. html 2021/12/13 12
Collision Avoidance at Intersections ß Two million accidents at intersections per year in US Source: http: //www. fhwa. dot. gov/tfhrc/safety/pubs/its/ruralitsandrd/tb-intercollision. pdf 2021/12/13 13
Mobile and Wireless Services – Always Best Connected LAN, WLAN 780 kbit/s GSM 53 kbit/s Bluetooth 500 kbit/s UMTS Rel. 5 400 kbit/s LAN 100 Mbit/s, WLAN 54 Mbit/s UMTS, DECT 2 Mbit/s GSM/EDGE 135 kbit/s, WLAN 780 kbit/s 2021/12/13 GSM 115 kbit/s, WLAN 1114 Mbit/s UMTS Rel. 6 400 kbit/s
Disaster Recovery/Military ß ß 9/11, Tsunami, Hurricane Katrina, South Asian earthquake … Wireless communication and mobile computing capability can make a difference between life and death ! http: //www. att. com/ndr/ Þ Þ 2021/12/13 rapid deployment efficient resource and energy usage flexible: unicast, broadcast, multicast, anycast resilient: survive in unfavorable and untrusted environments 15
Habitat Monitoring: Example on Great Duck Island A 15 -minute human visit leads to 20% offspring mortality Patch Network Gateway Transit Network Basestation 2021/12/13 16
Wireless and Mobile Computing ß Driven by technology and vision Þ Þ ß wireless communication technology global infrastructure device miniaturization mobile computing platforms The field is moving fast 2021/12/13 17
Challenge 1: Unreliable and Unpredictable Wireless Coverage ß Wireless links are not reliable: they may vary over time and space Reception vs. Distance Asymmetry vs. Power *Cerpa, Busek et. al 2021/12/13 What Robert Poor (Ember) calls “The good, the bad and the ugly” 18
Challenge 2: Open Wireless Medium ß ß Wireless interference S 2 R 1 R 2 Exposed terminal R 1 ß R 1 Hidden terminals and S 1 ß S 1 Wireless security Þ 2021/12/13 S 2 R 2 eavesdropping, denial of service, … 19
Challenge 3: Mobility ß Mobility causes poor-quality wireless links ß Mobility causes intermittent connection Þ ß under intermittent connected networks, traditional routing, TCP, applications all break Mobility changes context, e. g. , location 2021/12/13 20
Challenge 4: Portability ß ß Limited battery power Limited processing, display and storage Sensors, embedded controllers PDA phone Laptop • data • simpler graphical displays • fully functional • standard applications • 802. 11/3 G • battery; 802. 11 Mobile phones • voice, data • simple graphical displays • GSM/3 G 2021/12/13 Performance/Weight/Power Consumption 21
Challenge 5: Regulation and Multiple Communication Standards cellular phones 1981: NMT 450 1991: CDMA digital 2021/12/13 1991: D-AMPS 1993: PDC 2000: GPRS wireless LAN 1984: CT 1 1988: Inmarsat. C 1994: DCS 1800 analogue 1980: CT 0 1982: Inmarsat. A 1983: AMPS 1986: NMT 900 1992: GSM cordless phones satellites 1992: Inmarsat-B Inmarsat-M 1998: Iridium 1987: CT 1+ 1989: CT 2 1991: DECT 199 x: proprietary 1997: IEEE 802. 11 1999: 802. 11 b, Bluetooth 2000: IEEE 802. 11 a 2001: IMT-2000 22 Fourth Generation (Internet based)
Today’s Lecture ß Introduction and Challenges ß Internet Mobility ß IPv 6 Mobility Support ß Ad hoc Network ß Mobile System Framework ß Rethinking about Mobility ß Reading List 2021/12/13 23
Routing to Mobile Nodes ß Obvious solution: have mobile nodes advertise route to mobile address/32 Þ ß Should work!!! Why is this bad? Þ Consider forwarding tables on backbone routers Would have an entry for each mobile host � Not very scalable � ß What are some possible solutions? 2021/12/13 24
How to Handle Mobile Nodes? (Addressing) ß Dynamic Host Configuration (DHCP) Þ Þ Host gets new IP address in new locations Problems Host does not have constant name/address how do others contact host � What happens to active transport connections? � 2021/12/13 25
How to Handle Mobile Nodes? (Naming) ß Naming Þ Þ 2021/12/13 Use DHCP and update name-address mapping whenever host changes address Fixes contact problem but not broken transport connections 26
How to Handle Mobile Nodes? (Transport) ß TCP currently uses 4 tuple to describe connection Þ ß ß Modify TCP to allow peer’s address to be changed during connection Security issues Þ ß <Src Addr, Src port, Dst addr, Dst port> Can someone easily hijack connection? Difficult deployment both ends must support mobility 2021/12/13 27
How to Handle Mobile Nodes? (Link Layer) ß Link layer mobility Þ Þ Learning bridges can handle mobility this is how it is handled at CMU Encapsulated PPP (PPTP) Have mobile host act like he is connected to original LAN � 2021/12/13 Works for IP AND other network protocols 28
How to Handle Mobile Nodes? (Routing) ß ß Allow mobile node to keep same address and name How do we deliver IP packets when the endpoint moves? Þ ß What about packets from the mobile host? Þ Þ ß Can’t just have nodes advertise route to their address Routing not a problem What source address on packet? this can cause problems Key design considerations Þ Þ 2021/12/13 Scale Incremental deployment 29
Basic Solution to Mobile Routing ß Same as other problems in computer science Þ ß Keep some part of the network informed about current location Þ ß Add a level of indirection Need technique to route packets through this location (interception) Need to forward packets from this location to mobile host (delivery) 2021/12/13 30
Interception ß Somewhere along normal forwarding path Þ Þ ß At source Any router along path Router to home network Machine on home network (masquerading as mobile host) Clever tricks to force packet to particular destination Þ 2021/12/13 “Mobile subnet” – assign mobiles a special address range and have special node advertise route 31
Delivery ß ß Need to get packet to mobile’s current location Tunnels Þ Þ ß Tunnel endpoint = current location Tunnel contents = original packets Source routing Þ 2021/12/13 Loose source route through mobile current location 32
Mobile IP (RFC 2290) ß Interception Þ ß Delivery Þ Þ ß Typically home agent – a host on home network Typically IP-in-IP tunneling Endpoint – either temporary mobile address or foreign agent Terminology Þ Þ 2021/12/13 Mobile host (MH), correspondent host (CH), home agent (HA), foreign agent (FA) Care-of-address, home address 33
Mobile IP (MH at Home) Packet Correspondent Host (CH) Internet Visiting Location Home Mobile Host (MH) 2021/12/13 34
Mobile IP (MH Moving) Packet Correspondent Host (CH) Internet Visiting Location Home Agent (HA) 2021/12/13 I am here 35 Mobile Host (MH)
Mobile IP (MH Away – FA) Packet Correspondent Host (CH) Mobile Host (MH) Internet Visiting Location Home Encapsulated Home Agent (HA) 2021/12/13 Foreign Agent (FA) 36
Mobile IP (MH Away - Collocated) Packet Correspondent Host (CH) Internet Visiting Location Home Encapsulated Home Agent (HA) 2021/12/13 Mobile Host (MH) 37
Other Mobile IP Issues ß Route optimality Þ Þ Resulting paths can be sub-optimal Can be improved with route optimization � ß Authentication Þ Þ ß Registration messages Binding cache updates Must send updates across network Þ ß Unsolicited binding cache update to sender Handoffs can be slow Problems with basic solution Þ Þ 2021/12/13 Triangle routing Reverse path check for security 38
Today’s Lecture ß Introduction and Challenges ß Internet Mobility ß IPv 6 Mobility Support ß Ad hoc Network ß Mobile System Framework ß Rethinking about Mobility ß Reading List 2021/12/13 39
IPv 6 addressing and mobility ß IPv 6 addresses consist of two parts: a 64 -bit network prefix and a 64 -bit host suffix. Network prefix Host suffix Identifies the network to which host is connected ß ß Identifies host within the network. Network prefix of address depends on location. When a host moves from one IP network to another, it needs to change the network part of its address. → 2021/12/13 Issues with reachability, session continuity. 40
Mobile IPv 6 ß ß Mobility support in IPv 6 (RFC 3775) Mobile node (MN) is a mobile device with an IPv 6 home address Correspondent node (CN) is a computer with which mobile node communicates using its home address. Home Agent (HA) helps MN to manage its mobility: Þ Þ 2021/12/13 Mobile node can always be reached at its home address, regardless of its point of attachment (care-of address) to the Internet. Connections made with home address survive movement between different IP networks. 41
Mobile IPv 6 addressing ß ß IP addresses act as both an identifier for a node and as a locator. Mobile IPv 6 separates the identity, home address of mobile node from its locator, known as care-of address (Co. A). Without Mobile IPv 6 MN can not use its home address for sending and receiving packets when it is outside its home network. Mobile IPv 6 uses IP-IP tunneling to create a virtual network between its Co. A and HA, so that MN always appears to be in its home network. 2021/12/13 42
Reverse Tunneling ß IPv 6 in IPv 6 tunnel is used for delivering traffic to and from home address of MN via HA. Tunnel IPv 6 hdr (Co. A –HA) IPv 6 hdr (Ho. A-CN) Data HA uses proxy neighbor discovery to redirect packets on home link destined to home address of MN to its own link layer address. ß HA keeps track of the care-of address of MN to deliver packets to MN. 2021/12/13 43 ß
Mobile IPv 6 operation Tunnel Binding Ack. Proxy ND for Ho. A Binding Update Router Advertisement Router solicitation MN forms Care-of address 2021/12/13 44
Route Optimization in Mobile IPv 6 ß Tunneling of traffic between MN and CN via home agent is not efficient. Þ Þ ß ß HA is a potential bottleneck Extra routing hop increases network latency Route optimization (RO) allows MN and CN to communicate directly MN sends a BU to CN. MN and CN use home address option and routing header, type 2 to send packets to each other. Route optimization is secured using return routability protocol. 2021/12/13 45
Mobile IPv 6 Implementations ß Windows Þ Þ Þ ß BSD Þ Þ Þ ß ß ß KAME (Wide project): MN/CN/HA INRIA: MN/CN/HA NEC? Linux Þ ß MS Research implementation MN, CN, HA MS CN implementation for Win XP Elmic software: embedded MN MIPL (Helsinki University of Technology): MN/CN/HA Elmic software: embedded MN Symbian: MN HP-UX 11. 11, 11. 23 : HA/CN Cisco: HA Nokia: HA 2021/12/13 46
Mobile IPv 6 extensions ß Localized mobility management Þ Þ ß ß Hierarchical Mobile IPv 6 Fast Mobile IPv 6 Context transfer to new router: Context transfer protocol Early discovery of new router: Candidate access router discovery protocol 2021/12/13 47
Network Mobility 2021/12/13 48
NEMO (RFC 3963) Operation Network a: : Network b: : IP IP tunnel Network a: 1: : 2021/12/13 49
References ß ß ß ß Mobile IPv 6: RFC 3775 Securing Mobile IPv 6 MN-HA signaling: RFC 3776 Hierarchical MIPv 6: RFC 4140 Fast Mobile IPv 6: RFC 4068 Context transfer protocol: RFC 4067 Candidate access router discovery protocol: RFC 4068 Network Mobility (NEMO) Basic Support Protocol: RFC 3963 2021/12/13 50
Today’s Lecture ß Introduction and Challenges ß Internet Mobility ß IPv 6 Mobility Support ß Ad hoc Network ß Mobile System Framework ß Rethinking about Mobility ß Reading List 2021/12/13 51
Wireless Network Topology Independent Basic Service Set 2021/12/13 52
Introduction to Ad hoc ß What is Ad hoc Networks? Þ ß Peer to peer communication by use of Wi-Fi technology without passing through an access point (AP) Why Ad hoc Networks? Þ Þ Þ 2021/12/13 No infrastructure needed Can be deployed quickly, where there is no wireless communication infrastructure present Can act as an extension to existing networks Cost-effective Adaptive computing and self-configuring 53
Ad Hoc Routing ß Goal: Communication between wireless nodes Þ Þ 2021/12/13 No external setup (self-configuring) Often need multiple hops to reach dst 54
Challenges ß Poorly-defined “links” Þ ß ß ß Probabilistic delivery, etc. Kind of n^2 links Time-varying link characteristics No oracle for configuration (no ground truth configuration file of connectivity) Low bandwidth (relative to wired) Possibly mobile Possibly power-constrained 2021/12/13 55
Goals ß ß Provide connectivity! Low consumption of memory, bandwidth, {possibly power} Scalable with numbers of nodes Localized effects of link failure Þ 2021/12/13 (For scalability and stability) 56
Standard Routing: DV and LS ß DV protocols may form loops Þ Þ ß ß Very wasteful in wireless: bandwidth, power Loop avoidance sometimes complex LS protocols: high storage and communication overhead – particularly when potentially n^2 links! More links in wireless (e. g. , clusters) - may be redundant higher protocol overhead 2021/12/13 57
Problems Using DV or LS ß Periodic updates waste power Þ Þ ß Tx sends portion of battery power into air Reception requires less power, but periodic updates prevent mobile from “sleeping” Convergence may be slower in conventional networks but must be fast in ad-hoc networks and be done without frequent updates 2021/12/13 58
Evaluating Ad Hoc Protocols ß Parameter question: How much mobility? Þ Þ And what mobility model? Consider reality: Random waypoint? Clustered? � ß Businesspeople wandering to/from work vs. soldiers, etc. Link model Þ Early research all used spherical propagation, etc. � Þ 2021/12/13 Tended to binary “working” or “not working” More modern uses traces from real deployments or more realistic models 59
Protocols Classification ß Proactive vs. reactive Þ Þ Þ ß proactive: continuously evaluate network connectivity reactive: invoke a route determination procedure ondemand. Right balance between proactive and reactive Flat vs. hierarchical 2021/12/13 60
Sample Protocols ß Proactive Protocols Þ ß Reactive Protocols Þ Þ Þ ß Dynamic source routing (DSR) Ad hoc on-demand distance vector routing (AODV) Temporally ordered routing algorithms (TORA) Hybrid: Þ ß Destination sequenced distance vector (DSDV) Zone routing Hierarchical Þ Þ 2021/12/13 Cluster-based Connected-dominating-set-based 61
Proactive: DSDV ß ß ß DSDV is Destination Based No global view of topology Based on Bellman-Ford routing algorithms Enhanced with freedom from loops. Enhanced with differentiation of stale routes from new ones by sequence numbers. 2021/12/13 62
DSDV Protocol ß DSDV is Proactive (Table Driven) Þ Þ 2021/12/13 Each node maintains routing information for all known destinations Routing information must be updated periodically Traffic overhead even if there is no change in network topology Maintains routes which are never used 63
DSDV Protocol ß ß Keep the simplicity of Distance Vector Guarantee Loop Freeness Þ ß New Table Entry for Destination Sequence Number Allow fast reaction to topology changes Þ Þ 2021/12/13 Make immediate route advertisement on significant changes in routing table but wait with advertising of unstable routes (damping fluctuations) 64
DSDV (Table Entries) ß ß ß Destination Next Metric Seq. Nr Install Time Stable Data A A 0 A-550 001000 Ptr_A B B 1 B-102 001200 Ptr_B C B 3 C-588 001200 Ptr_C D B 4 D-312 001200 Ptr_D Sequence number originated from destination. Ensures loop freeness. Install Time when entry was made (used to delete stale entries from table) Stable Data Pointer to a table holding information on how stable a route is. Used to damp fluctuations in network. 2021/12/13 65
DSR Concepts ß Source routing Þ ß No need to maintain up-to-date info at intermediate nodes On-demand route discovery Þ 2021/12/13 No need for periodic route advertisements 66
DSR Components ß Route discovery Þ ß The mechanism by which a sending node obtains a route to destination Route maintenance Þ 2021/12/13 The mechanism by which a sending node detects that the network topology has changed and its route to destination is no longer valid 67
DSR Route Discovery ß Route discovery - basic idea Þ Þ Þ Source broadcasts route-request to Destination Each node forwards request by adding own address and re-broadcasting Requests propagate outward until: Target is found, or � A node that has a route to Destination is found � 2021/12/13 68
C Broadcasts Route Request to F A D E Route Request B Source C Destination F G 2021/12/13 H 69
C Broadcasts Route Request to F A D E Route Request B Source C Destination F G 2021/12/13 H 70
H Responds to Route Request A D E B Source C Destination F G 2021/12/13 H 71 G, H, F
C Transmits a Packet to F A D E B Source C G, H, F Destination F G 2021/12/13 H, F H 72 F
Forwarding Route Requests ß A request is forwarded if: Þ Þ ß Node is not the destination Node not already listed in recorded source route Node has not seen request with same sequence number IP TTL field may be used to limit scope Destination copies route into a Route-reply packet and sends it back to Source 2021/12/13 73
Route Cache ß All source routes learned by a node are kept in Route Cache Þ ß ß Reduces cost of route discovery If intermediate node receives RR for destination and has entry for destination in route cache, it responds to RR and does not propagate RR further Nodes overhearing RR/RP may insert routes in cache 2021/12/13 74
Sending Data ß ß Check cache for route to destination If route exists then Þ If reachable in one hop � Þ ß Send packet Else insert routing header to destination and send If route does not exist, buffer packet and initiate route discovery 2021/12/13 75
DSR Discussion ß ß Source routing is good for on demand routes instead of a priori distribution Route discovery protocol used to obtain routes on demand Þ ß ß Caching used to minimize use of discovery Periodic messages avoided But need to buffer packets 2021/12/13 76
AODV ß Combination of DSR and DSDV Þ Þ ß Routing table is constructed on demand. Sequence numbers (issued from different destinations) are used to avoid looping The node should respond (ROUTE_REPLY) a request (ROUTE_REQ) if Þ Þ 2021/12/13 It is the destination node An intermediate node with a route of a destination sequence number no less than that in the request packet. 77
TORA ß For each destination, a DAG is maintained with destination as the sink: Þ Þ ß Each node has a height metric. A directed link always points to a node with a lower height metric. To send a packet, a host forwards the packet to any neighbor with a lower metric. 2021/12/13 78
TORA: route maintenance ß Full reversal Þ ß At each iteration each node other than the destination that has no outgoing link reverses the directions of all its incoming links. Partial reversal Þ Þ 2021/12/13 Every node u other than the destination keeps a list of its neighboring nodes v that have reversed the direction of the corresponding link (u, v) At each iteration each node u that has no outgoing link reverses the directions of the links (u; v) for all v which do not appear on its list, and empties the list. If no such v exists, node u reverses the directions of all incoming links and empties the list. 79
TORA: route maintenance 2021/12/13 80
Hybrid: Zone-based Routing ß ß Trade-offs: network capacity usage in proactive approaches and the long delay in reactive approaches. A routing zone (for a host) includes the nodes within a given number of hops. Each host maintains routing information only to nodes within its routing zone. Information outside the routing zone is obtained through on demand. 2021/12/13 81
Zone-based Routing (Cont’d. ) Zone routing 2021/12/13 82
Hiearchical: Domination-set-based School bus routing 2021/12/13 83
Graph-theoretic Definition ß A set in G(V, E) is dominating if all the nodes in the system are either in the set or neighbors of nodes in the set. 2021/12/13 84
Five-Queen Problem (1850’s) 2021/12/13 85
Desirable Features ß ß Simple and quick Connected dominating set A simple ad hoc wireless network of five wireless mobile hosts. 2021/12/13 86
Existing Approaches ß Graph theory community: Þ Þ ß Bounds on the domination number (Haynes, Hedetniemi, and Slater, 1998). Special classes of graph for which the domination problem can be solved in polynomial time. Ad hoc wireless network community: Þ Þ 2021/12/13 Global: MCDS (Sivakumar, Das, and Bharghavan, 1998). Quasi-global: spanning-tree-based (Wan, Alzoubi, and Frieder, 2002). Quasi-local: cluster-based (Lin and Gerla, 1999). Local: marking process (Wu and Li, 1999). 87
MCDS ß ß All nodes are initially colored white. The node with the maximum node degree is selected as the root and colored black. All the neighbors of the root are colored gray. Select a gray node that has the maximum white neighbors. The gray node is colored black and its white neighbors are marked gray. Repeat step (3) until there is no more white node. 2021/12/13 88
MCDS (Cont’d. ) black nodes = CDS (connected dominating set) MCDS as an approximation of CDS 2021/12/13 89
Spanning-tree-based ß ß ß A spanning tree rooted at v (selected through an election process) is first constructed. Nodes are labeled according to a topological sorting order of the tree. Nodes are marked based on their positions in the order starting from root v. Þ Þ ß All nodes are white initially. V is marked black and all nodes are labeled black unless there is a black neighbor. Each black node (except root v) selects a neighbor with the largest label but smaller than its own label and mark it gray. 2021/12/13 90
Spanning-tree-based (Cont’d. ) black nodes = DS black nodes + gray nodes = CDS selecting CDS in a spanning tree 2021/12/13 91
Cluster-based All nodes are initially white. ß When a white node finds itself having the lowest id among all its white neighbors, it becomes a cluster head and colors itself black. ß All its neighbors join in the cluster and change their colors to gray. ß Repeat steps (1) and (2) until there is no white node left. ß Special gray nodes: gray nodes that have two neighbors in different 92 clusters. 2021/12/13 ß
Cluster-based (Cont’d. ) black nodes = DS black nodes + special gray nodes = CDS sequential propagation in the cluster-based approach. 2021/12/13 93
Today’s Lecture ß Introduction and Challenges ß Internet Mobility ß IPv 6 Mobility Support ß Ad hoc Network ß Mobile System Framework ß Rethinking about Mobility ß Reading List 2021/12/13 94
Recap ß What are the major considerations in developing a software environment and application framework for mobile wireless applications? Þ Þ 2021/12/13 Handle heterogeneous devices/configurations Efficient (memory, battery, …) Easy programming for event-driven programming … 95
Overview ß Software framework for mobile applications is a quite large topic, we will see three representative examples Þ Þ Þ 2021/12/13 Tiny. OS J 2 ME Android 96
Tiny. OS ß Hardware Þ Þ Assembled from off-the-shelf components 4 Mhz, 8 bit MCU (ATMEL) � Þ 512 bytes RAM, 8 KB ROM Devices serial Port � temperature sensor & light sensor � 900 Mhz Radio (RF monolithics) � � 2021/12/13 � 10 -100 ft. range LED outputs 97 1. 5” x 1. 5”
Schematic Diagram of a Mote 2021/12/13 98
Sample Application: Environment Monitoring ß Environment monitoring, e. g. , Þ Þ Þ ß measure temperature, lighting values/events periodically transmit measurements/events to a base station forward data for other nodes that are out of range of the base station … 2021/12/13 99
Requirements on Software Dev. Framework ß Small foot print Þ ß ß devices have limited memory and power resources Support one application at a time but flexible reprogramming Flexible configuration of attached devices 2021/12/13 100
Tiny. OS Application Dev. Framework ß ß Basic principle: Generate customized OS + application for each given scenario We say each generated scenario generates a tiny. OS 2021/12/13 101
Tiny. OS: Software Components ß A tiny. OS consists of one or more components linked together Þ ß software components motivated by hardware component Each component specifies that Þ it provides some interfaces � Þ also uses some interfaces � 2021/12/13 allows other components to control it control other components 102
Interface ß An interface Þ Þ 2021/12/13 declares a set of functions called commands that provider must implement and A uses interfaces I 1 and I 2 I 1 commands another set of functions called events that the interface user must implement I 2 events commands B provides I 1 C provides I 3 103 events C provides I 2
Linking Components ß Two types of components: Þ Þ 2021/12/13 modules: individual components configurations : assemble components together, connecting interfaces (objects) used by components to interfaces (objects) provided by others 104
Tiny. OS Execution Model ß Concurrency model: only two threads Þ ß Tasks perform the primary computation work Þ Þ ß long running tasks that can be interrupted by hardware event handlers commands and event handlers post tasks call lower level commands signal higher level events schedule other tasks within a component Each task is atomic with respect to other tasks Þ Þ 2021/12/13 run to completion, but can be preempted by events the task scheduler is a simple FIFO scheduler 105
A More Complete Sample Application ß Sensor network monitoring Þ Þ 2021/12/13 monitor temperature and light conditions periodically transmit measurements to a base station sensors can forward data for other sensors that are out of range of the base station dynamically determine the correct routing topology for the network 106
Message Send Transition ß Total propagation delay up the 5 layer radio communication stack is about 80 instructions Timing diagram of event propagation 107 2021/12/13
Evaluation: Storage ß ß ß Component Name Scheduler only occupies 178 bytes Complete application only requires 3 KB of instruction memory and 226 bytes of data (less than 50% of the 512 bytes available) Only processor_init, Tiny. OS scheduler, and C runtime are required 2021/12/13 108 Code Size (bytes) Data Size (bytes) Routing AM_dispatch AM_temperature AM_light AM RADIO_packet RADIO_byte RFM Light Temp UART_packet I 2 C 88 40 78 146 356 334 810 310 84 64 196 314 198 0 0 32 8 40 40 8 1 1 40 8 Processor_init Tiny. OS scheduler C runtime 172 178 82 30 16 0 3450 226 Total
Evaluation: Timing Operations Cost (cycles) Byte copy Normalized to byte copy 8 2 1 Post an Event 10 2. 5 1. 25 Call a Command 10 2. 5 1. 25 Post a task to scheduler 46 11. 5 6 51 12. 75 6 Interrupt (hardware cost) 9 2. 25 1 Interrupt (software cost) 71 17. 75 9 Context switch overhead 2021/12/13 Time (µs) 109
Discussion ß What would we need to extend to tiny. OS if we were to use it for writing mobile applications for mobile phones and PDAs? 2021/12/13 110
Andriod 2021/12/13 111
Andriod Features ß Linux kernel as foundation ß Java based framework (J 2 SE not J 2 ME) ß Dalvik Virtual machine 2021/12/13 112
Application Framework: Key Concepts ß Activity Þ ß Service Þ ß Shared data Broadcast receivers Þ ß Background services Content provider Þ ß Visible screen Receive and react to broadcast events Intent Þ 2021/12/13 Activating component 113
Today’s Lecture ß Introduction and Challenges ß Internet Mobility ß IPv 6 Mobility Support ß Ad hoc Network ß Mobile System Framework ß Rethinking about Mobility ß Reading List 2021/12/13 114
The problem ß ß ß How to “support” mobile users What do we mean by support? Make it easy and convenient to effectively use the network while moving from location to location 2021/12/13 115
The Solution Space ß Where can we address this problem? Þ Þ Þ 2021/12/13 Physical layer? (sure; very limited) Link layer Transport layer “Something higher” (often called session) Application layer 116
The questions ß What components are affected? Þ Þ ß ß ß E. g. , what needs to explicitly support mobility? Is it incrementally deployable? What timescales does it support? What geographic/logical bounds does it place on mobility? What overhead does it impose? How does it affect or interact with other aspects of the architecture? How does it scale? 2021/12/13 117
Who are we supporting? ß What kinds of mobility scenarios should we support? Þ Þ Þ 2021/12/13 Talking on a Vo. IP phone while walking down the street? Navigating with a laptop in a car? Using a laptop in an airplane? Taking laptop from home to work? Walking around lab or campus? Something we haven’t thought of yet? ? 118
No Network Support (Applications are on their own) ß Let them disconnect and reconnect when they arrive at a new location. Þ Þ Þ Network support needed: None / DHCP Your SSH sessions die. Your streaming media probably gets interrupted. Some applications have already worked around this: Your Web browser doesn’t care � Your IMAP mail reader probably doesn’t care � 2021/12/13 119
Dealing with disconnection ß Possible to code many applications to deal with disconnection Þ Þ 2021/12/13 It’s all about trying to resume and managing state (we’ll come back to this) But should the burden be placed on every application developer? 120
So – Application? ß What components are affected? Þ ß What timescales does it support? Þ ß None What overhead does it impose? Þ ß End-to-end application communication. Seconds? What geographic/logical bounds does it place on mobility? Þ ß Any application that wants to work Lots of programmer overhead How does it affect or interact with other aspects of the architecture? Þ 2021/12/13 Nothing’s changed 121
Link-layer mobility ß Have the link layer mask mobility Þ ß ß ß E. g. , the campus 802. 11 wireless. You can move anywhere and keep the same MAC and IP address Completely transparent. No OS/App support needed. Brilliant! Fast & Local: Only switches near moving client must be updated. But – only local! Can’t move out of your subnet. 2021/12/13 122
So – Link? ß What components are affected? Þ ß What timescales does it support? Þ ß Can only move within local subnet What overhead does it impose? Þ ß Pretty durned fast What geographic/logical bounds does it place on mobility? Þ ß The local switching infrastructure Little How does it affect or interact with other aspects of the architecture? Þ 2021/12/13 Could encourage ideas like making all of CMU a single broadcast domain. Oops, too late. 123
IP Layer Mobility ß ß Allow hosts to take their “home” IP address with them wherever they go. Advantages: Þ Þ ß Potentially global mobility scope (not limited to subnet like link layer) Transparent to applications and layers above IP How can we do it? Þ 2021/12/13 (Many ways, each with own costs) 124
Brute Force: IP routing ß If node leaves home, send out (global? ) routing announcement pointing to new location Þ Þ 2021/12/13 In theory, “just works” Example: Boeing’s “Connexion” announced a /24 into BGP for every supported airplane and moved the announcement to the gateway the plane was closest to Why? Latency concerns over really long flights (start in SF, end in London) Already have high latency from using satellites. Ow. 125
Brute force(cont’d) ß ß May be feasible for Boeing But wouldn’t scale for single IP addresses Þ ß ß Every AS in world would have routing entry for every mobile user in the world? Ouch! Problem: Having the whole world maintain state for every user Alternative: Keep state local, by… 2021/12/13 126
Mobile IP (& others): ß Same as other problems in Computer Science Þ ß Keep some part of the network informed about current location Þ ß Add a level of indirection Need technique to route packets through this location (interception) Need to forward packets from this location to mobile host (delivery) 2021/12/13 127
TCP Migrate ß ß Transport-layer solution Idea: No IP support; just have transport layer dynamically re-bind endpoints 2021/12/13 128
The Migrate Approach ß Locate hosts through existing DNS Þ Þ Secure, dynamic DNS is currently deployed and widely available (RFC 2137) Maintains standard IP addressing model IP address are topological addresses, not Ids � Fundamental to Internet scaling properties � ß Ensure seamless connectivity through connection migration Þ Þ 2021/12/13 Notify only the current set of correspondent hosts Follows from the end-to-end argument 129
Migrate Architecture Location Query (DNS Lookup) Location Update (Dynamic DNS Update) DNS Server Connection Initiation Connection Migration Correspondent Host Mobile Host foo. bar. edu yyy xxx 2021/12/13 130
Migrate ß Advantages: Þ (Mostly) transparent to applications � Þ Þ ß Unless they know their IP address and use it, e. g. , peer-topeer apps. Keeps state and modifications entirely at endpoints No triangle routing! All communication is direct But: Þ Requires TCP support / only works for TCP � Þ 2021/12/13 Not true in general: “Host ID Protocol” – HIP – can work with both, but requires more invasive IP stack changes Slower timescales than link-layer migration (several RTTs) 131
Complexities of e 2 e mobility ß Simultaneous movement Þ Þ Þ ß If only one host moves, easy If both move, must be able to reconnect Snoeren approch uses DNS with dynamic DNS updates – re-point your old name to your new IP when you move Security Þ 2021/12/13 How to prevent connection hijacking? 132
Mobility & Security ß Migrate principle: Equivalent security to TCP Þ Þ TCP connections hard to hijack remotely if you can’t sniff because you must guess a 32 -bit sequence # space. (mostly; we’ll talk about this more later) Migrate approach: Establish a pretty secure session key on connection establishment � � ß Resists snooping but not man-in-the-middle But neither does normal TCP! Other options: HIP uses cryptographic host identification Þ Þ 2021/12/13 Better idea Less incrementally deployable 133
Names & Addresses & Bears ß Mobility raises good question: Þ What is the identity of a host? � ß MAC address? IP address? DNS name? Something else? Consider: Þ Þ Þ 2021/12/13 Hosts can have multiple MAC & IP addresses IP address is a topological identifier – it points to a place in the local IP space and is awkward to move, as we’ve seen DNS names? Maybe, but the binding between DNS/IP/hosts isn’t very strict 134
Host Identity ß Considerable recent work: Give each host a unique identity Þ Þ Þ 2021/12/13 Simplifies mobility Also simplifies multi-homing! (Many related issues) Me? I think it’s a great idea. Will it ever take off? 135
What mobility do we need? ß ß ß Consider our scenarios and our techniques – what do we really need? Link layer mobility can deal with smallscale motion E 2 E mobility does a good job on “big”, less frequent movement Þ Þ 2021/12/13 But if only a few apps matter, so does recoding those apps to deal Requires bilateral deployment! Boooo. 136
What mobility do we need? (cont’d) ß Mobile IP (or VPNs, which is basically what mobile IP is) can be unilaterally deployed, but has triangle routing problems Þ ß But require more infrastructure Do most people care enough? Or would we have entire new classes of applications if mobility was easier? 2021/12/13 137
- Slides: 137