Collec:ng telemetry data with pmacct - AfPIF · Presentaon history § 1.1: – MENOG 13 mee:ng,...

70
AfPIF 2017, Abidjan – Aug 2017 Collec:ng telemetry data with pmacct Paolo Lucente pmacct

Transcript of Collec:ng telemetry data with pmacct - AfPIF · Presentaon history § 1.1: – MENOG 13 mee:ng,...

Page 1: Collec:ng telemetry data with pmacct - AfPIF · Presentaon history § 1.1: – MENOG 13 mee:ng, Kuwait City, Sep 2013 § 1.2: – SEE 3 mee:ng, Sofia, Apr 2014 § 1.3: – AfPIF

AfPIF2017,Abidjan–Aug2017

Collec:ngtelemetrydatawithpmacct

PaoloLucentepmacct

Page 2: Collec:ng telemetry data with pmacct - AfPIF · Presentaon history § 1.1: – MENOG 13 mee:ng, Kuwait City, Sep 2013 § 1.2: – SEE 3 mee:ng, Sofia, Apr 2014 § 1.3: – AfPIF

Presenta:onhistory

§  1.1:–  MENOG13mee:ng,KuwaitCity,Sep2013

§  1.2:–  SEE3mee:ng,Sofia,Apr2014

§  1.3:–  AfPIF2017mee:ng,Abidjan,Aug2017

Page 3: Collec:ng telemetry data with pmacct - AfPIF · Presentaon history § 1.1: – MENOG 13 mee:ng, Kuwait City, Sep 2013 § 1.2: – SEE 3 mee:ng, Sofia, Apr 2014 § 1.3: – AfPIF

Agenda

§  Introduc)on§  pmacctarchitecture&benefits§  example,dataaggrega:on:trafficmatrices§  example,loggingmicro-flowsorevents§  tee:brieflyonhorizontalscalability

AfPIF2017,Abidjan–Aug2017

Collec:ngtelemetrydatawithpmacct

Page 4: Collec:ng telemetry data with pmacct - AfPIF · Presentaon history § 1.1: – MENOG 13 mee:ng, Kuwait City, Sep 2013 § 1.2: – SEE 3 mee:ng, Sofia, Apr 2014 § 1.3: – AfPIF

whoami

PaoloLucenteGitHub:paololucenteLinkedIn:plucenteDiggingdataoutofnetworksworldwideforfunandprofitformorethan10years

Page 5: Collec:ng telemetry data with pmacct - AfPIF · Presentaon history § 1.1: – MENOG 13 mee:ng, Kuwait City, Sep 2013 § 1.2: – SEE 3 mee:ng, Sofia, Apr 2014 § 1.3: – AfPIF

libpcap

