BabbleSim / base

BabbleSim base/common components. Any BabbleSim user will want some of these.
13 stars 2 forks source link

Do you have an estimate on the Performance when simulating a larger number of BLE devices? #2

Closed mariusheil closed 2 years ago

mariusheil commented 2 years ago

Hello,

I have just been made aware of this project and think it sounds very interesting. I am one of the developers of FruityMesh (https://github.com/mwaylabs/fruitymesh) and I have also developed a simulator for our mesh network that uses many similar concepts to abstract the BLE stack / physical layer. We also have two rendering implementations to display the devices and their communication.

Now, BabbleSim sounds like it went a lot further on the abstraction level and on the simulation level. While we were mostly concerned to be able to develop FruityMesh on a desktop pc and to run automated tests against it, it sounds like BabbleSim would be a lot more accurate.

Now, the important question: How long do you think would BabbleSim take to simulate around 100 devices that are very close to each other for e.g. 60 simulated seconds, with each of them broadcasting advertising packets continuously? This is of quadratic complexity but with some of the right optimizations could perform like a linear problem as the PHY gets congested.

If BabbleSim performs better or at around the same speed, it might be possible that we implement a second HAL for FruityMesh that compiles against BabbleSim.

Thank you, Marius

aescolar commented 2 years ago

Hi @mariusheil , how fast it will be will depend a lot on the devices radio activity, and of your choice of channel simulation. So it is not easy to give a number. With that number of devices you may be looking at around real-time'ish. It is right that performance scales down with the square of the number of devices, but some optimizations have been done to better suit mesh simulations with many devices ( https://github.com/BabbleSim/ext_2G4_phy_v1/pull/1 )

Maybe you just want to give it a spin? You can build one of Zephyr's mesh sample apps targeting the nrf52_bsim simulated board and run 100 of them in a simulation to give you an idea. Just be sure to use the latest bsim phy version to have this optimizations.

A side-comment: The distance at which devices sit does not have any impact for the Phy execution speed, but, for the indoors channel, how fast they move around will, as that determines how often the channel needs to be recalculated.

mariusheil commented 2 years ago

Thanks for answering that fast :-)

I will try to get it running once I have some time. I'll have to build BabbleSim in WSL2 and hopefully will not run into many issues.

Marius

aescolar commented 2 years ago

One very relevant note, virtual machines in general can have very significant overheads for process switching. (I have not tried in WSL2 though)