signetlabdei / lorawan

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

Setting different data rate for different set of end device #41

Closed shobhitaggarwal92 closed 5 years ago

shobhitaggarwal92 commented 5 years ago

I am trying to configure different end devices with different values of spreading factors but it seems like SF can be configured using datarate. I am quite new with NS-3 Can you give a simple illustration of how to use the SetDataRate method for it?

Thanks

DvdMgr commented 5 years ago

Hi, in the EU868 region, there's a direct correspondence between Data Rate and Spreading Factor: DR0 = SF12BW125, DR1 = SF11BW125, ..., DR5 = SF7BW125.

You can find more about this correspondence on the Regional Parameters document of the LoRaWAN standard!

EduLima7 commented 5 years ago

In the EU868, you can do it using LoraMacHelper::SetSpreadingFactorsUp method. This method sets the Data Rate from the sensitivity of each End Device. For example, on complete-network-example line macHelper.SetSpreadingFactorsUp (endDevices, gateways, channel); sets Data Rate of EndDevices NodeContainer.

shobhitaggarwal92 commented 5 years ago

Thanks. I was able to configure different SF for different nodes.