ripe atlas - cisco workshop

56
Paris | 9 March 2016 Daniel Karrenberg Massimo Candela Science Division RIPE NCC RIPE Atlas Workshop

Upload: massimo-candela

Post on 11-Apr-2017

120 views

Category:

Internet


0 download

TRANSCRIPT

Page 1: RIPE Atlas - Cisco Workshop

Paris | 9 March 2016

Daniel Karrenberg Massimo Candela

Science Division RIPE NCC

RIPE Atlas Workshop

Page 2: RIPE Atlas - Cisco Workshop

Daniel Karrenberg | Massimo Candela | RIPE Atlas workshop | 9 March 2016 2

Goals• Learn how to:

- Benefit from using RIPE Atlas measurements for network monitoring and troubleshooting

- Use API calls and Command line tool to create and inspect measurements

- Write code to manipulate Atlas data

- Receive measurement results in real-time

• Get your questions answered by a developer

Page 3: RIPE Atlas - Cisco Workshop

Daniel Karrenberg | Massimo Candela | RIPE Atlas workshop | 9 March 2016 3

Prerequisites

• Do you have a RIPE NCC Access account? • If not - quickly create one: ripe.net/register

• Do you have credits to spend? • Redeem this voucher “cisco-paris-atlas” on https://

atlas.ripe.net/user/credits/

Page 4: RIPE Atlas - Cisco Workshop

Introduction to RIPE Atlas

Page 5: RIPE Atlas - Cisco Workshop

Daniel Karrenberg | Massimo Candela | RIPE Atlas workshop | 9 March 2016 5

• RIPE Atlas is a global active measurements platform

• Probes hosted by volunteers

• Data publicly available

• "RIPE Atlas: A Global Internet Measurement Network" (PDF). Internet Protocol Journal 18. September 2015. ISSN 1944-1134.

Page 6: RIPE Atlas - Cisco Workshop

Daniel Karrenberg | Massimo Candela | RIPE Atlas workshop | 9 March 2016 6

RIPE Atlas numbers

•9,300+ probes connected (170+ Anchors)

•3,700+ results collected per second

•35,000+ user-defined measurements weekly - Five types of user-defined measurements available to probe

hosts and RIPE NCC members: ping, traceroute, DNS, SSL, NTP

Page 7: RIPE Atlas - Cisco Workshop

Daniel Karrenberg | Massimo Candela | RIPE Atlas workshop | 9 March 2016 7

RIPE Atlas coverage

Page 8: RIPE Atlas - Cisco Workshop

Daniel Karrenberg | Massimo Candela | RIPE Atlas workshop | 9 March 2016 8

RIPE Atlas results

• Ongoing global measurements towards root nameservers - Visualised as Internet traffic maps

• Ongoing regional measurements towards “anchors”

• Users can run customised measurements - ping, traceroute, DNS, SSL/TLS, NTP and HTTP

Page 9: RIPE Atlas - Cisco Workshop

Measurement Results

Page 10: RIPE Atlas - Cisco Workshop

Daniel Karrenberg | Massimo Candela | RIPE Atlas workshop | 9 March 2016 10

Looking up measurements results• Go to “Measurements, Maps and Tools” >

“Measurements”

Page 11: RIPE Atlas - Cisco Workshop

Daniel Karrenberg | Massimo Candela | RIPE Atlas workshop | 9 March 2016 11

RIPE Atlas REST APIs• List of scheduled measurements

- https://atlas.ripe.net/api/v2/measurements/

- https://atlas.ripe.net/api/v2/measurements/{TYPE}/

• Information about a specific measurement - https://atlas.ripe.net/api/v2/measurements/{ID}/

• Results of a specific measurement - https://atlas.ripe.net/api/v2/measurements/{ID}/results

Page 12: RIPE Atlas - Cisco Workshop

Daniel Karrenberg | Massimo Candela | RIPE Atlas workshop | 9 March 2016 12

RIPE Atlas REST APIs• List of probes

- https://atlas.ripe.net/api/v2/probes/

• Information about a specific probe - https://atlas.ripe.net/api/v2/probes/{ID}

• List of anchors - https://atlas.ripe.net/api/v2/anchors/

• Information about a specific anchor - https://atlas.ripe.net/api/v2/anchors/{ID}

Page 13: RIPE Atlas - Cisco Workshop

Daniel Karrenberg | Massimo Candela | RIPE Atlas workshop | 9 March 2016 13

RIPE Atlas REST APIs• List of measurements targeted to an anchor

- https://atlas.ripe.net/api/v2/anchor-measurements/

