[네트워크] 5.4 BGP

PADO·2020년 12월 14일
1

컴퓨터 네트워크

목록 보기
25/27
post-thumbnail

지난 시간 배운 내용

Pop Quiz

RIP를 사용하고 있으며, split horizon으로 routing loop를 막고 있는 AS에서 어떤 라우터가 특정한 destination subnet으로 가기 위한 FIB table의 output port가 0번으로 되어있다. 이 경우, 그 destination subnet으로 가는 정보를 output port 0번으론 보내지 않는다.

⇒ T.

OSPF를 사용하는 어떤 ISP는 지리적으로 넓게 분포되어 있어서 여러 개의 area로 쪼개져 있을 때, 어떤 하나의 특정 router에 link state 정보는 그 AS에 속하는 모든 router들에게 broadcast된다.

⇒ F. 그 router가 속한 AS가 아닌 area의 router들에게만 broadcast 된다.

OSPF를 사용하는 ISP에서 서로 다른 area들 사이의 통신은 그 area border router들을 peer로 연결해 직접 주고 받을 수 있다.

⇒ F. inter-area 통신은 반드시 직접할 수 없고, backbone area를 거쳐야 함. backbone area에 속한 backbone router들은 DV algorithm을 사용. routing loop에 취약하기에 loop free topology를 갖춰야 함 = OSPF의 inter area topology는 loop free를 유지해야 한다.

RIP를 사용할 경우에는 여러 개의 라우터를 거치더라도 link 용량이 큰 곳을 더 선호해 path를 알려준다.

⇒ F. RIP는 link의 bandwidth를 고려한 path를 찾지 않음. 그저 개수만 (OSPF는 bandwidth까지 고려 가능)

OSPF는 RIP보다 하나의 링크에 전송되는 msg size가 더 크다.

⇒ F. DV algorithm을 사용하는 RIP의 msg size가 더 크다.


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 connection

    스크린샷 2020-12-14 오후 4 48 12 Marker: BGP 헤더 안에 16 byte짜리 특정한 패턴인 marker를 넣어 BGP 메시지를 구별하게 한다.

Path attributes and BGP routes

스크린샷 2020-12-14 오후 4 51 50

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

Keywords

  • BGP = Policy-based routing, Path-vector (a list of ASes) routing protocol,
  • (Q) Why BGP keeps" a list of AS" to get to a destination subnet prefix in its routing table?

(A) In order to avoid a loop in an inter-AS path

  • BGP peers set up a TCP session.
  • 2 types of BGP session

-- eBGP : 2 BGP peers belong to the different AS

-- iBGP  : 2 BGP peers belong to the same AS

  • Why does iBGP NOT advertise the inter-AS route info learned from iBGP to another iBGP?

-- In order for distance vector algorithm not to change the next-hop IP address

  • Why does a border router have a (iBGP) TCP connection to all of intra-AS routers?

-- Because the border router needs to directly send inter-AS routes information to all internal routers in its AS.

  • Finally via the above two answers, all intra-AS routers can have the same inter-AS route information (NEXT_HOP).
  • BGP route selection condition : Local_pref(= policy) -> AS_PATH -> Next_Hop (Hot potato routing) -> random (BGP ID)

0개의 댓글