Skip to content

Commit

Permalink
feat: get correct probe IP when mutliple probe on hop (#562)
Browse files Browse the repository at this point in the history
Co-authored-by: Pierre-Olivier Côté <pierre-olivier.cote@polymtl.ca>
kellyjonbrazil and poclecoqq authored Apr 29, 2024
1 parent dfc9427 commit 5bec53b
Showing 6 changed files with 60 additions and 54 deletions.
106 changes: 56 additions & 50 deletions jc/parsers/traceroute.py
Original file line number Diff line number Diff line change
@@ -118,6 +118,7 @@
import re
from decimal import Decimal
import jc.utils
from copy import deepcopy


class info():
@@ -237,6 +238,57 @@ def __str__(self):
text += "\n"
return text

def _get_probes(hop_string: str):
probes = []
probe_asn_match = [ (match, "ASN") for match in RE_PROBE_ASN.finditer(hop_string)]
probe_name_ip_match = [(match, "NAME_IP") for match in RE_PROBE_NAME_IP.finditer(hop_string)]
probe_ip_only_match = [(match, "IP_ONLY") for match in RE_PROBE_IP_ONLY.finditer(hop_string)]
probe_bsd_ipv6_match = [(match, "IP_IPV6") for match in RE_PROBE_BSD_IPV6.finditer(hop_string)]
probe_ipv6_only_match = [(match, "IP_IPV6_ONLY") for match in RE_PROBE_IPV6_ONLY.finditer(hop_string)]
probe_rtt_annotations = [(match, "RTT") for match in RE_PROBE_RTT_ANNOTATION.finditer(hop_string)]

matches = sorted(probe_asn_match + probe_name_ip_match + probe_ip_only_match + probe_bsd_ipv6_match + probe_ipv6_only_match + probe_rtt_annotations, key=lambda x: x[0].start(0))
probe, is_last_match_rtt = _Probe(), False
for match, match_type in matches:
if match_type == "ASN":
probe.asn = int(match.group(1))
elif match_type == "NAME_IP":
probe.name = match.group(1)
probe.ip = match.group(2)
elif match_type == "IP_ONLY":
probe.ip = match.group(1)
elif match_type == "IP_IPV6":
probe.ip = match.group(0)
elif match_type == "IP_IPV6_ONLY":
probe.ip = match.group(1)
elif match_type == "RTT":
if match.groups()[0]:
probe_rtt = Decimal(match.groups()[0])
elif match.groups()[1]:
probe_rtt = None
else:
message = f"Expected probe RTT or *. Got: '{match.group(0)}'"
raise ParseError(message)

# If the last match is a RTT, then copy all probe values and replace RTT field
if is_last_match_rtt:
probe = deepcopy(last_probe)
# Set RTT values
probe.rtt = probe_rtt
probe.annotation = match.groups()[2] or None
# RTT is the last value shown for a hop
if any([probe.ip, probe.asn, probe.annotation, probe.rtt, probe.name]):
probes.append(probe)
last_probe = probe
probe = _Probe()


if match_type == "RTT":
is_last_match_rtt = True
else:
is_last_match_rtt = False

return probes

def _loads(data):
lines = data.splitlines()
@@ -270,56 +322,10 @@ def _loads(data):

hop_string = hop_match.group(2)

probe_asn_match = RE_PROBE_ASN.search(hop_string)
if probe_asn_match:
probe_asn = int(probe_asn_match.group(1))
else:
probe_asn = None

probe_name_ip_match = RE_PROBE_NAME_IP.search(hop_string)
probe_ip_only_match = RE_PROBE_IP_ONLY.search(hop_string)
probe_bsd_ipv6_match = RE_PROBE_BSD_IPV6.search(hop_string)
probe_ipv6_only_match = RE_PROBE_IPV6_ONLY.search(hop_string)
if probe_ip_only_match:
probe_name = None
probe_ip = probe_ip_only_match.group(1)
elif probe_name_ip_match:
probe_name = probe_name_ip_match.group(1)
probe_ip = probe_name_ip_match.group(2)
elif probe_bsd_ipv6_match:
probe_name = None
probe_ip = probe_bsd_ipv6_match.group(0)
elif probe_ipv6_only_match:
probe_name = None
probe_ip = probe_ipv6_only_match.group(1)
else:
probe_name = None
probe_ip = None

probe_rtt_annotations = RE_PROBE_RTT_ANNOTATION.findall(hop_string)

for probe_rtt_annotation in probe_rtt_annotations:
if probe_rtt_annotation[0]:
probe_rtt = Decimal(probe_rtt_annotation[0])
elif probe_rtt_annotation[1]:
probe_rtt = None
else:
message = f"Expected probe RTT or *. Got: '{probe_rtt_annotation[0]}'"
raise ParseError(message)

probe_annotation = probe_rtt_annotation[2] or None

probe = _Probe(
name=probe_name,
ip=probe_ip,
asn=probe_asn,
rtt=probe_rtt,
annotation=probe_annotation
)

# only add probe if there is data
if any([probe_name, probe_ip, probe_asn, probe_rtt, probe_annotation]):
hop.add_probe(probe)
probes = _get_probes(hop_string)
for probe in probes:
hop.add_probe(probe)


return traceroute

Empty file modified tests/fixtures/generic/csv-10k-sales-records.csv
100755 → 100644
Empty file.
2 changes: 1 addition & 1 deletion tests/fixtures/generic/traceroute-n-ipv4.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"destination_ip":"199.58.80.40","destination_name":"www.koumbit.org","hops":[{"hop":1,"probes":[{"annotation":null,"asn":null,"ip":"192.168.2.1","name":null,"rtt":0.967},{"annotation":null,"asn":null,"ip":"192.168.2.1","name":null,"rtt":1.022},{"annotation":null,"asn":null,"ip":"192.168.2.1","name":null,"rtt":1.204}]},{"hop":2,"probes":[{"annotation":null,"asn":null,"ip":"24.212.242.17","name":null,"rtt":10.176},{"annotation":null,"asn":null,"ip":"24.212.242.17","name":null,"rtt":18.136},{"annotation":null,"asn":null,"ip":"24.212.242.17","name":null,"rtt":18.244}]},{"hop":3,"probes":[{"annotation":null,"asn":null,"ip":"10.170.192.58","name":null,"rtt":19.396},{"annotation":null,"asn":null,"ip":"10.170.192.58","name":null,"rtt":19.575},{"annotation":null,"asn":null,"ip":"10.170.192.58","name":null,"rtt":19.572}]},{"hop":4,"probes":[{"annotation":null,"asn":null,"ip":"192.171.61.61","name":null,"rtt":23.072},{"annotation":null,"asn":null,"ip":"192.171.61.61","name":null,"rtt":17.073},{"annotation":null,"asn":null,"ip":"192.171.61.61","name":null,"rtt":23.308}]},{"hop":5,"probes":[{"annotation":null,"asn":null,"ip":"206.248.189.97","name":null,"rtt":20.521},{"annotation":null,"asn":null,"ip":"206.248.189.97","name":null,"rtt":22.837},{"annotation":null,"asn":null,"ip":"206.248.189.97","name":null,"rtt":23.194}]},{"hop":6,"probes":[{"annotation":null,"asn":null,"ip":"198.179.18.41","name":null,"rtt":18.334},{"annotation":null,"asn":null,"ip":"198.179.18.41","name":null,"rtt":17.894},{"annotation":null,"asn":null,"ip":"198.179.18.41","name":null,"rtt":17.792}]},{"hop":7,"probes":[{"annotation":null,"asn":null,"ip":"64.15.69.54","name":null,"rtt":17.056},{"annotation":null,"asn":null,"ip":"64.15.69.54","name":null,"rtt":14.033},{"annotation":null,"asn":null,"ip":"64.15.69.54","name":null,"rtt":12.351}]},{"hop":8,"probes":[{"annotation":null,"asn":null,"ip":"199.58.80.40","name":null,"rtt":18.203},{"annotation":null,"asn":null,"ip":"199.58.80.40","name":null,"rtt":18.789},{"annotation":null,"asn":null,"ip":"199.58.80.40","name":null,"rtt":18.906}]}]}
{"destination_ip":"199.58.80.40","destination_name":"www.koumbit.org","hops":[{"hop":1,"probes":[{"annotation":null,"asn":null,"ip":"192.168.2.1","name":null,"rtt":0.967},{"annotation":null,"asn":null,"ip":"192.168.2.1","name":null,"rtt":1.022},{"annotation":null,"asn":null,"ip":"192.168.2.1","name":null,"rtt":1.204}]},{"hop":2,"probes":[{"annotation":null,"asn":null,"ip":"24.212.242.17","name":null,"rtt":10.176},{"annotation":null,"asn":null,"ip":"24.212.242.17","name":null,"rtt":18.136},{"annotation":null,"asn":null,"ip":"24.212.242.17","name":null,"rtt":18.244}]},{"hop":3,"probes":[{"annotation":null,"asn":null,"ip":"10.170.192.58","name":null,"rtt":19.396},{"annotation":null,"asn":null,"ip":"10.170.192.58","name":null,"rtt":19.575},{"annotation":null,"asn":null,"ip":"10.170.192.58","name":null,"rtt":19.572}]},{"hop":4,"probes":[{"annotation":null,"asn":null,"ip":"192.171.61.61","name":null,"rtt":23.072},{"annotation":null,"asn":null,"ip":"206.248.155.109","name":null,"rtt":17.073},{"annotation":null,"asn":null,"ip":"192.171.63.17","name":null,"rtt":23.308}]},{"hop":5,"probes":[{"annotation":null,"asn":null,"ip":"206.248.189.97","name":null,"rtt":20.521},{"annotation":null,"asn":null,"ip":"206.248.189.97","name":null,"rtt":22.837},{"annotation":null,"asn":null,"ip":"206.248.189.97","name":null,"rtt":23.194}]},{"hop":6,"probes":[{"annotation":null,"asn":null,"ip":"198.179.18.41","name":null,"rtt":18.334},{"annotation":null,"asn":null,"ip":"198.179.18.41","name":null,"rtt":17.894},{"annotation":null,"asn":null,"ip":"198.179.18.41","name":null,"rtt":17.792}]},{"hop":7,"probes":[{"annotation":null,"asn":null,"ip":"64.15.69.54","name":null,"rtt":17.056},{"annotation":null,"asn":null,"ip":"64.15.69.54","name":null,"rtt":14.033},{"annotation":null,"asn":null,"ip":"64.15.69.54","name":null,"rtt":12.351}]},{"hop":8,"probes":[{"annotation":null,"asn":null,"ip":"199.58.80.40","name":null,"rtt":18.203},{"annotation":null,"asn":null,"ip":"199.58.80.40","name":null,"rtt":18.789},{"annotation":null,"asn":null,"ip":"199.58.80.40","name":null,"rtt":18.906}]}]}
2 changes: 1 addition & 1 deletion tests/fixtures/generic/traceroute-n-ipv6.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"destination_ip":"2607:f8b0:4020:806::2004","destination_name":"www.google.com","hops":[{"hop":1,"probes":[{"annotation":null,"asn":null,"ip":"2605:9000:402:6a01::1","name":null,"rtt":4.181},{"annotation":null,"asn":null,"ip":"2605:9000:402:6a01::1","name":null,"rtt":4.294},{"annotation":null,"asn":null,"ip":"2605:9000:402:6a01::1","name":null,"rtt":4.253}]},{"hop":2,"probes":[{"annotation":null,"asn":null,"ip":"2605:9000:0:400a::f1","name":null,"rtt":0.354},{"annotation":null,"asn":null,"ip":"2605:9000:0:400a::f1","name":null,"rtt":0.532},{"annotation":null,"asn":null,"ip":"2605:9000:0:400a::f1","name":null,"rtt":0.484}]},{"hop":3,"probes":[{"annotation":null,"asn":null,"ip":"2001:5a0:40:100::51","name":null,"rtt":15.284},{"annotation":null,"asn":null,"ip":"2001:5a0:40:100::51","name":null,"rtt":4.864},{"annotation":null,"asn":null,"ip":"2001:5a0:40:100::51","name":null,"rtt":15.415}]},{"hop":4,"probes":[{"annotation":null,"asn":null,"ip":"2001:5a0:40:100::51","name":null,"rtt":15.379},{"annotation":null,"asn":null,"ip":"2001:5a0:40:100::51","name":null,"rtt":12.709},{"annotation":null,"asn":null,"ip":"2001:5a0:40:100::51","name":null,"rtt":15.289}]},{"hop":5,"probes":[{"annotation":null,"asn":null,"ip":"2001:5a0:1900:100::12","name":null,"rtt":10.02},{"annotation":null,"asn":null,"ip":"2001:5a0:1900:100::12","name":null,"rtt":10.212},{"annotation":null,"asn":null,"ip":"2001:5a0:1900:100::12","name":null,"rtt":10.163}]},{"hop":6,"probes":[{"annotation":null,"asn":null,"ip":"2001:5a0:1900:100::12","name":null,"rtt":10.113},{"annotation":null,"asn":null,"ip":"2001:5a0:1900:100::12","name":null,"rtt":8.399},{"annotation":null,"asn":null,"ip":"2001:5a0:1900:100::12","name":null,"rtt":10.215}]},{"hop":7,"probes":[{"annotation":null,"asn":null,"ip":"2001:4860:0:1127::2","name":null,"rtt":9.11},{"annotation":null,"asn":null,"ip":"2001:4860:0:1127::2","name":null,"rtt":8.476},{"annotation":null,"asn":null,"ip":"2001:4860:0:1127::2","name":null,"rtt":8.38}]},{"hop":8,"probes":[{"annotation":null,"asn":null,"ip":"2001:4860::8:4000:cd80","name":null,"rtt":9.428},{"annotation":null,"asn":null,"ip":"2001:4860::8:4000:cd80","name":null,"rtt":9.36},{"annotation":null,"asn":null,"ip":"2001:4860::8:4000:cd80","name":null,"rtt":9.229}]},{"hop":9,"probes":[{"annotation":null,"asn":null,"ip":"2001:4860::9:4001:d508","name":null,"rtt":9.376},{"annotation":null,"asn":null,"ip":"2001:4860::9:4001:d508","name":null,"rtt":9.105},{"annotation":null,"asn":null,"ip":"2001:4860::9:4001:d508","name":null,"rtt":9.384}]},{"hop":10,"probes":[{"annotation":null,"asn":null,"ip":"2001:4860:0:11da::1","name":null,"rtt":8.489},{"annotation":null,"asn":null,"ip":"2001:4860:0:11da::1","name":null,"rtt":8.978},{"annotation":null,"asn":null,"ip":"2001:4860:0:11da::1","name":null,"rtt":9.64}]},{"hop":11,"probes":[{"annotation":null,"asn":null,"ip":"2001:4860:0:1::c73","name":null,"rtt":9.596},{"annotation":null,"asn":null,"ip":"2001:4860:0:1::c73","name":null,"rtt":9.077},{"annotation":null,"asn":null,"ip":"2001:4860:0:1::c73","name":null,"rtt":9.724}]},{"hop":12,"probes":[{"annotation":null,"asn":null,"ip":"2607:f8b0:4020:806::2004","name":null,"rtt":8.086},{"annotation":null,"asn":null,"ip":"2607:f8b0:4020:806::2004","name":null,"rtt":8.091},{"annotation":null,"asn":null,"ip":"2607:f8b0:4020:806::2004","name":null,"rtt":8.436}]}]}
{"destination_ip":"2607:f8b0:4020:806::2004","destination_name":"www.google.com","hops":[{"hop":1,"probes":[{"annotation":null,"asn":null,"ip":"2605:9000:402:6a01::1","name":null,"rtt":4.181},{"annotation":null,"asn":null,"ip":"2605:9000:402:6a01::1","name":null,"rtt":4.294},{"annotation":null,"asn":null,"ip":"2605:9000:402:6a01::1","name":null,"rtt":4.253}]},{"hop":2,"probes":[{"annotation":null,"asn":null,"ip":"2605:9000:0:400a::f1","name":null,"rtt":0.354},{"annotation":null,"asn":null,"ip":"2605:9000:0:400a::f1","name":null,"rtt":0.532},{"annotation":null,"asn":null,"ip":"2605:9000:0:400a::f1","name":null,"rtt":0.484}]},{"hop":3,"probes":[{"annotation":null,"asn":null,"ip":"2001:5a0:40:100::51","name":null,"rtt":15.284},{"annotation":null,"asn":null,"ip":"2605:9000:0:101::1","name":null,"rtt":4.864},{"annotation":null,"asn":null,"ip":"2001:5a0:40:100::51","name":null,"rtt":15.415}]},{"hop":4,"probes":[{"annotation":null,"asn":null,"ip":"2001:5a0:40:100::51","name":null,"rtt":15.379},{"annotation":null,"asn":null,"ip":"2001:5a0:300:200::202","name":null,"rtt":12.709},{"annotation":null,"asn":null,"ip":"2001:5a0:40:100::51","name":null,"rtt":15.289}]},{"hop":5,"probes":[{"annotation":null,"asn":null,"ip":"2001:5a0:1900:100::12","name":null,"rtt":10.02},{"annotation":null,"asn":null,"ip":"2001:5a0:1900:100::12","name":null,"rtt":10.212},{"annotation":null,"asn":null,"ip":"2001:5a0:1900:100::12","name":null,"rtt":10.163}]},{"hop":6,"probes":[{"annotation":null,"asn":null,"ip":"2001:5a0:1900:100::12","name":null,"rtt":10.113},{"annotation":null,"asn":null,"ip":"2001:5a0:400:700::17","name":null,"rtt":8.399},{"annotation":null,"asn":null,"ip":"2001:5a0:1900:100::12","name":null,"rtt":10.215}]},{"hop":7,"probes":[{"annotation":null,"asn":null,"ip":"2001:4860:0:1127::2","name":null,"rtt":9.11},{"annotation":null,"asn":null,"ip":"2001:5a0:400:700::17","name":null,"rtt":8.476},{"annotation":null,"asn":null,"ip":"2001:5a0:400:700::17","name":null,"rtt":8.38}]},{"hop":8,"probes":[{"annotation":null,"asn":null,"ip":"2001:4860::8:4000:cd80","name":null,"rtt":9.428},{"annotation":null,"asn":null,"ip":"2001:4860:0:1128::14","name":null,"rtt":9.36},{"annotation":null,"asn":null,"ip":"2001:4860::8:4000:cd80","name":null,"rtt":9.229}]},{"hop":9,"probes":[{"annotation":null,"asn":null,"ip":"2001:4860::9:4001:d508","name":null,"rtt":9.376},{"annotation":null,"asn":null,"ip":"2001:4860::c:4002:652a","name":null,"rtt":9.105},{"annotation":null,"asn":null,"ip":"2001:4860::c:4002:6523","name":null,"rtt":9.384}]},{"hop":10,"probes":[{"annotation":null,"asn":null,"ip":"2001:4860:0:11da::1","name":null,"rtt":8.489},{"annotation":null,"asn":null,"ip":"2001:4860::9:4001:d508","name":null,"rtt":8.978},{"annotation":null,"asn":null,"ip":"2001:4860::1c:4000:f5eb","name":null,"rtt":9.64}]},{"hop":11,"probes":[{"annotation":null,"asn":null,"ip":"2001:4860:0:1::c73","name":null,"rtt":9.596},{"annotation":null,"asn":null,"ip":"2001:4860:0:1::c73","name":null,"rtt":9.077},{"annotation":null,"asn":null,"ip":"2001:4860:0:1::c73","name":null,"rtt":9.724}]},{"hop":12,"probes":[{"annotation":null,"asn":null,"ip":"2607:f8b0:4020:806::2004","name":null,"rtt":8.086},{"annotation":null,"asn":null,"ip":"2607:f8b0:4020:806::2004","name":null,"rtt":8.091},{"annotation":null,"asn":null,"ip":"2607:f8b0:4020:806::2004","name":null,"rtt":8.436}]}]}
2 changes: 1 addition & 1 deletion tests/fixtures/generic/traceroute1.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"destination_ip": "173.207.22.152", "destination_name": "http://google.es", "hops": [{"hop": 1, "probes": [{"annotation": "!P", "asn": 1739, "ip": "131.240.100.12", "name": "131.240.100.12", "rtt": 0.676}, {"annotation": "!", "asn": 1739, "ip": "131.240.100.12", "name": "131.240.100.12", "rtt": 0.763}, {"annotation": "!<500>", "asn": 1739, "ip": "131.240.100.12", "name": "131.240.100.12", "rtt": 0.91}]}, {"hop": 2, "probes": [{"annotation": null, "asn": 1739, "ip": "131.232.1.26", "name": "http://tut1-fw-vlan558.av.tut.fi", "rtt": 0.266}, {"annotation": null, "asn": 1739, "ip": "131.232.1.26", "name": "http://tut1-fw-vlan558.av.tut.fi", "rtt": 0.404}, {"annotation": null, "asn": 1739, "ip": "131.232.1.26", "name": "http://tut1-fw-vlan558.av.tut.fi", "rtt": 0.493}]}, {"hop": 3, "probes": [{"annotation": null, "asn": 1739, "ip": "131.232.1.20", "name": "http://surf-gw-vlan557.av.tut.fi", "rtt": 0.967}, {"annotation": null, "asn": 1739, "ip": "131.232.1.20", "name": "http://surf-gw-vlan557.av.tut.fi", "rtt": 0.961}, {"annotation": null, "asn": 1739, "ip": "131.232.1.20", "name": "http://surf-gw-vlan557.av.tut.fi", "rtt": 1.085}]}, {"hop": 4, "probes": [{"annotation": null, "asn": 1739, "ip": "130.230.1.237", "name": "http://funet-tut6-rtr-xe-0-0-0.cc.tut.fi", "rtt": 1.096}, {"annotation": null, "asn": 1739, "ip": "130.230.1.237", "name": "http://funet-tut6-rtr-xe-0-0-0.cc.tut.fi", "rtt": 1.086}, {"annotation": null, "asn": 1739, "ip": "130.230.1.237", "name": "http://funet-tut6-rtr-xe-0-0-0.cc.tut.fi", "rtt": 1.049}]}, {"hop": 5, "probes": [{"annotation": null, "asn": 1741, "ip": "86.50.255.220", "name": "http://hameenlinna2-et-0-0-0-1.ip.funet.fi", "rtt": 3.81}, {"annotation": null, "asn": 1741, "ip": "86.50.255.220", "name": "http://hameenlinna2-et-0-0-0-1.ip.funet.fi", "rtt": 3.845}, {"annotation": null, "asn": 1741, "ip": "86.50.255.220", "name": "http://hameenlinna2-et-0-0-0-1.ip.funet.fi", "rtt": 3.82}]}, {"hop": 6, "probes": [{"annotation": null, "asn": 1741, "ip": "86.50.255.224", "name": "http://hameenlinna1-et-0-0-1-1.ip.funet.fi", "rtt": 29.055}, {"annotation": null, "asn": 1741, "ip": "86.50.255.224", "name": "http://hameenlinna1-et-0-0-1-1.ip.funet.fi", "rtt": 29.013}, {"annotation": null, "asn": 1741, "ip": "86.50.255.224", "name": "http://hameenlinna1-et-0-0-1-1.ip.funet.fi", "rtt": 28.977}]}, {"hop": 7, "probes": [{"annotation": null, "asn": 1741, "ip": "86.50.255.223", "name": "http://espoo2-et-0-1-2-1.ip.funet.fi", "rtt": 3.468}, {"annotation": null, "asn": 1741, "ip": "86.50.255.223", "name": "http://espoo2-et-0-1-2-1.ip.funet.fi", "rtt": 8.007}, {"annotation": null, "asn": 1741, "ip": "86.50.255.223", "name": "http://espoo2-et-0-1-2-1.ip.funet.fi", "rtt": 7.89}]}, {"hop": 8, "probes": [{"annotation": null, "asn": 1741, "ip": "86.50.255.232", "name": "http://espoo1-et-0-1-7-1.ip.funet.fi", "rtt": 13.498}, {"annotation": null, "asn": 1741, "ip": "86.50.255.232", "name": "http://espoo1-et-0-1-7-1.ip.funet.fi", "rtt": 13.307}, {"annotation": null, "asn": 1741, "ip": "86.50.255.232", "name": "http://espoo1-et-0-1-7-1.ip.funet.fi", "rtt": 13.399}]}, {"hop": 9, "probes": [{"annotation": null, "asn": 2603, "ip": "109.105.102.168", "name": "http://fi-csc2.nordu.net", "rtt": 3.25}, {"annotation": null, "asn": 2603, "ip": "109.105.102.168", "name": "http://fi-csc2.nordu.net", "rtt": 3.268}, {"annotation": null, "asn": 2603, "ip": "109.105.102.168", "name": "http://fi-csc2.nordu.net", "rtt": 3.236}]}, {"hop": 10, "probes": [{"annotation": null, "asn": 2603, "ip": "109.105.97.93", "name": "http://se-fre.nordu.net", "rtt": 9.418}, {"annotation": null, "asn": 2603, "ip": "109.105.97.93", "name": "http://se-fre.nordu.net", "rtt": 9.41}, {"annotation": null, "asn": 2603, "ip": "109.105.97.93", "name": "http://se-fre.nordu.net", "rtt": 9.369}]}, {"hop": 11, "probes": [{"annotation": null, "asn": 2603, "ip": "109.105.97.27", "name": "http://se-kst2.nordu.net", "rtt": 9.617}, {"annotation": null, "asn": 2603, "ip": "109.105.97.27", "name": "http://se-kst2.nordu.net", "rtt": 9.594}, {"annotation": null, "asn": 2603, "ip": "109.105.97.27", "name": "http://se-kst2.nordu.net", "rtt": 9.603}]}, {"hop": 12, "probes": [{"annotation": null, "asn": 15169, "ip": "192.121.80.47", "name": "http://as15169-10g-sk1.sthix.net", "rtt": 10.01}, {"annotation": null, "asn": 15169, "ip": "192.121.80.47", "name": "http://as15169-10g-sk1.sthix.net", "rtt": 9.182}, {"annotation": null, "asn": 15169, "ip": "192.121.80.47", "name": "http://as15169-10g-sk1.sthix.net", "rtt": 44.983}]}, {"hop": 13, "probes": [{"annotation": null, "asn": 15169, "ip": "108.170.254.49", "name": "108.170.254.49", "rtt": 10.852}, {"annotation": null, "asn": 15169, "ip": "108.170.254.49", "name": "108.170.254.49", "rtt": 11.185}, {"annotation": null, "asn": 15169, "ip": "108.170.254.49", "name": "108.170.254.49", "rtt": 10.876}]}, {"hop": 14, "probes": [{"annotation": null, "asn": 15169, "ip": "209.85.242.11", "name": "209.85.242.11", "rtt": 10.192}, {"annotation": null, "asn": 15169, "ip": "209.85.242.11", "name": "209.85.242.11", "rtt": 10.471}, {"annotation": null, "asn": 15169, "ip": "209.85.242.11", "name": "209.85.242.11", "rtt": 10.502}]}, {"hop": 15, "probes": [{"annotation": null, "asn": 15169, "ip": "172.217.21.163", "name": "http://arn11s03-in-f3.1e100.net", "rtt": 9.652}, {"annotation": null, "asn": 15169, "ip": "172.217.21.163", "name": "http://arn11s03-in-f3.1e100.net", "rtt": 9.664}, {"annotation": null, "asn": 15169, "ip": "172.217.21.163", "name": "http://arn11s03-in-f3.1e100.net", "rtt": 9.777}]}]}
{"destination_ip":"173.207.22.152","destination_name":"http://google.es","hops":[{"hop":1,"probes":[{"annotation":"!P","asn":1739,"ip":"131.240.100.12","name":"131.240.100.12","rtt":0.676},{"annotation":"!","asn":1739,"ip":"131.240.100.12","name":"131.240.100.12","rtt":0.763},{"annotation":"!<500>","asn":1739,"ip":"131.240.100.12","name":"131.240.100.12","rtt":0.91}]},{"hop":2,"probes":[{"annotation":null,"asn":1739,"ip":"131.232.1.26","name":"http://tut1-fw-vlan558.av.tut.fi","rtt":0.266},{"annotation":null,"asn":1739,"ip":"131.232.1.26","name":"http://tut1-fw-vlan558.av.tut.fi","rtt":0.404},{"annotation":null,"asn":1739,"ip":"131.232.1.26","name":"http://tut1-fw-vlan558.av.tut.fi","rtt":0.493}]},{"hop":3,"probes":[{"annotation":null,"asn":1739,"ip":"131.232.1.20","name":"http://surf-gw-vlan557.av.tut.fi","rtt":0.967},{"annotation":null,"asn":1739,"ip":"131.232.1.20","name":"http://surf-gw-vlan557.av.tut.fi","rtt":0.961},{"annotation":null,"asn":1739,"ip":"131.232.1.20","name":"http://surf-gw-vlan557.av.tut.fi","rtt":1.085}]},{"hop":4,"probes":[{"annotation":null,"asn":1739,"ip":"130.230.1.237","name":"http://funet-tut6-rtr-xe-0-0-0.cc.tut.fi","rtt":1.096},{"annotation":null,"asn":1739,"ip":"130.230.1.237","name":"http://funet-tut6-rtr-xe-0-0-0.cc.tut.fi","rtt":1.086},{"annotation":null,"asn":1739,"ip":"130.230.1.237","name":"http://funet-tut6-rtr-xe-0-0-0.cc.tut.fi","rtt":1.049}]},{"hop":5,"probes":[{"annotation":null,"asn":1741,"ip":"86.50.255.220","name":"http://hameenlinna2-et-0-0-0-1.ip.funet.fi","rtt":3.81},{"annotation":null,"asn":1741,"ip":"86.50.255.220","name":"http://hameenlinna2-et-0-0-0-1.ip.funet.fi","rtt":3.845},{"annotation":null,"asn":1741,"ip":"86.50.255.220","name":"http://hameenlinna2-et-0-0-0-1.ip.funet.fi","rtt":3.82}]},{"hop":6,"probes":[{"annotation":null,"asn":1741,"ip":"86.50.255.224","name":"http://hameenlinna1-et-0-0-1-1.ip.funet.fi","rtt":29.055},{"annotation":null,"asn":1741,"ip":"86.50.255.224","name":"http://hameenlinna1-et-0-0-1-1.ip.funet.fi","rtt":29.013},{"annotation":null,"asn":1741,"ip":"86.50.255.224","name":"http://hameenlinna1-et-0-0-1-1.ip.funet.fi","rtt":28.977}]},{"hop":7,"probes":[{"annotation":null,"asn":1741,"ip":"86.50.255.223","name":"http://espoo2-et-0-1-2-1.ip.funet.fi","rtt":3.468},{"annotation":null,"asn":1741,"ip":"86.50.255.223","name":"http://espoo2-et-0-1-2-1.ip.funet.fi","rtt":8.007},{"annotation":null,"asn":1741,"ip":"86.50.255.223","name":"http://espoo2-et-0-1-2-1.ip.funet.fi","rtt":7.89}]},{"hop":8,"probes":[{"annotation":null,"asn":1741,"ip":"86.50.255.232","name":"http://espoo1-et-0-1-7-1.ip.funet.fi","rtt":13.498},{"annotation":null,"asn":1741,"ip":"86.50.255.232","name":"http://espoo1-et-0-1-7-1.ip.funet.fi","rtt":13.307},{"annotation":null,"asn":1741,"ip":"86.50.255.232","name":"http://espoo1-et-0-1-7-1.ip.funet.fi","rtt":13.399}]},{"hop":9,"probes":[{"annotation":null,"asn":2603,"ip":"109.105.102.168","name":"http://fi-csc2.nordu.net","rtt":3.25},{"annotation":null,"asn":2603,"ip":"109.105.102.168","name":"http://fi-csc2.nordu.net","rtt":3.268},{"annotation":null,"asn":2603,"ip":"109.105.102.168","name":"http://fi-csc2.nordu.net","rtt":3.236}]},{"hop":10,"probes":[{"annotation":null,"asn":2603,"ip":"109.105.97.93","name":"http://se-fre.nordu.net","rtt":9.418},{"annotation":null,"asn":2603,"ip":"109.105.97.93","name":"http://se-fre.nordu.net","rtt":9.41},{"annotation":null,"asn":2603,"ip":"109.105.97.93","name":"http://se-fre.nordu.net","rtt":9.369}]},{"hop":11,"probes":[{"annotation":null,"asn":2603,"ip":"109.105.97.27","name":"http://se-kst2.nordu.net","rtt":9.617},{"annotation":null,"asn":2603,"ip":"109.105.97.27","name":"http://se-kst2.nordu.net","rtt":9.594},{"annotation":null,"asn":2603,"ip":"109.105.97.27","name":"http://se-kst2.nordu.net","rtt":9.603}]},{"hop":12,"probes":[{"annotation":null,"asn":null,"ip":"192.121.80.47","name":"http://as15169-10g-sk1.sthix.net","rtt":10.01},{"annotation":null,"asn":15169,"ip":"72.14.196.42","name":"72.14.196.42","rtt":9.182},{"annotation":null,"asn":15169,"ip":"72.14.196.42","name":"72.14.196.42","rtt":44.983}]},{"hop":13,"probes":[{"annotation":null,"asn":15169,"ip":"108.170.254.49","name":"108.170.254.49","rtt":10.852},{"annotation":null,"asn":15169,"ip":"108.170.254.33","name":"108.170.254.33","rtt":11.185},{"annotation":null,"asn":15169,"ip":"108.170.254.49","name":"108.170.254.49","rtt":10.876}]},{"hop":14,"probes":[{"annotation":null,"asn":15169,"ip":"209.85.242.11","name":"209.85.242.11","rtt":10.192},{"annotation":null,"asn":15169,"ip":"209.85.242.11","name":"209.85.242.11","rtt":10.471},{"annotation":null,"asn":15169,"ip":"209.85.242.11","name":"209.85.242.11","rtt":10.502}]},{"hop":15,"probes":[{"annotation":null,"asn":15169,"ip":"172.217.21.163","name":"http://arn11s03-in-f3.1e100.net","rtt":9.652},{"annotation":null,"asn":15169,"ip":"172.217.21.163","name":"http://arn11s03-in-f3.1e100.net","rtt":9.664},{"annotation":null,"asn":15169,"ip":"172.217.21.163","name":"http://arn11s03-in-f3.1e100.net","rtt":9.777}]}]}
2 changes: 1 addition & 1 deletion tests/fixtures/generic/traceroute8.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"destination_ip": "2606:4700:3030::6812:3e4e", "destination_name": "baeldung.com", "hops": [{"hop": 1, "probes": [{"annotation": null, "asn": null, "ip": "2001:2e8:665:0:2:2:0:1", "name": "2001:2e8:665:0:2:2:0:1", "rtt": 0.083}, {"annotation": null, "asn": null, "ip": "2001:2e8:665:0:2:2:0:1", "name": "2001:2e8:665:0:2:2:0:1", "rtt": 0.048}, {"annotation": null, "asn": null, "ip": "2001:2e8:665:0:2:2:0:1", "name": "2001:2e8:665:0:2:2:0:1", "rtt": 0.044}]}, {"hop": 2, "probes": [{"annotation": null, "asn": null, "ip": "2001:2e8:22:204::2", "name": "2001:2e8:22:204::2", "rtt": 25.128}, {"annotation": null, "asn": null, "ip": "2001:2e8:22:204::2", "name": "2001:2e8:22:204::2", "rtt": 25.047}, {"annotation": null, "asn": null, "ip": "2001:2e8:22:204::2", "name": "2001:2e8:22:204::2", "rtt": 25.025}]}, {"hop": 3, "probes": [{"annotation": null, "asn": null, "ip": "2001:2e8:20::22:11", "name": "2001:2e8:20::22:11", "rtt": 1.106}, {"annotation": null, "asn": null, "ip": "2001:2e8:20::22:11", "name": "2001:2e8:20::22:11", "rtt": 25.83}, {"annotation": null, "asn": null, "ip": "2001:2e8:20::22:11", "name": "2001:2e8:20::22:11", "rtt": 1.007}]}, {"hop": 4, "probes": [{"annotation": null, "asn": null, "ip": "2001:218:2000:5000::305", "name": "xe-0-0-14-1.a02.tokyjp05.jp.bb.gin.ntt.net", "rtt": 0.908}, {"annotation": null, "asn": null, "ip": "2001:218:2000:5000::305", "name": "xe-0-0-14-1.a02.tokyjp05.jp.bb.gin.ntt.net", "rtt": 1.197}, {"annotation": null, "asn": null, "ip": "2001:218:2000:5000::305", "name": "xe-0-0-14-1.a02.tokyjp05.jp.bb.gin.ntt.net", "rtt": 1.097}]}, {"hop": 5, "probes": [{"annotation": null, "asn": null, "ip": "2001:218:0:2000::59", "name": "ae-25.r02.tokyjp05.jp.bb.gin.ntt.net", "rtt": 1.515}, {"annotation": null, "asn": null, "ip": "2001:218:0:2000::59", "name": "ae-25.r02.tokyjp05.jp.bb.gin.ntt.net", "rtt": 1.744}, {"annotation": null, "asn": null, "ip": "2001:218:0:2000::59", "name": "ae-25.r02.tokyjp05.jp.bb.gin.ntt.net", "rtt": 1.785}]}, {"hop": 6, "probes": [{"annotation": null, "asn": null, "ip": "2001:218:0:2000::11a", "name": "ae-4.r30.tokyjp05.jp.bb.gin.ntt.net", "rtt": 1.466}, {"annotation": null, "asn": null, "ip": "2001:218:0:2000::11a", "name": "ae-4.r30.tokyjp05.jp.bb.gin.ntt.net", "rtt": 1.538}, {"annotation": null, "asn": null, "ip": "2001:218:0:2000::11a", "name": "ae-4.r30.tokyjp05.jp.bb.gin.ntt.net", "rtt": 1.337}]}, {"hop": 7, "probes": [{"annotation": null, "asn": null, "ip": "2001:218:0:2000::2d7", "name": "ae-3.r00.tokyjp08.jp.bb.gin.ntt.net", "rtt": 1.857}, {"annotation": null, "asn": null, "ip": "2001:218:0:2000::2d7", "name": "ae-3.r00.tokyjp08.jp.bb.gin.ntt.net", "rtt": 1.839}, {"annotation": null, "asn": null, "ip": "2001:218:0:2000::2d7", "name": "ae-3.r00.tokyjp08.jp.bb.gin.ntt.net", "rtt": 1.901}]}, {"hop": 8, "probes": [{"annotation": null, "asn": null, "ip": "2001:218:2000:5000::26", "name": "as7515.ntt.net", "rtt": 2.717}, {"annotation": null, "asn": null, "ip": "2001:218:2000:5000::26", "name": "as7515.ntt.net", "rtt": 2.419}, {"annotation": null, "asn": null, "ip": "2001:218:2000:5000::26", "name": "as7515.ntt.net", "rtt": 2.325}]}, {"hop": 9, "probes": [{"annotation": null, "asn": null, "ip": "2400:cb00:22:1024::a29e:759c", "name": "2400:cb00:22:1024::a29e:759c", "rtt": 2.115}, {"annotation": null, "asn": null, "ip": "2400:cb00:22:1024::a29e:759c", "name": "2400:cb00:22:1024::a29e:759c", "rtt": 1.985}, {"annotation": null, "asn": null, "ip": "2400:cb00:22:1024::a29e:759c", "name": "2400:cb00:22:1024::a29e:759c", "rtt": 2.272}]}]}
{"destination_ip":"2606:4700:3030::6812:3e4e","destination_name":"baeldung.com","hops":[{"hop":1,"probes":[{"annotation":null,"asn":null,"ip":"2001:2e8:665:0:2:2:0:1","name":"2001:2e8:665:0:2:2:0:1","rtt":0.083},{"annotation":null,"asn":null,"ip":"2001:2e8:665:0:2:2:0:1","name":"2001:2e8:665:0:2:2:0:1","rtt":0.048},{"annotation":null,"asn":null,"ip":"2001:2e8:665:0:2:2:0:1","name":"2001:2e8:665:0:2:2:0:1","rtt":0.044}]},{"hop":2,"probes":[{"annotation":null,"asn":null,"ip":"2001:2e8:22:204::2","name":"2001:2e8:22:204::2","rtt":25.128},{"annotation":null,"asn":null,"ip":"2001:2e8:22:204::2","name":"2001:2e8:22:204::2","rtt":25.047},{"annotation":null,"asn":null,"ip":"2001:2e8:22:204::2","name":"2001:2e8:22:204::2","rtt":25.025}]},{"hop":3,"probes":[{"annotation":null,"asn":null,"ip":"2001:2e8:20::22:11","name":"2001:2e8:20::22:11","rtt":1.106},{"annotation":null,"asn":null,"ip":"2001:2e8:20::22:11","name":"2001:2e8:20::22:11","rtt":25.83},{"annotation":null,"asn":null,"ip":"2001:2e8:20::22:11","name":"2001:2e8:20::22:11","rtt":1.007}]},{"hop":4,"probes":[{"annotation":null,"asn":null,"ip":"2001:218:2000:5000::305","name":"xe-0-0-14-1.a02.tokyjp05.jp.bb.gin.ntt.net","rtt":0.908},{"annotation":null,"asn":null,"ip":"2001:218:2000:5000::305","name":"xe-0-0-14-1.a02.tokyjp05.jp.bb.gin.ntt.net","rtt":1.197},{"annotation":null,"asn":null,"ip":"2001:218:2000:5000::305","name":"xe-0-0-14-1.a02.tokyjp05.jp.bb.gin.ntt.net","rtt":1.097}]},{"hop":5,"probes":[{"annotation":null,"asn":null,"ip":"2001:218:0:2000::59","name":"ae-25.r02.tokyjp05.jp.bb.gin.ntt.net","rtt":1.515},{"annotation":null,"asn":null,"ip":"2001:218:0:2000::59","name":"ae-25.r02.tokyjp05.jp.bb.gin.ntt.net","rtt":1.744},{"annotation":null,"asn":null,"ip":"2001:218:0:2000::59","name":"ae-25.r02.tokyjp05.jp.bb.gin.ntt.net","rtt":1.785}]},{"hop":6,"probes":[{"annotation":null,"asn":null,"ip":"2001:218:0:2000::11a","name":"ae-4.r30.tokyjp05.jp.bb.gin.ntt.net","rtt":1.466},{"annotation":null,"asn":null,"ip":"2001:218:0:2000::11a","name":"ae-4.r30.tokyjp05.jp.bb.gin.ntt.net","rtt":1.538},{"annotation":null,"asn":null,"ip":"2001:218:0:2000::11a","name":"ae-4.r30.tokyjp05.jp.bb.gin.ntt.net","rtt":1.337}]},{"hop":7,"probes":[{"annotation":null,"asn":null,"ip":"2001:218:0:2000::2d7","name":"ae-3.r00.tokyjp08.jp.bb.gin.ntt.net","rtt":1.857},{"annotation":null,"asn":null,"ip":"2001:218:0:2000::2d7","name":"ae-3.r00.tokyjp08.jp.bb.gin.ntt.net","rtt":1.839},{"annotation":null,"asn":null,"ip":"2001:218:0:2000::2d7","name":"ae-3.r00.tokyjp08.jp.bb.gin.ntt.net","rtt":1.901}]},{"hop":8,"probes":[{"annotation":null,"asn":null,"ip":"2001:218:2000:5000::26","name":"as7515.ntt.net","rtt":2.717},{"annotation":null,"asn":null,"ip":"2001:218:2000:5000::26","name":"as7515.ntt.net","rtt":2.419},{"annotation":null,"asn":null,"ip":"2001:218:2000:5000::26","name":"as7515.ntt.net","rtt":2.325}]},{"hop":9,"probes":[{"annotation":null,"asn":null,"ip":"2400:cb00:22:1024::a29e:759c","name":"2400:cb00:22:1024::a29e:759c","rtt":2.115},{"annotation":null,"asn":null,"ip":"2400:cb00:22:1024::a29e:759c","name":"2400:cb00:22:1024::a29e:759c","rtt":1.985},{"annotation":null,"asn":null,"ip":"2400:cb00:22:1024::a29e:759f","name":"2400:cb00:22:1024::a29e:759f","rtt":2.272}]}]}

0 comments on commit 5bec53b

Please sign in to comment.