# Pairwise latencies between all anchors?

**URL:** <https://forum.ripe.net/t/pairwise-latencies-between-all-anchors/537>\
**Category:** RIPE Atlas\
**Created:** [19 June 2023 16:33 UTC](https://forum.ripe.net/t/pairwise-latencies-between-all-anchors/537 "2023-06-19T16:33:09Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mustafa\_Gezer](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.ripe.net/mustafa_gezer/32/283_2.png) [@Mustafa\_Gezer](https://forum.ripe.net/u/Mustafa_Gezer)\
**Post date:** [19 June 2023 16:33 UTC](https://forum.ripe.net/t/pairwise-latencies-between-all-anchors/537/1 "2023-06-19T16:33:09Z")

</div>

Hey I asked a question some time ago on how to use the API to get pairwise latencies between all nodes. I was told I should look into anchoring measurements. Since the anchores are in a mesh getting the pairwise latencies for all of them should be possible. But I am having trouble gathering the data.

I am accesing the API using Python at the moment and use Sagan to deal with the results. But I have trouble with formulating the GET requests. [https://atlas.ripe.net/api/v2/anchor-measurements/?type=ping](https://atlas.ripe.net/api/v2/anchor-measurements/?type=ping) for example does not only return measurements of type ping.

And even if it did. What would I have to do to get the RTT between the anchors. It really is not intuitive for me at the moment.

---

<div class="post-metadata">

**Author:** ![camin](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.ripe.net/camin/32/243_2.png) [@camin](https://forum.ripe.net/u/camin)\
**Post date:** [21 June 2023 12:37 UTC](https://forum.ripe.net/t/pairwise-latencies-between-all-anchors/537/2 "2023-06-21T12:37:13Z")

</div>

Hi Mustafa,

You’re right, the /anchor-measurements/ endpoint doesn’t currently allow filtering by type. In order to get the pairwise latencies of the anchor mesh, I would suggest something like the following:

- Manually filter (client-side) the measurements in [https://atlas.ripe.net/api/v2/anchor-measurements](https://atlas.ripe.net/api/v2/anchor-measurements) for “type” = “ping” and “is\_mesh” = true, and extract the “measurement” URL from each one
- Add “/latest” to the measurement URL, which allows you to fetch a JSON array containing all the most recent results
- Extract “prb\_id” (source probe) and the latency result from the JSON. The latest result format is documented here: [RIPE Atlas docs | Measurement Result Format | Docs](https://atlas.ripe.net/docs/apis/result-format/#version-5000). To abstract various result format versions behind a single interface, you can consider using [GitHub - RIPE-NCC/ripe-atlas-sagan: A parsing library for RIPE Atlas measurement results](https://github.com/RIPE-NCC/ripe-atlas-sagan).

Note: in general when you fetch measurement results you get probe IDs and not anchor names. If you want to map between the two, take a look at [https://atlas.ripe.net/api/v2/anchors/](https://atlas.ripe.net/api/v2/anchors/), which has both “probe” and “fqdn” fields, allowing you to make the connection.

Does this help your use case?

Regards,  
Chris

---

<div class="post-metadata">

**Author:** ![Mustafa\_Gezer](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.ripe.net/mustafa_gezer/32/283_2.png) [@Mustafa\_Gezer](https://forum.ripe.net/u/Mustafa_Gezer)\
**Post date:** [3 July 2023 10:19 UTC](https://forum.ripe.net/t/pairwise-latencies-between-all-anchors/537/3 "2023-07-03T10:19:53Z")

</div>

Hey Chris,

Pardon the late response. Yes this helped me tremendously. Is there anyway for me to not only use /latest and get 3 RTT for a pair? Can I somehow filter the api/v2/measurements/ID/results to give me the RTT measured in a certain timeframe?

---

<div class="post-metadata">

**Author:** ![apkhomie07](https://avatars.discourse-cdn.com/v4/letter/a/d26b3c/32.png) [@apkhomie07](https://forum.ripe.net/u/apkhomie07)\
**Post date:** [25 August 2023 11:55 UTC](https://forum.ripe.net/t/pairwise-latencies-between-all-anchors/537/4 "2023-08-25T11:55:16Z")

</div>

Hey there,

HOMIE here. I’ve faced similar challenges with APIs before. From my experience, some APIs don’t always filter results strictly based on the parameters you give. It might be helpful to double-check the API documentation and see if there’s any specific formatting or additional parameters required.

For the RTT between anchors, once you have the ping data, you’ll likely have to parse through the response data to extract it. Sagan should help, but you might need some custom parsing to make it fit your exact needs.

Remember, the community forums or official support for RIPE Atlas could be quite helpful for these kinds of questions. Hope this helps a bit!

All the best,  
HOMIE

---

<div class="post-metadata">

**Author:** ![Yehudamy](https://avatars.discourse-cdn.com/v4/letter/y/aca169/32.png) [@Yehudamy](https://forum.ripe.net/u/Yehudamy)\
**Post date:** [12 January 2024 11:24 UTC](https://forum.ripe.net/t/pairwise-latencies-between-all-anchors/537/5 "2024-01-12T11:24:27Z")

</div>

> [@Mustafa\_Gezer](#):
>
> Hey I asked a question some time ago on how to use the API to get pairwise latencies between all nodes. I was told I should look into anchoring measurements. Since the anchores are in a mesh getting the pairwise latencies for all of them should be possible. But I am [store hours](https://returnspolicy.info/) having trouble gathering the data.
> 
> I am accesing the API using Python at the moment and use Sagan to deal with the results. But I have trouble with formulating the GET requests.
> 
> And even if it did. What would I have to do to get the RTT between the anchors. It really is not intuitive for me at the moment.

Once I manage to retrieve ping measurements, I’m struggling to interpret the results effectively. I’m aiming to extract the Round-Trip Time (RTT) between the anchors, but the structure of the returned data is not very intuitive to me. Any insights or sample code snippets on how to extract and analyze the RTT data from the API responses would be immensely helpful.

---

<div class="post-metadata">

**Author:** ![robertk](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.ripe.net/robertk/32/413_2.png) [@robertk](https://forum.ripe.net/u/robertk)\
**Post date:** [17 January 2024 12:47 UTC](https://forum.ripe.net/t/pairwise-latencies-between-all-anchors/537/6 "2024-01-17T12:47:47Z")

</div>

Hello, the structure of the JSON results is documented here: [RIPE Atlas docs | Measurement Result Format | Docs](https://atlas.ripe.net/docs/apis/result-format/#notes) - if you decide to parse this yourself. You could also use existing tools and libraries that do most of the work for you, such as RIPE Atlas Sagan (for Python, see [GitHub - RIPE-NCC/ripe-atlas-sagan: A parsing library for RIPE Atlas measurement results](https://github.com/RIPE-NCC/ripe-atlas-sagan/)) or goat (for Go, see [GitHub - robert-kisteleki/goat: Go (RIPE) Atlas Tools](https://github.com/robert-kisteleki/goat/))