pmacctisopen-source,free,GPL’edso[ware

sFlow

BGP

maps

IGP

MySQL PgSQL SQLite

MongoDB BerkeleyDB

flat-files

RabbitMQ Kafka

memory tables

sFlow

tee

NetFlow IPFIX

NetFlow IPFIX

h\p://www.pmacct.net/

Streaming Telemetry

BMP GeoIP

Page 6: Collec:ng telemetry data with pmacct - AfPIF · Presentaon history § 1.1: – MENOG 13 mee:ng, Kuwait City, Sep 2013 § 1.2: – SEE 3 mee:ng, Sofia, Apr 2014 § 1.3: – AfPIF

pmacct:afewsimpleuse-cases

BMP

flat-files

tee

NetFlow IPFIX

sFlow

Kafka

IPFIX libpcap

Page 7: Collec:ng telemetry data with pmacct - AfPIF · Presentaon history § 1.1: – MENOG 13 mee:ng, Kuwait City, Sep 2013 § 1.2: – SEE 3 mee:ng, Sofia, Apr 2014 § 1.3: – AfPIF

pmacct:aslightlymorecomplexuse-case

BGP

flat-files

tee

NetFlow IPFIX

Kafka

MySQL

aggregation method #1

aggregation method #2

nfacctd

Page 8: Collec:ng telemetry data with pmacct - AfPIF · Presentaon history § 1.1: – MENOG 13 mee:ng, Kuwait City, Sep 2013 § 1.2: – SEE 3 mee:ng, Sofia, Apr 2014 § 1.3: – AfPIF

Theuse-caseformessagebrokers

Page 9: Collec:ng telemetry data with pmacct - AfPIF · Presentaon history § 1.1: – MENOG 13 mee:ng, Kuwait City, Sep 2013 § 1.2: – SEE 3 mee:ng, Sofia, Apr 2014 § 1.3: – AfPIF

pmacct-to-elas:csearch0.3.0

Creditsto:PierCarloChiodi,h\ps://github.com/pierky/pmacct-to-elas:csearch

Page 10: Collec:ng telemetry data with pmacct - AfPIF · Presentaon history § 1.1: – MENOG 13 mee:ng, Kuwait City, Sep 2013 § 1.2: – SEE 3 mee:ng, Sofia, Apr 2014 § 1.3: – AfPIF

Usecasesbyindustry

Page 11: Collec:ng telemetry data with pmacct - AfPIF · Presentaon history § 1.1: – MENOG 13 mee:ng, Kuwait City, Sep 2013 § 1.2: – SEE 3 mee:ng, Sofia, Apr 2014 § 1.3: – AfPIF

Keypmacctnon-technicalfacts

§  10+yearsoldproject§  Can’tspellthenamea[ertheseconddrink§  Free,open-source,independent§  Underac:vedevelopment§  Innova:onbeingintroduced§ Welldeployedaround,alsoinlargeSPs/IXPs§  ClosetotheSP/IXPcommunityneeds

Page 12: Collec:ng telemetry data with pmacct - AfPIF · Presentaon history § 1.1: – MENOG 13 mee:ng, Kuwait City, Sep 2013 § 1.2: – SEE 3 mee:ng, Sofia, Apr 2014 § 1.3: – AfPIF

Agenda

§  Introduc:on§  pmacctarchitecture&benefits§  example,dataaggrega:on:trafficmatrices§  example,loggingmicro-flowsorevents§  tee:brieflyonhorizontalscalability

AfPIF2017,Abidjan–Aug2017

Collec:ngtelemetrydatawithpmacct

Page 13: Collec:ng telemetry data with pmacct - AfPIF · Presentaon history § 1.1: – MENOG 13 mee:ng, Kuwait City, Sep 2013 § 1.2: – SEE 3 mee:ng, Sofia, Apr 2014 § 1.3: – AfPIF

Sometechnicalfacts

§  Pluggablearchitecture:•  Caneasilyaddsupportfornewdatasourcesandbackends

§  Correla:onofdatasources:•  Na:velysupporteddatasources(ie.flowtelemetry,BGP,BMP,IGP,StreamingTelemetry)

•  Enrichwithexternaldatasourcesviatagsandlabels

§  Enableanaly:csagainsteachdatasource:•  Streamreal-:me•  Dumpatregular:meintervals(possiblestatecompression)

Page 14: Collec:ng telemetry data with pmacct - AfPIF · Presentaon history § 1.1: – MENOG 13 mee:ng, Kuwait City, Sep 2013 § 1.2: – SEE 3 mee:ng, Sofia, Apr 2014 § 1.3: – AfPIF

Sometechnicalfacts(cont.d)

BGP thread

NetFlow thread

Abstraction layer

Core Process

MySQLplugin

Printplugin(toflat-files)

Observed network Backends

Plugins

Pipe

Pipe

Page 15: Collec:ng telemetry data with pmacct - AfPIF · Presentaon history § 1.1: – MENOG 13 mee:ng, Kuwait City, Sep 2013 § 1.2: – SEE 3 mee:ng, Sofia, Apr 2014 § 1.3: – AfPIF

Sometechnicalfacts(cont.d)

§  Buildmul:pleviewsoutoftheverysamecollectednetworktraffic,ie.:•  Unaggregatedtoflat-filesforsecurityandforensics;ortomessagebrokers(RabbitMQ,Kaia)forBigData

•  Aggregatedas[<ingressrouter>,<ingressinterface>,<BGPnext-hop>,<peerdes:na:onASN>]andsenttoaSQLDBtobuildaninternaltrafficmatrixforcapacityplanningpurposes

§  Pervasivedata-reduc:ontechniques,ie.:•  Dataaggrega:on•  Filtering•  Sampling

Page 16: Collec:ng telemetry data with pmacct - AfPIF · Presentaon history § 1.1: – MENOG 13 mee:ng, Kuwait City, Sep 2013 § 1.2: – SEE 3 mee:ng, Sofia, Apr 2014 § 1.3: – AfPIF

Touchingground:aconfigsnippetforbothaggregatedandunaggregatedviews

nfacctd_ip: 10.0.0.1 nfacctd_port: 2100

!

plugins: print[forensics], mysql[int_traffic_matrix]

!

aggregate[forensics]: etype, src_host, dst_host, \

peer_src_ip, peer_dst_ip, in_iface, out_iface, \

timestamp_start, timestamp_end, src_port, \

dst_port, proto, tos, src_mask, dst_mask, src_as, \

dst_as, tcpflags, export_proto_seqno

!

aggregate[int_traffic_matrix]: in_iface, peer_src_ip, \

peer_dst_ip, peer_dst_as

! ! <rest of config skipped>

Basic daemon config

Instantiating plugins

Instantiating plugins

Defining plugin aggregation

methods

Page 17: Collec:ng telemetry data with pmacct - AfPIF · Presentaon history § 1.1: – MENOG 13 mee:ng, Kuwait City, Sep 2013 § 1.2: – SEE 3 mee:ng, Sofia, Apr 2014 § 1.3: – AfPIF

Touchingground:dataaggrega:on&custom-definedprimi:ves

§  Configfilesnippet: ! … aggregate[int_traffic_matrix]: peer_src_ip, \ mplsTopLabelIPv4Address

! aggregate_primitives: /path/to/primitives.lst

! …

§  Customprimi:vedefini:on: ! …

name=mplsTopLabelIPv4Address field_type=47 len=4 semantics=ip

! …

Node-to-node internal TM (egress NetFlow)

mplsTopLabelIPv4Address not supported natively, let’s

define it!

Primitive name, will be used for

everything

NetFlow field type, IPFIX Information Element NetFlow/IPFIX

field length

Data presentation: [ u_int, hex, ip, mac, str ]

Page 18: Collec:ng telemetry data with pmacct - AfPIF · Presentaon history § 1.1: – MENOG 13 mee:ng, Kuwait City, Sep 2013 § 1.2: – SEE 3 mee:ng, Sofia, Apr 2014 § 1.3: – AfPIF

BGPintegra:on

§  pmacctintroducedaQuagga-basedBGPdaemon:•  Implementedasaparallelthreadwithinthecollector•  Doesn’tsendUPDATEswhatsoever•  BehavesasapassiveBGPneighbor•  Maintainsper-peerBGPRIBs•  Supports32-bitASNs;IPv4,IPv6andVPNfamilies•  SupportsADD-PATH:dra[-ieq-idr-add-paths

§  WhyBGPatthecollector?•  Telemetryreportsonforwarding-plane,andabitmore•  Extendedvisibilityintocontrol-planeinforma:on

Page 19: Collec:ng telemetry data with pmacct - AfPIF · Presentaon history § 1.1: – MENOG 13 mee:ng, Kuwait City, Sep 2013 § 1.2: – SEE 3 mee:ng, Sofia, Apr 2014 § 1.3: – AfPIF

BMPintegra:on

§  pmacctintroducedaBMPdaemonwri\enfromscratch:•  BMPis:BGPMonitoringProtocol•  Implementedasaparallelthreadwithinthecollector•  AllgoodiesalreadydescribedfortheBGPdaemon:

§ Contribu:ngtoIETFdra[-ieq-grow-bmp-local-rib

•  VisibilityinAdj-RIB-In•  VisibilityinAdj-RIB-Out:

§ Contribu:ngtoIETFdra[-ieq-grow-bmp-adj-rib-out

Page 20: Collec:ng telemetry data with pmacct - AfPIF · Presentaon history § 1.1: – MENOG 13 mee:ng, Kuwait City, Sep 2013 § 1.2: – SEE 3 mee:ng, Sofia, Apr 2014 § 1.3: – AfPIF

IGP(IS-IS)integra:on

§  AQuagga-basedIS-ISdaemonwasintroduced:•  Implementedasaparallelthreadwithinthecollector•  IS-ISneighborshipoveraGREtunnel•  Currentlylimitedtosingleneighborhip,singlelevel,singletopology

•  UsefultolookupnonBGP-routednetworks§  Itwillgeteventuallyreplaced(BGP-LS)

Page 21: Collec:ng telemetry data with pmacct - AfPIF · Presentaon history § 1.1: – MENOG 13 mee:ng, Kuwait City, Sep 2013 § 1.2: – SEE 3 mee:ng, Sofia, Apr 2014 § 1.3: – AfPIF

Storingdatapersistently§  Dataneedtobeaggregatedbothinspa:alandtemporaldimensionsbeforebeingwri\endown:•  Op:malusageofsystemresources•  Avoidsexpensiveconsolida:onofmicro-flows

§  Buildproject-drivendataset(s):•  Noshameinmul:plepartlyoverlappingdata-sets•  Op:mizecompu:ng

Page 22: Collec:ng telemetry data with pmacct - AfPIF · Presentaon history § 1.1: – MENOG 13 mee:ng, Kuwait City, Sep 2013 § 1.2: – SEE 3 mee:ng, Sofia, Apr 2014 § 1.3: – AfPIF

Storingdatapersistently(cont.d)§  “noSQL”databases(BigDataJ):•  Abletohandlelarge:me-seriesdata-sets•  MeaningfulsubsetofSQLquerylanguage•  Innova:vestorageandindexingengines•  Scalable:clustering,spa:alandtemporalpar::oning•  UI-ready:ie.ELKandTICKstacks

§  Open-sourceRDBMS:•  Abletohandlelargedata-sets•  FlexibleandstandardizedSQLquerylanguage•  Solidstorageandindexingengines•  Scalable:clustering,spa:alandtemporalpar::oning

Page 23: Collec:ng telemetry data with pmacct - AfPIF · Presentaon history § 1.1: – MENOG 13 mee:ng, Kuwait City, Sep 2013 § 1.2: – SEE 3 mee:ng, Sofia, Apr 2014 § 1.3: – AfPIF

Storingdatapersisently:MongoDB

§  OnceitwaspmacctopeningtonoSQLdatabases:•  MessupwiththeCAPIover:me•  2017realitycheck:lackofinterest,discon:nuing

§  noSQLlandscapedifficulttomovethrough,ie.fragmentedandlacksofstandardiza:on

§ MongoDBseemedinteres:ngfor:•  Na:vegroupingopera:on(moreperformingandlesscomplexthanmap/reduce)

•  Horizontalscalingconcept(sharding)

Page 24: Collec:ng telemetry data with pmacct - AfPIF · Presentaon history § 1.1: – MENOG 13 mee:ng, Kuwait City, Sep 2013 § 1.2: – SEE 3 mee:ng, Sofia, Apr 2014 § 1.3: – AfPIF

Brokeringdataaround:RabbitMQ,Kaiamessageexchanges

§  noSQLlandscapedifficulttomovethrough,ie.fragmentedandlacksofstandardiza:on,amirepea:ngmyself?J

§  Datacanbepickedupatthemessageexchangeinthepreferredprogramming/scrip:nglanguage

§  Datacanbetheneasilyinsertedinthepreferredbackend,ie.notna:velysupportedbypmacct

Page 25: Collec:ng telemetry data with pmacct - AfPIF · Presentaon history § 1.1: – MENOG 13 mee:ng, Kuwait City, Sep 2013 § 1.2: – SEE 3 mee:ng, Sofia, Apr 2014 § 1.3: – AfPIF

Agenda

§  Introduc:on§  pmacctarchitecture&benefits§  example,dataaggrega)on:trafficmatrices§  example,loggingmicro-flowsorevents§  tee:brieflyonhorizontalscalability

AfPIF2017,Abidjan–Aug2017

Collec:ngtelemetrydatawithpmacct

Page 26: Collec:ng telemetry data with pmacct - AfPIF · Presentaon history § 1.1: – MENOG 13 mee:ng, Kuwait City, Sep 2013 § 1.2: – SEE 3 mee:ng, Sofia, Apr 2014 § 1.3: – AfPIF

Whyspeakingoftrafficmatrices?

–  Aretrafficmatricesusefultoanetworkoperatorinthefirstplace?Yes…§  Capacityplanning(buildcapacitywhereneeded)§  TrafficEngineering(steertrafficwherecapacityisavailable)

§  Be\erunderstandtrafficpa\erns(whattoexpect,withoutacrystalball)

§  Supportpeeringdecisions(trafficinsight,trafficengineeringattheborder,supportwhatifscenarios)

Page 27: Collec:ng telemetry data with pmacct - AfPIF · Presentaon history § 1.1: – MENOG 13 mee:ng, Kuwait City, Sep 2013 § 1.2: – SEE 3 mee:ng, Sofia, Apr 2014 § 1.3: – AfPIF

Reviewoftrafficmatrices:internal

§  POPtoPOP,ARtoAR,CRtoCR

CR

CR

CR

CR

PoP

AR

AR

AR

AR

AR

PoP

AR

Customers Customers

AS1 AS2 AS3 AS4 AS5

Server Farm 1 Server Farm 2

©2010CiscoSystems,Inc./CaridenTechnologies,Inc.

Page 28: Collec:ng telemetry data with pmacct - AfPIF · Presentaon history § 1.1: – MENOG 13 mee:ng, Kuwait City, Sep 2013 § 1.2: – SEE 3 mee:ng, Sofia, Apr 2014 § 1.3: – AfPIF

Reviewoftrafficmatrices:external

§  Router(ARorCR)toexternalASorexternalAStoexternalAS(forIPtransitproviders)

CR

CR

CR

CR

PoP

AR

AR

AR

AR

AR

PoP

AR

Customers Customers

AS1 AS2 AS3 AS4 AS5

Server Farm 1 Server Farm 2

©2010CiscoSystems,Inc./CaridenTechnologies,Inc.

Page 29: Collec:ng telemetry data with pmacct - AfPIF · Presentaon history § 1.1: – MENOG 13 mee:ng, Kuwait City, Sep 2013 § 1.2: – SEE 3 mee:ng, Sofia, Apr 2014 § 1.3: – AfPIF

Let’sfocusonanexternaltrafficmatrixtosupportpeeringdecisions

§  Analysisofexis:ngpeersandinterconnects:•  Supportpolicyandrou:ngchanges•  Fine-grainedaccoun:ngoftrafficvolumesandra:os•  Determinebackbonecostsassociatedtopeering•  Determinerevenueleaks

§  Planningofnewpeersandinterconnects:•  Whotopeernext•  Wheretoplacenextinterconnect•  Modelingandforecas:ng

Page 30: Collec:ng telemetry data with pmacct - AfPIF · Presentaon history § 1.1: – MENOG 13 mee:ng, Kuwait City, Sep 2013 § 1.2: – SEE 3 mee:ng, Sofia, Apr 2014 § 1.3: – AfPIF

Ourtrafficmatrixvisualized

P P

P

PEA

PED

PEC

PEB

P3

P1 P2

P4

BZ

A={src_as,in_iface,peer_src_ip,peer_dst_ip,as_path,tstamp,bytes}

{CZ,X(->CY),PEC,PEA,AZ_AY,<:me>,<bytes>}

{BX,Y(->BY),PEB,PEC,CY_CX,<:me>,<bytes>}

{AX,Z(->AZ),PEA,PEB,BY_BZ,<:me>,<bytes>}

Page 31: Collec:ng telemetry data with pmacct - AfPIF · Presentaon history § 1.1: – MENOG 13 mee:ng, Kuwait City, Sep 2013 § 1.2: – SEE 3 mee:ng, Sofia, Apr 2014 § 1.3: – AfPIF

Ge|ngBGPtothecollector

§  Neededfortechnicalreasons:•  FlowexportersuseNetFlowv5,ie.noBGPnext-hop•  FlowexportersareunawareofBGP•  Libpcapisusedtocollecttrafficdata

§  Neededfortopologyortrafficrelatedreasons:•  Transi:ngtrafficto3rdpar:es•  Dominatedbyoutboundtraffic

Page 32: Collec:ng telemetry data with pmacct - AfPIF · Presentaon history § 1.1: – MENOG 13 mee:ng, Kuwait City, Sep 2013 § 1.2: – SEE 3 mee:ng, Sofia, Apr 2014 § 1.3: – AfPIF

§  LetthecollectorBGPpeerwithallPEdevices:facingpeers,transitandcustomers.

§  Determinememoryfootprint(belowinMB/peer,usingBGPbest-pathsessions)

44.03

22.73

19.97 18.59 18.12 17.89 17.76 17.57 17.48 17.39

50

0

10

20

30

40

50

60

0 200 400 600 800 1000 1200 1400

MB/peer>=0.12.4

MB/peer<0.12.4

NumberofBGPpeers

MB/pe

er

500KIPv4routes,50KIPv6routes,64-bitexecutable

~9GBtotalmemory@500peers

Ge|ngBGPtothecollector(cont.d)

Page 33: Collec:ng telemetry data with pmacct - AfPIF · Presentaon history § 1.1: – MENOG 13 mee:ng, Kuwait City, Sep 2013 § 1.2: – SEE 3 mee:ng, Sofia, Apr 2014 § 1.3: – AfPIF

§  SetthecollectorasiBGPpeeratthePEdevices:•  ConfigureitasaRRclienttogetfulltable•  CollectoractsasiBGPpeeracross(sub-)ASes

§  BGPnext-hophastorepresenttheremoteedgeofthenetworkmodel:•  TypicalscenarioforMPLSnetworks•  Canbefolloweduptocoverspecificscenarioslike:

§ BGPconfedera:ons§ defaultgatewaydefinedduetopar:alordefault-onlyrou:ngtables

Ge|ngBGPtothecollector(cont.d)

Page 34: Collec:ng telemetry data with pmacct - AfPIF · Presentaon history § 1.1: – MENOG 13 mee:ng, Kuwait City, Sep 2013 § 1.2: – SEE 3 mee:ng, Sofia, Apr 2014 § 1.3: – AfPIF

Ge|ngtelemetrytothecollector

–  Exportingress-onlymeasurementsatallPEdevices:facingpeers,transitandcustomers.§  Trafficisroutedtodes:na:on,soplentyofinforma:ononwhereit’sgoingto•  True,someeBGPmul:-pathscenariosmaygetchallenging

§  It’scrucialinsteadtogetasmuchaspossibleaboutwheretrafficiscomingfrom,ie.:•  inputinterfaceatingressrouter•  sourceMACaddress

–  Performdatareduc:onatthePE(ie.sampling)

Page 35: Collec:ng telemetry data with pmacct - AfPIF · Presentaon history § 1.1: – MENOG 13 mee:ng, Kuwait City, Sep 2013 § 1.2: – SEE 3 mee:ng, Sofia, Apr 2014 § 1.3: – AfPIF

Telemetrydata/BGPcorrela:on

Page 36: Collec:ng telemetry data with pmacct - AfPIF · Presentaon history § 1.1: – MENOG 13 mee:ng, Kuwait City, Sep 2013 § 1.2: – SEE 3 mee:ng, Sofia, Apr 2014 § 1.3: – AfPIF

Touchingground:aconfigsnippetfortrafficmatrices

plugins: mysql[int_tm], mysql[ext_tm] !

aggregate[int_tm]: in_iface, peer_src_ip, \

peer_dst_ip, peer_dst_as

!

aggregate[ext_tm]: src_as, in_iface, peer_src_ip, \

peer_dst_ip, peer_dst_as, as_path, dst_as

!

sql_table[int_tm]: int_tm-%Y%m%d_%H%M

!

sql_table[ext_tm]: ext_tm-%Y%m%d_%H%M

sql_cache_entries[ext_tm]: 99991

!

sql_refresh_time: 300

sql_history: 5m

!

! <rest of config skipped>

Dynamic SQL table names, ie.: XXX_tm-20130803_1400

Build time bins of 5 mins

Insert data every 5 mins

AS-to-AS external TM

Port-to-port internal TM

Page 37: Collec:ng telemetry data with pmacct - AfPIF · Presentaon history § 1.1: – MENOG 13 mee:ng, Kuwait City, Sep 2013 § 1.2: – SEE 3 mee:ng, Sofia, Apr 2014 § 1.3: – AfPIF

Touchingground:howdatawouldlooklike:internaltrafficmatrixexample(1/2)

mysql> SHOW TABLES FROM pmacct; +----------------------+

| Tables_in_pmacct |

+----------------------+

| … |

| int_tm-20130803_1400 |

| int_tm-20130803_1405 |

| int_tm-20130803_1410 |

| … |

| ext_tm-20130803_1400 |

| ext_tm-20130803_1405 |

| ext_tm-20130803_1410 |

| … |

+----------------------+

Set of internal traffic matrices

Set of external traffic matrices

NOTE: sub-aggregation is expensive: we could also have had our traffic matrices over multiple temporal aggregations in parallel, ie. 5 mins (as above) but also hourly and daily.

Page 38: Collec:ng telemetry data with pmacct - AfPIF · Presentaon history § 1.1: – MENOG 13 mee:ng, Kuwait City, Sep 2013 § 1.2: – SEE 3 mee:ng, Sofia, Apr 2014 § 1.3: – AfPIF

Touchingground:howdatawouldlooklike:internaltrafficmatrixexample(2/2)

mysql> SELECT * FROM int_tm-20130803_1400 LIMIT 10; +----------+-------------+-------------+-------------+------------------+-------+ | iface_in | peer_ip_src | peer_ip_dst | peer_dst_as | stamp_inserted | bytes | +----------+-------------+-------------+-------------+------------------+-------+ | 212 | 10.0.0.107 | 10.0.0.3 | 65000 | 03-08-2013 14:00 | 859 | | 212 | 10.0.0.107 | 10.0.0.253 | 65001 | 03-08-2013 14:00 | 5358 | | 212 | 10.0.0.107 | 10.0.0.234 | 65002 | 03-08-2013 14:00 | 6181 | | 212 | 10.0.0.107 | 10.0.0.251 | 65003 | 03-08-2013 14:00 | 27002 | | 205 | 10.0.0.107 | 10.0.0.233 | 65004 | 03-08-2013 14:00 | 1200 | | 258 | 10.0.0.107 | 10.0.0.240 | 65005 | 03-08-2013 14:00 | 560 | | 212 | 10.0.0.107 | 10.0.0.252 | 65006 | 03-08-2013 14:00 | 62682 | | 212 | 10.0.0.107 | 10.0.0.234 | 65007 | 03-08-2013 14:00 | 3843 | | 212 | 10.0.0.107 | 10.0.0.17 | 65008 | 03-08-2013 14:00 | 21074 | | 205 | 10.0.0.107 | 10.0.0.254 | 65009 | 03-08-2013 14:00 | 2023 | +----------+-----------+---------------+-----------------+--------------+-------+ 10 rows in set (0.03 sec)

Getting ingress NetFlow from 10.0.0.7 Time reference

Here is our matrix Here is our matrix Here is our matrix Here is our matrix

Amount of traffic sent in the time window 14:00 – 14:05

Page 39: Collec:ng telemetry data with pmacct - AfPIF · Presentaon history § 1.1: – MENOG 13 mee:ng, Kuwait City, Sep 2013 § 1.2: – SEE 3 mee:ng, Sofia, Apr 2014 § 1.3: – AfPIF

Case-study:peeringatAS286[year2009]

Nego:a:on

Engineering

Produc:on

Op:miza:on

§  Peeringasacycle§  NetFlow+BGPtrafficmatrix

steerspeeringop:miza:on:•  Iden:fynewand“old”peers•  Trafficanalysis:backbone

costs,95thpercen:les,ra:os•  Analysisofinterconnec:on

densityandtrafficdispersion•  Forecas:ngandtrending•  Ad-hocqueriesfromDesign

&Engineeringandindeed…theIPTProductManager

Page 40: Collec:ng telemetry data with pmacct - AfPIF · Presentaon history § 1.1: – MENOG 13 mee:ng, Kuwait City, Sep 2013 § 1.2: – SEE 3 mee:ng, Sofia, Apr 2014 § 1.3: – AfPIF

§  250+Gbpsrou:ng-domain§  100+high-endroutersaround

theglobe:•  ExportsampledNetFlow•  Adver:sefullrou:ngtable•  MixofJuniperandCisco

§  Collectorenvironment:•  Runson2Solaris/SPARCzones•  pmacct:dual-core,4GBRAM•  MySQL:quad-core,24GBRAM,

500GBdisk§  Datareten:on:6months

AS286rou:ngdomain

pmacct

MySQL

Internalusers

Case-study:peeringatAS286[year2009]

Page 41: Collec:ng telemetry data with pmacct - AfPIF · Presentaon history § 1.1: – MENOG 13 mee:ng, Kuwait City, Sep 2013 § 1.2: – SEE 3 mee:ng, Sofia, Apr 2014 § 1.3: – AfPIF

§  AS286backboneroutersarefirstconfiguredfromtemplates:•  NetFlow+BGPcollectorIPaddressdefinedoverthere•  Enablerforauto-discoveryofnewdevices

§  Edgeinterfacesareprovisionedfollowingservicedeliverymanuals:•  RelevantmanualsandTSDsincludeNetFlowac:va:on•  PeriodicchecksNetFlowisac:vewhereitshould

§  Maps,ie.sourcepeer-AStoingressinterfaces,arere-builtperiodically

Case-study:peeringatAS286[year2009]

Page 42: Collec:ng telemetry data with pmacct - AfPIF · Presentaon history § 1.1: – MENOG 13 mee:ng, Kuwait City, Sep 2013 § 1.2: – SEE 3 mee:ng, Sofia, Apr 2014 § 1.3: – AfPIF

Agenda

§  Introduc:on§  pmacctarchitecture&benefits§  example,dataaggrega:on:trafficmatrices§  example,loggingmicro-flowsorevents§  tee:brieflyonhorizontalscalability

AfPIF2017,Abidjan–Aug2017

Collec:ngtelemetrydatawithpmacct

Page 43: Collec:ng telemetry data with pmacct - AfPIF · Presentaon history § 1.1: – MENOG 13 mee:ng, Kuwait City, Sep 2013 § 1.2: – SEE 3 mee:ng, Sofia, Apr 2014 § 1.3: – AfPIF

pmacct,logging&flat-files:briefhistory(1/2)

§  OriginallypmacctwasaboutmemorytablesandRDBMS(noflat-files)

§  Itwasalsoaboutdataaggrega:on(nologgingmicro-flows)

§  Othertoolsweredoingthisgreatlyalready–be\erinvestinnewideas

§  In2011pmacctopenedtoflat-files(seenextslide)

Page 44: Collec:ng telemetry data with pmacct - AfPIF · Presentaon history § 1.1: – MENOG 13 mee:ng, Kuwait City, Sep 2013 § 1.2: – SEE 3 mee:ng, Sofia, Apr 2014 § 1.3: – AfPIF

pmacct,logging&flat-files:briefhistory(2/2)

§  InrecentyearsthelandscapechangedandNetFlowandIPFIXprotocolswerebeinggeneralizedbesidesflows

§  No:ceably,theyenteredintheEventLoggingspace,ie.:•  CiscoNEL,ie.(CG)NATevents•  CiscoNSEL,ie.securityevents

§  Thiswasgreat:metoreviewthestrategyaroundflat-filesandlogging(ofeventsand,asaconsequence,ofmicro-flows)

Page 45: Collec:ng telemetry data with pmacct - AfPIF · Presentaon history § 1.1: – MENOG 13 mee:ng, Kuwait City, Sep 2013 § 1.2: – SEE 3 mee:ng, Sofia, Apr 2014 § 1.3: – AfPIF

Logginguse-cases

§ Micro-flows:•  R&D,labac:vi:es•  Security,DDoSdetec:on,forensics•  Relatedtodataaggrega:on:

§ Analysis,temporary:elaborateaggrega:onmethods§ Back-up,permanent:keeprawdataincaseuseful

§  Events:•  NATevents:compliancywithlocalauthori:es•  FWevents:securityreports

Page 46: Collec:ng telemetry data with pmacct - AfPIF · Presentaon history § 1.1: – MENOG 13 mee:ng, Kuwait City, Sep 2013 § 1.2: – SEE 3 mee:ng, Sofia, Apr 2014 § 1.3: – AfPIF

Loggingfeatures

§  Splitdatainfilesanddirectoriesbasingon:meofthedayand(some)primi:vevalues,ie.:•  5mins,hourly,dailyfiles(fullycustomizable)•  IPaddressoftelemetryexporter

§  Canappendtoanexis:ngfile:ie.hourlyfilesbutrefreshedevery5mins

§  Filescanbethenarchivedrightawayviatriggers,print_trigger_exec)

§  Pointertolatestfilein:me-series

Page 47: Collec:ng telemetry data with pmacct - AfPIF · Presentaon history § 1.1: – MENOG 13 mee:ng, Kuwait City, Sep 2013 § 1.2: – SEE 3 mee:ng, Sofia, Apr 2014 § 1.3: – AfPIF

Loggingdataformats

§  Textformatssupported:tab-spaced,CSVandJSON•  CSV:quickestserializa:on,notself-descrip:ve•  JSON:verbose,(hence)slowertoserialize,self-descrip:ve

§  Binaryformatsupported:ApacheAvro•  Spaceefficient,schema-based,indirectaccess•  GPBbeingavoided•  MayberevisitCap’nProtoinfuture

Page 48: Collec:ng telemetry data with pmacct - AfPIF · Presentaon history § 1.1: – MENOG 13 mee:ng, Kuwait City, Sep 2013 § 1.2: – SEE 3 mee:ng, Sofia, Apr 2014 § 1.3: – AfPIF

Touchingground:aconfigsnippetforloggingmicro-flows

plugins: print[forensics] !

aggregate[forensics]: src_host, dst_host, \

peer_src_ip, peer_dst_ip, in_iface, out_iface, \

timestamp_start, timestamp_end, src_port, \

dst_port, proto, tos, src_mask, dst_mask, src_as, \

dst_as, tcpflags

!

print_output_file[forensics]: /path/to/forensics-%Y%m%d_%H%M.txt

print_output[forensics]: csv

print_refresh_time[forensics]: 300

print_history[forensics]: 5m

print_output_file_append[forensics]: true

!

print_latest_file[forensics]: /path/to/forensics-latest

! <rest of config skipped>

Micro-flow (de)aggregation

Dynamic file names, ie.: forensics-20130803_1400

[ formatted, csv, json ]

Insert data every 5 mins, append to file if exists

Insert data every 5 mins, append to file if exists

Pointer to latest file to become optional and explicitly configured

Insert data every 5 mins, append to file if exists

Page 49: Collec:ng telemetry data with pmacct - AfPIF · Presentaon history § 1.1: – MENOG 13 mee:ng, Kuwait City, Sep 2013 § 1.2: – SEE 3 mee:ng, Sofia, Apr 2014 § 1.3: – AfPIF

Touchingground:howdatawouldlooklike:loggingmicro-flows(1/2)

shell> ls –la …

-rw------- 1 pmacct pmacct <size> Aug 02 13:50 forensics-20130802-1345.txt

-rw------- 1 pmacct pmacct <size> Aug 02 13:55 forensics-20130802-1350.txt

-rw------- 1 pmacct pmacct <size> Aug 02 14:00 forensics-20130802-1355.txt

-rw------- 1 pmacct pmacct <size> Aug 02 14:05 forensics-20130802-1400.txt

lrwxrwxrwx 1 pmacct pmacct 10 Aug 02 14:05 forensics-latest -> /path/to/forensics-20130802-1400.txt

Pointer to latest finalized file

Configurable ownership

Page 50: Collec:ng telemetry data with pmacct - AfPIF · Presentaon history § 1.1: – MENOG 13 mee:ng, Kuwait City, Sep 2013 § 1.2: – SEE 3 mee:ng, Sofia, Apr 2014 § 1.3: – AfPIF

Touchingground:howdatawouldlooklike:loggingmicro-flows(2/2)

shell> cat forensics-latest

SRC_AS,DST_AS,PEER_SRC_IP,PEER_DST_IP,IN_IFACE,OUT_IFACE,SRC_IP,DST_IP,SRC_MASK,DST_MASK,SRC_PORT,DST_PORT,TCP_FLAGS,PROTOCOL,TOS,TIMESTAMP_START,TIMESTAMP_END,PACKETS,BYTES 65001,65002,10.0.0.1,10.0.0.100,101,8,192.168.158.133,192.168.126.141,24,24,61912,22,24,tcp,16,2013-08-04 17:40:12.167216,2013-08-04 17:41:36.140279,21,1407

[ .. ]

Page 51: Collec:ng telemetry data with pmacct - AfPIF · Presentaon history § 1.1: – MENOG 13 mee:ng, Kuwait City, Sep 2013 § 1.2: – SEE 3 mee:ng, Sofia, Apr 2014 § 1.3: – AfPIF

Touchingground:aconfigsnippetforloggingNATevents

plugins: print[cgn] !

aggregate[cgn]: src_host, post_nat_src_host, src_port, \

post_nat_src_port, proto, nat_event, timestamp_start

!

print_output_file[cgn]: /path/to/cgn-%Y%m%d_%H%M.txt

print_output[cgn]: json

print_refresh_time[cgn]: 300

print_history[cgn]: 5m

print_cache_entries[cgn]: 9999991

print_output_file_append[cgn]: true

! <rest of config skipped>

Well-defined NAT event

Bigger cache size to cope with increased number of records

NOTE 2: a bigger cache is beneficial to limit scattering of writes to the backend. If the configured cache is unable to contain all records, a purge of data to the backend is triggered and cache content is

flushed so to make room to new data.

NOTE 1: see config snippet for micro-flows (a few slides back) for additional comments on configuration directives listed above.

Let’s increase readability J

Page 52: Collec:ng telemetry data with pmacct - AfPIF · Presentaon history § 1.1: – MENOG 13 mee:ng, Kuwait City, Sep 2013 § 1.2: – SEE 3 mee:ng, Sofia, Apr 2014 § 1.3: – AfPIF

Touchingground:howdatawouldlooklike:loggingNATevents(1/2)

shell> ls –la …

-rw------- 1 pmacct pmacct <size> Aug 02 13:50 cgn-20130802-1345.txt

-rw------- 1 pmacct pmacct <size> Aug 02 13:55 cgn-20130802-1350.txt

-rw------- 1 pmacct pmacct <size> Aug 02 14:00 cgn-20130802-1355.txt

-rw------- 1 pmacct pmacct <size> Aug 02 14:05 cgn-20130802-1400.txt

lrwxrwxrwx 1 pmacct pmacct 10 Aug 02 14:05 cgn-latest -> /path/to/cgn-20130802-1400.txt

Page 53: Collec:ng telemetry data with pmacct - AfPIF · Presentaon history § 1.1: – MENOG 13 mee:ng, Kuwait City, Sep 2013 § 1.2: – SEE 3 mee:ng, Sofia, Apr 2014 § 1.3: – AfPIF

Touchingground:howdatawouldlooklike:loggingNATevents(2/2)

shell> cat cgn-latest

{"timestamp_start": "2013-02-21 16:56:33.518000000", "ip_proto": "tcp", "post_nat_ip_src": ”1.2.179.16", "ip_src": ”192.168.37.51", "port_src": 61020, "nat_event": 1, "post_nat_port_src": 31392} [ .. ]

Page 54: Collec:ng telemetry data with pmacct - AfPIF · Presentaon history § 1.1: – MENOG 13 mee:ng, Kuwait City, Sep 2013 § 1.2: – SEE 3 mee:ng, Sofia, Apr 2014 § 1.3: – AfPIF

Asingle(setof)collector(s)forbothmicro-flowsandeventslogging?

§  Yes,possible:•  AllNetFlow,regardless,pointedtothesameplace•  Makessenseonsmall-mediumdeployments•  Onlargeronespoten:allypressuringthe(samesetof)collector(s)with,say,anongoingDDoSandaCGNbladereboo:ngisnotagoodidea.Goforspli|ng.

§  pmacctabletotagandchannelizedata(ie.senddataselec:velytoplugins)basingonanumberofclauses

Page 55: Collec:ng telemetry data with pmacct - AfPIF · Presentaon history § 1.1: – MENOG 13 mee:ng, Kuwait City, Sep 2013 § 1.2: – SEE 3 mee:ng, Sofia, Apr 2014 § 1.3: – AfPIF

Touchingground:aconfigsnippetforbothmicro-flowsandeventlogging(1/2)plugins: print[forensics], print[cgn] ! pre_tag_filter[forensics]: 10 aggregate[forensics]: <micro-flows aggregation method> print_output_file[forensics]: /path/to/forensics-%Y%m%d_%H%M.txt ! pre_tag_filter[cgn]: 20 aggregate[cgn]: <NAT events aggregation method> print_output_file[cgn]: /path/to/cgn-%Y%m%d_%H%M.txt print_cache_entries[cgn]: 9999991 ! print_output: csv print_refresh_time: 300 print_output_file_append: true ! pre_tag_map: /path/to/pretag.map ! <rest of config skipped>

NOTE: This configuration merely merges the micro-flows and event logging configurations seen before. Check them out (a few slides back) for additional comments on configuration directives listed above.

Enabler for channelizing data to the correct plugin

instance: map to assign tags to records

Allowing only flows through (see next slide)

Allowing only events through (see next slide)

Page 56: Collec:ng telemetry data with pmacct - AfPIF · Presentaon history § 1.1: – MENOG 13 mee:ng, Kuwait City, Sep 2013 § 1.2: – SEE 3 mee:ng, Sofia, Apr 2014 § 1.3: – AfPIF

Touchingground:aconfigsnippetforbothmicro-flowsandeventlogging(2/2)shell> cat pretag.map

set_tag=10 ip=0.0.0.0/0 sample_type=flow

set_tag=20 ip=0.0.0.0/0 sample_type=event

Tags are assigned in pretag.map and recalled in the configuration by pre_tag_filter

Tags are assigned in pretag.map and recalled in the configuration by pre_tag_filter

Apply to all NetFlow/IPFIX exporters

Apply to all NetFlow/IPFIX exporters

Apply heuristics to classify records among flows and

events

Apply heuristics to classify records among flows and

events

Page 57: Collec:ng telemetry data with pmacct - AfPIF · Presentaon history § 1.1: – MENOG 13 mee:ng, Kuwait City, Sep 2013 § 1.2: – SEE 3 mee:ng, Sofia, Apr 2014 § 1.3: – AfPIF

Agenda

§  Introduc:on§  pmacctarchitecture&benefits§  example,dataaggrega:on:trafficmatrices§  example,loggingmicro-flowsorevents§  tee:brieflyonhorizontalscalability

AfPIF2017,Abidjan–Aug2017

Collec:ngtelemetrydatawithpmacct

Page 58: Collec:ng telemetry data with pmacct - AfPIF · Presentaon history § 1.1: – MENOG 13 mee:ng, Kuwait City, Sep 2013 § 1.2: – SEE 3 mee:ng, Sofia, Apr 2014 § 1.3: – AfPIF

Brieflyonscalability§  Asinglecollectormightnotfititall:•  Memory:can’tstoreallBGPfullrou:ngtables•  CPU:can’tcopewiththepaceoftelemetryexport

§  Divide-et-imperaapproachisvalid:•  AssignPEs(bothtelemetryandBGP)tocollectors•  Ifna:velysupportedDB:

§ AssigncollectorstoDBnodes§ ClustertheDB

•  Ifnot-na:velysupportedDB:§ Assigncollectorstomessagebrokers§ Clusterthemessaginginfrastructure

Page 59: Collec:ng telemetry data with pmacct - AfPIF · Presentaon history § 1.1: – MENOG 13 mee:ng, Kuwait City, Sep 2013 § 1.2: – SEE 3 mee:ng, Sofia, Apr 2014 § 1.3: – AfPIF

Brieflyonscalability(cont.d)§  Intui:vely,thematrixcanbecomebig:•  Canbereducedbyexcludingen::esnegligibletothespecificscenario:§ Keepsmallerroutersoutoftheequa:on§  Filteroutspecific(classof)customers§  FocusondownstreamifCDN,upstreamifISP§  Sampleorputthresholdsontrafficrelevance

Page 60: Collec:ng telemetry data with pmacct - AfPIF · Presentaon history § 1.1: – MENOG 13 mee:ng, Kuwait City, Sep 2013 § 1.2: – SEE 3 mee:ng, Sofia, Apr 2014 § 1.3: – AfPIF

Needforhorizontalscalabilityinatelemetrycollector

§  High-frequencysampling(ie.security)§  Copewithincreasingdatarates:•  10Gto100Gbut,dependingontheapplica:on,samplingratesmightstaythesame

•  Eventslogging:ie.NetFlowchallengesSysloginthespaceofloggingCarrierGradeNAT(CGN)andfirewallevents

§  Scalewithoutsuper-compu:ngpowers

Page 61: Collec:ng telemetry data with pmacct - AfPIF · Presentaon history § 1.1: – MENOG 13 mee:ng, Kuwait City, Sep 2013 § 1.2: – SEE 3 mee:ng, Sofia, Apr 2014 § 1.3: – AfPIF

pmacct&horizontalscaling

§  Supportsa‘tee’plugin•  Receiverscanbeadded/changed/removedonthefly•  Load-balencedtee’ing(hashedorround-robin)•  Selec:vetee’ing

§ Mul:plepmacctcollectorscanruninparallel•  Couplingtelemetryandrou:ngdatafromsamePE

Page 62: Collec:ng telemetry data with pmacct - AfPIF · Presentaon history § 1.1: – MENOG 13 mee:ng, Kuwait City, Sep 2013 § 1.2: – SEE 3 mee:ng, Sofia, Apr 2014 § 1.3: – AfPIF

Touchingground:aconfigsnippetfortransparenthashingbalancer(1/2)

plugins: tee[balancer] !

plugin_buffer_size[blabla]: 100000

plugin_pipe_zmq[blabla]: true

!

tee_receivers[balancer]: /path/to/tee_receivers.lst

tee_transparent: true

Instantiating a tee plugin

File containing receivers definitions

Transparent balancing enabled. Disabling it acts as

a proxy

Queueing and buffering to handle sustained packet

rates

Queueing and buffering to handle sustained packet

rates

Page 63: Collec:ng telemetry data with pmacct - AfPIF · Presentaon history § 1.1: – MENOG 13 mee:ng, Kuwait City, Sep 2013 § 1.2: – SEE 3 mee:ng, Sofia, Apr 2014 § 1.3: – AfPIF

Touchingground:aconfigsnippetfortransparenthashingbalancer(2/2)

shell> cat tee_receivers.lst

id=1 \

ip=192.168.5.1:2100,192.168.5.2:2100,192.168.5.3:2100 \

balance-alg=hash-agent

Page 64: Collec:ng telemetry data with pmacct - AfPIF · Presentaon history § 1.1: – MENOG 13 mee:ng, Kuwait City, Sep 2013 § 1.2: – SEE 3 mee:ng, Sofia, Apr 2014 § 1.3: – AfPIF

Touchingground:aconfigsnippetfortransparentselec:vebalancer(1/2)

plugins: tee[balancer] !

plugin_buffer_size[blabla]: 100000

plugin_pipe_zmq[blabla]: true

!

tee_receivers[balancer]: /path/to/tee_receivers.lst

tee_transparent: true

!

pre_tag_map: /path/to/pretag.map

NOTE: see config snippet for transparent hashing balancer (a few slides back) for additional comments on configuration directives listed above.

Enabler for selective balancing: map to assign tags

to NetFlow/IPFIX exporters

Page 65: Collec:ng telemetry data with pmacct - AfPIF · Presentaon history § 1.1: – MENOG 13 mee:ng, Kuwait City, Sep 2013 § 1.2: – SEE 3 mee:ng, Sofia, Apr 2014 § 1.3: – AfPIF

Touchingground:aconfigsnippetfortransparentselec:vebalancer(2/2)

shell> cat tee_receivers.lst

id=2 ip=192.168.4.1:2100 tag=100id=3 ip=192.168.4.2:2100 tag=200

shell> cat pretag.map

set_tag=100 ip=10.0.0.0/25

set_tag=200 ip=10.0.0.128/25

Tags are assigned in pretag.map and recalled in

tee_receivers.lst

Tags are assigned in pretag.map and recalled in

tee_receivers.lst

Page 66: Collec:ng telemetry data with pmacct - AfPIF · Presentaon history § 1.1: – MENOG 13 mee:ng, Kuwait City, Sep 2013 § 1.2: – SEE 3 mee:ng, Sofia, Apr 2014 § 1.3: – AfPIF

Furtherinforma:onaboutpmacct

§  h\ps://github.com/pmacct/pmacct•  OfficialGitHubrepository,wherestarandwatchusJ

§  h\p://www.pmacct.net/lucente_pmacct_uknof14.pdf•  MoreaboutcouplingtelemetryandBGP

§  h\p://ripe61.ripe.net/presenta:ons/156-ripe61-bcp-planning-and-te.pdf•  Moreabouttrafficmatrices,capacityplanning&TE

§  h\ps://github.com/pmacct/pmacct/wiki/•  Wiki:docs,implementa:onnotes,ecosystem,etc.

Page 67: Collec:ng telemetry data with pmacct - AfPIF · Presentaon history § 1.1: – MENOG 13 mee:ng, Kuwait City, Sep 2013 § 1.2: – SEE 3 mee:ng, Sofia, Apr 2014 § 1.3: – AfPIF

Thanks!Ques:ons?

PaoloLucente<[email protected]>

h\p://www.pmacct.net/|h\ps://github.com/pmacct/pmacct

AfPIF2017,Abidjan–Aug2017

Collec:ngtelemetrydatawithpmacct

Page 68: Collec:ng telemetry data with pmacct - AfPIF · Presentaon history § 1.1: – MENOG 13 mee:ng, Kuwait City, Sep 2013 § 1.2: – SEE 3 mee:ng, Sofia, Apr 2014 § 1.3: – AfPIF

Backupslides

Collec:ngtelemetrydatawithpmacct

AfPIF2017,Abidjan–Aug2017

Page 69: Collec:ng telemetry data with pmacct - AfPIF · Presentaon history § 1.1: – MENOG 13 mee:ng, Kuwait City, Sep 2013 § 1.2: – SEE 3 mee:ng, Sofia, Apr 2014 § 1.3: – AfPIF

Post-processingRDBMSandrepor:ng(1/2)§  TrafficdeliveredtoaBGPpeer,perloca:on: mysql> SELECT peer_as_dst, peer_ip_dst, SUM(bytes), stamp_inserted

FROM acct_bgp

WHERE peer_as_dst = <peer | customer | IP transit> AND

stamp_inserted = < today | last hour | last 5 mins >

GROUP BY peer_as_dst, peer_ip_dst;§  AggregateASPATHstothesecondhop:mysql> SELECT SUBSTRING_INDEX(as_path, ‘.’, 2) AS as_path, bytes

FROM acct_bgp

WHERE local_pref = < IP transit pref> AND

stamp_inserted = < today | yesterday | last week >

GROUP BY SUBSTRING_INDEX(as_path, ‘.’, 2)

ORDER BY SUM(bytes);

§  Focuspeakhour(say,8pm)data:mysql> SELECT … FROM … WHERE stamp_inserted LIKE ‘2010-02-% 20:00:00’

Page 70: Collec:ng telemetry data with pmacct - AfPIF · Presentaon history § 1.1: – MENOG 13 mee:ng, Kuwait City, Sep 2013 § 1.2: – SEE 3 mee:ng, Sofia, Apr 2014 § 1.3: – AfPIF

§  Trafficbreakdown,ie.topNgroupingBGPpeersofthesamekind(ie.peers,customers,transit):

mysql> SELECT … FROM … WHERE …

local_pref = <<peer | customer | IP transit> pref>

§  Downloadtrafficmatrix(orasubsetofit)to3rdpartybackboneplanning/trafficengineeringapplica:on(ie.Cariden,Wandl,etc.):

mysql> SELECT peer_ip_src, peer_ip_dst, bytes, stamp_inserted

FROM acct_bgp

WHERE [ peer_ip_src = <location A> AND

peer_ip_dst = <location Z> AND … ]

stamp_inserted = < today | last hour | last 5 mins >

GROUP BY peer_ip_src, peer_ip_dst;

Post-processingRDBMSandrepor:ng(2/2)