• Info about a specific anchor measurement - https://atlas.ripe.net/api/v2/anchor-measurements/{ID}

V2 has been not released yet The format may change

Documentation: https://atlas.ripe.net/docs/rest/

Page 14: RIPE Atlas - Cisco Workshop

Daniel Karrenberg | Massimo Candela | RIPE Atlas workshop | 9 March 2016 14

Available visualisations• List of probes:

sortable by RTT

• Map: colour-coded by RTT

• LatencyMON: compare multiple latency trends

Page 15: RIPE Atlas - Cisco Workshop

Daniel Karrenberg | Massimo Candela | RIPE Atlas workshop | 9 March 2016 15

LatencyMON

Page 16: RIPE Atlas - Cisco Workshop

Creating a Measurement

Page 17: RIPE Atlas - Cisco Workshop

Daniel Karrenberg | Massimo Candela | RIPE Atlas workshop | 9 March 2016 17

Benefits of your own measurements• A customer reports a problem: he cannot

reach one of your servers - You can schedule measurements (e.g. pings or

traceroutes) from up to 500 RIPE Atlas probes worldwide to check where the problem might be

• Measuring packet loss on a suspected “bad” link

• Testing anycast deployment

Page 18: RIPE Atlas - Cisco Workshop

Daniel Karrenberg | Massimo Candela | RIPE Atlas workshop | 9 March 2016 18

Credits system• Running your own measurements cost credits

- ping = 10 credits, traceroute = 20, etc.

• Why? Fairness and to avoid overload

• Daily spending limit & max measurements user can create

• Hosting a RIPE Atlas probe earns credits

• Earn extra credits by:

- Being a RIPE NCC member

- Hosting an anchor

- Sponsoring probes

Page 19: RIPE Atlas - Cisco Workshop

Daniel Karrenberg | Massimo Candela | RIPE Atlas workshop | 9 March 2016 19

Credits overview

My Atlas > Credits

Give credits to someone

Page 20: RIPE Atlas - Cisco Workshop

DEMOCreate a Measurement (GUI) Explore advanced parameters

Page 21: RIPE Atlas - Cisco Workshop

Daniel Karrenberg | Massimo Candela | RIPE Atlas workshop | 9 March 2016 21

Using API to schedule a measurement • Using command-line & scripting:

- https://atlas.ripe.net/docs/measurement-creation-api/

- https://atlas.ripe.net/keys/

• You will need API keys - To create measurements without logging in

- To securely share your measurement data

Page 22: RIPE Atlas - Cisco Workshop

DEMOCreate an API key

Create a Measurement (API)

Page 23: RIPE Atlas - Cisco Workshop

ExerciseCreate a Measurement

Page 24: RIPE Atlas - Cisco Workshop

Daniel Karrenberg | Massimo Candela | RIPE Atlas workshop | 9 March 2016 24

Tasks• Create a TCP traceroute measurement:

- Involving 10 probes

- The closest five at the workshop location (Issy-les-Moulineaux)

- Another random five from another country of your choice

- To a target of your choice

- Duration of two days

- Repeated every 60 seconds

1. Model a measurement using the GUI

2. Create API key

3. Schedule a measurement using the API

Page 25: RIPE Atlas - Cisco Workshop

Code with RIPE Atlas

Page 26: RIPE Atlas - Cisco Workshop

Daniel Karrenberg | Massimo Candela | RIPE Atlas workshop | 9 March 2016 26

RIPE Atlas Sagan• A translation layer for RIPE Atlas

measurement results - https://github.com/RIPE-NCC/ripe.atlas.sagan

- pip install ripe.atlas.sagan

• Transforms JSON results in Python objects

• The output is firmware version transparent

• Pre-computes useful attributes (e.g. Does a traceroute reach the target host?)

Page 27: RIPE Atlas - Cisco Workshop

Daniel Karrenberg | Massimo Candela | RIPE Atlas workshop | 9 March 2016 27

RIPE Atlas Cousteau• A python wrapper around RIPE Atlas API

- https://github.com/RIPE-NCC/ripe-atlas-cousteau

- pip install ripe.atlas.cousteau

• Fetches results from API and streaming, and probe and measurement information

• You can manage measurements: - Create a measurement

- Stop a measurement

- Change probes involved

Page 28: RIPE Atlas - Cisco Workshop

DEMOFetching and Creating a Measurement with

RIPE Atlas Cousteau

Page 29: RIPE Atlas - Cisco Workshop

Daniel Karrenberg | Massimo Candela | RIPE Atlas workshop | 9 March 2016 29

