<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Networking Stats - Socket Data Usage (sent/received data amount)</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/115192/networking-stats---socket-data-usage-sent-received-data-amount</link><description>I am developing a project on nRF9161. 
 I am interested in calculating data usage for different protocols (for example MQTT with TLS) when communicating with a server over cellular network/socket. Is there a way to do so? 
 I have found &amp;quot;net stats&amp;quot; sample</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 29 Oct 2024 05:57:01 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/115192/networking-stats---socket-data-usage-sent-received-data-amount" /><item><title>RE: Networking Stats - Socket Data Usage (sent/received data amount)</title><link>https://devzone.nordicsemi.com/thread/508272?ContentTypeID=1</link><pubDate>Tue, 29 Oct 2024 05:57:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6318df6c-4b8b-42b3-ad91-fb6f4795038f</guid><dc:creator>Achim Kraus</dc:creator><description>&lt;p&gt;I&amp;#39;m not an employee of Nordic, but for me the reason is pretty clear:&lt;/p&gt;
&lt;p&gt;&amp;quot;AT%XCONNSTAT?&amp;quot; does a good job.&lt;/p&gt;
&lt;p&gt;If you use MQTT you will have some unaware data consumption (TCP connect/TCP ACK) and if you use TLS, each connect will come with an handshake (several k bytes). So the experience is pretty clear and simple: let it run for a week and see how much data-volume that requires in the &amp;quot;wild&amp;quot; outside your laboratory. Especially in cases with low radio signals you will need some extra data for TCP/TLS.&lt;/p&gt;
&lt;p&gt;For UDP it&amp;#39;s up to you (and the use-case), if a missing message should &amp;quot;restart the connection&amp;quot; or simply &amp;quot;try it later again&amp;quot; works. Using CoAP/DTLS 1.2 CID requires for IP/UDP/DTLS 1.2 CID/CoAP an&amp;nbsp;average overhead of about 100 bytes per message (rare DTLS handshakes included). If you use IP/TCP/TLS 1.2 the overhead per message will be slightly smaller (you mainly save the CID), but the average the depends pretty much from the number of required connect/TLS handshakes. Therefore, only a test in the &amp;quot;wild&amp;quot; will give you realistic results.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Networking Stats - Socket Data Usage (sent/received data amount)</title><link>https://devzone.nordicsemi.com/thread/508264?ContentTypeID=1</link><pubDate>Tue, 29 Oct 2024 03:37:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3512f81f-2e40-4eb3-9834-6a20e035501c</guid><dc:creator>AdrianT</dc:creator><description>&lt;p&gt;Encountering the same issue (NRF9161), when trying to check data&amp;nbsp;usage for MQTT communications. Any chance that support can provide a reason why this doesn&amp;#39;t work?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Networking Stats - Socket Data Usage (sent/received data amount)</title><link>https://devzone.nordicsemi.com/thread/504785?ContentTypeID=1</link><pubDate>Thu, 03 Oct 2024 07:22:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ed5d1b93-20b1-487a-ab3d-d595f7210c36</guid><dc:creator>Achim Kraus</dc:creator><description>&lt;p&gt;&amp;gt; I am interested in bytes.&lt;/p&gt;
&lt;p&gt;Send 1024 messages and you will see the bytes ;-).&lt;/p&gt;
&lt;p&gt;To be frank, with all the things happening &amp;quot;unexpected&amp;quot; (e.g. TCP internal retransmissions or retransmission from upper UDP protocols), counting bytes won&amp;#39;t reflect the real data consumption in the wild. There you need to run the device for a couple of days and the k-bytes will be a pretty well value reflecting the reality.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Networking Stats - Socket Data Usage (sent/received data amount)</title><link>https://devzone.nordicsemi.com/thread/504781?ContentTypeID=1</link><pubDate>Thu, 03 Oct 2024 06:57:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:87177e4b-4a88-4b8d-ab76-2a605cbbbb57</guid><dc:creator>Povilas S</dc:creator><description>&lt;p&gt;I&amp;#39;ve seen that one, but it is kilobytes and for this case I am interested in bytes.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Networking Stats - Socket Data Usage (sent/received data amount)</title><link>https://devzone.nordicsemi.com/thread/504723?ContentTypeID=1</link><pubDate>Wed, 02 Oct 2024 14:47:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:137fea2f-7c64-4fa5-9b41-b3d8ded3a83e</guid><dc:creator>Achim Kraus</dc:creator><description>&lt;p&gt;I&amp;#39;m used to &amp;quot;AT%XCONNSTAT?&amp;quot;, which works pretty well on the nRF91 series. I&amp;#39;m not common to other approaches.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>