A Simple Sensing Program Structure

Slides:



Advertisements
Similar presentations
Computer Networks21-1 Chapter 21. Network Layer: Address Mapping, Error Reporting, and Multicasting 21.1 Address Mapping 21.2 ICMP 21.3 IGMP 21.4 ICMPv6.
Advertisements

Internet Control Protocols Savera Tanwir. Internet Control Protocols ICMP ARP RARP DHCP.
CCNA – Network Fundamentals
© 2007 Cisco Systems, Inc. All rights reserved.Cisco Public 1 Version 4.0 OSI Transport Layer Network Fundamentals – Chapter 4.
BOOTP and DHCP Shivkumar Kalyanaraman Rensselaer Polytechnic Institute
1 CCNA 2 v3.1 Module Intermediate TCP/IP CCNA 2 Module 10.
WXES2106 Network Technology Semester /2005 Chapter 8 Intermediate TCP CCNA2: Module 10.
© 2007 Cisco Systems, Inc. All rights reserved.Cisco Public 1 Version 4.0 Communicating over the Network Network Fundamentals – Chapter 2.
Ad Hoc Wireless Routing COS 461: Computer Networks
DHCP for Multi-hop Wireless Ad-Hoc Networks Presented by William List.
Protocols and the TCP/IP Suite Chapter 4. Multilayer communication. A series of layers, each built upon the one below it. The purpose of each layer is.
1 Lab 3 Transport Layer T.A. Youngjoo Han. 2 Transport Layer  Providing logical communication b/w application processes running on different hosts 
CIS 725 Wireless networks. Low bandwidth High error rates.
Guide to TCP/IP, Second Edition1 Guide To TCP/IP, Second Edition Chapter 6 Basic TCP/IP Services.
1 Semester 2 Module 10 Intermediate TCP/IP Yuda college of business James Chen
Chapter 6-2 the TCP/IP Layers. The four layers of the TCP/IP model are listed in Table 6-2. The layers are The four layers of the TCP/IP model are listed.
TCP/IP Honolulu Community College Cisco Academy Training Center Semester 2 Version 2.1.
Rudra Dutta CSC , Fall, 2012 A Simple Sensing Program Structure.
Lectu re 1 Recap: “Operational” view of Internet r Internet: “network of networks” m Requires sending, receiving of messages r protocols control sending,
Networking Basics CCNA 1 Chapter 11.
1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Dynamic Host Configuration Protocol (DHCP)
Linux Operations and Administration Chapter Eight Network Communications.
1 Connectivity with ARP and RARP. 2 There needs to be a mapping between the layer 2 and layer 3 addresses (i.e. IP to Ethernet). Mapping should be dynamic.
CS/EE 145A Reliable Transmission over Unreliable Channel II Netlab.caltech.edu/course.
IP Protocol CSE TCP/IP Concepts Connectionless Operation Internetworking involves connectionless operation at the level of the Internet Protocol.
TCP/IP1 Address Resolution Protocol Internet uses IP address to recognize a computer. But IP address needs to be translated to physical address (NIC).
1 Group Communications: Host Group and IGMP Dr. Rocky K. C. Chang 19 March, 2002.
Communication in Distributed Systems. . The single most important difference between a distributed system and a uniprocessor system is the interprocess.
1 Chapter 24 Internetworking Part 4 (Transport Protocols, UDP and TCP, Protocol Port Numbers)
Dynamic Host Configuration Protocol
Scaling the Network: Subnetting and Protocols
Introduction to Networks v6.0
Scaling the Network Chapters 3-4 Part 2
Chapter 9: Transport Layer
ICMP The IP provides unreliable and connectionless datagram delivery. The IP protocol has no error-reporting or error-correcting mechanism. The IP protocol.
Instructor Materials Chapter 9: Transport Layer
Chapter 21 Address Mapping
Cellular IP: A New Approach to Internet Host Mobility
Instructor Materials Chapter 5: Ethernet
Scaling the Network: The Internet Protocol
Definition of Distributed System
21-2 ICMP(Internet control message protocol)
Layered Architectures
TCP/IP Transmission Control Protocol / Internet Protocol
Hubs Hubs are essentially physical-layer repeaters:
Networking for Home and Small Businesses – Chapter 6
Internet Networking recitation #4
TCP Transport layer Er. Vikram Dhiman LPU.
Data Networking Fundamentals
Virtual LANs.
Switching Techniques In large networks there might be multiple paths linking sender and receiver. Information may be switched as it travels through various.
Networking for Home and Small Businesses – Chapter 6
Chapter 5 Network and Transport Layers
Protocols and the TCP/IP Suite
Introduction to the Transport Layer
Mobile and Wireless Networking
EEC-484/584 Computer Networks
By - Ricardo Sanchez, Ken Wolters and William Hibbard
Vidur Nayyar Xueting Wang Weicong Zhao
The OSI 7 Layer Model Ben, Stuart, Charles.
EEC-484/584 Computer Networks
Internet Control Message Protocol
CS4470 Computer Networking Protocols
Scaling the Network: The Internet Protocol
Protocols and the TCP/IP Suite
Networking for Home and Small Businesses – Chapter 6
Mobile IP Outline Homework #4 Solutions Intro to mobile IP Operation
Mobile IP Outline Intro to mobile IP Operation Problems with mobility.
Computer Networks Protocols
Presentation transcript:

A Simple Sensing Program Structure Rudra Dutta CSC 453-001, Spring, 2015

Overview Designing the program on the mobile platform Brings up issues and representative solutions Possibly useful in project Not mandated to be template – not a “standard” Assumes a wireless multihop (mesh) network Nodes perform routing, forwarding, sensing Some or all nodes can act as 802.11 Aps Mobile auxiliary sensing devices (ASD) Sensor rich, 802.11, moderate processing/memory Flexibly connecting and disconnecting from mesh Copyright Spring 2015, Rudra Dutta, NCSU

Requirements / Issues Rendezvous Context management Sensing Management Mobile devices’ presence is transient Context management Benefits if same device is recognized Sensing Management Agreeing on frequency of sensing, reporting Timestamping Cannot assume accurate clock at auxiliary nodes Semantics Physical quantities corresponding to readings, units Heterogeneity: Multiple types of sensing devices Robustness State refresh, soft state Copyright Spring 2015, Rudra Dutta, NCSU

Big Picture to Design Problem Copyright Spring 2015, Rudra Dutta, NCSU

Syntax “Wire format” of application layer PDU Common header format Signals – header design Data – sensed data format in payload Meta – type of packet, details Common header format Preamble – application specific distinct pattern Action code – type of packet, interpretation of rest of packet ID – identity of ASD (from / to) Code Meaning Rendezvous request 1 Rendezvous reply 2 Req. capabilities 3 Reply capabilities 4 Set requirements list 5 Reporting sensed data 6 Sensed data ACK … Preamble Action Code ID Copyright Spring 2015, Rudra Dutta, NCSU

Rendezvous Auxiliary Sensing device’s presence is transient Rendezvous with AP when close MAC / IP : Inbuilt into protocol Entry to network of AP, IP address by DHCP Application level rendezvous Periodic beacons from Server, optionally Periodic broadcasts for discover from ASD Client, when ready to connect Subnet broadcast at IP level, but specific UDP port Reply is unicast, completing application layer association Copyright Spring 2015, Rudra Dutta, NCSU

Rendezvous Auxiliary Sensing device’s presence is transient Does ASD perform sensing while disconnected? May be useful in many cases; mobility trace etc. that can be post-analyzed Less useful for managed sensing systems ASD requires local auxiliary storage Sensor Mgr Client Server Comm Comm Copyright Spring 2015, Rudra Dutta, NCSU

Context Management ASDs may connect and disconnect multiple times, to multiple servers (APs) Recognizing previously encountered ones can be beneficial May be able to “connect” space-time differentiated sensor readings (location, mobility) May help in calibration, self-calibration Simple approach: ASD puts ID (if assigned) in rendezvous packet, Server assigns in reply Allows continuity of readings without PII, supports heterogeneity Preamble Action Code ID Preamble Action Code ID Copyright Spring 2015, Rudra Dutta, NCSU

Sensor Management ASDs may connect and disconnect multiple times, to multiple servers Different servers may have different ability/requirement to serve multiple clients Must be capable of telling the client to report at a certain frequency Reasonable to piggyback on the rendezvous interaction Or use a general-purpose SET message (later) Preamble Action Code ID Preamble Action Code ID Rep. Freq. Copyright Spring 2015, Rudra Dutta, NCSU

Distributed Server To utilize the distributed nature of the mesh, server must run as distributed coordinated process Human user / controlling application at one node (may or may not be mesh node) Commands issued at any mesh node should reach any and all ASDs Sensor readings reported to any mesh node should be available at central database May not be necessary for simple applications Copyright Spring 2015, Rudra Dutta, NCSU

Timestamping Each ASD keeps its own clock Not guaranteed to be very accurate Stores sensor readings with timestamps by local time When reporting to Server, includes a “reporting timestamp” Server is expected to maintain accurate clock Synchronized across the mesh Can calibrate/update ASD timestamps by comparing time at server with ASD reporting time Copyright Spring 2015, Rudra Dutta, NCSU

