450 likes | 621 Vues
MAC for Wireless Sensor Networks. Present by: Yang Liu AICIP Research Sep. 7, 2004. Example: Cocktail party – many people gather together in a large room. broadcast medium – air Human rules: Give everyone a chance to speak. Don’t speak until you are spoken to.
E N D
MAC for Wireless Sensor Networks • Present by: Yang Liu • AICIP Research • Sep. 7, 2004
Example: Cocktail party – many people gather together in a large room. broadcast medium – air Human rules: Give everyone a chance to speak. Don’t speak until you are spoken to. Don’t interrupt when someone is speaking Raise your hand if you have a question Don’t fall asleep when someone else is talking … Multiple Access Problem
The same thing in Sensor Networks? Multiple sensor nodes want to communicate in a common geographic area using shared communication medium. Such as RF. Problem: How should we coordinate and schedule the access of multiple sending and receiving nodes to a single shared broadcasting channel? How should we allocate our resources so that as many nodes as possible can communicate simultaneously? Problem Statement
Motivation • What are the design goals? • High throughput or good channel utilization; • Low latency or even plus real time support; • Fairness; • Efficient; • Simple and decentralized;
TDMA/FDMA • TDMA: • Divide time into frames • Further divide each frame into N slots (number of competing nodes ) • Each node will have R/N rate. R is the total bandwidth. • FDMA: • Divide the R bps channel into different frequency bands. • Assign each frequency to one of N nodes. • Cons: • A node is limited to a bandwidth R/N, even when it is the only node with packets to send • Centralized Scheduling and synchronization is needed
CDMA • CDMA (code Division Multiple Access) • unique “code” assigned to each user. • All users share the same frequency, but each user has own “chipping” sequence (ie, code) • encoded signal = (original signal) X (chipping sequence) • decoding: innerproduct of encoded signal and chipping sequence • chipping sequences must be chosen orthogonal to each other
ALOHA/Slotted ALOHA • Pure ALOHA: • Transmit a packet when it is generated • If the data transmission succeed, receiver responses with a ACK. • In case of collision, sender retransmit after a random period. • Slotted ALOHA: • Time is divided into slots and nodes only transmit at the beginning of slots. • The length of a time slot equals to the length of the packet duration. • No partial overlap between packets. • Pros and Cons • Simple • Poor use of the channel capacity: 18% for Pure ALOHA and 36% for Slotted ALOHA.
CSMA • Carrier Sense Multiple Access • Key issues: it should not send if someone else is sending. • Strategies: Persistent and non-persistent CSMA • Persistent Strategy: reduces chance of collisions and also reduces the efficiency • Non-persistent Strategy: increases the chance for collisions.
DS DATA ACK CTS CTS CTS ACK RTS RTS RTS X DATA DATA DATA CSMA/CA • Carrier Sense Multiple Access/Collision Avoidance • Hidden Terminal and Exposed Terminal Problems: • RTS/CTS/DATA: Proposed in MACA • RTS/CTS/DATA/ACK: Proposed in MACAW A B C D A B C D Hidden Terminal Exposed Terminal B A B A MACA B A MACAW
IEEE 802.11 • DCF ( Distributed Coordination Function) with Virtual Carrier Sense • Backoff Time ( Exponential Backoff Algorithm ) • Backoff Time = rand() X SlotTime where rand() = [0,CW] CWmin <= CW <= CWmax SlotTime = The value of the corresponding PHY characteristic CWnew = ( CWold + 1) x PF - 1 where PF =2
IEEE 802.11 • PCF ( Point Coordination Function) • a wireless channel has a superframe structure (contention Free Repetition Interval) that consists of a contention free period (CFP) and contention period (CP).
Polling • All data exchanges made through the primary device • primary device controls the channel and is initiator of the session • polling delay • channel becomes inoperative if master device fails • Example: 802.15.4
IEEE 802.15.4 ( ZigBee ) • Industry standard through application profiles running over IEEE 802.15.4 radios • Target applications are sensors networks, interactive toys, smart badges, remote controls, and home automation.
IEEE 802.15.4 ( ZigBee ) • Specify three Devices Network Coordinator Full Function Device (FFD) Powerful and can talk to any device Reduced Function Device (RFD) Can only talk to a FFD. ZigBee Coordinator (FFD) ZigBee Router (FFD) ZigBee End Device (RFD or FFD) Mesh Link Star Link
IEEE 802.15.4 ( ZigBee ) • Beacon • Control information • Allocate GTS • Synchronization • CAP • Allows contention via CSMA • CFP • Time slot allocation specified in the beacon • Reserved bandwidth for DEV
Characteristics of MAC in WSN Energy Efficiency QoS provision Self-Organization Simple and distributed solution Medium Access for Sensor Networks
Energy Waste of MAC • Idle listening • Listening to receive possible traffic that is not sent • major source of energy inefficiency • Collision • Packet retransmission increases energy consumption. • Overhearing • picking up packets that are destined to other nodes • Communication Overhead • Required frame header to implement MAC
SMAC • Approaches: Contention-based MAC with various energy-conserving features. • Periodic listen and sleep • Collision avoidance ( IEEE 802.11) • Overhearing avoidance • Put nodes into sleep when neighbors are talking • Massage passing • Long message is fragmented and sent in burst • RTS/CTS reserve time for entire message • Problems: • Fix duty cycle while traffic in sensor networks are busty. • Multiple on/sleep schedule on the edge nodes which results in unbalanced energy cost and losing communication coverage • On/sleep synchronization involves much communication overhead. sleep listen listen sleep
TMAC • Fixed duty cycle like S-MAC, is not optimal. • The nodes must be deployed with an active time that can handle the highest expected load. • Whenever the load is lower than that, the active time is not optimally used and energy will be wasted on idle listening • An active period ends when no activation event has occurred for a time TA • TA > CW + R + T • CW : the length of the • contention interval • R : the length of RTS packet • T : the short time between the • end of the RTS packet and the • beginning of the CTS packet
Motivation • Energy Efficiency • Why energy efficiency? - Sensor networks consist of a couple of powerful sensor nodes which we call sensor sink and a bunch of battery powered sensor nodes which can not be recharged once running out of power. • How? - Communication is the main contributor for energy consumption. • To avoid unnecessary communications ( transmitting, receiving and idle listening) • To balance energy cost among all nodes based on their residual energy. • A simple MAC Layer Protocols is preferred. • Differentiate Services • What is service for sensor node? -- Clearly data transmission • Why needs to differentiate Services? • Sensing reading from different types of sensors may have different importance for a specified application • Aggregated data is clearly more important the normal sensing data. • A data packet which is already transmitted for several hops maybe need higher transmitting bandwidth compared with new generated data packets or data packets which have been transmitted for less hops. • Any More Reasons?
Assumptions • Energy Constrains • Highly redundancy ( in-network processing are used to reduce the redundancy ) • Periodical and busty traffic are both existed • Periodical traffic: periodical sensing the field • Busty traffic: the traffic triggered by sensing event. • Multi-hops wireless data communications.
Parameters: weights for each queue • While (at the starting of a new frame) if the size of instant queue > 0 next packet = the first packet in the instant queue else Calculate rate using MAX-MIN Fairness Algorithm; Find out which packet needed to be served first by using Packetized Generalized Processor Sharing (GPS) and set it to next packet; end End Weighted Queuing Algorithm
MAX-MIN Fairness Algorithm N flows share a link of rate C, flow i's expectation rate is wi. It is allocated rate ri. • Algorithm Outline: • 1. Pick the flow i with the smallest requested rate. • 2. If wi < C/N, then set ri = wi ; • 3. If wi > C/N, then set ri = C/N; • 4. Set N = N -1, C = C - ri ; • 5. If N > 0 goto 1
R(f1) = 0.1 R(f2) = 0.3 C R1 R(f3) = 0.3 R(f4) = 0.3 Order of service for the four queues: … f1, f2, f2, f2, f3, f3, f3, f4, f4, f4, f1,… Packetized GPS • Generalized Processor Sharing (GPS) • Packetized GPS • serve a whole packet at a time • Determine what time a packet, p, would complete if we served flows bit-by-bit. Call this the packet’s finishing time, F. • Serve packets in the order of increasing finishing time.
Power Saving MACAW The time of each sensor node has been divided into frames and then further divided into time slots. Each frame consists of Contention Period (CP) and data Transmission Period (TP). RTS/CTS/TS/DATA/ACK are used for packet transmission. Energy saving achieves from the node (except sender and receiver ) sleeping during TP. The starting time of the first frame can be decide through network-wide broadcasting by sensor sink and can be resynchronized by the same way. Only Loosely synchronization is required because of random access nature
Power Saving MACAW • The reasons for framing: • Each node contend for channel at the starting time of a frame which ensure the fairness of node transmission. It also provides the fundamental requirement of our next proposed Loosely Prioritized Random Access protocols. Since each node contends the channel at the same time, by assigning them with different waiting time, we can coordinate the data transmission among multiple nodes. • The same frame schedule of all sensor nodes make communication easier since all the nodes can always hear the RTS/CTS messages. In order to achieve the same thing, SMAC has extra sacrifice for consuming more energy for the edge nodes. • Simple and have a very good scalability for large Scale Wireless Sensor Networks.
Loosely Prioritized Random Access • Provide a mechanism to assign the channel access to high transmission priority sensor nodes. • Solution: • Measuring the transmission priority of a sensor node • Divide the Contention Period into N priority levels. Distribute • the random access into sub contention period which is decided by • the priority level of sensor node.
Loosely Prioritized Random Access • Solution: (cont) • Division of Contention Periods. • LPRA algorithm for random access
Loosely Prioritized Random Access • LPRA Algorithm: • If ( next transmitting packet != null ) && ( at the starting time of a frame) calculate the urgency of the packet calculate the priority level of the packet calculate the contention time (CT) wait for CT; if ( no packet received during CT ) while ( current time < end of CP of this frame ) transmit RTS and wait for CTS; listening the channel; if ( collision happen ) recalculate CT; retransmit RTS and wait for CTS; end if (receive CTS) break; end end transmit TS; transmit Data and Wait for ACK; else
Loosely Prioritized Random Access • LPRA Algorithm: (cont) else while ( current time < the end of CP of this frame) if ( receive packet is RTS or CTS ) stop contend for channel; wait for TS; end if ( receive packet is TS ) stop contend for channel; sleep to the duration specified in TS; end if ( detect collision) && ( collision time < CT ) stop contend for channel; wait for TS; end end if ( current time > the end of CP of this frame ) && ( no TS received ) sleep to the beginning of next frame; end end if ( time > the end of CP of this frame ) && ( nothing happened ) sleep until the beginning of next frame; end
Loosely Prioritized Random Access • Collision Reduction: • High priority transmission nodes continue to access the channel when meeting collision during the Contention Period (CP). Low priority nodes constrain accessing the channel when they detection collision from high priority node or successfully receives RTS, CTS, TS. • Apply a pseudo random number generator which is based on optimal Probability distribution function which minimizing the happening of collision. 1 CW collision 1 CW without collision
Application Level Extra four bits in application header to represent the criticality of packets Sensor Types ( different sensors ) Data Types ( Periodic Sensing data or aggregation data ) Control Messages ( for routing, security usage ) Synchronization packets, reconfiguration packets of sensor networks has the highest priority and needed to be transmit instantly. Network Level Extra three bits at network header to represents the number of hops that a packet has been transmitted. MAC Level Combine both information from Application layer and network layer to form the MAC level priority which is used for real transmitting. Differentiate Services
RTS/CTS control packets collision recovery can been seen in LPRA For data packet collision, it involves two scheme High priority data packets, generate a CT from [0, CW/2] Low priority data packets, increase the priority level by one which means increasing the CT to average CW. Since most low priority packets are periodic sensor reading, therefore, it is Possible that other nodes have already transmitted the sensing data. So we Can defer the data transmission by increasing priority levels. Furthermore, If difference of sensing time and current time is beyond certain threshold, We can delete the sensing data directly. Collision Recovery
Talk on related work of Sensor Mac design Presents Comprehensive simulation environment and simulation results. Any Questions? Next Time