BGP Question
up2thetime
Member Posts: 154
in CCNP
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...?
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
-
NetworkVeteran Member Posts: 2,338 ■■■■■■■■□□RRup2thetime 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.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... -
Forsaken_GA Member Posts: 4,024up2thetime 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 -
up2thetime Member Posts: 154Thanks 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.