Top Banner
Implemen’ng BGP Flowspec at IP transit network Dmitry Onuchin root@core# show magic class-map type traffic match-all fs_ex match destination-address ipv4 a.b.c.d/32 match protocol udp match destination-port 137-139 80 8080 end-class-map policy-map type pbr fs_table_ex class type traffic fs_ex police rate 8000 bps class class-default end-policy-map
24

Implementing BGP Flowspec at IP transit network

Jan 22, 2018

Download

Internet

Pavel Odintsov
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: Implementing BGP Flowspec at IP transit network

Implemen'ngBGP Flowspec atIPtransitnetwork

DmitryOnuchin

root@core# show magic class-map type traffic match-all fs_ex match destination-address ipv4 a.b.c.d/32 match protocol udp match destination-port 137-139 80 8080 end-class-map policy-map type pbr fs_table_ex class type traffic fs_ex police rate 8000 bps class class-default end-policy-map

Page 2: Implementing BGP Flowspec at IP transit network

BGPFlowspec

About:–  RFC5575–  AnnounceFlowSpecifica-onviaBGP–  Itcanberepresentedasdistributedaccess-listontheoperator`snetwork

–  OBenusedtopreventsometypesofDDoSaEacksonthefourthlevelofOSI(Amplifica'on/UDPflood)

Page 3: Implementing BGP Flowspec at IP transit network

FlowSpecifica5onOp'ons(NLRI):1.  Des'na'onprefix2.  Sourceprefix3.  IPprotocol4.  Port5.  Des'na'onport6.  Sourceport7.  ICMPtype8.  ICMPcode9.  TCPflags10.  Packetlength11.  DSCP12.  Fragment

Ac'ons(extended-community):•  Traffic-rate•  Traffic-ac'on•  Redirect•  Traffic-marking

Page 4: Implementing BGP Flowspec at IP transit network

Typicala9ackscenario(beforeddos)

Page 5: Implementing BGP Flowspec at IP transit network

Typicala9ackscenario(ddos)

Page 6: Implementing BGP Flowspec at IP transit network

Typicala9ackscenario(usingflowspec)

Page 7: Implementing BGP Flowspec at IP transit network

Discussedimplementa5onop5ons•  Enableaddress-familyIPv4/IPv6flowspeconPEroutersandcustomer

sessions:–  Rulesvalida'on?(vendor-specific,more-specific,etc)–  Youcan“lose”therouterreceivingthewrongrules–  NeedhardwaresupportforBGPFlowspec

•  WritesoBware(BGPFScontroller):–  Thepossibilityofanytypeofvalida'on–  Separa'onoftheoperator'snetworkfromclientsessionsBGPFS–  Abilitytosetruleswithouthardwaresupportfromtheclient–  Scaling

Page 8: Implementing BGP Flowspec at IP transit network

Flowspecrulevalida5on

•  Musthavedes5na5onprefix•  Des5na5onprefixmustbebestonoperator`snetworkandreceivedfromcustomersession

•  Denyportspecifica'on(dst/src)isnotinprotocolstcp/udp

•  Denytcp-flagisnotinprotocoltcp•  Denyicmp-type/codeisnotinprotocolicmp•  Limita'onswithregardtotheequipmentusedonthenetwork(vendor-specific).

Page 9: Implementing BGP Flowspec at IP transit network

Implemen5ngBGPFlowspec(stage1)

Page 10: Implementing BGP Flowspec at IP transit network

Implemen5ngBGPFlowspec(stage2:+stat/mon)

Page 11: Implementing BGP Flowspec at IP transit network

Implemen5ngBGPFlowspec(stage3:+web)

Page 12: Implementing BGP Flowspec at IP transit network

Sta5s5cs/Monitoring

•  Collectsta's'csfromPErouters•  Sendmetricstoanalyze•  Periodicrevalida'onofrules•  Checkinstalledrulesonrouters

Page 13: Implementing BGP Flowspec at IP transit network

Webcustomerportal•  Sta's'csandcontrolrules•  Checkhistoryonflowspecrules•  Exportcounters(match/drop)injson•  PossibilitytosendFlowspec:–  Forcustomerswithouthardwaresupportbgpflowspec–  Incasesyoudonothaveaccesstotherouter–  Simple/fast/convenient

Page 14: Implementing BGP Flowspec at IP transit network

Installingflowspecviacustomerportal

Page 15: Implementing BGP Flowspec at IP transit network

GraphsexampleForcustomersinCustomerportal

AdminportalJ:

Page 16: Implementing BGP Flowspec at IP transit network

Rate-limit

CiscoASR9Kinstallsflowspecaspolicy-mapinput.

Page 17: Implementing BGP Flowspec at IP transit network

DDoSdetec5on•  AEacksonoverload(UDPFlood/Amplifica'on):

–  BGPFlowspecappliestoalmostallcases–  Detec'onisrela'velyinexpensive(Nellow/Sflow),includingonIPtransitnetwork

•  AEackstothenetworkstack(Syn/Ackflood,conntrack…):

–  BGPFlowspecrarelyused–  Detec'onontransitisnotalwayspossible

•  Applica'on-basedaEacks:–  BGPFlowspecnotapplicable–  Simpledetec'onontransitisimpossible(withoutDPIandanaly'cs)

Page 18: Implementing BGP Flowspec at IP transit network

Top10DDoSa9acksvectors(AKAMAI)BGPFlowspecapplicableinmorethan75%ofcases

Page 19: Implementing BGP Flowspec at IP transit network

Sta5s5cs(Rascomnetwork)Asampleof>5000realrules

Page 20: Implementing BGP Flowspec at IP transit network

Sta5s5cs(Rascomnetwork)

Page 21: Implementing BGP Flowspec at IP transit network

Sta5s5cs(Rascomnetwork)>85%ofthetrafficofddosa9acksdetectedusingBGPFlowspec(clientrules)comefromforeigninterfaces(mostlyTier1operators)

Page 22: Implementing BGP Flowspec at IP transit network

•  Hardwarelimita5on.Itisnotrecommendedtouseflowspecasapermanentaccess-listandalwaysremoveunused

•  Badvalida5on.Donottestthestrengthoftheoperator

(vendor)valida'onrulesandalwaysfollowtheRFC:–  FallCloudflarenetworkcore(matchpacket-length>64K)–  Duringthetests,theJunipervMX(RPDoutage)waslostseveral'mesbyincorrectrules

•  Understanding.Ifyoudonotunderstandbgpflowspecanditsapplica'ons,thendonotusethisservice.

Recommenda5ons

Page 23: Implementing BGP Flowspec at IP transit network

Developmentplans•  Theintroduc'onofthesecondcontrollerbasedonGoBGP

–  Reserva'on–  Insurancefrom"bugs"soBware

•  API–  Seqng/removingrules–  Sta's'cs(raw)–  Informing/removingrulesforwhichthereisnotraffic

•  Integra'onwiththeproductofthedetec'onofaEacksbasedonnellow/sflow

•  Improvementwebcustomerportal

Page 24: Implementing BGP Flowspec at IP transit network

Theend!

Ques'onsandsugges'ons-email:[email protected]

2017 root@core# cat flood > /dev/null