Skip to content

commesan/reticle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Reticle

GoDoc Go Report Card

A parsing library for RIPE Atlas measurement results in Go

RIPE Atlas generates a lot of data, and the format of that data changes over time. Often you want to do something simple like fetch the median RTT for each measurement result between date X and date Y. Unfortunately, there are dozens of edge cases to account for while parsing the JSON, like the format of errors and firmware upgrades that changed the format entirely.

Reticle should make it easier for RIPE Atlas users to use the measurement data. For each measurement type (ping, traceroute, ...) it has a single struct regardless of the original firmware version. This struct will be modelled after the most recent firmware versions. Older version will be mapped onto the newer versions.

Isn't there a library for this already?

Yes! RIPE's own parsing library Sagan is an excellent parser with support for all the different probe firmware versions. But it's written in Python and I needed a Go version to integrate with the rest of my tooling.

For now Reticle only has full support for the traceroutes of all firmware versions. Support for older firmware versions for the other measurement types will be added in time. See below for the availible versions.

Usage

Install

    go get github.com/commesan/reticle/v1/reticle

Example

    dnsJson := `{"af":4,"dst_addr":"216.239.34.106","dst_port":"53","from":"195.130.61.208","fw":4910,"group_id":15314087,"lts":243,"msm_id":15314087,"msm_name":"Tdig","prb_id":6366,"proto":"UDP","result":{"ANCOUNT":1,"ARCOUNT":0,"ID":19295,"NSCOUNT":0,"QDCOUNT":1,"abuf":"S1+EAAABAAEAAAAACDBES1A0YzVZBHRlc3QGZ2NwZG5zA25ldAAAAQABwAwAAQABAAAOEAAEaxbr9Q==","rt":34.738,"size":58},"src_addr":"195.130.61.208","stored_timestamp":1532169612,"timestamp":1532169601,"type":"dns"}`

    msmt, _ := ParseString(dnsJson)
    dnsMsmt, _ := msmt.DNS()
    responseTime := dnsMsmt.Result.RT
    fmt.Printf("Request took: %f", responseTime)
    
    # or read measurments from url
    ms, err := MeasurmentsFromURL("https://atlas.ripe.net/api/v2/measurements/15597929/results/?format=txt")
    for _, m := range ms {
    	tr, _ := m.TraceRoute()
    	fmt.Printf("Traceroute from %s to %s \n", tr.FromAddr, tr.DestAddr)
    }

Tested for firmware

  • Ping : fw >= 4610
  • Traceroute : All
  • DNS Lookup : fw >= 4610
  • HTTP : fw >= 4750
  • SSL Cert : fw >= 4750
  • NTP : fw >= 4750
  • WIFI : fw >= 4750

For test data

About

Parser for RIPE Atlas measurments in Go

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages