Manet Ref01

download Manet Ref01

of 40

Transcript of Manet Ref01

  • 8/12/2019 Manet Ref01

    1/40

    Lecture 5: Programming Mobile Ad Hoc Networks

    Cristian Borcea

    Department of Computer Science

    NJIT

  • 8/12/2019 Manet Ref01

    2/40

    Wireless systems cooperate

    to achieve global tasks

    2

    Mobile devices dont interactwith each other directly Traditional client-server model

    predominates

    No interaction between mobiles

    and static sensors

  • 8/12/2019 Manet Ref01

    3/40

    Hard to program applications over mobile ad hoc

    networks (MANETs) Systems

    Mobile and distributed across physical space

    Internet connectivity may be unavailable or too expensive

    Resource-constrained: battery, bandwidth

    May contain highly sensitive data: location, social contacts

    Heterogeneous: both hardware and software

    Networks Large scale

    Volatile: ad hoc topologies, dynamic resources

    Less secure than wired networks 3

  • 8/12/2019 Manet Ref01

    4/40

    Introduction

    3 MANET programming models [Ref. 1]

    Migratory Services: context-aware client-service

    programming

    Spatial Programming: location-aware imperative

    programming

    Contory: SQL-like declarative programming Smart Messages: implementation platform for all 3

    models

    4

  • 8/12/2019 Manet Ref01

    5/40

    5

    Typical devices: smart phones and vehicular systems Distributed sensing services

    Acquire, process, disseminate real-time information from proximityof regions, entities, or activities of interest

    Have context-aware execution Many times, interact for longer period of time with clients

    P

    CLARKST

    LAKEST

    ELMWOODAVE

    MAPLEAVE

    RIDGE

    AVE

    DAVIS ST

    COLLEGE ST

    OLD

    TOWN

    P

    BURNSIDE ST

    P

    GROVEST

    OAKAV

    P

    P

    CHURCH ST

    S

    C

    Parking spotfinder

    S

    C

    Traffic jampredictor

    C

    S

    Entitytracking

  • 8/12/2019 Manet Ref01

    6/40

    6

    No support for context-awareness When service stops satisfying context requirements, only solution is

    to discover new service

    Not always possible to find new service

    Overhead due to service discovery The state of the old service is lost

    No support for dynamic binding of names to IP addresses Difficult to ensure that name resolution ends up with new service

    when necessary No support for dynamic service deployment

    Cannot guarantee that a node satisfying all context requirementshas the necessary service

    End-to-end data transfers may hardly complete

  • 8/12/2019 Manet Ref01

    7/40

    7

    Context-awareclient-server programming model

    Services migrate to nodes where they can accomplish

    their tasks

    Present single virtual end-point to clients One-to-one mapping between clients and services

    Carry execution state across migrations

    Transfer their code if necessary

    Service migration Triggered by context changes

    Regulated through context rules

    Transparent to clients

    Typically multi-hop

  • 8/12/2019 Manet Ref01

    8/408

    Virtual serviceend-point

    Client

    n1

    C

    n2

    n3

    Context Change! (e.g., n2moves out of the region of interest)

    MS cannot accomplish its task on n2any longer

    ServiceMigration

    MS

    State MigratoryService

    MSState

    MigratoryService

  • 8/12/2019 Manet Ref01

    9/409

    n1

    C1

    Meta-service

    n3

    M

    CreateMigratory Service

    MS1

    State

    n2 n5

    MS2

    State

    C2MS2State

    n4

    MS1

    State

  • 8/12/2019 Manet Ref01

    10/4010

    Context

    Manager Validator

    Communication

    Manager

    Smart Messages Platform

    Operating System/ Wireless Communication / Sensors

    MonitoredCxt

    Client Application/Service

    Reliability

    Manager

    InCxtRules

    OutCxtRules

    Monitors context identifiers specified byprograms

    Evaluates context rules specified by programs

    IN context rules control incoming data

    Used for meta-services to accept/refuse requests

    Used for clients to accept/refuse responses

    OUT context rules control outgoing data

    Used for migratory services to decide whether to

    send a response or trigger a migration

    Based on the classical primary-backup approachwith two modifications

    Secondary node dynamically selected in acontext-aware manner

    Backup frequency constantly adapted based

    on the operating network conditions

    Discover meta-services

    Transfer messages between

    communicating end-points Carry out service migration

    Provides execution migration, routing, property-basednaming

  • 8/12/2019 Manet Ref01

    11/4011

    Predict traffic jams in real-time The request specifies region of interest

    Service migrates to ensure it stays in this region

    Uses history (service execution state) to improve prediction

    TJam utilizes information that every car has: Number of one-hop neighboring cars

    Speed of one-hop neighboring cars

    Inform me when there is high

    probability of traffic jam 10 miles ahead

  • 8/12/2019 Manet Ref01

    12/4012

    monitoredCtx= {location, speed}

    inCtxRule= {,

    rejectResponse && sendUpdate}

    serviceParameters = {region, frequency}

    request = {clientName, serviceParameters}

    send(TJam, request);while (NOT_DONE)

    response = receive(msName);

    monitoredCtx= {location, speed, region}outCtxRule= {,

    migrateService}

    while (NOT_DONE)

    response = computeResponse();

    send(clientName, response);

    Client

    MigratoryService

  • 8/12/2019 Manet Ref01

    13/40

    Introduction

    3 MANET programming models

    Migratory Services: context-aware client-service

    programming

    Spatial Programming: location-aware imperative

    programming

    Contory: SQL-like declarative programming Smart Messages: implementation platform for all 3

    models

    13

  • 8/12/2019 Manet Ref01

    14/4014

    Imperative programming model with fine-grained control

    over individual systems

    Provides a virtual name space over MANETs

    Systems referencedby their locations and properties

    Runtime system takes care of name resolution, reference

    consistency, and networking aspects

    Implementation on top of Smart Messages: SP applicationsexecute, sequentially, on each system referenced in their

    code

  • 8/12/2019 Manet Ref01

    15/4015

    Distributed application

    Shared virtual address space

    Page table + OS + Message passing

    Distributed physical memory

    Variable accesses

    Programs access data through variables Variables mapped to physical distributed memory locations Page Table and OS guarantee reference consistency

    Runtime system translates variable accesses into message passing

    Access time has an (acceptable) upper bound

  • 8/12/2019 Manet Ref01

    16/40

    16

    radius

    Hill = new Space({lat, long}, radius);

    {lat,long}

    Virtual representation of a physical space Similar to a virtual address space in a distributed shared

    memory system Defined statically or dynamically

  • 8/12/2019 Manet Ref01

    17/40

    17

    {Hill:robot[0]}

    {Hill:robot[1]}

    {Hill:motion[0]}

    Hill

    r2r7

    m5

    Defined as {space:property} pairs Virtual names for wireless systems Similar to variables in conventional programming Indexes used to distinguish among similar systems in the

    same space region

  • 8/12/2019 Manet Ref01

    18/4018

    At first access, a spatial reference is mapped to asystem located in the specified space

    Mappings maintained in per-application Mapping

    Table (MT) similar to a page table

    Subsequent accesses to the same spatial referencewill reach the same system (using MT) as long as itis located in the same space region

    {space, property, index} {unique_address, location}

  • 8/12/2019 Manet Ref01

    19/40

    19

    Left Hill Right Hill

    {Left_Hill:robot[0]}.move = ON;

    r2r7

    r5

    {Left_Hill:robot[0]}.move = OFF;

  • 8/12/2019 Manet Ref01

    20/40

    20

    {Left_Hill:robot[0]}

    Left Hill Right Hill

    {Right_Hill:(Left_Hill:robot[0])}

    r7

  • 8/12/2019 Manet Ref01

    21/4021

    Systems may move, go out of space, or disappear

    Solution: associate an explicit timeout with each

    spatial reference access

    try{

    {Hill:robot[0], timeout}.move = ON;

    }catch(TimeoutException e){

    // the programmer decides the next action

    }

  • 8/12/2019 Manet Ref01

    22/4022

    for(i=0; i Max_motion)

    Max_motion = {Left_Hill:motion[i], timeout}.detect;Max_id = i;

    }catch(TimeoutException e)

    break;

    intrusionSpace = rangeOf({Left_Hill:motion[Max_id].location}, Range);

    {intrusionSpace:robot[0]}.camera = ON;{intrusionSpace:robot[0]}.focus = {Left_Hill:motion[Max_id].location};

    - Find sensor thatdetected strongestmotion on Left Hill

    - Turn on a camera in the

    proximity of thissensor

    Left Hill Right Hill

  • 8/12/2019 Manet Ref01

    23/40

    Introduction 3 MANET programming models

    Migratory Services: context-aware client-service

    programming Spatial Programming: location-aware imperative

    programming

    Contory: SQL-like declarative programming Smart Messages: implementation platform for all 3

    models

    23

  • 8/12/2019 Manet Ref01

    24/40

    SensorDataSources

    Resources

    Monitor

    SensorDataSource

    SensorData

    Sources

    SensorDataSources

    Internal

    Reference 2G/3G

    Reference

    WiFi

    Reference

    Context

    AggregatorContextAggregator

    ContextF

    actory

    BT

    Reference

    Application

    Application

    Application

    Event-based

    commun.

    MANET

    commun.

    MANET

    commun.

    OE

    P

    on demand queryevent-based query

    periodic query

    LocalCxt

    Provder

    O E P

    LocalCxtProvider

    O E PAdHocCxt

    Provder

    O E P

    AdHocCxtProvider

    O E PInfraCxt

    Provder

    O E P

    InfraCxtProvider

    O E P

    Infra

    Facade

    AdHoc

    Facade

    Local

    FacadeQuery

    ManagerCxtQuery

    Cxt

    Query

    Cxt

    Query

    SensorData

    Sources

    SensorDataSources

    SensorData

    Sources

    SensorData

    Sources

    Declarative programmingmodel that sees MANETs asdistributed database for context (i.e., sensing) information

    Flexible and adaptive context provisioning based on dynamicoperating conditions

    May also query internal sensors and Internet-accessible sensors

    24

    MANET part

  • 8/12/2019 Manet Ref01

    25/40

    SELECT FROM [(# nodes, # hops | region)]

    WHERE FRESHNESS DURATION | EVERY | EVENT

    SELECT temperature

    FROM adHocNetwork(3, 2)

    WHERE fidelity = 0.2

    FRESHNESS 30 sec

    DURATION 1 hour

    EVENT AVG(temperature)>2525

    Supports on-demand, periodic, and event-based MANETqueries

    Required

    Weather watcher application

  • 8/12/2019 Manet Ref01

    26/40

  • 8/12/2019 Manet Ref01

    27/40

    Monitor available resources

    Power, memory, running applications, etc.

    Trade off sensing quality and resource consumption

    Reduce the global utilization of resources

    Query aggregation for queries submitted by the same

    device

    Prioritize tasks Context-awareness is a background activity on phones

    27

  • 8/12/2019 Manet Ref01

    28/40

  • 8/12/2019 Manet Ref01

    29/40

    Introduction 3 MANET programming models

    Migratory Services: context-aware client-service

    programming Spatial Programming: location-aware imperative

    programming

    Contory: SQL-like declarative programming Smart Messages: implementation platform for all 3

    models

    29

  • 8/12/2019 Manet Ref01

    30/40

    30

    Data migration

    Lunch:

    AppetizerEntreeDessert

    Execution migration

  • 8/12/2019 Manet Ref01

    31/40

    31

    User-defined distributed applications Composed of code bricks, data bricks, and execution control state

    Execute on nodes of interest named by properties (i.e., tags) Migrate between nodes of interest Self-routeat every node in the path during migrations

    Network

    SMPlatform

    Admission

    Manager

    NetworkSM SM

    Operating System & I/O

    CodeCache

    Virtual

    Machine

    TagSpace

    SM ReadyQueue

    Authorization

    Cooperative node

    architecture

  • 8/12/2019 Manet Ref01

    32/40

    Takes place over a virtual machine

    Non-preemptive, but time bounded

    Ends with a migration, or terminates

    During execution, SMs can Spawn new SMs

    Create smaller SMs out of their code and data bricks

    Access the tag space

    Block on a tag to be updated (i.e., update-based

    synchronization)

  • 8/12/2019 Manet Ref01

    33/40

  • 8/12/2019 Manet Ref01

    34/40

    Ensures progress for all SMs in the network

    Prevents SMs from migrating to nodes that cannot provide

    enough resources

    SMs specify lower bounds for resource requirements (e.g.,memory, bandwidth)

    Determined a-priori through profiling

    SMs accepted if the node can satisfy these requirements

    More resources can be granted according to admissionpolicy

    If not granted, SMs are allowed to migrate

  • 8/12/2019 Manet Ref01

    35/40

    35

    migrate(Taxi)

    sys_migrate(2) sys_migrate(3) sys_migrate(4)

    TaxiTaxi

    1 2 3 4

    migrate() multi-hop content-based migration

    migrates application to node of interest named by tags

    implements routing algorithm using tags and sys_migrate sys_migrate()

    one hop migration

    captures SM state, transfers SM to next hop, resumes SM execution

  • 8/12/2019 Manet Ref01

    36/40

    36

    SMs carry the routing and execute it at each node Routing information stored in tag space

    SMs control their routing

    Select routing algorithm (migrate primitive) Multiple library implementations

    Implement a new one

    Change routing algorithm during execution in response to Adverse network conditions

    Applications requirements

  • 8/12/2019 Manet Ref01

    37/40

    37

    Network1 i

    RouteToTaxi = 2 TaxiRouteToTaxi = ?RouteToTaxi = j

    migrate(Taxi){

    while(readTag(Taxi) == null)

    if (readTag(RouteToTaxi))

    sys_migrate(readTag(RouteToTaxi));

    elsecreate_SM(DiscoverySM, Taxi);

    createTag(RouteToTaxi, lifetime, null);

    block_SM(RouteToTaxi, timeout);

    }

    2

  • 8/12/2019 Manet Ref01

    38/40

    Implemented in Java

    Java 2 Micro-Edition (J2ME) with CLDC 1.1 and MIDP 2.0

    J2ME with CDC

    Development using HP iPAQs (Linux) and Nokia phones

    (Symbian)

    SM platforms

    Original SM on modified KVM (HP iPAQs) migration state captured

    in the VM

    Portable SM on Java VM, J2ME CDC (Nokia 9500) migration state

    captured using bytecode instrumentation

    38

  • 8/12/2019 Manet Ref01

    39/40

    1. Urbanets

    http://cs.njit.edu/~borcea/papers/ieee-pervasive07.pdf

    2. Migratory Services

    http://cs.njit.edu/~borcea/papers/ieee-tmc07.pdf

    3. Spatial Programming

    http://cs.njit.edu/~borcea/papers/spsm04.pdf

    4. Contory http://people.inf.ethz.ch/oriva/pubs/riva_middleware06_paper.pdf

    5. Smart Messages

    http://cs.njit.edu/~borcea/papers/sm03.pdf 39

    http://cs.njit.edu/~borcea/papers/ieee-pervasive07.pdfhttp://cs.njit.edu/~borcea/papers/ieee-tmc07.pdfhttp://cs.njit.edu/~borcea/papers/spsm04.pdfhttp://people.inf.ethz.ch/oriva/pubs/riva_middleware06_paper.pdfhttp://cs.njit.edu/~borcea/papers/sm03.pdfhttp://cs.njit.edu/~borcea/papers/sm03.pdfhttp://people.inf.ethz.ch/oriva/pubs/riva_middleware06_paper.pdfhttp://cs.njit.edu/~borcea/papers/spsm04.pdfhttp://cs.njit.edu/~borcea/papers/spsm04.pdfhttp://cs.njit.edu/~borcea/papers/spsm04.pdfhttp://cs.njit.edu/~borcea/papers/ieee-tmc07.pdfhttp://cs.njit.edu/~borcea/papers/ieee-tmc07.pdfhttp://cs.njit.edu/~borcea/papers/ieee-tmc07.pdfhttp://cs.njit.edu/~borcea/papers/ieee-pervasive07.pdfhttp://cs.njit.edu/~borcea/papers/ieee-pervasive07.pdfhttp://cs.njit.edu/~borcea/papers/ieee-pervasive07.pdfhttp://cs.njit.edu/~borcea/papers/ieee-pervasive07.pdfhttp://cs.njit.edu/~borcea/papers/ieee-pervasive07.pdf
  • 8/12/2019 Manet Ref01

    40/40

    1. Two decades of mobile computing

    2. Infrastructure support for mobility

    3. Mobile social computing

    4. People-centric sensing5. Programming mobile ad hoc networks

    6. Vehicular computing and networking

    Vehicular ad hoc network (VANET) applications: EzCab & TrafficView

    RBVT routing in VANET

    Dynamic traffic guidance in vehicular networks

    7. Privacy and security in mobile computing