7

What is BGP? | BGP routing explained

 2 years ago
source link: https://www.cloudflare.com/learning/security/glossary/what-is-bgp/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Learning Objectives

After reading this article you will be able to:

Copy article link

What is BGP?

Border Gateway Protocol (BGP) is the postal service of the Internet. When someone drops a letter into a mailbox, the postal service processes that piece of mail and chooses a fast, efficient route to deliver that letter to its recipient. Similarly, when someone submits data across the Internet, BGP is responsible for looking at all of the available paths that data could travel and picking the best route, which usually means hopping between autonomous systems.

BGP is the protocol that makes the Internet work. It does this by enabling data routing on the Internet. When a user in Singapore loads a website with origin servers in Argentina, BGP is the protocol that enables that communication to happen quickly and efficiently.

What is an autonomous system?

The Internet is a network of networks; it’s broken up into hundreds of thousands of smaller networks known as autonomous systems (AS). Each of these networks is essentially a large pool of routers run by a single organization.

Internet topography

If we continue to think of BGP as the postal service of the Internet, AS’s are like individual post office branches. A town may have hundreds of mailboxes, but the mail in those boxes must go through the local postal branch before being routed to another destination. The internal routers within an AS are like mailboxes, they forward their outbound transmissions to the AS, which then uses BGP routing to get these transmissions to their destinations.

BGP Simplified

The diagram above illustrates a simplified version of BGP. In this version there are only 6 autonomous systems on the Internet. If AS1 needs to route a packet to AS3, it has two different options:

Hopping to AS2 and then to AS3:

AS2 → AS3

Or hopping to AS6, then to AS5, AS4, and finally to AS3:

AS6 → AS5 → AS4 → AS3

In this simplified model, the decision seems simple. The AS2 route requires fewer hops than the AS6 route, and therefore it is the quickest, most efficient route. Now imagine that there are hundreds of thousands of AS’s and that hop count is only one part of a complex route selection algorithm. That’s the reality of BGP routing on the Internet.

The structure of the Internet is constantly changing, with new systems popping up and existing systems becoming unavailable. Because of this, every AS must be kept up to date with information regarding new routes as well as obsolete routes. This is done through peering sessions where each AS connects to neighboring AS’s with a TCP/IP connection for the purpose of sharing routing information. Using this information, each AS is equipped to properly route outbound data transmissions coming from within.

Here’s where part of our analogy falls apart: Unlike post office branches, autonomous systems are not all part of the same organization. As such, they have no reason to be friendly to each other and are often times business competitors! For this reason, BGP routes sometimes take business considerations into account. Autonomous Systems often charge each other to carry traffic across their networks, and the price of access can be factored into which route is ultimately selected.

Who operates BGP autonomous systems?

Autonomous systems typically belong to ISPs or other large high-tech organizations, such as tech companies, universities, government agencies, and scientific institutions. Each autonomous system wishing to exchange routing information must have a registered autonomous system number (ASN). Internet Assigned Numbers Authority (IANA) assigns ASNs to Regional Internet Registries (RIRs), which then assigns them to ISPs and networks. ASNs are 16 bit numbers between 1 and 65534 and 32 bit numbers between 131072 and 4294967294. As of 2018, there are approximately 64,000 ASNs in-use worldwide. These ASNs are only required for external BGP.

What’s the difference between external BGP and internal BGP?

Routes are exchanged and traffic is transmitted over the Internet using external BGP or eBGP. Autonomous systems can also use an internal version of BGP to route through their internal networks, which is known as internal BGP, or iBGP for short. It should be noted that using internal BGP is NOT a requirement for using external BGP. Autonomous systems can choose from a number of internal protocols to connect the routers on their internal network.

External BGP is like international shipping; there are certain standards and guidelines that need to be followed when shipping a piece of mail internationally. Once that piece of mail reaches its destination country, it has to go through the destination country’s local mail service to reach its final destination. Each country has its own internal mail service that doesn’t necessarily follow the same guidelines as those of other countries. Similarly, each autonomous system can have its own internal routing protocol for routing data within its own network.

How BGP can break the Internet