Semantics Further sensing management tasks Not all sensor readings may be “needed” by server at all times Sensor readings need not be collected unnecessarily ASDs are heterogeneous – not all have similar sensing capability Must be able to exchange information about sensing capabilities “Sensed quantity” “Representation” Code values in application logic – or config file Similar to action code Copyright Spring 2015, Rudra Dutta, NCSU

Sensing Management (SET) After rendezvous, interaction to setup recurrent sensing Client sends capabilities with every heartbeat (see next) Server sets requirements “SET” actions have soft state (decay over time) May also set reporting frequency Preamble Action Code ID Quantity Representation Max Sns. Freq. (Multiple instances) Preamble Action Code ID Seq. Nbr. Quantity Sens. Freq. Rep. Freq. (Multiple instances) Preamble Action Code ID Seq. Nbr. Copyright Spring 2015, Rudra Dutta, NCSU

State Maintenance (HeartBeat) ASD sends periodic “I am alive” messages to server Possibly broadcast Reasonable to include capabilities of sensor, ID if available Preamble Action Code ID Quantity Representation Max Sns. Freq. (Multiple instances) Copyright Spring 2015, Rudra Dutta, NCSU

Sensing Reporting Client maintains timer(s), collects sensor readings Client maintains reporting timer, transmits sensor readings Server transmits acknowledgement Preamble Action Code ID Rep. Time Seq. Nbr. Quantity Representation Reading Timestamp (Multiple instances) Preamble Action Code ID Seq. Nbr. Copyright Spring 2015, Rudra Dutta, NCSU

ASD Program Design Multi-thread implementation possible One thread for each sensor – block on timer One thread for server communication – block on read One thread for transmitting – block on timer Issues of concurrence Different threads wake up at different times May be “simultaneous” Global memory to communicate state Behavior of server communication thread unpredictable More demanding of platform capabilities Copyright Spring 2015, Rudra Dutta, NCSU

ASD Multi-thread Design On Tx Timer If buffer not empty Broadcast one packet On Rx If SET for this ASD, fresh Change settings Record sequence # If ACK Purge packet from buffer On Heartbeat Timer Broadcast capabilities, ID, time, sequence number On Sensor 1 Timer Read Sensor 1, buffer Idle Idle Idle Idle Idle Copyright Spring 2015, Rudra Dutta, NCSU

ASD Single-thread Design On Measurement Timer Take readings and buffer Flag  UP On Tx Timer OR Flag is UP If buffer not empty Broadcast one packet If buffer is now empty Flag  DOWN RX SET If SET is for this ASD, new SEQ # Broadcast ACK/NACK Do SET action (change setting) Record SEQ # Idle On Heartbeat Timer Broadcast capabilities, ID, time, sequence number RX ACK for measurement Discard top measurement Flag  UP Merge “idle” states into a single one Merge timers into a single one with variable alarm period Copyright Spring 2015, Rudra Dutta, NCSU

ASD Single-thread Program Flow x  min (NxtTimes)-t Block Receive with x second timeout Other Fresh SET for this ASD ACK Rx Broadcast ACK / NACK Take SET action Record SEQ # Discard top measurement Flag  UP Timeout t > NxtMeasurement Time? YES NO Take readings and buffer Flag  UP NxtMeasurementTime += MeasurementTimer t > NxtTx Time OR Flag UP ? YES NO If buffer not empty broadcast one packet NxtTxTime += TxTimer NO t > NxtHeartBeat Time? NO Broadcast capabilities, ID, time, sequence number NxtHeartBeatTime += HBTimer Copyright Spring 2015, Rudra Dutta, NCSU

Server Program Design Idle RX Heartbeat Timer (From ASD) Process Heartbeat RX Measurement from Client (From ASD) Broadcast ACK (WiFi) Take Measurement Action On ClientSETTxTimer For each SET in the the SETbuffer If entry expired then remove it else broadcast it (to ASDs) Idle RX ClientSETACK (from ASD) Broadcast SETACK to all mesh nodes Remove SET from buffer RX User SET Command RX SETACK (from Mesh Nodes) Buffer SET command to be sent to all ASDs Remove SET from SETBuffer Buffer SET command to be sent to all other mesh nodes and the ASDs Set Originating=TRUE On ServerSETTxTimer For each SET in the the SETbuffer If entry expired then remove it elseif Originating=TRUE then Bcast to all other mesh nodes RX SET (from other Mesh Node) Buffer SET command to be sent to sensor node(s) Copyright Spring 2015, Rudra Dutta, NCSU

Summary Even simple system requires some design Semantics and client-server management need to be designed Sits on top of networking and communication semantics Copyright Spring 2015, Rudra Dutta, NCSU