All posts

Test a route from outside with RIPE Atlas

RIPE Atlas measurements 1001 and 10001 to k-root, twenty probes. Three IPv4 pings were 0 of 3. Probe 910 got a SOA back in 18.303 ms.

Written by NodeRings Inc.

NodeRings Inc. writes these notes. The company runs the marketplace and the agent that stays on the provider’s side of the hypervisor.

Probe 910, in DE, AS9145, sent 3 ICMP packets to k.root-servers.net and recorded 0 replies on IPv4 and 0 on IPv6. The API stores that ping's avg as -1. The same probe asked k.root-servers.net for the SOA of . and got an answer in 18.303 ms on IPv4 and 27.128 ms on IPv6. The answer is one SOA, MNAME a.root-servers.net., TTL 86400.

That pair sits inside a pull of 20 probes. The ping ids are 1001 and 2001. The SOA ids are 10001 and 11001. All four are public built-ins, already running, so the GET is anonymous. A new measurement is a POST, and the POST needs a key. GetVPS is the writeup of that choice: one question, a saved probe list, IPv4 and IPv6 kept apart. The list and the latest samples are below.

From this host the same three ICMP packets to 193.0.14.129 came back 3 of 3, average 37.676 ms. IPv6 to 2001:7fd::1 came back 3 of 3, average 38.457 ms.

What twenty results cost

The credit page prices a result, and it charges when a result is delivered. A periodic ping with 3 packets is N * (int(S/1500) + 1). With the defaults that is 3 credits. Measurement 1001 reports credits_per_result 3 and packets 3, which matches. A DNS query over UDP is 10 credits. Measurement 10001 reports 10. A one-off result costs twice the periodic price, because the platform schedules it once and stores the metadata once.

A connected probe earns 15 credits a minute. 15 * 1440 is 21,600 credits in a day, and the host account is credited once a day. Each result the probe delivers adds 1 credit. An anchor host earns ten times the probe-host rate. An account whose balance is 0 and whose history has zero transactions can claim a one-time grant of 50,000 credits.

Twenty probes, four one-offs, every probe returning a line:

MeasurementPeriodic priceOne-off price20 results
Ping, one address family36120
DNS over UDP, one address family1020400

Both families are 120 + 120 + 400 + 400 = 1,040 credits. 1040 * 48 is 49,920, so the 50,000 grant covers this shape 48 times and leaves 80 credits. One periodic pass of every connected probe is a different bill. The status=1 list returned count 15,354. A one-off ping of all of them, one family, is 15354 * 6 = 92,124 credits, past the grant.

Charges land in a batch every four to six hours. A balance read in the same hour as the result can show the number from before the batch. These four ids are built-ins. The 1,040 is the price of creating the same shape, and the GET that filled the table is a read.

API fields: ping measurement 1001 costs 3 credits per result, DNS measurement 10001 costs 10, then the one-off cost of 20 probes on both address families, 1040 credits.
The price on the measurement object, and the one-off multiple from the credit page. 20 probes, four measurements, 1040 credits if every probe returns a line.

Twenty probes, four countries, one ASN each

The rule, so the next pull can copy it. Connected probes only (status=1). The tag pair system-ipv4-works and system-ipv6-works. Four countries, DE, US, SG, BR. Inside a country, walk ids upward and keep a probe when its asn_v4 is new, until there are five. That is 20 probes, 20 IPv4 ASNs.

The same tag pair, with page_size=1, returned count 6,904. Connected probes tagged system-ipv4-works returned 13,977. The tag system-ipv6-works returned 7,097. Probes tagged system-anchor and connected returned 1,033.

Three of the 20 use a different ASN on IPv6. Probe 81 is AS3209 on v4 and AS8820 on v6. Probe 1171 is AS20055 and AS53758. Probe 6659 is AS202422 and AS199524. The rule keyed off asn_v4, so those three stayed.

curl -sS 'https://atlas.ripe.net/api/v2/probes/?status=1&tags=system-ipv4-works,system-ipv6-works&country_code=DE&page_size=100&sort=id'

The other three countries are the same URL with country_code set to US, SG, and BR. Page once. Skip an asn_v4 you already kept.

The ping and the SOA

Every ping result in this pull names one destination. IPv4 is 193.0.14.129. IPv6 is 2001:7fd::1. k.root-servers.net is anycast, so that address is many machines, and the RTT is the instance the probe reached. The v4 ping interval is 240 seconds, and the 20 latest samples span 271 seconds. The v6 samples span 227 seconds. The SOA interval is 1,800 seconds. The v4 SOA samples span 1,608 seconds, and the v6 SOA samples span 1,755 seconds. Each figure is that probe's latest stored sample. The spans are how far apart those samples sit.

Of the 20 IPv4 pings, 17 came back 3 of 3. Those 17 averages run from 13.708 ms to 192.407 ms, median 50.219 ms. Of the 20 IPv6 pings, 19 came back 3 of 3, from 10.051 ms to 160.006 ms, median 42.764 ms. The three IPv4 zeros are probes 910, 307, and 1113. The only IPv6 zero is 910.

Horizontal bars of ping RTT for 20 probes in DE, US, SG, and BR. IPv4 in teal, IPv6 in purple. Probes 910, 307, and 1113 are marked 0/3 on IPv4.
Latest ping on measurements 1001 and 2001. A missing bar is 0 of 3, and the API records avg as -1. The long SG bar is probe 6568, 192.407 ms on IPv4.

Probe 6349 in BR is the clean split between families. IPv4 average 119.482 ms, IPv6 average 11.862 ms, both 3 of 3. The SOA times sit on top of those pings, 119.441 ms and 12.092 ms. The probe is fine. The two families took different paths to the anycast address.

