# Measure network jitter and packet retransmits/drops

**URL:** <https://discuss.elastic.co/t/measure-network-jitter-and-packet-retransmits-drops/272946>\
**Category:** Beats\
**Tags:** filebeat, packetbeat, metricbeat\
**Created:** [May 13, 2021, 6:50pm UTC](https://discuss.elastic.co/t/measure-network-jitter-and-packet-retransmits-drops/272946 "2021-05-13T18:50:14Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tydorius](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tydorius/32/88729_2.png) [@Tydorius](https://discuss.elastic.co/u/Tydorius)\
**Post date:** [May 13, 2021, 6:50pm UTC](https://discuss.elastic.co/t/measure-network-jitter-and-packet-retransmits-drops/272946/1 "2021-05-13T18:50:14Z")

</div>

I am working on an Elastic Stack that will be used to measure network activity in a testbed for various pieces of equipment.

My current hurdle is around measuring jitter and packet retransmits and drops.

Has anyone used one of the existing beats, with or without aggregation or other processing methods, to successfully measure these items?

Even if it's something like a script that dumps data into a log file that's then pushed by filebeat into the stack, that would be a phenomenally helpful thing to see how it's done.

Thank you for your time.

---

<div class="post-metadata">

**Author:** ![Tydorius](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tydorius/32/88729_2.png) [@Tydorius](https://discuss.elastic.co/u/Tydorius)\
**Post date:** [May 14, 2021, 1:39pm UTC](https://discuss.elastic.co/t/measure-network-jitter-and-packet-retransmits-drops/272946/2 "2021-05-14T13:39:09Z")

</div>

I've managed to pull some latency data by using Heartbeat and http.rtt.response\_header.us, so now I am attempting to put together a script to calculate jitter.

In case anyone is really good at scripting/TSVB but don't know what Jitter is, here is an example:

Jitter is the average difference in latency for a series of packets.

**Packet Response Times**  
150  
120  
100  
60  
140

**Changes in Response Time (All results kept positive)**  
150 - 120 = 30  
120 - 100 = 20  
100 - 60 = 40  
140 - 60 = 80

**Total Changes in Response Time:** 170

**Jitter, divide by the number of intervals (i.e. packets - 1)**  
Divide by Packets - 1 (i.e. Interval Counts)  
170 / 4 = **42.5ms Jitter**

So I need to write something that takes http.rtt.response\_header.us, and compares it to its immediate predecessor to get my interval, and then run through the math. That will solve my Jitter issue. I'm still working on packet retransmissions and drops.

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [May 14, 2021, 1:57pm UTC](https://discuss.elastic.co/t/measure-network-jitter-and-packet-retransmits-drops/272946/3 "2021-05-14T13:57:49Z")

</div>

Packet Drops and Errors are natively part of metricbeat system network metricset see [here](https://www.elastic.co/guide/en/beats/metricbeat/current/metricbeat-metricset-system-network.html) and [here](https://www.elastic.co/guide/en/beats/metricbeat/current/exported-fields-system.html#_network_11)

Don't think beats capture retrys

---

<div class="post-metadata">

**Author:** ![Tydorius](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tydorius/32/88729_2.png) [@Tydorius](https://discuss.elastic.co/u/Tydorius)\
**Post date:** [May 14, 2021, 3:07pm UTC](https://discuss.elastic.co/t/measure-network-jitter-and-packet-retransmits-drops/272946/4 "2021-05-14T15:07:23Z")

</div>

Thank you! I thought I had gone through looking for those keywords on all of the metrics lists but I missed them.

So now I just need to work out jitter and retransmit.

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [May 14, 2021, 3:38pm UTC](https://discuss.elastic.co/t/measure-network-jitter-and-packet-retransmits-drops/272946/5 "2021-05-14T15:38:15Z")

</div>

Also in TSVB there is a serial difference function that you could make positive only but that will just be a graph not persisted in the the data, you can do math there as well I suspect divide by the number of sample etc... I will think about it a bit...

Perhaps I can try that with some heartbeat data I have...

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [May 14, 2021, 9:21pm UTC](https://discuss.elastic.co/t/measure-network-jitter-and-packet-retransmits-drops/272946/6 "2021-05-14T21:21:48Z")

</div>

Hi @Tydorius  
Take A look at this.

Visualize -\> TSVB

Panel Options

 ![Screen Shot 2021-05-14 at 2.18.11 PM](https://us1.discourse-cdn.com/elastic/original/3X/1/e/1ed306b617b88e6e7f5406715f457bd3593d8a3e.png)

Data Settings

 ![Screen Shot 2021-05-14 at 2.18.21 PM](https://us1.discourse-cdn.com/elastic/original/3X/c/a/ca1e548658b3bc0f911c5a7025cfcf0237677005.png)

Data Options

 ![Screen Shot 2021-05-14 at 2.18.45 PM](https://us1.discourse-cdn.com/elastic/original/3X/b/5/b5eb43a6c09e730e86ad1670e8507e0fa2b35402.png)

Jitter Graph

 ![Screen Shot 2021-05-14 at 2.18.59 PM](https://us1.discourse-cdn.com/elastic/original/3X/6/7/67feb657afe7ed040c08bb8c34f3c88f2398a93b.jpeg)

---

<div class="post-metadata">

**Author:** ![Tydorius](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tydorius/32/88729_2.png) [@Tydorius](https://discuss.elastic.co/u/Tydorius)\
**Post date:** [May 17, 2021, 4:09pm UTC](https://discuss.elastic.co/t/measure-network-jitter-and-packet-retransmits-drops/272946/7 "2021-05-17T16:09:16Z")

</div>

This looks promising! I'm going to mirror this in my environment and get back with you!

Thank you for your help, I'll mark as solution as soon as I confirm! I think retransmit is beyond what I'm able to look at for the moment, so I'll edit my initial post to note that for anyone that runs across this in the future.

---

<div class="post-metadata">

**Author:** ![Tydorius](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tydorius/32/88729_2.png) [@Tydorius](https://discuss.elastic.co/u/Tydorius)\
**Post date:** [May 17, 2021, 5:07pm UTC](https://discuss.elastic.co/t/measure-network-jitter-and-packet-retransmits-drops/272946/8 "2021-05-17T17:07:50Z")

</div>

Resolved - Note to anyone that finds this thread, everything was resolved except retransmission. So if you're looking for details on retransmission packets you'll need to continue working.

Thank you again, @stephenb

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [May 17, 2021, 5:08pm UTC](https://discuss.elastic.co/t/measure-network-jitter-and-packet-retransmits-drops/272946/9 "2021-05-17T17:08:28Z")

</div>

Awesome!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [June 14, 2021, 7:08pm UTC](https://discuss.elastic.co/t/measure-network-jitter-and-packet-retransmits-drops/272946/10 "2021-06-14T19:08:57Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