RIPE Atlas Cousteau Demo• Fetch results

- https://github.com/RIPE-NCC/ripe-atlas-cousteau#fetch-results

• Fetch real-time results - https://github.com/RIPE-NCC/ripe-atlas-cousteau#fetch-real-time-

results

• Create a measurement - https://github.com/RIPE-NCC/ripe-atlas-cousteau#creating-a-

measurement

• More - https://github.com/RIPE-NCC/ripe-atlas-cousteau

Page 30: RIPE Atlas - Cisco Workshop

ExerciseCreate a Measurement by Using RIPE

Atlas Cousteau

Page 31: RIPE Atlas - Cisco Workshop

Daniel Karrenberg | Massimo Candela | RIPE Atlas workshop | 9 March 2016 31

Tasks• Create a ping measurement:

- Involving 10 probes worldwide

- Targeting www.google.fr

- One-off

• Annotate the measurement ID returned

• Fetch the results after a few minutes (no real-time)

Page 32: RIPE Atlas - Cisco Workshop

Real-time performance monitoring

Page 33: RIPE Atlas - Cisco Workshop

Daniel Karrenberg | Massimo Candela | RIPE Atlas workshop | 9 March 2016 33

RIPE Atlas streaming• RIPE Atlas streaming is an architecture that

allows users to receive the measurement results as soon as they are sent by the probes - in real time - Publish/subscribe through web sockets

• There are three types of data: - Measurement results

- Probe connection status events

- Measurements metadata

Page 34: RIPE Atlas - Cisco Workshop

Daniel Karrenberg | Massimo Candela | RIPE Atlas workshop | 9 March 2016 34

RIPE Atlas streaming• Visualising network outages

-http://sg-pub.ripe.net/demo-area/atlas-stream/conn/

• Real-time server and performance monitoring

• Filtering and reusing measurement results

• Documentation: - https://atlas.ripe.net/docs/result-streaming/

Page 35: RIPE Atlas - Cisco Workshop

Daniel Karrenberg | Massimo Candela | RIPE Atlas workshop | 9 March 2016 35

How it Works (Client)1.Create a socket

2.Create a callback (function) - for each event type

- to be executed for each message received

3.Start listening the channel

4.Declare what you want to receive for that event type

Page 36: RIPE Atlas - Cisco Workshop

Daniel Karrenberg | Massimo Candela | RIPE Atlas workshop | 9 March 2016 36

How it Works (Client)

Page 37: RIPE Atlas - Cisco Workshop

ExerciseUsing streaming API

Page 38: RIPE Atlas - Cisco Workshop

Daniel Karrenberg | Massimo Candela | RIPE Atlas workshop | 9 March 2016 38

EX1: Monitoring server reachability • Scenario: customers are complaining that it

occasionally takes a long time to reach your service or server

• Action: ping your server from 500 probes - Decide what is acceptable latency threshold to apply

- Notice and react when you start receiving samples

• Task: Use the ping measurement ID 2340408 - Choose which threshold (e.g. greater than 30ms)

- Imposes the threshold on “min” (the minimum result of the three ping attempts)

Page 39: RIPE Atlas - Cisco Workshop

Daniel Karrenberg | Massimo Candela | RIPE Atlas workshop | 9 March 2016 39

Steps

1.Go to http://atlas.ripe.net/webinar/streaming01.html

2.Open the development console

3.Wait for results to arrive

4.Save the HTML file locally and edit the code

Page 40: RIPE Atlas - Cisco Workshop

Daniel Karrenberg | Massimo Candela | RIPE Atlas workshop | 9 March 2016 40

Page Source

Page 41: RIPE Atlas - Cisco Workshop

Daniel Karrenberg | Massimo Candela | RIPE Atlas workshop | 9 March 2016 41

Example of results

Page 42: RIPE Atlas - Cisco Workshop

Daniel Karrenberg | Massimo Candela | RIPE Atlas workshop | 9 March 2016 42

EX2: Monitoring server reachability • Imagine you are in the situation described in

the exercise before, but you didn’t schedule a measurement in advance - You don’t have a measurement ID

• You want to get all the measurements reaching 193.0.10.197

• Now restrict the results to just include ping measurements

Page 43: RIPE Atlas - Cisco Workshop

Command-line Interface (CLI) Toolset

Page 44: RIPE Atlas - Cisco Workshop

Daniel Karrenberg | Massimo Candela | RIPE Atlas workshop | 9 March 2016 44

RIPE Atlas CLI• Network troubleshooting for command line

pros

• Familiar output (ping, dig, traceroute)