The SOA query on 10001 is UDP, type SOA, name ., target k.root-servers.net, and the probe's own resolver is left unset. The time is the probe talking to the root server. A query through the probe's resolver would time that resolver, which is the split in GeoDNS follows the resolver. Eighteen of the 20 IPv4 queries returned one SOA. Nineteen of the 20 IPv6 queries did. The TTL on those answers is 86400 seconds. There is no DNS propagation is what a cache does with the TTL it stored. The SOA in this pull was already the answer.

CountryProbeAS v4Ping v4 msPing v6 msSOA v4 msSOA v6 ms
DE80332013.70816.38116.73517.535
DE81320914.22110.05119.48020.681
DE8821250240.19444.86942.63949.740
DE901888132.25942.76429.54829.727
DE91091450/30/318.30327.128
US30779220/3119.848298.14126.881
US1113168810/387.756timeouttimeout
US117120055150.66426.070153.34928.911
US11864637588.51579.56698.27083.262
US49307018154.241117.600158.220118.864
SG64775500268.41267.74766.31067.153
SG65062047356.88940.43656.89740.672
SG656841095192.407160.006198.81179.855
SG659419961068.42967.712timeout73.538
SG66762448250.21949.81549.85250.221
BR63492716119.48211.862119.44112.092
BR64102254847.08238.75146.43028.862
BR66023623632.59335.06034.94829.957
BR665920242228.14627.97128.00034.110
BR67905769534.59931.35231.45334.694

0/3 is sent 3 and rcvd 0. timeout is the DNS error object {"timeout": 5000}.

Probe 910 is the row where ICMP is 0/3 and the SOA has a time. Probe 307, AS7922, is the same shape on IPv4 only: ping 0 of 3, SOA in 298.14 ms, while its IPv6 ping is 3 of 3 at 119.848 ms. Probe 1113, AS16881, is the other way round. IPv4 ping 0 of 3, both SOA queries timed out at 5,000 ms, and the IPv6 ping is 3 of 3 at 87.756 ms. A 0 of 3 is a result about ICMP. The SOA is a result about UDP to port 53 on the same address. Probe 6594 in SG is a smaller version of that split: both pings 3 of 3, the IPv4 SOA timed out, the IPv6 SOA came back in 73.538 ms.

Probe 910 recorded 0 of 3 pings on IPv4 and IPv6 and a SOA in 18.303 ms and 27.128 ms. Probe 1113 recorded an IPv6 ping of 87.756 ms and DNS timeouts of 5000 ms.
910's address answered the SOA and stayed quiet for ICMP. 1113's IPv6 ping came back and both SOA queries hit the 5000 ms timeout.
curl of measurement 1001 showing id, target k.root-servers.net, packets 3, and the twenty probe ids used for the latest-results pull.
Measurement 1001, then the probe ids. The same ids on 2001, 10001, and 11001 are the other three pulls.

Commands

The ping pull, and the same shape for 2001, 10001, and 11001:

curl -sS 'https://atlas.ripe.net/api/v2/measurements/1001/latest/?probe_ids=80,81,882,901,910,307,1113,1171,1186,4930,6477,6506,6568,6594,6676,6349,6410,6602,6659,6790'

latest moves. The fields worth keeping from each row are prb_id, sent, rcvd, avg, and for DNS result.rt, result.ANCOUNT, and result.answers[0].MNAME. src_addr is the probe's own address. The route in the table comes from the other fields.

A one-off of the same probe list, which needs Authorization: Key and the credits above. I read the built-ins. This POST is the call that spends the 1,040.

curl -sS 'https://atlas.ripe.net/api/v2/measurements/' \
  -H 'Authorization: Key YOUR-KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "is_oneoff": true,
    "probes": [{"requested": 20, "type": "probes", "value": "80,81,882,901,910,307,1113,1171,1186,4930,6477,6506,6568,6594,6676,6349,6410,6602,6659,6790"}],
    "definitions": [
      {"type": "ping", "af": 4, "target": "k.root-servers.net", "packets": 3, "description": "k-root ping v4"},
      {"type": "ping", "af": 6, "target": "k.root-servers.net", "packets": 3, "description": "k-root ping v6"},
      {"type": "dns", "af": 4, "target": "k.root-servers.net", "query_type": "SOA", "query_argument": ".", "protocol": "UDP", "description": "k-root soa v4"},
      {"type": "dns", "af": 6, "target": "k.root-servers.net", "query_type": "SOA", "query_argument": ".", "protocol": "UDP", "description": "k-root soa v6"}
    ]
  }'

The response body is {"measurements": [ ... ]} with four ids, in the order of definitions. Swap target for an address you run if the question is your VM. Keep the probe value if you want this set again.

FAQ

Is a probe a stand-in for a phone?

A probe is a host someone volunteered and keeps connected. These 20 are the lowest id per IPv4 ASN in four countries. A phone on another network would be another source. This table has these 20 ids.

Can the target be a VPS?

Yes. The target field is the address under test, and a marketplace VM is a normal value there. This pull uses k.root-servers.net because measurements 1001, 2001, 10001, and 11001 are public and already aimed at it. ICMP to a VM can be empty while TCP to the service still completes. Probe 910 is that shape against a root server: 0 of 3 pings, and a SOA from the same address.

What does 0 of 3 mean?

For 910, both families, ICMP is 0 of 3 and the SOA has a time. For 307 that split is IPv4. For 1113 the IPv4 ping is 0 of 3 and both SOA queries timed out, while the IPv6 ping received 3 of 3. Read the row. One probe's timeout is that probe's result.

Where is the credit balance?

On the account that holds the key, and the credit page says the debit arrives in a batch every four to six hours. The numbers in this post are credits_per_result on the built-ins, times two for a one-off, times 20 probes. The GET that filled the table was anonymous.