LoRaWAN
The lorawan library provides structures and tools for reading and writing LoRaWAN 1.0.2 messages from and to slices of bytes.
Sample Packet manipulation
Use the library
[]
= "0.5.0"
Packet generation
use ;
use heapless;
Packet parsing
use *;
use *;
Benchmarks
Ran on Intel i7-8550U CPU @ 1.80GHz with 16GB RAM running Ubuntu 18.04.
- Benchmarks brocaar/lorawan (the code for the benchmarks can be found
here, results were obtained by running
go test -bench . -benchtime=5s
,go1.13.1
)
pkg: github.com/brocaar/lorawan
BenchmarkDecode-8 40410 150498 ns/op
BenchmarkValidateMic-8 2959 2026736 ns/op
BenchmarkDecrypt-8 9390 648402 ns/op
- Benchmarks rust-lorawan (the code is inside
benches/lorawan.rs
, results are obtained runningcargo bench --workspace
,rustc 1.43.0
)
Running target/release/deps/lorawan-32e80b41705c7d41
Gnuplot not found, using plotters backend
data_payload_headers_parsing
time: [30.354 ns 30.430 ns 30.497 ns]
change: [-5.5657% -5.1359% -4.7052%] (p = 0.00 < 0.05)
Performance has improved.
Found 1 outliers among 100 measurements (1.00%)
1 (1.00%) high mild
Approximate memory usage per iteration: 1 from 303847227
data_payload_mic_validation
time: [2.2334 us 2.2388 us 2.2476 us]
change: [-3.7708% -3.3970% -2.8941%] (p = 0.00 < 0.05)
Performance has improved.
Found 20 outliers among 100 measurements (20.00%)
2 (2.00%) low severe
5 (5.00%) low mild
2 (2.00%) high mild
11 (11.00%) high severe
Approximate memory usage per iteration: 114 from 4349451
data_payload_decrypt
time: [1.1179 us 1.1186 us 1.1193 us]
change: [-0.8167% -0.4650% -0.1514%] (p = 0.00 < 0.05)
Change within noise threshold.
Found 8 outliers among 100 measurements (8.00%)
2 (2.00%) low severe
2 (2.00%) low mild
3 (3.00%) high mild
1 (1.00%) high severe
Approximate memory usage per iteration: 57 from 8668603
Contributing
Please read the contributing guidelines
Used code and inspiration
I would like to thank the projects lorawan by brocaar for the inspiration and useful examples.