bgp - backbone of the internet 2 · “border gateway protocol(bgp) is a standardizedexterior...

51
BGP – The Backbone of the Internet Michael Kehoe Sr Staff Site Reliability Engineer

Upload: others

Post on 26-May-2020

8 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: BGP - Backbone of the Internet 2 · “Border Gateway Protocol(BGP) is a standardizedexterior gateway protocoldesigned to exchange routing and reachability information amongautonomous

BGP – The Backbone of the Internet

Michael KehoeSr Staff Site Reliability Engineer

Page 2: BGP - Backbone of the Internet 2 · “Border Gateway Protocol(BGP) is a standardizedexterior gateway protocoldesigned to exchange routing and reachability information amongautonomous

Today’s agenda

1 Introduction

2 Basics of BGP

3 History of BGP

4 Details of BGP

6 Conclusion

7 Q&A

Page 3: BGP - Backbone of the Internet 2 · “Border Gateway Protocol(BGP) is a standardizedexterior gateway protocoldesigned to exchange routing and reachability information amongautonomous

Introduction

Page 4: BGP - Backbone of the Internet 2 · “Border Gateway Protocol(BGP) is a standardizedexterior gateway protocoldesigned to exchange routing and reachability information amongautonomous

Michael Kehoe$ WHOAMI

• Sr Staff Site Reliability Engineer @ LinkedIn

• Infrastructure-SRE Team

• Worked on:

• Networks• Micro-services• Traffic Engineering• Databases

Page 5: BGP - Backbone of the Internet 2 · “Border Gateway Protocol(BGP) is a standardizedexterior gateway protocoldesigned to exchange routing and reachability information amongautonomous

What is BGP

Page 6: BGP - Backbone of the Internet 2 · “Border Gateway Protocol(BGP) is a standardizedexterior gateway protocoldesigned to exchange routing and reachability information amongautonomous

“Postal service of the internet”

C l o u d f l a r e

Page 7: BGP - Backbone of the Internet 2 · “Border Gateway Protocol(BGP) is a standardizedexterior gateway protocoldesigned to exchange routing and reachability information amongautonomous

“The slowest routing protocol in the world”

J e r e m y C i o a r a

Page 8: BGP - Backbone of the Internet 2 · “Border Gateway Protocol(BGP) is a standardizedexterior gateway protocoldesigned to exchange routing and reachability information amongautonomous

“Border Gateway Protocol (BGP) is a standardized exterior gateway protocol designed to exchange routing and reachability information

among autonomous systems (AS) on the Internet. The Border Gateway Protocol makes routing decisions based on paths, network policies, or rule-

sets configured by a network administrator and is involved in making core routing decisions.”

W i k i p e d i a

https://en.wikipedia.org/wiki/Border_Gateway_Protocol

Page 9: BGP - Backbone of the Internet 2 · “Border Gateway Protocol(BGP) is a standardizedexterior gateway protocoldesigned to exchange routing and reachability information amongautonomous

Basics of BGP

Page 10: BGP - Backbone of the Internet 2 · “Border Gateway Protocol(BGP) is a standardizedexterior gateway protocoldesigned to exchange routing and reachability information amongautonomous

What is BGP

Basics of BGP

• Exterior Gateway Protocol (EGP)

• Exchange routing & reachability information among AS on the public internet

• Can also be used within an AS –Interior Border Gateway Protocol (iBGP)

• Path Vector Protocol

• Layer 7 OSI Protocol (TCP/179)

https://datapath.io/resources/blog/the-history-of-border-gateway-protocol/https://www.routerfreak.com/ggp-egp-and-25-years-of-bgp-a-brief-history-of-internet-routing/

Page 11: BGP - Backbone of the Internet 2 · “Border Gateway Protocol(BGP) is a standardizedexterior gateway protocoldesigned to exchange routing and reachability information amongautonomous

History of BGP

Page 12: BGP - Backbone of the Internet 2 · “Border Gateway Protocol(BGP) is a standardizedexterior gateway protocoldesigned to exchange routing and reachability information amongautonomous

Before BGP

History of BGP

• First Internet message (1969)

• ARPRANET – (1971)

• GGP – RFC 823 (1982)

• EGP – RFC 904 (1984)

• RIP –RFC 1058 (1988)

https://datapath.io/resources/blog/the-history-of-border-gateway-protocol/https://www.routerfreak.com/ggp-egp-and-25-years-of-bgp-a-brief-history-of-internet-routing/

Page 13: BGP - Backbone of the Internet 2 · “Border Gateway Protocol(BGP) is a standardizedexterior gateway protocoldesigned to exchange routing and reachability information amongautonomous

Main BGP RFC’s

History of BGP

• BGPv1 – RFC 1105 (1989)

• BGPv2 – RFC 1163 (1990)

• BGPv3 – RFC 1267 (1991)

