pmacct: introducing BGP natively into a NetFlow/sFlow collector



Similar documents
pmacct: introducing BGP na2vely into a NetFlow/sFlow collector

NetFlow & BGP multi-path: quo vadis?

NetFlow & BGP multi-path: quo vadis?

APNIC elearning: BGP Basics. Contact: erou03_v1.0

APNIC elearning: BGP Attributes

Advanced BGP Policy. Advanced Topics

BGP Attributes and Path Selection

Understanding Virtual Router and Virtual Systems

BGP Link Bandwidth. Finding Feature Information. Prerequisites for BGP Link Bandwidth

CS 457 Lecture 19 Global Internet - BGP. Fall 2011

The Value of Flow Data for Peering Decisions

Transitioning to BGP. ISP Workshops. Last updated 24 April 2013

Border Gateway Protocol BGP4 (2)

basic BGP in Huawei CLI

Simple Multihoming. ISP Workshops. Last updated 30 th March 2015

Configuring SNMP and using the NetFlow MIB to Monitor NetFlow Data

Edge-1#show ip route Routing entry for /24. Known via "bgp 65001", distance 200, metric 0. Tag 65300, type internal

BGP Convergence in much less than a second Clarence Filsfils - cf@cisco.com

Load balancing and traffic control in BGP

Bell Aliant. Business Internet Border Gateway Protocol Policy and Features Guidelines

Tutorial: Options for Blackhole and Discard Routing. Joseph M. Soricelli Wayne Gustavus NANOG 32, Reston, Virginia

NetFlow Aggregation. Feature Overview. Aggregation Cache Schemes

How To Understand Bg

BGP Link Bandwidth. Finding Feature Information. Contents

Using the Border Gateway Protocol for Interdomain Routing

Chapter 49 Border Gateway Protocol version 4 (BGP-4)

BGP Basics. BGP Uses TCP 179 ibgp - BGP Peers in the same AS ebgp - BGP Peers in different AS's Private BGP ASN. BGP Router Processes

Load balancing and traffic control in BGP

Simple Multihoming. ISP/IXP Workshops

Lecture 18: Border Gateway Protocol"

Border Gateway Protocol (BGP)

JUNOS Secure BGP Template

Exterior Gateway Protocols (BGP)

Brocade to Cisco Comparisons

BGP Best Path Selection Algorithm

Network Monitoring and Management NetFlow Overview

Understanding Route Redistribution & Filtering

Introduction to Netflow

Module 12 Multihoming to the Same ISP

Routing Protocol - BGP

E : Internet Routing

Passively Detecting Remote Connectivity Issues Using Flow Accounting. 2nd EMANICS Workshop on Netflow/IPFIX usage in network management

How To Set Up Bgg On A Network With A Network On A Pb Or Pb On A Pc Or Ipa On A Bg On Pc Or Pv On A Ipa (Netb) On A Router On A 2

Border Gateway Protocol Best Practices

MPLS. Cisco MPLS. Cisco Router Challenge 227. MPLS Introduction. The most up-to-date version of this test is at:

Traffic analysis with NetFlow

BGP Router Startup Message Flow

BGP Multihoming Techniques

Monitoring BGP and Route Leaks using OpenBMP and Apache Kafka

Quick Note 20. Configuring a GRE tunnel over an IPSec tunnel and using BGP to propagate routing information. (GRE over IPSec with BGP)

ETHEL THE AARDVARK GOES BGP ROUTING

RFC 2547bis: BGP/MPLS VPN Fundamentals

DDoS detection & mitigation

Cisco IOS Flexible NetFlow Technology

How More Specifics increase your transit bill (and ways to avoid it)

BGP Multihoming Techniques

Multiprotocol Label Switching Load Balancing

BGP4 Case Studies/Tutorial

Application Note: Securing BGP on Juniper Routers

Netflow Overview. PacNOG 6 Nadi, Fiji

Inter-domain Routing Basics. Border Gateway Protocol. Inter-domain Routing Basics. Inter-domain Routing Basics. Exterior routing protocols created to:

BGP Terminology, Concepts, and Operation. Chapter , Cisco Systems, Inc. All rights reserved. Cisco Public

ECSE-6600: Internet Protocols Exam 2

Understanding Route Aggregation in BGP

Advanced Routing. FortiOS Handbook v3 for FortiOS 4.0 MR3

Computer Networks. Introduc)on to Naming, Addressing, and Rou)ng. Week 09. College of Information Science and Engineering Ritsumeikan University

NetFlow/IPFIX Various Thoughts

How NOC manages and controls inter-domain traffic? 5 th tf-noc meeting, Dubrovnik nino.ciurleo@garr.it

IPv6 over MPLS VPN. Contents. Prerequisites. Document ID: Requirements

This feature was introduced. This feature was integrated in Cisco IOS Release 12.2(11)T.

LAB II: Securing The Data Path and Routing Infrastructure

