1 / 37

Wireless Sensor Networks

Wireless Sensor Networks. Link Layer Protocols. Mario Č agalj mario.cagalj@fesb.hr FESB University of Split 20 13. Based on “Protocols and Architectures for Wireless Sensor Networks”, Holger Karl , 2005. Data Link Layer services (source: Wiki).

hosea
Download Presentation

Wireless Sensor Networks

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Wireless Sensor Networks Link Layer Protocols Mario Čagalj mario.cagalj@fesb.hr FESB University of Split 2013. Based on “Protocols and Architectures for Wireless Sensor Networks”, Holger Karl, 2005.

  2. Data Link Layer services (source: Wiki) • Encapsulation of network layer data packets into frames • Frame synchronization • Logical link control (LLC) sublayer: • Error control (automatic repeat request,ARQ), in addition to ARQ provided by some Transport layer protocols, to forward error correction (FEC) techniques provided on the Physical Layer, and to error-detection and packet canceling provided at all layers, including the network layer. Data link layer error control (i.e. retransmission of erroneous packets) is provided in wireless networks, error detection and canceling of erroneous packets are provided. • Flow control, in addition to one provided on the Transport layer. Data link layer error control is not used in LAN protocols such as Ethernet, but in modems and wireless networks. • Media access control (MAC) sublayer: • Multiple access protocols for channel-access control, for example CSMA/CD protocols for collision detection and retransmission in Ethernet bus networks and hub networks, or the CSMA/CA protocol for collision avoidance in wireless networks. • Physical addressing (MAC addressing)

  3. Link layer tasks in general • Framing – group bit sequence into packets/frames • Important: format, size (impact on energy-consumtion and throughput) • Error control – make sure that the sent bits arrive and no other • Forward and backward error control • Flow control – ensure that a fast sender does not overrun its slow(er) receiver • Link management – discovery and manage links to neighbors • Do not use a neighbor at any cost, only if link is good enough Understand the issues involved in turning the radio communication between two neighboring nodes into a somewhat reliable link

  4. Error control • Error control has to ensure that data transport is • Error-free – deliver exactly the sent bits/packets • In-sequence – deliver them in the original order • Duplicate-free – and at most once • Loss-free – and at least once • Error sources: fading, interference, loss of bit synchronization, … • Results in bit errors, “bursty” (they tend to occur in clusters with error-free periods) • In wireless, sometimes quite high average bit error rates – 10-2 … 10-4 possible!

  5. Characteristics of transmission errors • IEEE 802.11 physical layer frame • MPDU – MAC Protocol Data Unit • Preamble – constant bit pattern for bit and frame synchronization of the receiver • The PHY header describes the lenght and the modulation used in the data part (MPDU) • The distortion of waveforms translates into bit errors and packet losses • Packet losses (the MAC protocol does not see any data at all) • The receiver fails to acquire bit/frame synchronization • The SFD is wrong, the PHY header has an incorrect checksum • Bit errors • Synch and PHY header ok, but some bits in MPDU not the same as their transmitted counterpart

  6. Basic approaches to error control • Backward error control • Automatic Repeat Request (ARQ) • Forward error control • Forward Error Correction • Different combinations

  7. Backward error control – ARQ • Basic procedure • Put header information around the payload • Compute a checksum and add it to the packet • Typically: Cyclic redundancy check (CRC), quick, low overhead, low residual error rate • Provide feedback from receiver to sender • Send positive(pkt received) or negative acknowledgement(pkt lost) • Sender uses timer to detect that acknowledgements have not arrived • Assumes packet has not arrived • Optimal timer setting? • If sender infers that a packet has not been receivedcorrectly, sender can retransmit it • What is maximum number of retransmission attempts?

  8. Standard ARQ protocols • Alternating bit(or Send-and-Wait) • Transmitter (XMTR) buffers one packet, sends it and sets a timer • RECV receives the packet -> positive ACK -> XMTR frees the buffer and transmits the next packet • RECV receives nothing -> negative ACK or being quite -> XMTR retransmits the packet • XMTR marks each new packet with sequence numbers alternating between 0 and 1 • Retransmitted packets are coplies of the original packets • Have the same sequence number • The sequence numbers allow the RECV to detect duplicates • Occurs when positive ACK is lost

  9. Standard ARQ protocols • Goback N • Send up to N packets, if a packet has not been acknowledged when timer goes off, retransmit all unacknowledged packets • Goback N allows the XMTR to have multiple unacknowledged packets • XMTR keeps a buffer for up to N packets (a window) • Each packet has its own timer, started upon the packet’s transmission • RECV accepts packets only in sequence and drops packets received out of sequence (some previous packet had been lost) • For this RECV needs only buffer space for one packet • Usually RECV acknowledges the last packet arrieved in sequence • If at the XMTR the timer for the oldest packet expires before receiving the corresponding ACK, this packet and all other packets in the window are retransmitted

  10. Standard ARQ protocols • Selective Repeat • Similar to Goback N, however here the RECV has N buffers and uses them to buffer frames arriving out of sequence • RECV sends either positive or negative ACKs • XMTR retransmits only those packet for which no ACK has been received withing the timeout period (more energy-efficient) • Alternating bit and Selective Repeat retransmit only erroneous packets (while Goback N potentially retransmits correctly received packets) • The number of retransmissions allowed per packet must be bounded (to avoid spending too much energy) • A loss-free service therefore cannot be guaranteed (semireliable protocols) • Example (Energy consumption of alternating bit)

  11. Digital channel model • How to stochastically capture the behavior of a wireless channel • Directly model the resulting bit error behavior • Each bit is erroneous with constant probabilityp, independent of the other bits ->binary symmetric channel (BSC)

  12. Example: Energy consumption of alternating bit

  13. How to use acknowledgements • Be careful about ACKs from different layers • A MAC ACK (e.g., S-MAC) does not necessarily imply buffer space in the link layer • On the other hand, having both MAC and link layer ACKs is a waste • Do not (necessarily) acknowledge every packet – use cumulative ACKs • Tradeoff against buffer space • Tradeoff against number of negative ACKs to send

  14. When to retransmit • Assuming sender has decided to retransmit a packet – when to do so? • In a BSC channel, any time is as good as any • In fading channels, try to avoid bad channel states – postpone transmissions • Retransmissions may be unecessarily lost • Instead (e.g.): send a packet to another node (if in queue and if it has better channel) -> exploit multi-user diversity • How long to wait? • Example solution: Probing protocol • Idea: reflect channel state by two protocol modes, “normal” and “probing” • When error occurs, go from normal to probing mode • In probing mode, periodically send short packets (acknowledged by receiver) – when successful, go to normal mode

  15. Basic approaches to error control • Backward error control • Automatic Repeat Request (ARQ) • Forward error control • Forward Error Correction • Different combinations

  16. Forward error control • Idea: Endow symbols in a packet with additional redundancy to withstand a limited amount of random permutations • Additionally: interleaving – change order of symbols to withstand burst errors(clustered errors)

  17. Forward error control • Can be used as an open loop technique • No feedback from the receiver • Possibly more energy-efficient as no ACK packets are sent • Moreover, the transmitter does not have to switch from the transmitting to receiving states in order to be able to receive ACKs • In practice FEC is used thogether with acknowlegments (backward error control) for more robust/reliable communicaiton

  18. Block-coded FEC • Level of redundancy: blocks of symbols • Block: k p-ary source symbols (not necessarily just bits) • Encoded into n q-ary channel symbols • Mostly, we have p = q = 2, n ≥ k, and thesymbols correspond to bits • Injective mapping of pk source symbols -> qn channel symbols • This mapping is called a code • Code rate: (k ld p) / (n ld q) • When p=q=2: k/n is code rate • For p=q=2: Hamming bound – code can correct up to t bit errors only if • Codes for (n,k,t) do not always exist!

  19. Hamming distance • An important metric for a block code • The Hamming distance of twovalid channel words w1 and w2 is defined as the number of bits in which they differ • E.g., 1001 and 1011 -> Hamming distance = 1 • TheHamming distance dmin of the whole code is defined as the minimum Hamming distance of allpairs of valid channel words • Any code with a Hamming distance dmin can reliably detect up toand including dmin − 1 bit errors and can reliably correct up to and including (dmin−1)/2 bit errors

  20. Popular block codes • Popular examples • Reed-Solomon codes (RS) • Bose-Chaudhuri-Hocquenghem codes (BCH) • Energy consumption • E.g., BCH encoding: negligible overhead (linear-feedback shift register) • BCH decoding: depends on block length (n) and Hamming distance (that is the number ofcorrectable bits t) • Eadd and Emult are the energy needed to carry out addition and multiplication • Similar for RS codes

  21. Convolutional codes • Here also kbits of user data are mapped to nchannel symbols; the coding of two successive k-bit blocks is not independent • Code rate: ratio of k user bits mapped onto n coded bits • Constraint length K determines coding gain(by increasing K we can reduce the transmit power required to achieve fixed BER) • Energy • Encoding: cheap • Decoding: Viterbi algorithm, energy & memory depends exponentially (!) on constraint length (K)

  22. Energy consumption of convolutional codes • Tradeoff between coding energy and reduced transmission power (coding gain) • Overall: block codes tend to be more energy-efficient

  23. Interleaving • Bursy error characteristics affect performances of codes • Solution: Bit interleaving • An interleaverat the XMTR takes the packet (of multiple blocks) generated by the FEC encoder • The bits in this packet are permuted before transmitting • The deinterleaver at the RECV inverts the permutation before the packet is handed to the FES decoder • The error burst are spread over multiple coding blocks instead of being concatrated to one or a few blocks • Increases the chance that each block can be successfully decoded

  24. Hybrid schemes: FEC and ARQ • No single fixed error-control strategy will give optimumenergy efficiency at all times t: error correction capacity • FEC • Constant overhead for each packet • Not (easily) possible to adapt to changing channel characteristics • ARQ • Overhead only when errors occurred (expect for ACK, always needed) • Both schemes have their uses ->hybrid schemes Relative energy consumption BCH + unlimited number of retransmissions

  25. Power control on a link level • Further controllable parameter: transmission power • Higher power, lower error rates – less FEC/ARQ necessary • Lower power, higher error rates – higher FEC necessary • Tradeoff • However, by increasing the power of a single XMTR, the interference on other (neigboring) XMTRs increases -> i.e., the BER increases as well • Tradeoffs of this nature are very complex in multihop networks

  26. Link layer tasks in general • Framing – group bit sequence into packets/frames • Important: format, size (impact on energy-consumtion and throughput) • Error control – make sure that the sent bits arrive and no other • Forward and backward error control • Flow control – ensure that a fast sender does not overrun its slow(er) receiver • Link management – discovery and manage links to neighbors • Do not use a neighbor at any cost, only if link is good enough

  27. Framing • We discuss two aspects of framing • Choice of packet size • Intemediate checksum schemes • The goal is to try to reduce the amount of information that has to be retransmitted in case of errors while maintaining minimal overhead

  28. Frame, packet size • Small packets: low packet error rate, high packetization overhead • Large packets: high packet error rate, low overhead • Depends on bit error rate, energy consumption per transmitted bit • Notation: h(overhead, payload size, BER)

  29. Dynamically adapt frame/packet length • For known bit error rate (BER), optimal frame length is easy to determine • Problem: how to estimate BER? • Collect channel state information at the receiver (RSSI, FEC decoder information, …) • Example: Use number of attempts T required to transmit the last M packets as an estimator of the packet error rate (assuming a BSC) • Second problem: how long are observations valid/how should they be aged? • Only recent past is – if anything at all – somewhat credible

  30. Intermediate checksum schemes • With traditional framing the whole packet has to be retransmitted • In interdediate checksum schemes • The user’s data are partitioned into a number L of chunks, each having c bits to which a checksum of h bits is appended • The chunks are appended to the original frame header of size m bits • The overall frame has size m+L(c+h) bits • RECV behaves as follows • Error in the header -> discard the whole packet • Check each chunk separatly and buffer the correct ones • If all correct RECV sends final ACK to XMTR • The faulty chunks indicated with and incomplete ACK -> XMTR retransmits only the faulty packets • High overhead in low BER scenarios • Optimal chunk size exists for fixed BER

  31. Putting it together: ARQ, FEC, packet length optimization • Applying ARQ, FEC (both block and convolutional codes), frame length optimization to a Rayleigh fading channel • Rayleigh fading models assume that the magnitude of a signal that has passed through such a transmissionmedium (also called a communications channel) will vary randomly, or fade, according to a Rayleigh distributionthe radial component of the sum of two uncorrelated Gaussian random variables.

  32. Link layer tasks in general • Framing – group bit sequence into packets/frames • Important: format, size (impact on energy-consumtion and throughput) • Error control – make sure that the sent bits arrive and no other • Forward and backward error control • Flow control – ensure that a fast sender does not overrun its slow(er) receiver • Link management – discovery and manage links to neighbors • Do not use a neighbor at any cost, only if link is good enough

  33. Link management • Goal: decide to which neighbors that are more or less reachable a link should be established • Problem: communication quality fluctuates, far away neighbors can be costly to talk to, error-prone, quality can only be estimated • Establish a neighborhood table for each node • Partially automatically constructed by MAC protocols

  34. Link quality characteristics • Expected: simple, circular shape of “region of communication” – not realistic • Instead: • Correlation between distance and loss rate is weak; iso-loss-lines are not circular but irregular(see figures) • Asymmetric links are relatively frequent (up to 15%) • Significant short-term Packet Eerror Rates (PER) variations even for stationary nodes Power1 Power2 < Power1

  35. Three regions of communication • Effective region: PER consistently < 10% • Transitional region:anything in between, with large variation for nodes at same distance • Poor region: PER well beyond 90%

  36. Link quality estimation • How to estimate, on-line, in the field, the actual link quality? • Requirements • Precision – estimator should give the statistically correct result • Agility – estimator should react quickly to changes • Stability – estimator should not be influenced by short aberrations • Efficiency – Active or passive estimator • Example: EWMAonly estimates at fixed intervals EWMA exponentially weighted moving average

  37. Conclusion • Link layer combines traditional mechanisms • Framing, packet synchronization, flow control with relatively specific issues • Careful choice of error control mechanisms – tradeoffs between FEC & ARQ & transmission power & packet size … • Link estimation and characterization

More Related