我试图了解 Radio.cc 的行为(在 inet/physicallayer/common/packetlevel/ 中)。
我特别想知道它如何检测碰撞。
我希望是这样的:
if(radio==IDLE and newFrame arrives){
radio = RECEIVING;
startReception();
}
else
if(radio==RECEIVING and newFrame arrives)
impossible to receive --> COLLISION! --> stop()
Run Code Online (Sandbox Code Playgroud)
但是对于我所看到的,如果两个帧同时到达接收器,第一个的接收是'接收开始:忽略',第二个被传递到 MAC 层,它说'包含位错误或冲突,放下它'(IdealMac)。
我的问题是,接收器不应该阻塞两个帧(因为它不能同时接收两个)或将它们都传递给上层 MAC 层,然后将它们作为错误帧读取?