How to Configure BGP Tech Note

Can Forwarding Loops Appear when Activating ibgp Multipath Load Sharing?

> Border Gateway Protocol (BGP-4) Technical Configuration Guide. Ethernet Routing Switch. Engineering

Methods of interconnecting MPLS Networks

Emerald. Network Collector Version 4.0. Emerald Management Suite IEA Software, Inc.

MPLS VPN Route Target Rewrite

DEMYSTIFYING ROUTING SERVICES IN SOFTWAREDEFINED NETWORKING

Flow Analysis. Make A Right Policy for Your Network. GenieNRM

Configuring a Load-Balancing Scheme

BGP Multihoming. Why Multihome? Why Multihome? Why Multihome? Why Multihome? Why Multihome? Redundancy. Reliability

MPLS-based Layer 3 VPNs

Configuring NetFlow Data Export (NDE)

Introduction to Cisco IOS Flexible NetFlow

Best Practices for Eliminating Risk from Routing Changes

Basic Configuration Examples for BGP

Network Configuration Example

Application Note. Failover through BGP route health injection

DDoS Mitigation Techniques

BGP Multihoming Techniques. Philip Smith APRICOT 2013 Singapore 19 th February 1 st March 2013

NetFlow Tracker Overview. Mike McGrath x ccie CTO mike@crannog-software.com

Troubleshooting Bundles and Load Balancing

Anycast Rou,ng: Local Delivery. Tom Daly, CTO h<p://dyn.com Up,me is the Bo<om Line

Chapter 7 Configuring Trunk Groups and Dynamic Link Aggregation

- Multiprotocol Label Switching -

Network Management & Monitoring

Transcription:

pmacct: introducing BGP natively into a NetFlow/sFlow collector Paolo Lucente the pmacct project AS286 <paolo at pmacct dot net> http://www.pmacct.net/ SwiNOG #19 meeting, Berne, 29 th Sep 2009

pmacct: introducing BGP natively into a NetFlow/sFlow collector Agenda I. Introduction II. Recent developments SwiNOG #19 meeting, Berne, 29 th Sep 2009

pmacct is open-source, free, GPL ed software

pmacct: where is it sitting?

pmacct: typical usage scenarios

pmacct: introducing BGP natively into a NetFlow/sFlow collector Agenda I. Introduction II. Recent developments SwiNOG #19 meeting, Berne, 29 th Sep 2009

The BGP peer who came from NetFlow (and sflow) pmacct introduces a Quagga-based BGP daemon Implemented as a parallel thread within the collector Doesn t send UPDATEs and WITHDRAWs whatsoever Behaves as a passive BGP neighbor Maintains per-peer BGP RIBs Supports 32-bit ASNs Supports both IPv4 and IPv6 Joins NetFlow (or sflow) and BGP data basing on: NetFlow source address == BGP source address

The BGP peer who came from NetFlow (and sflow) (cont.d) Relevant implementation details: Bases on trust: peers are not defined but a max number of peers who can connect is defined instead Ensures ibgp peering by presenting itself as part of the AS of the neighbor, as read in the OPEN message Enables the following traffic aggregation primitives: AS path, Local Preference, MED, Peer ASNs (freely mixed with origin ASNs), Communities, Peer IPs Caveats: BGP multi-path is not supported

The BGP peer who came from NetFlow (and sflow) illustrated

Theory applied, SQL example (1/3) shell> cat pmacct-create-db_bgp_v1.mysql [ ] BGP Fields create table acct_bgp ( Tag Counters Time ); agent_id INT(4) UNSIGNED NOT NULL, as_src INT(4) UNSIGNED NOT NULL, as_dst INT(4) UNSIGNED NOT NULL, peer_as_src INT(4) UNSIGNED NOT NULL, peer_as_dst INT(4) UNSIGNED NOT NULL, peer_ip_src CHAR(15) NOT NULL, shell> cat pretag.map peer_ip_dst CHAR(15) NOT NULL, id=100 peer_src_as=<customer> comms CHAR(24) NOT NULL, id=80 peer_src_as=<peer> as_path CHAR(21) NOT NULL, id=50 peer_src_as=<ip transit> local_pref INT(4) UNSIGNED NOT NULL, [ ] med INT(4) UNSIGNED NOT NULL, packets INT UNSIGNED NOT NULL, bytes BIGINT UNSIGNED NOT NULL, stamp_inserted DATETIME NOT NULL, stamp_updated DATETIME, PRIMARY KEY ( ) shell> cat peers.map id=65534 ip=x in=a id=65533 ip=y in=b src_mac=j id=65532 ip=z in=c bgp_nexthop=w [ ] shell> mysql -u root -p < pmacct-create-db_bgp_v1.mysql

