BGP Question

up2thetimeup2thetime Member Posts: 154
Hey guys... I had a question about BGP, and how it actually sends a packet.

Consider this:

R1---R2---R3---R4---10.1.1.0/24

Where R1 and R2 are core routers.
R3 is a PE router. R4 is a CE router.

R3 has an eBGP connection to R4.
R3 also has an iBGP connection to R2 and R2 is the RR.
R1 has an iBGP connection to R2 and is a RR client.

When R1 wants to forward a packet to 10.1.1.0/24, its BGP table says that the next hop is R3 and not R2.
How does R1 encapsulate the packet? R1 has a route to R3s internal interface via an IGP (OSPF), but I am not sure how the encapsulation works. The original source and destination IP address of the packet must not change, but a way to forward the packet to R3 is needed...

Does that make sense...?

Comments

  • NetworkVeteranNetworkVeteran Member Posts: 2,338 ■■■■■■■■□□
    RR
    This is outside the scope of the CCNP.
    up2thetime wrote: »
    R3 has an eBGP connection to R4.
    R3 also has an iBGP connection to R2 and R2 is the RR.
    R1 has an iBGP connection to R2 and is a RR client.

    When R1 wants to forward a packet to 10.1.1.0/24, its BGP table says that the next hop is R3 and not R2.
    No. Barring special configuration, it will actually say R4 is the next-hop.
    How does R1 encapsulate the packet? R1 has a route to R3s internal interface via an IGP (OSPF), but I am not sure how the encapsulation works.
    The way R1 encapsulates the packet depends on what data-link protocol is running between R1 and R2. If it's Ethernet, then R1 will encapsulate IP packet in an Ethernet frame.
    The original source and destination IP address of the packet must not change, but a way to forward the packet to R3 is needed...
    R2 will know that the next-hop for 10.1.1.0/24 is R4 via its iBGP session with R3. It will then check its IGP to figure out how to actually reach R4.
  • Forsaken_GAForsaken_GA Member Posts: 4,024
    up2thetime wrote: »
    When R1 wants to forward a packet to 10.1.1.0/24, its BGP table says that the next hop is R3 and not R2.

    Only if R3 has set next-hop-self in it's neighbor configuration to it's iBGP peers. Default eBGP behavior is to advertise the actual next hop. Unless R3 is advertising the link between R3 and R4 into it's IGP or BGP, the next hop to R4 will be inaccessible, and therefore the route will not be installed. It's bad form to advertise transit links between external neighbors, it's unnecessary bloat to the routing table, so generally, eBGP routers will set next-hop-self to it's iBGP peers in order to show itself as the next-hop.
    How does R1 encapsulate the packet? R1 has a route to R3s internal interface via an IGP (OSPF), but I am not sure how the encapsulation works. The original source and destination IP address of the packet must not change, but a way to forward the packet to R3 is needed...

    Layer 3 packet will never change. The only encapsulation at play is the layer 2, so it depends on the link type between the routers. If R1 to R2 is ethernet, then R1 will encapsulate the frame in ethernet, and the destination MAC will be R2's interface. When R2 receives the frame, it will strip the layer 2 encapsulation, process the layer 3 packet, and then route it out it's interface to R3 with the appropriate encapsulation. Again, if R2 to R3 is ethernet, it will be an ethernet frame with R3's MAC as the destination MAC. And so on.

    Every time a layer 3 link receives a frame, the first thing the router does is destroy the layer 2 frame, and look only at the layer 3 packet. This happens at every single layer 3 hop for all traffic, since the media type is not guaranteed to be the same end to end, and there's no way to communicate layer 2 information end to end throughout a layer 3 network, as not all layer 2 types use the same framing
  • up2thetimeup2thetime Member Posts: 154
    Thanks guys. Sorry, I guess this should have been under CCIP.

    I was thinking that an extra layer 3 header would have needed to be added in order for the packet to reach R4. I guess this doesn't make sense though. Still have much work to do with BGP.
Sign In or Register to comment.