# LoRaWAN packets in ns-3 simulation

**URL:** <https://www.thethingsnetwork.org/forum/t/lorawan-packets-in-ns-3-simulation/65898>\
**Category:** LoRaWAN Discussions\
**Tags:** guide\
**Created:** [December 10, 2023, 7:28pm UTC](https://www.thethingsnetwork.org/forum/t/lorawan-packets-in-ns-3-simulation/65898 "2023-12-10T19:28:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![yuksel12](https://www.thethingsnetwork.org/forum/letter_avatar_proxy/v4/letter/y/bcef8e/32.png) [@yuksel12](https://www.thethingsnetwork.org/forum/u/yuksel12)\
**Post date:** [December 10, 2023, 7:28pm UTC](https://www.thethingsnetwork.org/forum/t/lorawan-packets-in-ns-3-simulation/65898/1 "2023-12-10T19:28:52Z")

</div>

Hello, everyone. I’m new here and to LoRaWAN 🙂 , i’ve been checking a simulated LoRaWAN network using ns-3 LoRaWAN module([GitHub - signetlabdei/lorawan: An ns-3 module for simulation of LoRaWAN networks](https://github.com/signetlabdei/lorawan)) and i just can’t get to understand what these hex numbers logged are supposed to mean.

I looked all over the source code on the module but they don’t mention how they represent packets and it seems they use a 12-digit hex number for both packets and devices.

For example, in the source code network-server.cc, NS\_LOG\_FUNCTION(this \<\< packet) logs 0x55b9aa1b1cf0, 0x55b9aa1b3420.  
And the numbers are all the same except last 4 digits for gateways, end devices and network server.

What exactly are they and how can i actually get packets or how do i create a LoRaWAN packet myself in ns-3 that goes from Network Server to Application server?

I will basically bit-flip the DevAddr, FCnt, FrmPayload to simulate an MITM/bit-flipping attack.

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![noise](https://www.thethingsnetwork.org/forum/letter_avatar_proxy/v4/letter/n/9d8465/32.png) [@noise](https://www.thethingsnetwork.org/forum/u/noise)\
**Post date:** [December 30, 2023, 8:45pm UTC](https://www.thethingsnetwork.org/forum/t/lorawan-packets-in-ns-3-simulation/65898/2 "2023-12-30T20:45:56Z")

</div>

I’m seriously noob myself but have you seen this [online packet decoder](https://lorawan-packet-decoder-0ta6puiniaut.runkit.sh/)?
