Hi Robert,
You should imagine R3 as a P router which knows only label switching between PEs.
P routers need label information to correctly switch the packets between PE routers. This is stored in mpls.0 table.
inet.3 routing table is used on ingress routers to route packets to the destination egress router.
BGP uses the inet.3 routing table on the ingress router to help in resolving next-hop addresses.
mpls.0 contains a list of the next label-switched router in each LSP. This routing table is used on transit routers to route packets to the next router along an LSP.
In MPLS VPN network,
inet.3 table is consulted when a router acts as a PE in MPLS network.
mpls.0 table is consulted when a router acts as a P router.
When we send a packet from R7 to R8, R3 acts like a transit router. Therefore it needs label information in mpls.0 table. ( should know, how to swap the label of the incoming packet from R5 and forward it to R1..)
ok, Now....
If you check the vpn-a routing table on R4
7.7.7.7/32 has protocol next-hop 2.2.2.2, so R4 will check how to reach 2.2.2.2.
The answer will be 5.5.5.5.
So, R4 needs to send the packet to R5 and then from there it should reach R2.
Which means, from R5, we need an unbroken label-switch path up to R2.
How this label-switch-path established??
R3 sends 2.2.2.2/32 route with a label (X) to R5. ( in simple word, R3 tells R5, if you want to send a packet to R2, send it with outer label X)
The following is the export policy on R3 to export 2.2.2.2/32 to R5..
policy-options {
policy-statement pe {
term 1 {
from {
route-filter 2.2.2.2/32 exact;
}
then accept;
}
term 2 {
then reject;
}
}
}
Basically, this policy tells, export 2.2.2.2/32 from main routing table (inet.0).
When R3 sends 2.2.2.2/32 to R5 over labeled-unicat session, it should send a label (Y) and allocate a local label.
That means, R3 should decide what to do when R5 sends a packet with label Y.
If R3 has OSPF route 2.2.2.2/32 in inet.0, R3 will think, It needs to do pure IP routing towards R1 when it receives a packet with label Y. That is the reason, we see "POP" operation in mpls.0 of R3 when we have OSPF route ( when we don't configure "traffic-engineering bgp-igp").
This is not desirable, because If R3 "pops" the outer label, P router (R1) doesn't know what to do with VPN label.
On the other hand, if R3 has a working label-switch route, R3 will decide , it needs to send the packet to R1 with a label (Z) and hence we see a "swap" operation in mpls.0.
This is desirable, because P routers can label-switch the packet now until it reaches R2.
Therefore, we need a label-switch path in inet.0 to reach PE loopback 2.2.2.2.2. This can be achieved by copying/moving RSVP LSP to inet.0 by "mpls traffic-engineering bgp-igp".
I hope, this explains your question.
Regards,
Moses N