Top Banner
BGP Flow specification Update David Lambert [email protected]
21

BGP Flow specification Update David Lambert [email protected].

Dec 26, 2015

Download

Documents

Baldric Hardy
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: BGP Flow specification Update David Lambert djl@juniper.net.

BGP Flow specification Update

David [email protected]

Page 2: BGP Flow specification Update David Lambert djl@juniper.net.

What is BGP Flow-Spec• draft-marques-idr-flow-spec-XX.txt

• Defines a method for the originator of a BGP NLRI to define and advertise a flow filter to its upstream BGP peers via BGP.

• Multi vendor support • Co-authored with Cisco, Arbor, NTT/Verio

• Authors:– Jared Mauch – Danny McPherson– Robert Raszuk– Barry Greene– Pedro Marques– Nischal Sheth

Page 3: BGP Flow specification Update David Lambert djl@juniper.net.

What is BGP Flow-Spec

• New Address family for BGP– NLRI type (afi=1, safi=134 )

• Defines a way to carry “flow” in BGP– Sends a “component type” in a BGP update

• Defines operations to perform on flows– Sends an “action” in a BGP Update

• Defines a Model for ValidationAddress family identifier / sub address family indicator

Page 4: BGP Flow specification Update David Lambert djl@juniper.net.

Component Types

• T1 Destination Address• T2 Source Address• T3 IP Protocol• T4 Port ( source or dest )• T5 Destination port • T6 Source Port• T7 ICMP type• T8 ICMP code• T9 TCP flags • T10 Packet length• T11 DSCP• T12 Fragment Encoding

Page 5: BGP Flow specification Update David Lambert djl@juniper.net.

Actions

• Traffic-Rate

• Traffic-Action– Action ( set to “action or not “ )– Sample**** <<< fix this ( get explanation )

• Redirect– Send traffic to another VRF for collection

Page 6: BGP Flow specification Update David Lambert djl@juniper.net.

Flow Validation

• Need to validate by default to prevent spoofing

• Rules

a) The "originator" of a flow route matches the "originator" of thebest match unicast route for the destination address that is

embedded in the the route.

b) There are no more-specific unicast routes, when compared todestination address of the flow route, for which the active route

hasbeen received from a different next-hop autonomous-system.

Page 7: BGP Flow specification Update David Lambert djl@juniper.net.

Disabling Flow Validation

• No Validation is useful when you want central flow arbitration – But its validation with conditions

• Route policy

Page 8: BGP Flow specification Update David Lambert djl@juniper.net.

Disabling Validation

• Validate against a policyfamily inet {

flow {

no-validate <policy>; "Validation procedure is skipped for

routes that match this policy";

}

}

Page 9: BGP Flow specification Update David Lambert djl@juniper.net.

What can we do with it

• Allows Customers to set their own firewalls on SP core.– Validation rules will avoid spoofing of flow

NLRI

• Provides a tool for the NOC to quickly react to DDOS attacks.

Page 10: BGP Flow specification Update David Lambert djl@juniper.net.

A quick word on detection

• Easy on CPU based routers – Chances are the CPE router can already work out the attack vector

• Some challenges on ASIC based platform.– Can be done, but it costs Service Provider $$

• Try to push the detection/inspection to the edge if you can.– There is a stack of IDP box solutions out there– It makes sense to give the downstream the tools required

• Empower the downstream to work it out for you – Provide a back channel for DDOS traffic.

• Case of known attack ( worm announced )

• Enabling floespec can save the SP Time and Money

Page 11: BGP Flow specification Update David Lambert djl@juniper.net.

Flow-routes are a small part of picture

Data out of routerFlow ( Arbor )Mirror ( IDP )

AnalysisFlow analysisIDP inspection

vectorProcessFalse positive?

Flow route

FirewallConfig push

Very small but convenient way to distribute flow

Page 12: BGP Flow specification Update David Lambert djl@juniper.net.

Configuration Options Define FLOWrouting-options {

flow {route <name> { match {

destination;source ;protocol ;port ;destination-port ;source-port ;icmp-code ;icmp-type ;tcp-flags ;packet-length ;dscp ;fragment [ dont-fragment not-a-fragment is-fragment first-fragment last-fragment]

}

then { accept;

discard;next-term;rate-limit;sample;routing-instance;

}}

}}

[edit protocols bgp]group <name> { family inet flow;

neighbor <a.b.c.d> {family inet flow;

}}

Page 13: BGP Flow specification Update David Lambert djl@juniper.net.

Configuration Example Routing Options

• Define Flow routes

routing-options { flow { route filter { match destination 192.168.21.0/24; then { community test; rate-limit 32k; } } }}

Page 14: BGP Flow specification Update David Lambert djl@juniper.net.

Configuration example BGP

• Add family flow to BGP peers

Protocols { bgp { group int { type internal; local-address 20.2.2.2; family inet { unicast; flow; } neighbor 20.3.3.3;}

Page 15: BGP Flow specification Update David Lambert djl@juniper.net.

Configuration example

• Define Non-Validation

show protocols bgp group int { type internal; local-address 20.3.3.3; family inet { unicast; flow { no-validate test; } } neighbor 20.2.2.2;}

Page 16: BGP Flow specification Update David Lambert djl@juniper.net.

Diagnostics

• show route receive-protocol bgp • Shows received NLRI

• show route advertising-protocol bgp • Shows advertised NLRI

• show route flow• show active flow routes

• show route table inetflow.0• Shows actual defined flow routes ( from routing options )

• show firewall• Shows installed flow filters and counters

Page 17: BGP Flow specification Update David Lambert djl@juniper.net.

Show Firewalllab@Darstardly-re0#

lab@Darstardly-re0# run show firewall

Counters:Name Bytes Packets192.168.21/24,* 28672 112Policers:Name Packets 192.168.21/24,* 112

[edit]lab@Darstardly-re0#

Page 18: BGP Flow specification Update David Lambert djl@juniper.net.

Who’s using it

• Secret information !

Page 19: BGP Flow specification Update David Lambert djl@juniper.net.

Common Arguments

• Spoofing– Validation will prevent this

• Remote initiated black holeseducation will help

• Why BGP– Its there

• BGP instability • What's stopped auto configuration efforts in the past?

– As boundaries

– NO tools that work

Page 20: BGP Flow specification Update David Lambert djl@juniper.net.

Future Enhancements

• Community based firewall for flow routes– A Community match to reference a generic

firewall• Set forwarding class

• Why not in the draft?– Least common denominator

Page 21: BGP Flow specification Update David Lambert djl@juniper.net.

Alternatives

• What about RADB bogons list of common attack vectors

Its all pretty scary but flowspec is a little less scary