Monday, January 30, 2012

MPLS TUNNELS AND PHP

MPLS PENULTIMATE HOP POPPING (PHP)
----------------------------------
Penultimate means next to last
Normally last hop must
  - lookup mpls label
  - pop mpls label
  - lookup ipv4 destination
PHP avoids extra lookup on last hop
Accomplished via the implicit null label advertisement for connected prefixes
So the next to last takes the removes teh label and sends it to last hop minus label
You recieve implicit null labels for neighbors that are directly connected
MPLS Tunnels
------------
1 Large Advantage for MPLS is that it can enable "BGP Free Core"
P routers only need IGP information for internal SP routers
Routes outside the SP network can be label switched based on the BGP next-hop

If wee look at the process of bgp enviorment say in the below lab diagram
if s1 wanted to send packets to switch 2 loopback of 22.22.22.22
the process would be s1 would lookup 22.22.22.22 in routing and see it is next hop of r6
r6 would recieve packets lookup the next hop of 22.22.22.0 which would be r5 as it was
advertised in BGP via IBGP
r5 has next hop self on. SO r6 would recusive lookup the r5  address and it would say go to
r1 if r1 did not have a route to 22.22.22.0 the traffic would be black holed

With mpls the process would be as follows
s1 would do as above with route-lookup send to r6 would do a route-lookup and find next hop
of r5. Now  r5 would have mpls label associated so r6 would put the outgoing mpls label on
and send it out the outgoing interface towards
r1 would recieve the packet look at the mpls label and would have an outgoing mpls label it
would then forwad to r3
r3 would do the same and forward to r5 if php was enabled r3 would remove the label and
forward to r5. R5 would normal route lookup for 22.22.22.0 and send it to s2
the point being the only routers in the mpls network that needed the routes from external
peers where the edge routers once inside the internal mpls we are switching based on local
next so the internal peers just need reachability information for internal networks and next
hop where it can create labels in regard to them
MPLS Tunnel Problems
-----------------------
BGP next-hop values must be for loopback interface of remote PE
BGP next hop determines what label value should be used
Incorect next-hop value can result in traffic black hole in mpls network
   - Label is php one hop too soon as it is connected segemetn
LAB
-----

OK we will have a look penultimate hop popping. Currently the core network 1-6 is configured
with ospf and ldp enabled

r5
---
r5#sh mpls ldp neighbor
    Peer LDP Ident: 3.3.3.3:0; Local LDP Ident 5.5.5.5:0
        TCP connection: 3.3.3.3.646 - 5.5.5.5.18064
        State: Oper; Msgs sent/rcvd: 46/46; Downstream
        Up time: 00:27:11
        LDP discovery sources:
          FastEthernet0/0.35, Src IP addr: 155.0.6.3
        Addresses bound to peer LDP Ident:
          155.0.5.3       155.0.4.3       155.0.6.3       3.3.3.3
r5#

we see that it see that it neighbor 3.3.3.3 r3 is directly connected to 155.0.4.3,155.0.6.3
and 3.3.3.3

r5#sh mpls for
Local  Outgoing    Prefix            Bytes tag  Outgoing   Next Hop
tag    tag or VC   or Tunnel Id      switched   interface
16     16          1.1.1.1/32        0          Fa0/0.35   155.0.6.3
17     17          2.2.2.2/32        0          Fa0/0.35   155.0.6.3
18     18          155.0.3.0/24      0          Fa0/0.35   155.0.6.3
19     19          155.0.2.0/24      0          Fa0/0.35   155.0.6.3
20     20          155.0.7.0/24      0          Fa0/0.35   155.0.6.3
21     Pop tag     155.0.5.0/24      0          Fa0/0.35   155.0.6.3
22     Pop tag     155.0.4.0/24      0          Fa0/0.35   155.0.6.3
23     Pop tag     3.3.3.3/32        0          Fa0/0.35   155.0.6.3
24     21          4.4.4.4/32        0          Fa0/0.35   155.0.6.3
25     23          6.6.6.6/32        0          Fa0/0.35   155.0.6.3
r5#
we can see fr this  that if we recieve a packet with final destination of any of these
network we will remove the tag as we know it is directly connected to our neighbor so
 we remove the tag send it to our neighbor then our neighbor does not have to remove the tag
and do route lookup which it would typically have to do it will just recieve the packet
untagged and do route lookup saving on recursion

Ok we will take a quick look at the BGP free core as of MPLS on r4 i will connect to SW4
which will advertise a route of 2.4.4.4  i will do an IBGP relationship between r4 and r6
connects to s1 which should be able to ping 2.4.4.4.4

r4
---
first configuring EBGP relationship with sw4
r4(config)#router bgp 200
r4(config-router)#neighbor 10.164.48.4 remote-as 400

Configuring IBGP relation ship with r6
r4(config-router)#neighbor 6.6.6.6 remote-as 200
r4(config-router)#neighbor 6.6.6.6 next-hop-self
r4(config-router)#neighbor 6.6.6.6 update-source lo0


sw4
---
s4(config)#router bgp 400
s4(config-router)#neighbor 10.164.48.44 remote-as 200
s4(config-router)#network 2.4.4.4 mask 255.255.255.255

