본문 바로가기

컴퓨터 네트워크

5.4 BGP

5.4 Routing among the ISPs - BGP

OSPF는 AS 내부의 라우팅 프로토콜의 예이다. 동일한 AS 내에 있는 src와 dst 사이에서 패킷을 라우팅할 때, 패킷이 전송되는 경로는 전적으로 AS 내부 라우팅 프로토콜에 의해 결정된다. 그러나 패킷이 여러 AS를 통과하도록 라우팅 한다면 우리는 AS간 라우팅 프로토콜(Inter-AS)이 필요하다.

BGP (Border Gateway Protocol)

  • ISP들을 연결하는 inter-AS routing protocol.
  • Internet backbone에서 주로 사용된다.
  • policy-based routing
  • path vector routing protocol로 분류
    dest까지 가는데 거친 ASN들의 full path list를 advertise to avoid routing loop (DV의 단점)
    (advertise: will forward. 나중에 가입자 패킷이 오면 forwarding 해주겠다)
  • Classless Inter Domain Routing
    BGP는 패킷이 특정 목적지 주소가 아니라 CIDR로 표현된 주소의 앞쪽 prefix를 향해 포워딩 된다. prefix는 서브넷이나 서브넷 집합을 나타낸다.
  • Incremental updates: 변경된 내용만 update

BGP: peering

BGP간의 연결을 peering이라고 한다. peer들 사이에 BGP 메시지를 주고 받는다.

  • External BGP peering (eBGP) between differnt AS

서로 다른 AS간의 연결을 맺을 때 각 ASBR은 peer를 맺고 policy 기준으로 physically(directly) connect.

  • Internal BGP peering (iBGP) within the same AS

iBGP peer들은 same ASN을 가진다. 그들은 TCP로 fully meshed(directly connected 될 필요는 x)

eBGP와 iBGP가 running하고 있는 라우터(ASBR)에서 나머지 모든 iBGP와 직접적인 TCP 세션을 맺는다.

Pop Quiz

eBGP를 running하고 있는 자기가 속한 AS 안의 모든 라우터들과 iBGP TCP Session을 맺어야 한다.

⇒ T.

어떤 AS안에 iBGP로 running되고 있는 라우터들은 반드시 서로 TCP session을 맺어야 한다.

⇒ F. 그럴수도, 아닐 수도. 반드시 맺어야 할 필요는 없다.

eBGP가 다른 AS로부터 얻은 정보를 자신의 AS안에 있는 모든 라우터들에게 알려주기 위해 iBGP session을 직접 맺는다!

BGP: inter-AS routing

  • eBGP: learns subnet reachability information from neighboring ASs.
    eBGP와 iBGP를 모두 running하고 있는 ASBR은 learning한 내용을 자신의 AS안에 있는 모든 라우터과 맺은 TCP iBGP session으로 전달
  • iBGP: propagates prefixed learned from outside the AS to all AS-internal routers.
    • iBGP does not pass on prefixes learned from other iBGP
      eBGP를 running하고 있는 ASBR에게 받은 정보로 끝, 다른 internal iBGP와 정보를 주고 받지 X.
  • "good" routes = policy

BGP protocol : message format

TCP위에서 운용되고 있음.

  • OPEN: opens TCP connection to remote BGP peer and authenticates sending BGP peer
    ASN number를 주고 받고 eBGP인지 iBGP인지 판단.
  • UPDATE: advertises new path (or withdraws old)
  • KEEPALIVE: keeps connection alive in absence of UPDATES; also ACKs OPEN request
  • NOTIFICATION: reports errors in previous msg; also used to close connectionMarker: BGP 헤더 안에 16 byte짜리 특정한 패턴인 marker를 넣어 BGP 메시지를 구별하게 한다.

Path attributes and BGP routes

NLRi: destination subnet 정보. 여러 subnet이 함께 들어갈 수 있다. → destination prefix

AS-PATH

그 destination subnet으로 가기 위한 path attr.로 어떤 AS를 거쳐야 하는지 AS의 list들 = path vector 줌.

DV 알고리즘을 사용 → routing loop이 생길 수 있으므로 거쳐야하는 path vector를 줌.

NEXT-HOP

AS-PATH를 시작하는 라우터 인터페이스의 IP 주소.

각 BGP 경로는 NEXT-HOP, AS-PATH, 목적지 주소 prefix 이렇게 세 개로 구성된다.

BGP route selection

  1. local preference value attribute: Policy decision
  2. shortest AS-PATH rather than the number of router hops
  3. closest NEXT-HOP router: hot potato routing
  4. additional criteria (BGP ID)

Hot Potato routing

가능한 적은 cost로 내 AS를 벗어날 수 있는 path를 선택해 내 AS를 벗어나게 한다. (다음의 cost는 신경X)

Intra- vs. Inter-AS routing

  • intra-AS: focus on performance
  • inter-AS: policy

'컴퓨터 네트워크' 카테고리의 다른 글

6.1 MAC & ARP  (0) 2021.06.12
5.5 SDN & SNMP & ICMP  (0) 2021.06.12
5.3 AS & RIP & OSPF  (0) 2021.06.12
5.2 DV algorithm & AS  (0) 2021.06.12
5.1 Path selection algorithms  (0) 2021.06.12