无线传感器WSNs TheDataLinkLayer——B-MAC
B-MAC概述
B-MAC (Berkeley Medium Access Control protocol) 是一种用于无线传感器网络的省电型通信协议。
它主要为了解决 S-MAC 的两个能源问题:
- periodic transmission of SYNC packets : S-MAC 要不停发同步包(SYNC),浪费电;
- nodes active during LISTEN period to wait for possible incoming packets : S-MAC 要在 Listen 时间里一直醒着,即使没人来找它,也不能睡,还是浪费电。
Main differences
CCA in B-MAC
Clear Channel Assessment (CCA) for carrier sensing - no RTS/CTS 用于载波侦听的清晰信道评估
CCA replaces RTS/CTS
判断流程
先采样得到 noise floor(TX 后)
After packet TX, a sample of the channel is taken and used to compute an average noise floor estimate. 数据包 TX 之后,对信道进行采样并用于计算平均本底噪声估计值。
为什么是TX数据传送后?
因为那时候信道最安静,节点刚刚发送数据完成、别人也没抢 → 这时候测出来的信号值才是“真正的背景噪声”。
Noise floor 是指在没有任何通信的情况下,信道中自然存在的背景信号强度。
Summation of all the noise sources and unwanted signals generated within the entire system.
发数据前,再采一轮信道,判断是否outlier 离群值(busy)
Just before packet TX, samples of the channel are taken to search for outliers 在数据包发送之前,对信道进行采样以搜索异常值
no outliers found -> busy
yes outliers found -> clear
图:20~60ms 信道busy,outlier为0,没有异常。其他的时候,信号都很杂乱, clear。
outliers 异常值:没有发送信号的时候,信道会有各种杂乱的背景音,属于异常值。当有信号在发送时,维持一个统一的频率,没有异常值,只有稳定值,可判断信道Busy。
Low-Power Listening (LPL) in B-MAC / preamble sampling
B-MAC 中最核心的部分之一——Low-Power Listening(LPL)机制,也叫 preamble sampling。
Unsynchronized sleep schedules using Low-Power Listening (LPL) 使用低功耗监听 (LPL) 的非同步睡眠时间表
在 B-MAC 中,节点平时都在睡觉,只会周期性短时间醒来看一眼信道有没有人发 preamble。
所以,发送端必须发一个够长的 preamble,才能确保接收端在它醒来时刚好能听到。
Preamble 数据前的一段“提醒信号”,告诉接收者:我要发东西啦!
图中内容流程
节点 A:
先 Sleep,后开始发 preamble(一长段)
等接收端 B 监听到了 → A 再正式发 DATA + 等 ACK
节点 B:
它在固定节奏中醒来(蓝条)
某次醒来的时机刚好撞上 A 发 preamble
它听到了,保持清醒,接收数据,然后回 ACK
节点 C:
虽然它也听到了 preamble,但发现 data 里目标不是它
它就不理会,继续按节奏 sleep,避免能量浪费
What is the minimum length of the preamble? 至少等于 Tp(接收端的监听周期)
因为如果 preamble 太短,可能 A 发完了,B 还没醒——就错过了!
CCA在LPL中的作用——detection failure : missed preambles and false positives
接收端误判信道状态,导致通信失败
CCA 起到的作用是“辅助判断有没有 preamble”,不是像 S-MAC 那样用来避免冲突,而是 B-MAC 利用 CCA 来:
判断接收到的信号强度波动,是不是一个真正的 preamble,而不是背景噪声或偶然干扰。
具体怎么用 CCA?来解释两种情况:
[1] 避免 missed preamble(漏掉 preamble)
接收者醒来那一刻,使用 CCA 检查信道是否有明显信号活动:
如果有明显高于 noise floor 的强信号 → 说明有可能在发 preamble → 保持清醒 → 接收后续数据
如果不使用 CCA → 可能测不到强度变化 → 醒来了但没听到 → 漏掉 preamble ❌
→ 所以:CCA 用来检测信道上是否真的有前导信号,避免漏听
[2] 避免 false positive(误以为有人发)
有时候接收者醒来,信道上可能有偶然电磁波动、环境干扰,看起来像个 preamble。如果不做 CCA 分析,就可能误判“有人要发数据” → 白白保持清醒浪费电
CCA 会对信号强度波形做分析:是不是持续存在?是不是跳跃程度大?是不是“稳定”像!](https://i-blog.csdnimg.cn/direct/cd13e11efd4f4ee2bfcda36fb8bc4db0.png)
preamble?
→ 所以:CCA 用来防止被假信号误导
Energy with preamble sampling 前导采样带来的能耗问题
Advantage
LPL is simple, asynchronous and energy-efficient. LPL 简单/异步且节能
eliminates long idle listening periods. 消除长时间的空闲监听时间
Disadvantages
[1] Receiver must wait until the preamble is transmitted completely before receiving data. Even if the receiver wakes up at the start of the preamble. 接收器必须等到前导码完全传输后才能接收数据。即使接收器在前导码开始时就被唤醒。
[2] Other neighbours that also wake up during the preamble stay awake until the preamble is transmitted completely. Because they must listen to the head and find out if the packet is addressed to them -> overhearing problem 其他在前导码发送过程中被唤醒的邻居节点会一直保持唤醒状态,直到前导码发送完毕。因为它们必须监听头部,并确定数据包是否发给自己——这就产生了偷听问题。
Blue area: awake periods