Link Layer
Some images taken from
http://www.cs.uni-paderborn.de/index.php?id=1119&L=1
Overview
- The link layer deals with with the communication link
between two neighboring nodes. In particular, the link layer
is responsible for the following:
- Error control - ensuring that bits sent arrive correctly.
- Framing - grouping bits into packets/frames.
Error Control
- An error occurs if a frame fails to arrive at the receiver
or if a frame arrives with bit errors.
- The wireless medium can experience high error rates.
In addition, errors are often bursty;
communication will proceed without error for some time, then several
errors will occur in sequence or closely together.
- Approaches:
- Forward error correction (FEC) - use redundancy/encoding
to enable errors to be corrected at the receiver
- Automatic Repeat Request (ARQ) - use ACK/NACK and
retransmissions to recover lost packets or packets containing errors.
Timeouts are used to detect missing packets and CRC checksums
are used to detect errors.
Framing
- Determine how to split network layer packets into MAC layer
frames.
- Each frame has overhead: MAC/PHY headers containing CRC,
sender/receiver addresses, preamble for frame synchronization.
- Large frames = low overhead and good bandwidth utilization
- Small frames = effective error recovery since smaller
chunks can be retransmitted in case of error.
SPOT Details
- PHY layer does a CRC check and discards packets with bit
errors.
- The MAC layer retransmits packets that are non-broadcast
packets. If the sender and receiver are within radio range,
communication will be reliable.
- A RadioPacket (essentially MAC layer frame) is 128 bytes.
The CC2420 radio has a bounded 128 byte buffer.
- The Radiogram interface automatically fragments packets
larger than 128 bytes.
- You can bypass the link/MAC layer by using I_802_15_4_PHY
to directly send packets. No ACK check will be performed.
- The IProprietaryRadio provides information about the number
of packets dumped because of a failed CRC check and the LowPanStats
provides statistics on fragmented packets, etc.
Seda
"Datalink Streaming in Wireless Sensor Networks" by Ganti et. al.
- A link layer protocol that decouples framing from error
recovery.
- Idea: use large frames for better bandwidth utilization but
only retransmit small blocks when necessary (not entire frames)
- Assumption: there will be a stream of bits coming from the
network layer. Good for applications with lots of data.
Seda: Sender
- A packet from the network layer is broken into blocks.
- A block has 2 bytes of overhead: a sequence number and a
CRC.
- A series of blocks is packed into a single frame and
transmitted to the MAC layer.
- The sender waits for a recovery frame containing ACKs/NACks
for each block. Missing blocks are retransmitted.
Seda: Receiver
- The receiver waits for all blocks in a frame.
- When all blocks are received, the frame is forwarded to the
network layer.
- Periodically, a recovery frame with ACKs/NACKs for
outstanding blocks is sent.
Message Formats
- Blocks are of constant size. The last block may be padded with zeros to achieve this.
- The last block is identified by a 1-bit in the sequence number of the block.
- The last block also has a length field (1 byte) to specify the length of the data.
- The maximum block sequence number is 127.
- The recovery frame serves as ACK and NACK.
- Recovery frame:
- Type specifies that it is a recovery frame.
- Src/Dest are the source and destination of the message.
- Start block no. is the sequence number of the first missing or corrupt block.
- The block map is a bit map where each bit indicates whether the block was received or not.
Experiments
- The authors looked at the potential throughput for different loss models.
- The loss models varied in the size of the error clusters seen and
the inter-cluster size -- the size of the blocks without error between
two error clusters.
Observations
- As the time between error clusters increases, the optimal block size increases.
- Blocks of 20-25 bytes are optimal.
- The throughput increases as the frame size increases.
- The frame size used in the implementation was bounded by the packet buffer of the CC2420 radio (128 bytes).
Sami
Rollins
Date: 2008-04-18