• Linux/OSX - http://ripe-atlas-tools.readthedocs.org/en/latest/

installation.html#requirements-and-installation

• Windows [experimental] - https://github.com/chrisamin/ripe-atlas-tools-win32

Page 45: RIPE Atlas - Cisco Workshop

Daniel Karrenberg | Massimo Candela | RIPE Atlas workshop | 9 March 2016 45

RIPE Atlas CLI• Open source

- RIPE NCC led community contribution

• Documentation - https://ripe-atlas-tools.readthedocs.org/

• Source: - https://github.com/RIPE-NCC/ripe-atlas-tools/

• How to contribute: - https://github.com/RIPE-NCC/ripe-atlas-tools/blob/master/

CONTRIBUTING.rst

Page 46: RIPE Atlas - Cisco Workshop

Daniel Karrenberg | Massimo Candela | RIPE Atlas workshop | 9 March 2016 46

Configure RIPE Atlas CLI• Reuse the API key of the previous exercise

- Or create a new one at https://atlas.ripe.net/keys/

• Configure your CLI - ripe-atlas configure --set authorisation.create=MY_API_KEY

Page 47: RIPE Atlas - Cisco Workshop

Daniel Karrenberg | Massimo Candela | RIPE Atlas workshop | 9 March 2016 47

Fetch an existing measurement• Fetch the ping measurement 2340408

- ripe-atlas report 2340408

Page 48: RIPE Atlas - Cisco Workshop

Daniel Karrenberg | Massimo Candela | RIPE Atlas workshop | 9 March 2016 48

Search probes• Search all probes in AS 3333

- ripe-atlas probes --asn 3333

• Show specific fields - ripe-atlas probes --asn 3333 --field asn_v6 --field country

--field is_public --field description --field status

• Search for probes in and around Paris - ripe-atlas probes --location "Paris, France" --radius 15

Page 49: RIPE Atlas - Cisco Workshop

Daniel Karrenberg | Massimo Candela | RIPE Atlas workshop | 9 March 2016 49

Create a measurement• Create a ping measurement to wikipedia.org

- One-off, default parameters

- ripe-atlas measure ping --target wikipedia.org

Page 50: RIPE Atlas - Cisco Workshop

Daniel Karrenberg | Massimo Candela | RIPE Atlas workshop | 9 March 2016 50

Other examples of ping• Geo-specific from 20 probes from Canada:

- ripe-atlas measure ping --target example.com --probes 20 --from-country ca

• 20 Canadian probes that definitely support IPv6: - ripe-atlas measure ping --target example.com --probes 20

--from-country ca --include-tag system-ipv6-works

• Create a recurring measurement: - ripe-atlas measure ping --target example.com --interval

3600

Page 51: RIPE Atlas - Cisco Workshop

ExerciseUsing RIPE Atlas CLI

Page 52: RIPE Atlas - Cisco Workshop

Daniel Karrenberg | Massimo Candela | RIPE Atlas workshop | 9 March 2016 52

Search probes• Use the traceroute command to test the

reachability of wikipedia.org on TCP port 443 from 20 probes in France

• Render the results collected in the previous exercise in json format

Page 53: RIPE Atlas - Cisco Workshop

Daniel Karrenberg | Massimo Candela | RIPE Atlas workshop | 9 March 2016 53

Search probes• Use the traceroute command to test the

reachability of wikipedia.org on TCP port 443 from 20 probes in France - ripe-atlas measure traceroute --protocol TCP --target

wikipedia.org --port 443 --probes 20 --from-country fr

• Render the results collected in the previous exercise in json format - ripe-atlas report {MSM_ID} --renderer raw

Page 54: RIPE Atlas - Cisco Workshop

Take part in the RIPE Atlas community

Page 55: RIPE Atlas - Cisco Workshop

Daniel Karrenberg | Massimo Candela | RIPE Atlas workshop | 9 March 2016 55

RIPE Atlas community (part 1)• Individual volunteers host probes in homes or

offices

• Organisations host RIPE Atlas Anchors

• Sponsor organisations give financial support or host multiple probes in their own networks

Page 56: RIPE Atlas - Cisco Workshop

Daniel Karrenberg | Massimo Candela | RIPE Atlas workshop | 9 March 2016 56

Contact us• https://atlas.ripe.net & http://roadmap.ripe.net/

ripe-atlas/

• Users’ mailing list: [email protected]

• Articles and updates: https://labs.ripe.net/atlas

• Questions and bugs: [email protected]

• Twitter: @RIPE_Atlas and #RIPEAtlas