cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
919
Views
0
Helpful
10
Replies

MPLS and BGP

cisco8887
Level 2
Level 2

Hi All,

Is it safe to imagine MPLS is needed with BGP for VRF tags to be carried over from PE routers?

I am studying for my CCIE and my impression was the VRF tags are carried in BGP but now I understand I didn't have it right.

You can't run VRF with BGP only, correct ?

When you run VRF lite with no BGP, how does that work? I have used wireshark and cannot see any tags added to layer 2 or 3.

I therefore made an assumption that the router knows which VRF the client belongs to based on VLAN or the interface it is entering on .

Finally how does MPLS distribute the VPN v4 tags to PE routers?

Thanks

10 Replies 10

Hello cisco8887,

The concept of "Route Tagging" does not exist in BGP as Communities are used instead.

In MPLS L3 VPN scenarios, there are 2 main concepts to use with BGP-VPNv4. Those are Route Distinguisher and Route-Targets.

  • Route Distinguishers makes the prefix unique inside the ISP network. That is, a 64-bit value is prepended to a route when iBGP-VPNv4 advertises it. If two or more different customers advertise the same network prefix to the ISP, those prefixes will actually differ inside the ISP network thanks to the Route Distinguisher value set per customer's routes.
  • Those same advertisements carry, in the form of BGP Extended Communities (similar to 'tags') a value officially called "Route-Target", which are also set per customer when PEs receive their routes. Using that value, remote PEs know if those should "import" to the customer's VRF the network prefix or not.

I hope this helps.

Best Regards.

Sure thanks for this

What confuses me is the RT and RD are sent as extended community attributes so where does MPLS come in ?

If BGP is sending RT by prepending a 64bit value then when is this used?

When you ping it is using MPLS and MPLS has VPN V label for those VRF.

My questions is where is the link between these and how does VRF get mapped to a MPLS Label.

I cannot see how BGP helps here.

When you ping there is no RT or RD added to the frame.

LDP (used to create and propagate labels) and BGP-VPNv4 (used to advertise network prefixes) are 2 different protocols that work side by side (on top of an IGP) to build a MPLS L3 VPN network.

There is a distinction between Control Plane and Data Plane.

We call "Control Plane" to the process of populating the Router's Routing Tables with the correct network prefixes, usually with the help of Routing Protocols. Otherwise, Routers wouldn't know where to forward the received traffic next. Routers based its forwarding decision on the Destination IP header of the packet, there should be an entry in the Routing Table for that prefix (or a default route). In MPLS, the forwarding decision is based on a label instead.

Now, BGP is the protocol used by the providers to advertise customer's networks between their PE Routers (which are the ones facing customer's equipment).

BGP-VPNv4 is called to the BGP extension that adds RTs and RDs to the advertised prefix.

  • RT is an Extended Community.
  • RD is prepended to to the network prefix.

Without RTs and RDs, the ISP network wouldn't be able to differentiate between customer's networks and on which VRF should be installed when received via BGP-VPNv4 on the remote PEs.

Once BGP-VPNv4 has advertised the networks, LDP creates labels for the network prefixes now in the Routing Tables (thanks to BGP-VPNv4). Labels are stored in the LIB (Label Information Base) and LFIB (Label Forwarding Information Base). LDP also advertises those labels to the peer Routers in order to ultimately create a labeled path across the network. Routers can now based its routing decision on labels and not on the Destination IP header.

All the process described up to this point is only for the MPLS network can know how and where forward any customer's traffic within their network. Thanks to BGP-VPNv4 and LDP, the Routing Tables are populated and the labels are in place. 

You can now generate traffic using a ping (the mechanics of traffic forwarding is known as "Data Plane"), the ingress PE Router can then impose the corresponding labels to the traffic (usually 2, the VPN label and the Transport label in MPLS L3 VPN scenarios). A packet capture of that traffic will show the labels, exactly between the Ethernet and the IP header (that's the reason MPLS is sometimes referred as Layer 2.5).

In your capture, you should see the labels added to the Frame for the traffic generated.

Routers between the Ingress PE and the Egress PE based their forwarding decision on the topmost label.

I hope this helps to clarify your concerns.

Best Regards.

many thanks,

When I captured all packets by disabling MPLS globally and then enabling it, I could not see any packet exchange which mentioned what VPN label should be used for a certain VRF.

For instance MPLS Label 18 is assigned to VRF 1 and MPLS Label 19 to VRF2.

How is this communicated to the other PE router?

I did capture the files for a while and did not see any BGP or LDP apart from initial LDP forming a neighbour relationship followed by LDP hellos

What is puzzling me is how MPLS forwarding table knows what label to use for each VRF.

The Ingress PE Router will receive customer's traffic via an interface on a specific VRF. It then performs a CEF lookup to know the egress interface and the labels to be added.

CEF table is ultimately populated by the work done by LDP & BGP-VPNv4.

Sure understand this, to explain my question see the example below

We have VRF1

CE has no knowledge of VRF and forward its traffic on F0/0

PE1 knows that is coming in on f0/0 which belongs to VRF1.

PE1 then forwards it over Ps to PE2. PE1 attaches MPLS label for switching of the packet and an MPLS label for the VRF which has Bottom of Stack flag set.

Lets say the Bottom of stack label is 20 and mpls label to P is 80

80 gets swapped on next P with 81 and takes its path to PE2 all the way while Label 20 stays there.

the POH will POP the label so the PE2 will get the label 20 only .

How does PE2 know what 20 corresponds to which VRF ? This information is not exchanged between PE1 and PE2 at any stage ?

It is BGP-VPNv4 who makes that part possible actually.

Sure but how is what i am asking

when i shutdown mpls and enable it i can't see any bgp packats within 10-20 seconds and within first few secs the mpls forwarding table is populated but how

there is no bgp or mpls communication to exchange labels for the vrf

lab it up and you see what I mean

Hello cisco8887,

What do you mean with "shutdown mpls and enable it".

LDP and BGP-VPNv4 are 2 different protocols. Removing the 'mpls ip' command will not have any effect on the BGP-VPNv4 protocol and its corresponding data structures (tables).

by shutdown I mean disabling MPLS globally.

If you re read my earlier posts above, I am not suggesting BGP and MPLS are the same protocol.

What I am asking is how does MPLS tag a packet with an MPLS label and how is this communicated to the other side. Here is a copy of my earlier post

"

We have VRF1

CE has no knowledge of VRF and forward its traffic on F0/0

PE1 knows that is coming in on f0/0 which belongs to VRF1.

PE1 then forwards it over Ps to PE2. PE1 attaches MPLS label for switching of the packet and an MPLS label for the VRF which has Bottom of Stack flag set.

Lets say the Bottom of stack label is 20 and mpls label to P is 80

80 gets swapped on next P with 81 and takes its path to PE2 all the way while Label 20 stays there.

the POH will POP the label so the PE2 will get the label 20 only .

How does PE2 know what 20 corresponds to which VRF ? This information is not exchanged between PE1 and PE2 at any stage ?"

Review Cisco Networking products for a $25 gift card