Wireless Communication Bluetooth, Timing Amarjeet Singh February 22, 2012
Logistics Sample exam paper on the course website Group Project: Hardware nodes are with me. Software is still under development and will be ready in a week s time Will prefer if you wait for another week before issuing the hardware If you really want to play with it, you can get a WiFi node from me Mostly you will be installing Ethernet node in the hostel rooms Limited number (only 9) of programming boards 2-3 groups to timeshare I will prepare the spreadsheet You will not need to reprogram multiple times for the first phase Not every group is doing project that involves flyport in the second phase 2
Logistics Group Project extensions: Multiple groups with the same project unless explicitly allowed by me, take a different project Added more projects for PG students 3
Revision - I IEEE 802.15.4: Which two layers does the protocol define? What are the node types defined? What are the supported topologies? How many channels are available in 2.4 GHz range? Zigbee: How does it extend IEEE 802.15.4? What are different devices supported? What are the different addresses supported? What are different supported topologies? What are techniques employed for reliable communication? What are techniques employed for security of the data?
Revision - II Bluetooth physical layer: Frequency spectrum: Which other applications use the same frequency range Number of frequency channels Number of time slots per second Frequency selection scheme What are the different states in which BT devices can be in? standby disconnected detach inquiry page connecting Transmit AMA Connected AMA active Park PMA Hold AMA Sniff AMA low power
Bluetooth Radio Frequency Hop Spread Spectrum (FHSS) in 79 hops displaced by 1 MHz between 2.402-2.480 GHz Each device is classified into 3 power classes: Power class 1 - long range (~100 m), output power 20 dbm Power class 2 - medium range (~10 m), output power 4 dbm Power class 3 - short range (~10 cm), output power 0 dbm
Bluetooth Baseband Baseband is the physical layer of Bluetooth Manages physical channels and links apart from other services like error correction, flow control, synchronization and security Baseband protocol carries link level routines such as link connection and power control Baseband transceiver applies TDD (Time Division Duplex) Alternate transmit and receive - Master and slave transmit in even and odd number slots Device addressing: 4 types of addresses can be assigned to bluetooth units Bluetooth Device Address: Unique 48-bit device address Active Member Address: 3-bit number, valid as long as slave is active Parked Member Address: 8-bit master-local address for parked slaves Access Request Address: Specifies the slot when a parked slave is allowed to send access request
Bluetooth Packet 13 different types of packets defined in Baseband layer Each packet consists of 3 entities: Access Code (68/72 bits): Used for timing synchronization, inquiry etc. Header (54 bits): Contains information for packet acknowledgement, packet numbering, flow control, error check etc. Payload (0-2745 bits): Contains either voice field or data field or both
Bluetooth Security At Link level, a pair of devices share a secret key derived from Bluetooth passkey (also known as Personal Identification Number - PIN) Either built-in or entered in the user interface After authentication, devices can create shared link keys that can be used to encrypt traffic on a link Combination of authentication and creating link keys is called pairing Possibly accompanied by exchange of higher level security information
Interference Between 802.11b and BT Bluetooth interferes with 802.11b 802.11b frames collide with Bluetooth packets (longer frames have a higher probability of collision) Retransmissions increase delay Impact can be severe, depending on the distance from the node equipped with 802.11b to the access point and to the Bluetooth nodes 802.11b also interferes with Bluetooth High power 802.11b transmitter can saturate the Bluetooth receiver Can also cause increased errors if the bands are overlapping Impact can be severe, depending on the power of the 802.11b nodes and the distance to them
Zigbee vs Bluetooth Zigbee Network Speed - 250 kbps Network Range - 70 meters Typical Applications - home automation, remote controls Handle 65000+ devices Low power - designed to last long on battery Network join time - 30 ms Bluetooth Network Speed - 1 Mbps Network Range - 1/100 meters depending on class Typical Applications - Audio, file transfer Maximum of 8 devices per network Higher power consumption - Need recharge everyday Network join time - 3 seconds
Need for Synchronization What happens if all the clocks you use are put out of sync? What happens if the transmitter and receiver in Bluetooth connection are not in sync? Time based systems or protocols (e.g. TDMA) need accurate timing Specifically, in embedded system applications wherein small system observations are fused together to get a global view, time stamping information is important Help estimate temporal ordering of the events GPS based localization Broadcast by each satellite needs to be synchronous to all other satellites within a few nanoseconds for the system to work
Clocks and Timekeeping Almost any clock may be considered a two part device: Oscillating device: For determining the length of a time interval Counter: Keeps track of number of clock cycles that have occurred Historically pendulum was classic source of time interval Currently wrist watches have 32,768 Hz quartz crystal tuning fork Atomic clocks generally provide much more accurate frequency than can be generated by a physical device like pendulum or quarts crystal Uses as its reference the energy pf photon emitted or absorbed during the transition of electron [ E = h ] On-board GPS satellites
Clocks and Timekeeping Current official definition of 1 second is based on energy difference specific to quantum transition in Cesium-133 atom Frequency is defined as 9,192,631,770 Hz Precise measurement of time must account for Delay between clock and user: Delay for data from GPS orbit satellites is ~70 ms which is substantial for many applications Random and systemic variations Environmental changes (atomic clocks are less sensitive to them) Frequency deviation of 0.001% will cause the clock to drift by ~ 1sec/day
UTC UTC (Universal Coordinated Time) Adopted officially starting January, 1972 In order to obtain real estimate of UTC, current estimate from 50 timing centers around the world is combined together
GPS GPS (Global Positioning Service) World s principle supplier of accurate time 24 or more satellites - each containing one primary atomic clock and backups Three kinds of time reported by GPS - GPS time, UTC as estimated by US Naval Observatory, times from each free running atomic clock Master Control Station (MCS) gathers GPS satellites data from 5 monitor stations across the world The program at MCS estimates time and frequency error and transmits back to the satellites to be broadcasted in real time Master Clock precision is ~ 3ns i.e. drift 1 second per 300,000 years Satellites are always within 250 ns of each other GPS Receivers: Broadcast time for communication is 65-85 ms @ 10,900 nautical miles Receivers use quartz crystals Synchronizes time during initialization, and later perform triangulation
General Clock Synchronization Requirements Protocol should be resilient to unbounded message latencies Ability to estimate local clocks on remote nodes Time must never run backwards Do not want to repeat events in time Do not want to violate causality Synchronization overhead should not degrade system performance Inherent assumptions in common clock synchronization algorithms: Ability to periodically transmit messages between nodes that need synchronization Ability to accurately determine the time it takes for a message to travel between two nodes that need synchronization
Non-Determinism in Setting Clocks Medium access Network latency Packet loss Context switches Protocol overhead, if any
Properties of Ad-hoc Networks Highly dynamic, mobile, and sparsely distributed Communication links are short range and may have short lifecycles Store and forward techniques are needed for transient nodes Traditional assumptions do not hold Message delay can be estimated in wired, but ad hoc networks may have arbitrarily long communication delays Periodic message exchange common in wired networks, but energy constraints in ad hoc networks make this very expensive.
Illustration of Challenges in Ad-hoc Networks For node 3 to accurately detect the speed and direction of phenomena: Determine whether E1 happened after E2 and time difference Require Node 1 and 2 to be synchronized before E1 happens
A Brief Survey of Wired Clock Synchronization Protocols Remote Clock Reading Network Time Protocol (NTP)
Remote Clock Reading - I Query remote process for time Several queries are performed Round-trip time is an average or the lowest bound Latency is defined as ½ the round-trip time Round-trip time is not deterministic Inconsistencies and variance in routing, network load, system load and scheduling can vary results Reference: F. Cristian, Probabilistic Clock Synchronization, Distributed Computing, 3:146-158, Springer-Verlag, 1989
Remote Clock Reading II 1. Client sends request at T 0 2. Server replies with timestamp S-time (local time) 3. Client receives message at time T 1 4. Client sets time to [S-time + (T 1 -T 0 )/2] This is usually achieved by averaging several rounds or using the shortest round-trip time (T 1 -T 0 )
Offset Delay Estimation and NTP I Network Time Protocol (NTP) Predominant time-sync service running on switched IP networks Huge deployment of 10s of millions of clients and servers Nominal accuracy of 10ms on WANS, ~200μs on LANS Hierarchical design: root node synchronizes with UTC Second-tier nodes sync up with the root Clock filters select best from a window of 8 time-offset samples High synchronization overheads Messaging complexity and storage References 1. D.L. Mills, Internet Time Synchronization: the Network Time Protocol, IEEE Trans. Communications, Vol 39, no 10, pp. 1484-1493, Oct. 1991. 2. http://www.eecis.udel.edu/~mills/ntp.html
Offset Delay Estimation and NTP II also called round trip delay
Offset Delay Estimation and NTP III
From Wired Networks to WSNs WSN differs from wired fixed-infrastructure Limited communication range Less than 100 meters in most cases With high message loss Scalability 1000s of nodes: but may not have hierarchy Energy conservation Largest overhead is found in communication Self configuration and dynamic topologies Mobile nodes Not addressed in wired paradigms May have intermittent connectivity
WSN Design Parameters Energy, bandwidth and hardware are constrained Communication is very expensive Communication is limited in range and has high percentage of message loss Mobility, albeit an implicit benefit of wireless nodes, comes at the cost of complexity Intermittent connectivity Shifting topology changes require dynamic reconfiguration
Clock Synchronization Protocols for WSNs I Reference Broadcast Synchronization (RBS) Romer s protocol
Clock Synchronization Protocols for WSNs II Field is lively, lots of recent research Tulone s Clock Reading protocol, 2004 Meier et al s protocol, 2004 Lightweight Tree-based Synchronization, 2003 TSync protocol, 2004 Hu and Servetto s protocol, 2003 No generic one size fits all for any specific situation
Synchronization Issues - I Master-slave or peer-to-peer synchronization Master-slave: The slave node considers clock of the master as the reference and attempt to synchronize with the master Peer-to-peer: Every node can communicate directly with every other node in the network. They are more flexible but are also more difficult to control 31
Synchronization Issues - II Clock correction or untethered clocks Clock correction: Correcting the local clock in each node to run on par with a global time scale or an atomic clock Untethered clock: Build a table of parameters that relate the local clock of each node to the local clock of every other node in the network. When timestamps are exchanged between nodes, they are transformed to the local clock values of the receiving node 32
Synchronization Issues - III Internal or external synchronization Internal synchronization: The goal is to minimize the maximum difference between the readings of local clocks of the sensors External synchronization: A standard source of time is provided 33
Synchronization Issues - IV Probabilistic or deterministic synchronization Probabilistic synchronization: Provide a probabilistic guarantee on the maximum clock offset with a failure probability that can be bounded or determined Deterministic synchronization: Guarantee an upper bound on the clock offset with certainty 34
Synchronization Issues - V Sender-to-receiver or receiver-to-receiver synchronization Sender-to-receiver synchronization: The receiver synchronizes with the sender using the time stamps received; Message delay is calculated by measuring the round-trip delay Receiver-to-receiver synchronization: If any two receivers receives the same message in single-hop transmission, it is likely that they receive it at approximately the same time; The receivers exchange the time at which they received the same message and compute their offset based on the difference in reception time 35
Taxonomy of Synchronization Protocols Synchronization Issues Master-slave or peer-to-peer Clock correction or untethered clocks Internal or external synchronization Probabilistic or deterministic algorithms Sender-to-receiver or receiver-to-receiver Application-Dependent Features Single-hop or multi-hop Mobile or stationary network MAC layer or standard layer