• BGPv4 –

• RFC 1771 (1995) – Original v4

• RFC 1883/ 2283 IPv6 support (1995/ 1998)

• RFC 4271 (2006) – Current v4

https://datapath.io/resources/blog/the-history-of-border-gateway-protocol/https://www.routerfreak.com/ggp-egp-and-25-years-of-bgp-a-brief-history-of-internet-routing/

Page 14: BGP - Backbone of the Internet 2 · “Border Gateway Protocol(BGP) is a standardizedexterior gateway protocoldesigned to exchange routing and reachability information amongautonomous

Key BGP Extensions

History of BGP

• Communities – RFC 1997 (1996)

• Multiprotocol Ext– RFC 2283 (1998)

• MD5 Hashing - RFC 2385 (1998)

• Flap Damping – RFC 2439 (1998)

• 32-bit AS Number– RFC 4893 (2007)

https://datapath.io/resources/blog/the-history-of-border-gateway-protocol/https://www.routerfreak.com/ggp-egp-and-25-years-of-bgp-a-brief-history-of-internet-routing/

Page 15: BGP - Backbone of the Internet 2 · “Border Gateway Protocol(BGP) is a standardizedexterior gateway protocoldesigned to exchange routing and reachability information amongautonomous

Details of BGP

Page 16: BGP - Backbone of the Internet 2 · “Border Gateway Protocol(BGP) is a standardizedexterior gateway protocoldesigned to exchange routing and reachability information amongautonomous

Terminology

Page 17: BGP - Backbone of the Internet 2 · “Border Gateway Protocol(BGP) is a standardizedexterior gateway protocoldesigned to exchange routing and reachability information amongautonomous

Terminology

• Neighbor/ Peer – Two BGP speakers configured to connect with each other

• Route – A path

• Transit – A paid BGP session that provides a full route table

• RIB – Routing Information Base

• BGP ID - Indicates the BGP ID of the sender of BGP messages

• BGP speaker – A router that implements BGP

• Exchange – Physical network access point where major providers connect & exchange traffic

Page 18: BGP - Backbone of the Internet 2 · “Border Gateway Protocol(BGP) is a standardizedexterior gateway protocoldesigned to exchange routing and reachability information amongautonomous

AS

Autonomous Systems

• Set of routers under a single technical administration.

• Collection of IP prefixes

• Common routing policy (to other ASs)

• Registered by a RIR

https://www.routerfreak.com/ggp-egp-and-25-years-of-bgp-a-brief-history-of-internet-routing/

Autonomous Systems

Page 19: BGP - Backbone of the Internet 2 · “Border Gateway Protocol(BGP) is a standardizedexterior gateway protocoldesigned to exchange routing and reachability information amongautonomous

BGP Finite State Machine

Page 20: BGP - Backbone of the Internet 2 · “Border Gateway Protocol(BGP) is a standardizedexterior gateway protocoldesigned to exchange routing and reachability information amongautonomous

BGP Finite State Machine

• FSM has 6 states

• 5 types of BGP Messages

• Open

• Keepalive

• Notification

• Update

• Route Refresh (RFC 2918)

https://roshanznet.blogspot.com/2017/09/bgp-finite-state-machine.html

Page 21: BGP - Backbone of the Internet 2 · “Border Gateway Protocol(BGP) is a standardizedexterior gateway protocoldesigned to exchange routing and reachability information amongautonomous

BGP Protocol Format

Page 22: BGP - Backbone of the Internet 2 · “Border Gateway Protocol(BGP) is a standardizedexterior gateway protocoldesigned to exchange routing and reachability information amongautonomous

BGP Protocol Format

• Marker – Used for sync

• Length – Total length of message

• Type – BGP Message Type

• Open/ Update/ Notification/ Keepalive/ Route-Refresh

• Message Body – Specific fields used to implement message types

http://www.tcpipguide.com/free/t_BGPMessageGenerationandTransportandGeneralMessageF-2.htm

Page 23: BGP - Backbone of the Internet 2 · “Border Gateway Protocol(BGP) is a standardizedexterior gateway protocoldesigned to exchange routing and reachability information amongautonomous

BGP Protocol FormatOPEN MESSAGE

http://www.tcpipguide.com/free/t_BGPConnectionEstablishmentOpenMessages-2.htm

Page 24: BGP - Backbone of the Internet 2 · “Border Gateway Protocol(BGP) is a standardizedexterior gateway protocoldesigned to exchange routing and reachability information amongautonomous

BGP Protocol FormatUPDATE MESSAGE

http://www.tcpipguide.com/free/t_BGPRouteInformationExchangeUpdateMessages-2.htm

Page 25: BGP - Backbone of the Internet 2 · “Border Gateway Protocol(BGP) is a standardizedexterior gateway protocoldesigned to exchange routing and reachability information amongautonomous

BGP Protocol FormatUPDATE MESSAGE

http://www.tcpipguide.com/free/t_BGPRouteInformationExchangeUpdateMessages-2.htm

Page 26: BGP - Backbone of the Internet 2 · “Border Gateway Protocol(BGP) is a standardizedexterior gateway protocoldesigned to exchange routing and reachability information amongautonomous

BGP Protocol FormatUPDATE MESSAGE

http://www.tcpipguide.com/free/t_BGPRouteInformationExchangeUpdateMessages-2.htm

Page 27: BGP - Backbone of the Internet 2 · “Border Gateway Protocol(BGP) is a standardizedexterior gateway protocoldesigned to exchange routing and reachability information amongautonomous

BGP Protocol FormatKEEPALIVE MESSAGE

http://www.tcpipguide.com/free/t_BGPConnectivityMaintenanceKeepaliveMessages-2.htm

Page 28: BGP - Backbone of the Internet 2 · “Border Gateway Protocol(BGP) is a standardizedexterior gateway protocoldesigned to exchange routing and reachability information amongautonomous

BGP Protocol FormatNOTIFICATION MESSAGE

http://www.tcpipguide.com/free/t_BGPErrorReportingNotificationMessages-2.htm

Page 29: BGP - Backbone of the Internet 2 · “Border Gateway Protocol(BGP) is a standardizedexterior gateway protocoldesigned to exchange routing and reachability information amongautonomous

Route Building

Page 30: BGP - Backbone of the Internet 2 · “Border Gateway Protocol(BGP) is a standardizedexterior gateway protocoldesigned to exchange routing and reachability information amongautonomous

Route SelectionBELLMAN FORD DIAGRAM

http://www.csc.kth.se/utbildning/kth/kurser/DD2393/protok11/material/lectures/L11_Routing.pdf

A’s directly-connected networks

Page 31: BGP - Backbone of the Internet 2 · “Border Gateway Protocol(BGP) is a standardizedexterior gateway protocoldesigned to exchange routing and reachability information amongautonomous

Route SelectionBELLMAN FORD DIAGRAM

http://www.csc.kth.se/utbildning/kth/kurser/DD2393/protok11/material/lectures/L11_Routing.pdf

B’s directly-connected networks

Page 32: BGP - Backbone of the Internet 2 · “Border Gateway Protocol(BGP) is a standardizedexterior gateway protocoldesigned to exchange routing and reachability information amongautonomous

Route SelectionBELLMAN FORD DIAGRAM

http://www.csc.kth.se/utbildning/kth/kurser/DD2393/protok11/material/lectures/L11_Routing.pdf

A merge’s it’s initial state with B’s

Page 33: BGP - Backbone of the Internet 2 · “Border Gateway Protocol(BGP) is a standardizedexterior gateway protocoldesigned to exchange routing and reachability information amongautonomous

Route Selection

Page 34: BGP - Backbone of the Internet 2 · “Border Gateway Protocol(BGP) is a standardizedexterior gateway protocoldesigned to exchange routing and reachability information amongautonomous

AS

Routing Selection

• Highest weight

• Highest local preference

• Shortest AS path

• Origin type

• Multi-Exit Discriminator (MED)

• Route Age

• Other tiebreaking & multipath criteria

https://www.routerfreak.com/ggp-egp-and-25-years-of-bgp-a-brief-history-of-internet-routing/

Route Selection

https://www.cisco.com/c/en/us/support/docs/ip/border-gateway-protocol-bgp/13753-25.html

Page 35: BGP - Backbone of the Internet 2 · “Border Gateway Protocol(BGP) is a standardizedexterior gateway protocoldesigned to exchange routing and reachability information amongautonomous

How it works in practice?

Page 36: BGP - Backbone of the Internet 2 · “Border Gateway Protocol(BGP) is a standardizedexterior gateway protocoldesigned to exchange routing and reachability information amongautonomous

BGP in Practice

AS 1001.1.1.0/24

AS 2002.2.2.0/24

AS 3003.3.3.0/24

AS 4004.4.4.0/24

100

100

200 100

300 100

WEIGHT 20

WEIGHT 30

Page 37: BGP - Backbone of the Internet 2 · “Border Gateway Protocol(BGP) is a standardizedexterior gateway protocoldesigned to exchange routing and reachability information amongautonomous

BGP in PracticeAS 400’S ROUTING TABLE

Network Next Hop Path>* 4.4.4.0/24 i i>* 2.2.2.0/24 2.2.2.2 200 i>* 3.3.3.0/24 3.3.3.2 300 i* 1.1.1.0/24 2.2.2.2 200 100 i>* 1.1.1.0/24 3.3.3.2 300 100 i

Page 38: BGP - Backbone of the Internet 2 · “Border Gateway Protocol(BGP) is a standardizedexterior gateway protocoldesigned to exchange routing and reachability information amongautonomous

Conclusion

Page 39: BGP - Backbone of the Internet 2 · “Border Gateway Protocol(BGP) is a standardizedexterior gateway protocoldesigned to exchange routing and reachability information amongautonomous

BGP

Conclusion

• Message Bus of the internet

• Scales reasonably well

• Full-Convergence is never possible

• Getting implementations that support all features can be difficult

Page 40: BGP - Backbone of the Internet 2 · “Border Gateway Protocol(BGP) is a standardizedexterior gateway protocoldesigned to exchange routing and reachability information amongautonomous

Q & A

Page 41: BGP - Backbone of the Internet 2 · “Border Gateway Protocol(BGP) is a standardizedexterior gateway protocoldesigned to exchange routing and reachability information amongautonomous
Page 42: BGP - Backbone of the Internet 2 · “Border Gateway Protocol(BGP) is a standardizedexterior gateway protocoldesigned to exchange routing and reachability information amongautonomous

Appendix A: BGP FSM

Page 43: BGP - Backbone of the Internet 2 · “Border Gateway Protocol(BGP) is a standardizedexterior gateway protocoldesigned to exchange routing and reachability information amongautonomous

BGP Finite State MachineIDLE

• Initial BGP state

• Router refuses BGP connections

• Goes to CONNECT state after receiving a “Start” event

https://roshanznet.blogspot.com/2017/09/bgp-finite-state-machine.html

Page 44: BGP - Backbone of the Internet 2 · “Border Gateway Protocol(BGP) is a standardizedexterior gateway protocoldesigned to exchange routing and reachability information amongautonomous

BGP Finite State MachineCONNECT

• Tries to create a TCP connection on TCP/179

• If TCP connection is established:

• Send OPEN message, goes to OPENSENT state

• Else:

• Goes to ACTIVE state

https://roshanznet.blogspot.com/2017/09/bgp-finite-state-machine.html

Page 45: BGP - Backbone of the Internet 2 · “Border Gateway Protocol(BGP) is a standardizedexterior gateway protocoldesigned to exchange routing and reachability information amongautonomous

BGP Finite State MachineACTIVE

• Tries to establish TCP connection with peer

• If TCP connection is established:

• Send OPEN message, goes to OPENSENT state

• Else:

• Stays in ACTIVE state

https://roshanznet.blogspot.com/2017/09/bgp-finite-state-machine.html

Page 46: BGP - Backbone of the Internet 2 · “Border Gateway Protocol(BGP) is a standardizedexterior gateway protocoldesigned to exchange routing and reachability information amongautonomous

BGP Finite State MachineOPENSENT

• Waits for OPEN message and checks message validity

• If valid:

• Router sends KEEPALIVE message

• Else:

• Return to IDLE state

https://roshanznet.blogspot.com/2017/09/bgp-finite-state-machine.html

Page 47: BGP - Backbone of the Internet 2 · “Border Gateway Protocol(BGP) is a standardizedexterior gateway protocoldesigned to exchange routing and reachability information amongautonomous

BGP Finite State MachineOPENCONFIRM

• Waits for KEEPALIVE or NOTIFICATION messages

• If KEEPALIVE is received:

• Goes to ESTABLISHED

• If NOTIFICATION is received:

• Goes to IDLE

https://roshanznet.blogspot.com/2017/09/bgp-finite-state-machine.html

Page 48: BGP - Backbone of the Internet 2 · “Border Gateway Protocol(BGP) is a standardizedexterior gateway protocoldesigned to exchange routing and reachability information amongautonomous

BGP Finite State MachineESTABLISHED

• Exchange of messages:

• UPDATE

• KEEPALIVE

• ROUTEREFRESH

• NOTIFICATION

https://roshanznet.blogspot.com/2017/09/bgp-finite-state-machine.html

Page 49: BGP - Backbone of the Internet 2 · “Border Gateway Protocol(BGP) is a standardizedexterior gateway protocoldesigned to exchange routing and reachability information amongautonomous

BGP Finite State MachineESTABLISHED

• If valid UPDATE or KEEPALIVE

• Stays in ESTABLISHED state

• If invalid UPDATE or KEEPALIVE

• Goes to IDLE state

https://roshanznet.blogspot.com/2017/09/bgp-finite-state-machine.html

Page 50: BGP - Backbone of the Internet 2 · “Border Gateway Protocol(BGP) is a standardizedexterior gateway protocoldesigned to exchange routing and reachability information amongautonomous

Appendix B: ISP Tier Classification

Page 51: BGP - Backbone of the Internet 2 · “Border Gateway Protocol(BGP) is a standardizedexterior gateway protocoldesigned to exchange routing and reachability information amongautonomous

ISP Tier Classification

https://en.wikipedia.org/wiki/Tier_1_network