Electron Data Usage: What layer is it counted from?

Hello,

Can anyone give me a definitive answer - Is data usage counted including IPv4+UDP headers, just UDP headers, or just the payload itself?

For example, sending an 8 byte UDP datagram (using UDP directly, not using the Particle functions) - Would this count (for billing purposes) as 8 bytes (payload only), 16 bytes (payload + 8 bytes UDP header), or 36 bytes (payload + 8 bytes UDP header + 20 bytes IPv4 header)?

Including all data traffic the cell provider has to transport up- and downstream for you.

I’m not entirely sure what you’re saying there… are you saying that data usage includes all headers, plus the physical layer headers (PDCP between the device and cell tower, Ethernet within the provider’s network etc.)?

Sorry, I forgot to add a "for you" (added it above)

Surely you can't be held resposible for any internal data required to have your packet delivered.
But all bytes that leave your cellular modem (including the UDP and IP "wrapping") or are sent to it - excluding data the cellular network needs for providing the service as such.
So no cellular handshake to establish or maintain the cellular connection.

Thank you - So if I want to track data used in a given session, it would be accurate to do something along the lines of “bytesThisSession += (payloadLength + 28)”?

Or you use something like this
https://prerelease-docs.particle.io/reference/firmware/electron/#getdatausage-

1 Like