r6
--
r6(config)#router bgp 200
r6(config-router)#neighbor 4.4.4.4 remote-as 200
r6(config-router)#neighbor 4.4.4.4 update-source lo0
r6(config-router)#neighbor 4.4.4.4 next-hop-self
r6(config-router)#neighbor 172.25.15.1 remote-as 300

s1
--
s1(config)#router bgp 300
s1(config-router)#neighbor 172.25.15.6 remote-as 200
s1(config-router)#network 2.1.1.1 mask 255.255.255.255
s1(config-router)#exit
s1(config)#exit

s4#ping 2.1.1.1 source lo0
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 2.1.1.1, timeout is 2 seconds:
Packet sent with a source address of 2.4.4.4
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/3/8 ms
s4#

Ok none of the routes in the transit path are running BGP r2 is not running BGP r1 is not
running BGP
Lets take a look at how it is pinging

r4
---
has an IBGP route for 2.1.1.1 with next hop of 6.6.6.6
r4#sh ip bgp
BGP table version is 3, local router ID is 4.4.4.4
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
   Network          Next Hop            Metric LocPrf Weight Path
*>i2.1.1.1/32       6.6.6.6                  0    100      0 300 i
*> 2.4.4.4/32       10.164.48.4              0             0 400 i
r4#

it sends the traffic to 6.6.6.6 with a mpls tag of 20 sends it out fa0/0.24 which is the
interface to r2

r2
---
r2 recieves
r2#sh ip bgp
% BGP not active
it is not running BGP

r2#
r2#sh mpls forward
Local  Outgoing    Prefix            Bytes tag  Outgoing   Next Hop
tag    tag or VC   or Tunnel Id      switched   interface
16     Pop tag     1.1.1.1/32        0          Fa0/0.12   155.0.3.1
17     Pop tag     155.0.2.0/24      0          Fa0/0.12   155.0.3.1
18     Pop tag     155.0.5.0/24      0          Fa0/0.12   155.0.3.1
       Pop tag     155.0.5.0/24      0          Fa0/0.23   155.0.4.3
19     Pop tag     4.4.4.4/32        7287       Fa0/0.24   155.0.7.4
20     20          6.6.6.6/32        4145       Fa0/0.12   155.0.3.1
21     Pop tag     155.0.6.0/24      0          Fa0/0.23   155.0.4.3
22     Pop tag     3.3.3.3/32        0          Fa0/0.23   155.0.4.3
23     22          5.5.5.5/32        0          Fa0/0.23   155.0.4.3
r2#

it is looking at the mpls label it recieved the label of 20 and it is sending it out with
label of 20 out fa0/0.12 which is  the link to r1
we are not routing on destination we are switching the traffic based on mpls label


r1
--
r1#sh ip bgp
% BGP not active
r1#sh mpls forwardi
Local  Outgoing    Prefix            Bytes tag  Outgoing   Next Hop
tag    tag or VC   or Tunnel Id      switched   interface
16     Pop tag     2.2.2.2/32        0          Fa0/0.12   155.0.3.2
17     Pop tag     155.0.7.0/24      464        Fa0/0.12   155.0.3.2
18     Pop tag     155.0.4.0/24      0          Fa0/0.12   155.0.3.2
       Pop tag     155.0.4.0/24      0          Fa0/0.13   155.0.5.3
19     19          4.4.4.4/32        8820       Fa0/0.12   155.0.3.2
20     Pop tag     6.6.6.6/32        4300       Fa0/0.16   155.0.2.6
21     Pop tag     155.0.6.0/24      0          Fa0/0.13   155.0.5.3
22     Pop tag     3.3.3.3/32        0          Fa0/0.13   155.0.5.3
23     22          5.5.5.5/32        0          Fa0/0.13   155.0.5.3
r1#

r1 has no BGP active either it recieves a packet with label of 20 and it takes of the label
and sends it out the int fa0/0.16 connected to r6 it is php the label
as r6 is directly connected and it knows about 6.6.6.6 is directly connected to r6
r1#sh mpls ldp neig 6.6.6.6
    Peer LDP Ident: 6.6.6.6:0; Local LDP Ident 1.1.1.1:0
        TCP connection: 6.6.6.6.21310 - 1.1.1.1.646
        State: Oper; Msgs sent/rcvd: 125/128; Downstream
        Up time: 01:37:13
        LDP discovery sources:
          FastEthernet0/0.16, Src IP addr: 155.0.2.6
        Addresses bound to peer LDP Ident:
          155.0.2.6       6.6.6.6         172.25.15.6
r1#

r6
---
r6#sh ip bgp
BGP table version is 3, local router ID is 6.6.6.6
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
   Network          Next Hop            Metric LocPrf Weight Path
*> 2.1.1.1/32       172.25.15.1              0             0 300 i
*>i2.4.4.4/32       4.4.4.4                  0    100      0 400 i
r6#

r6 recieves the non label packet with a destination of 2.1.1.1 it does a route lookup and
see it has bgp route to 2.1.1.1 and forwards to s1

The same process is done on return
So mpls is saving running bgp in the core of our network.

No comments:

Post a Comment