signetlabdei / lorawan

An ns-3 module for simulation of LoRaWAN networks
GNU General Public License v2.0
182 stars 130 forks source link

lorawan module paccket indicated as lost and received successfully at the same time #155

Closed chekraF closed 5 months ago

chekraF commented 6 months ago

Hi,When I run the module lorawan in ns3, the start receive ( ...) function indicates that the packet was lost because the Ed is listening on another frequency, then endReceive( ...) indicates that the packet is received correctly! Can you have any idea about the origin of this contradiction? Screenshot from 2024-03-11 12-23-57

non-det-alle commented 6 months ago

Hi, I think you might have not correctly interpreted the logs in the screenshot. Note that in each line you have a timestamp, the id of the node printing the line and finally the message.

In the current abstraction of the PHY layer, the devices can always do preamble detection if they are not sleeping; in the future we might improve this to be more in line with the state changes of real devices, but for now it does not affect the behavior because the MAC always puts devices to sleep after TX or RX, avoiding accidental receptions. So, the first line you see is just device 1 skipping a packet preamble that was not for them while they are on STANDBY (you should put them to sleep instead). Then, 800ms later, device 0 finishes a TX and a gateway (node id 2) finishes reception.

I see you are implementing a class b devices, to avoid accidental receptions I suggest you put them to sleep when they are not meant to receive a message.

non-det-alle commented 5 months ago

Closing for lack of activity.