📡

BGP・ASってなんだろう?

に公開

はじめに

AWSのANSを勉強してて分からない用語が沢山出てきたので、自分の中での整理も兼ねてまとめました。 普段はReactNativeでスマホアプリを作ってるので、ネットワークはまだまだ理解が浅いです。
間違いや認識違いがあれば、コメントで教えてもらえると嬉しいです。

ボーダーゲートウェイプロトコル(BGP)

The Border Gateway Protocol (BGP) is an inter-Autonomous System routing protocol.

The primary function of a BGP speaking system is to exchange network reachability information with other BGP systems. This network reachability information includes information on the list of Autonomous Systems (ASes) that reachability information traverses. This information is sufficient for constructing a graph of AS connectivity for this reachability, from which routing loops may be pruned and, at the AS level, some policy decisions may be enforced.

BGP-4 provides a set of mechanisms for supporting Classless Inter- Domain Routing (CIDR) [RFC1518, RFC1519]. These mechanisms include support for advertising a set of destinations as an IP prefix and eliminating the concept of network "class" within BGP. BGP-4 also introduces mechanisms that allow aggregation of routes, including aggregation of AS paths.

https://datatracker.ietf.org/doc/html/rfc4271#section-1

まずは RFC 4271 で定義されている内容を確認します。
色々書かれてますが、掻い摘んで読むと

  • ボーダーゲートウェイプロトコル(BGP)は、自律システム間ルーティングプロトコルである。
  • 他のBGPシステムとネットワーク到達可能性情報を交換することである。
  • このネットワーク到達可能性情報には、到達可能性情報が通過する自律システム(AS)のリストに関する情報が含まれる。

ということが分かります。
ただ、これだけだと何のこっちゃ状態なので、もう少し噛み砕いた説明がされているAWSの BGP (ボーダーゲートウェイプロトコル) とは何ですか?を拝見してみます。

ボーダーゲートウェイプロトコルとは何ですか?
ボーダーゲートウェイプロトコル (BGP) は、インターネット上でのデータ転送に最適なネットワークルートを決定する一連のルールです。インターネットは、標準化されたプロトコル、デバイス、通信技術によって相互に接続された何千もの民間、公共、企業、および政府のネットワークで構成されています。インターネットを閲覧すると、データは配信先に到達する前に複数のネットワークを経由します。BGP の責任は、データが移動する可能性のあるすべての経路を調べ、最適な経路を選択することです。たとえば、米国のユーザーがヨーロッパのオリジンサーバーでアプリケーションをロードする場合、BGP はその通信を迅速かつ効率的に行います。

さっきよりも解像度が上がりました。最適なネットワークルートを決めるルールということは、現実世界でいうところの配送業の最適配送ルートを決めるルールみたいなものとして一旦納得しておきます。

Autonomous System (AS)

Autonomous System (AS)
The classic definition of an Autonomous System is a set of routers under a single technical administration, using an interior gateway protocol (IGP) and common metrics to determine how to route packets within the AS, and using an inter-AS routing protocol to determine how to route packets to other ASes. Since this classic definition was developed, it has become common for a single AS to use several IGPs and, sometimes, several sets of metrics within an AS. The use of the term Autonomous System stresses the fact that, even when multiple IGPs and metrics are used, the administration of an AS appears to other ASes to have a single coherent interior routing plan, and presents a consistent picture of the destinations that are reachable through it.

https://datatracker.ietf.org/doc/html/rfc4271#section-1.1

こちらも RFC 4271 から引用します。 こちらも中々難しいことが書かれてますが、先頭に書かれてることが要約かと思います。

自律システム(AS)の古典的な定義は、単一の技術的管理下にあるルータ群であり、内部ゲートウェイプロトコル(IGP)と共通のメトリックを用いてAS内部でのパケット転送方法を決定し、AS間ルーティングプロトコルを用いて他のASへのパケット転送方法を決定するものである

DeepLで翻訳しました。

これだけだと理解できないので、「分かりそう」で「分からない」でも「分かった」気になれるIT用語辞典を参照してみます。

「インターネットの世界は大きすぎて1つのネットワークとして管理するのは無理ですよ。だから、たくさんの小さなネットワークが合体して1つの大きなネットワークになっていることにしますね」な考え方における、それぞれの小さなネットワークのこと

さっきよりも何となく解像度が上がりましたね。

  • ASはルータ群(一つのネットワーク)
  • 一つの技術的管理下にある
  • AS内部では内部だけで使うルーティングプロトコル IGP がある
  • AS 対 ASでは BGP で目的の CIDRへ到達可能性を広告している

ってことかと一旦理解します。

BGP と AS ここまでをまとめると

  • ネットワークにはASが複数存在しており、ASには内部でそれぞれIGPが定義されている。
  • AS対ASではBGPを用いて、どのCIDRが到達可能か広告してる。
  • ネットワーク到達可能性情報でしかないので、到達する保証ではない。

他にも色々と深掘りするとあるのですが、一旦ここまでにしておきます。

Discussion