In 2004 a Turkish Internet service provider (ISP) called TTNet accidentally advertised bad BGP routes to its neighbors. These routes claimed that TTNet itself was the best destination for all traffic on the Internet. As these routes spread further and further to more autonomous systems, a massive disruption occurred, creating a 1-day crisis where many people across the world were not able to access some or all of the Internet.

Similarly, in 2008 a Pakistani ISP attempted to use a BGP route to block Pakistani users from visiting YouTube. The ISP then accidentally advertised these routes with its neighboring AS’s and the route quickly spread across the Internet’s BGP network. This route sent users trying to access YouTube to a dead end, which resulted in YouTube being inaccessible for several hours.

These are examples of a practice called BGP hijacking, and it isn’t always accidental. In April of 2018, attackers deliberately created bad BGP routes to redirect traffic that was meant for Amazon’s DNS service. The attackers were able to steal over $100,000 worth of cryptocurrency by redirecting this traffic to themselves.

Incidents like these can happen because the route-sharing function of BGP relies on trust, and autonomous systems implicitly trust the routes that are shared with them. While there have been a number of ambitious proposals intended to make BGP more secure, these are hard to implement because they would require every autonomous system to simultaneously update their behavior. Since this would require the coordination of hundreds of thousands of organizations and potentially result in a temporary takedown of the entire Internet, it seems unlikely that any of these major proposals will be put into place anytime soon.


Recommend

  • 43
    • www.sdnlab.com 5 years ago
    • Cache

    解耦 重构 Internet BGP SDN

    作者简介:马绍文,邮箱[email protected] 1 介绍/Why 高清视频和云计算的蓬勃发展,带来互联网流量持续高速增长,主流云公司的Internet出口带宽都已经达到Tbps...

  • 16
    • www.aa.net.uk 4 years ago
    • Cache

    BGP and RPKI

    We have been receiving occasional notifications, primarily via twitter from concerned customers who have visited 'isbgpsafeyet.com' and been told by the site's operator, Cloudflare, that their ISP is, apparently u...

  • 21
    • www.jordanwhited.com 4 years ago
    • Cache

    CoreBGP – Plugging in to BGP

    BGP BGP is one of many protocols that powers t...

  • 12
    • just4coding.com 3 years ago
    • Cache

    基于BGP EVPN的VXLAN通信实践

    基于BGP EVPN的VXLAN通信实践 发表于 2020-04-26...

  • 13
    • www.dengfm.com 3 years ago
    • Cache

    BGP 路由反射实验

    BGP 路由反射实验 图 1-1按照图示配置 IP 地址,R2,R3,R4,R5 配置 Loopback0口作为 OPSF 的 Router-id 和 IBGP 邻居地址,地址格式...

  • 5
    • www.dengfm.com 3 years ago
    • Cache

    BGP 基本排错实验

    BGP 基本排错实验图 1-1 注:如无特别说明,描述中的 R1 或 SW1 对应拓扑中设备名称末尾数字为 1 的设备,R2 或 SW2 对应拓扑中设备名称末...

  • 9
    • www.dengfm.com 3 years ago
    • Cache

    BGP 路由控制排错实验

    BGP 路由控制排错实验 图 1-1 注:如无特别说明,描述中的 R1 或 SW1 对应拓扑中设备名称末尾数字为 1 的设备,R2 或 SW2 对应拓扑中设备名称末尾...

  • 8
    • www.dengfm.com 3 years ago
    • Cache

    BGP 路由控制实验

    BGP 路由控制实验 图 1-1 注:如无特别说明,描述中的 R1 或 SW1 对应拓扑中设备名称末尾数字为 1 的设备,R2 或 SW2 对应拓扑中设备名称末尾数字...

  • 3
    • www.dengfm.com 3 years ago
    • Cache

    BGP 基本配置实验

    BGP 基本配置实验图 1-1 注:如无特别说明,描述中的 R1 或 SW1 对应拓扑中设备名称末尾数字为 1 的设备,R2 或 SW2 对应拓扑中设备名称末...

  • 2
    • vincent.bernat.ch 2 years ago
    • Cache

    L3 routing to the hypervisor with BGP

    L3 routing to the hypervisor with BGP Vincent Bernat January 29, 2018 ...

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK