Closed xiaoyaodiwang closed 2 years ago
Usually packet loss is a measurement of how many packets were successfully received vs how many were lost due to interference/collisions. You don't control packet loss directly, its just a result of many factors in the network.
It seems however that you want to set up the network in such a way that packets will intentionally be lost at a given rate. There's a number of ways you could do this, but they're all going to have different characteristics and side effects.
One simple way would be to modify the SimpleGateWayLoraPhy::EndReceive method to randomly pretend there was interference say, 75% of the time, and destroy uplink packets before they're received. This, however, still wont give you an exact 0.75 packet loss rate, as other factors could still cause interference/packet failure.
I think @CodeZombie's reply is quite good, thanks for taking the time to address this question!
I'd like to explore what may happen in the case of packet loss, so I need to set PHY packet loss rate between two nodes. How to set packet loss rate between two nodes in lorawan module?