Theory applied, SQL example (2/3) See traffic delivered to a specific BGP peer mysql> SELECT peer_as_dst, bytes, stamp_inserted \ FROM acct_bgp \ WHERE peer_as_dst = <peer customer IP transit> \ GROUP BY peer_as_dst Same as above but also per location if peering at multiple places mysql> SELECT peer_as_dst, peer_ip_dst, bytes, stamp_inserted \ FROM acct_bgp \ WHERE peer_as_dst = <peer customer IP transit> \ GROUP BY peer_as_dst, peer_ip_dst Simply replace dst with src in the above examples to see incoming traffic

Theory applied, SQL example (3/3) See outgoing traffic breakdown to all BGP peers of the same kind (ie. peers, customers, transit) mysql> SELECT peer_as_dst, bytes, stamp_inserted \ FROM acct_bgp \ WHERE local_pref = <<peer customer IP transit> pref> \ GROUP BY peer_as_dst

Why integrating BGP at the collector? One might argue validity of the work: hey, this all could have been done at the router!. Maintaining per-peer BGP RIBs at the collector has several advantages; some implemented: Follow default route, having the BGP RIB of the default gateway of a PE with partial BGP view or default-only Decouple NetFlow from BGP by mapping NetFlow agents to BGP peers Give better chances to the source peer-as (later)

Miscellaneous features implemented AS Path radius: AS PATHs can get long. This can easily get counter productive (ie. waste space) Cuts AS Path down to the specified number of AS hops. Assumption: people might be more interested into what happens around them. Communities pattern filter IP prefixes can have many communities attached Only a small subset might be relevant to the accounting infrastructure Hence filtering capabilities are made available

The source peer AS issue Traffic is traditionally routed to destination Problem #1: limited information about where traffic enters the AS domain. Applying this to traditional NetFlow it means: either origin ASNs OR peer ASNs Problem #2: asymmetric routing. Applying this to traditional NetFlow it means: FIB lookup on the source prefix; result: source peer AS is where traffic should have entered the AS domain, if it was symmetrical.

The source peer AS issue mitigated Having per-peer BGP RIBs on-board paves the way to capture both origin AND peer ASNs Source peer AS is statically mapped against: A whole port, ie. input port field. Source MAC address. Should be the way to go and depends on NetFlow v9 or sflow. BGP next-hop lookup against the source prefix: Only choice if running NetFlow v5 in scenarios where multiple peers are off a single port (ie. IXP) Accuracy is not really predictable Combine with input port to limit false positives

Auto-discovery of source peer ASNs Mix of: SNMP, bgp_neighbors_file feature and pmacct maps reloadable at runtime: Fetch all ebgp peers from bgppeertable Having local IP addresses fetch ifindex from ipaddrtable Detect multiple ebgp peers (ie. IXP scenarios) off the same (sub-)interface so that src_mac or bgp_nexthop can be appended. For example, check netmask length Detect ebgp multi-hops by checking ifindex against Loopback interfaces. If true, resolve in ipcidrtable Establish a small set of rules within your group, ie. when setting interface descriptions (ifalias)

Auto-discovery of source peer ASNs Router configuration template router bgp 65533 neighbor X remote-as 65533 neighbor X source-address 1.1.1.1 post-processing (ie. ipcidrtable) bgppeertable then ie. ipaddrtable shell> snmpwalk c secret \ 1.1.1.1 bgppeertable bgp_max_peers: 100 bgp_neighbors_file: routers.list bgp_peer_as_src_map: peers.map (reloadable at runtime) shell> cat routers.list 1.1.1.1... ifalias shell> cat peers.map id=65534 ip=1.1.1.1 in=1

The case of entities on the provider For such entities: IP address space AS PATH would be empty; origin and peer ASNs would be NULL. Problem: how to recognize them? Include IP prefix information in the DB structure: cumbersome and wouldn t scale. Split approach: Source: map ifindexes or MAC addresses to peer AS Destination: rely on BGP communities

The case of entities on the provider IP address space (cont.d) Ad-hoc feature (bgp_stdcomm_pattern_to_asn): Prerequisite: entities on the provider IP address space get tagged with a standard BGP community. You are in full control of the granularity of the assignment. pmacct config: bgp_stdcomm_pattern_to_asn: XXX:Y.. Say, an entity is tagged with community XXX:YYY; XXX value is mapped to the peer AS; YYY value is mapped to the origin AS. Works transparently for both sources and destinations; in future can make use of extended BGP communities.

Miscellaneous implementation details A BGP RIB of ~275-290K entries accounts for some 35-40MB of memory. Multiply this by the number of peers giving the full table. Attributes table is shared amongst all the RIBs; it typically takes ~10MB of memory. BGP RIB implements a binary tree; attributes table implements hashing. RIB entries have pointers to attributes; once an attribute is not referenced by any RIB entry, it is removed.

pmacct: introducing BGP natively into a NetFlow/sFlow collector Thanks for your attention! Questions? Paolo Lucente the pmacct project AS286 <paolo at pmacct dot net> http://www.pmacct.net/ SwiNOG #19 meeting, Berne, 29 th Sep 2009