inet icon indicating copy to clipboard operation
inet copied to clipboard

AckingMac don't work properly

Open GIANNIS-AGGELIS opened this issue 3 years ago • 3 comments

Hi to all, the last two weeks I try to make a simple scenario of two nodes client and server to communicate wirelessly. I connect the two nodes with a router. I use for radio medium the simplest model the UnitDiskRadioMedium and for mac the AckingMac.

When I run the simulation I get the following error

Received frame from upper layer while already transmitting. -- in module (inet::physicallayer::UnitDiskRadio)

To run the simulation properly I need to add a low value to

**.propagation.propagation speed.

From that, I know the radio communication on an Ideal medium is almost the speed of light.

After some conversation in the oment++ forum, we find that maybe is a bug in AckingMac. I have attached below the files to reproduce the bug (.ned and .ini). I use omnet++ 5.6 and INET Version 4.2.2

Files.zip

GIANNIS-AGGELIS avatar Jun 01 '21 15:06 GIANNIS-AGGELIS

I encountered the same error when using UnitDiskRadioMedium and AckingMac. I was using a transport layer protocol that sent 2 packets back to back in one function, then AckingMac::handleUpperPacket() was invoked back to back (i.e. twice) before Radio::handleUpperPacket() was invoked for the first packet. The problem was AckingMac::handleUpperPacket() uses radio->getTransmissionState() to check if radio is already transmitting a packet, if so, it should delay packet transmission, however, when AckingMac::handleUpperPacket() was invoked for the second packet, the first packet hasn't gone through Radio::handleUpperPacket() yet, hence AckingMac doesn't know the radio should be occupied by the first packet, and sends the second packet to transmission as well.

Right now I set useAck = true to bypass the problem, but I guess AckingMac should be fixed to keep state about radio transmission status. That's just my thought.

janenxiao avatar Mar 22 '22 00:03 janenxiao

Which INET version are you using? Can you check if the problem also happens in the latest INET master branch?

levy avatar Mar 22 '22 07:03 levy

I'm using INET 4.2.5 with OMNeT++ 5.6.2

janenxiao avatar Mar 22 '22 19:03 janenxiao

fixed

ZoltanBojthe avatar Feb 21 '23 13:02 ZoltanBojthe