Monday, January 30, 2012

MPLS OVERVIEW


MPLS OVERVIEW
--------------
Multiprotocol Label Switching
Open Standard per RFC 3031
Previously Cisco Propetiary Tag Switching

MPLS OVERVIEW- Multiprotocol
------------------------------
Can transport different payloads
layer 2
 - ethernet,hdlc,ppp,frame-relay & ATM
layer 3
  - IPV4 & IPV6
Traffic is switched between interfaces based on locally significant label values
Similar to how frame-relay or ATM switch uses input/output DLCIS and VPI/VCIS

MPLS LABEL FORMAT
-----------------
4 byte header used to switch packets
20 bit label= local significant to rotuers
3 bit EXP = class off service
s bit = defines last label in label stack
8 bit ttl= time to live



MPLS PACKET WITH IP AS PAYLOAD
------------------------------------------------



HOW LABEL WORKS
----------------
MPLS Labels are bound to FECS
 - forwarding equivlancy class
 -ipv4 prefix for our purpose
Router uses MPLS LFIB to switch traffic
Essentially the LFIB is cef table + label
Switching Logic
  - if traffic comes in if1 with label x send out if2 with label y

MPLS DEVICE ROLES
-----------------
PE/LER = provider edge router/label edge router, this connects to customer edge devices retrieves unlabelled packets          and add label (pe) aka label pursh or label imposition. In l3VPN performs both IP routing & MPLS Lookup
P/LSR = provider router/label switch routers connect pe to P routers switches traffic based only on label

Label PUsh/POP/SWAP
-------------------
PE and P routers perform 3 major operations
  - label push
     - add a label to an incoming packet aka label imposition
  - Label swap
     - replace a label on incoming packet
  - label pop- remove a label from outgoing packet aka label disposition
LABEL DISTRIBUTION
-------------------
Adjacent P/PE'S must agree on label per FEC
Label binding can be dynamic through
  - Tag Distribution Protocol (TDP) - CIsco Propetiary legacy protocol
  -Label Distribtuion Protocol (LDP)
  -RRSVP (RESOURCE RESERVATIOB PROTOCOL)- use for mpls te (traffic engineering)
  - Multiprotocol BGP (MPBGP)
LABEL DISTRIBUTION PROTOCOL (LDP)
----------------------------------
Standard Per RFC 3036
Neighbor discovery is done via udp port 646 to 224.0.0.2
Neighbor adjacency is TCP port 646
Label Advertisement
   - Advertise FEC for connected IGP interfaces
   - Advertise FEC for IGP learned routers (including static)
LDP router id is selected same process as OSPF router id
The labels are local link significant so labels get originated on per hop basis.They are significant to two neighboring routers

MPLS COMMANDS
--------------
ip cef
mpls label protocol ldp|tdp
mpls ip
show mpls ldp interface

show mpls ldp neighbor
show mpls forwarding-table
show ip cef [internal]
debug mpls packet
(config) ip cef
config ) mpls label protocol ldp
cofnig) mpls ip

debug mpls transport events

LAB
----
OK i am looking at the core of the network here r1-r6




I am going to enable mpls and i will use the ldp protocol

I have already configured the underlying topology with ospf so there is connectivity to loopbacks etc

r6
---
R6 is one of our pe I will start by configuring mpls and the ldp protocol

r6(config)#mpls ip
r6(config)#mpls label protocol ldp

r6(config)#int fa0/0.16
r6(config-subif)#mpls ip
r6#sh mpls int
Interface              IP            Tunnel   Operational
FastEthernet0/0.16     Yes (ldp)     No       Yes
r6#

r1
---
r1(config)#mpls ip
r1(config)#mpls label protocol ldp
r1(config)#int fa0/0.16
r1(config-subif)#mpls ip
r1(config-subif)#
*Mar  1 01:33:49.067: mpls: Add mpls app; FastEthernet0/0.16
*Mar  1 01:33:49.067: mpls: Add mpls app; FastEthernet0/0.16
*Mar  1 01:33:49.067: mpls: Add mpls app; i/f status change; FastEthernet0/0.16
*Mar  1 01:33:49.067: ldp: enabling ldp on FastEthernet0/0.16
*Mar  1 01:33:49.123: ldp: i/f status change: FastEthernet0/0.16; cur/des flags 0x2/0x2mcast 1
*Mar  1 01:33:49.123: mpls: Enable MPLS forwarding on FastEthernet0/0.16
*Mar  1 01:33:49.123: ldp: enabling ldp on FastEthernet0/0.16
*Mar  1 01:33:49.123: ldp: i/f status change: FastEthernet0/0.16; cur/des flags 0x2/0x2mcast 1
*Mar  1 01:33:49.127: mpls: Allocate router id, select 1.1.1.1
*Mar  1 01:33:54.011: tagcon: (Default-IP-Routing-Table) Assign peer id; 6.6.6.6:0: id 0
*Mar  1 01:33:54.015: %LDP-5-NBRCHG: LDP Neighbor 6.6.6.6:0 is UP
*Mar  1 01:33:54.015: tagcon: peer 6.6.6.6:0 (pp 0x83C87FD0): advertise 155.0.3.1
*Mar  1 01:33:54.015: tagcon: peer 6.6.6.6:0 (pp 0x83C87FD0): advertise 155.0.5.1
*Mar  1 01:33:54.015: tagcon: peer 6.6.6.6:0 (pp 0x83C87FD0): advertise 155.0.2.1
*Mar  1 01:33:54.015: tagcon: peer 6.6.6.6:0 (pp 0x83C87FD0): advertise 1.1.1.1
*Mar  1 01:33:54.019: tagcon: peer 6.6.6.6:0 (pp 0x83C87FD0): advertise 1.1.1.1/32, label 3 (imp-null) (#2)
*Mar  1 01:33:54.019: tagcon: peer 6.6.6.6:0 (pp 0x83C87FD0): advertise 2.2.2.2/32, label 16 (#4)
*Mar  1 01:33:54.019: tagcon: peer 6.6.6.6:0 (pp 0x83C87FD0): advertise 155.0.3.0/24, label 3 (imp-null) (#6)
*Mar  1 01:33:54.019: tagcon: peer 6.6.6.6:0 (pp 0x83C87FD0): advertise 155.0.2.0/24, label 3 (imp-null) (#8)
*Mar  1 01:33:54.019: tagcon: peer 6.6.6.6:0 (pp 0x83C87FD0): advertise 155.0.7.0/24, label 17 (#10)
*Mar  1 01:33:54.023: tagcon: peer 6.6.6.6:0 (pp 0x83C87FD0): advertise 155.0.5.0/24, label 3 (imp-null) (#12)
*Mar  1 01:33:54.023: tagcon: peer 6.6.6.6:0 (pp 0x83C87FD0): advertise 155.0.4.0/24, label 18 (#14)
*Mar  1 01:33:54.023: tagcon: peer 6.6.6.6:0 (pp 0x83C87FD0): advertise 4.4.4.4/32, label 19 (#16)
*Mar  1 01:33:54.023: tagcon: peer 6.6.6.6:0 (pp 0x83C87FD0): advertise 6.6.6.6/32, label 20 (#18)
r1(config-subif)#exit

we can see when we configure r1 the mpls ldp neighbor relationship comes up with router 6.6.6.6 r6

r1#sh mpls ldp neigh
    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: 14/15; Downstream
        Up time: 00:02:29
        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
We see that we have a tcp connection to 6.6.6.6 using 646 tell us what int and what the source address of our neighbor is and the uptme

r1#sh mpls ldp par
Protocol version: 1
Downstream label generic region: min label: 16; max label: 100000
Session hold time: 180 sec; keep alive interval: 60 sec
Discovery hello: holdtime: 15 sec; interval: 5 sec
Discovery targeted hello: holdtime: 90 sec; interval: 10 sec
Downstream on Demand max hop count: 255
Downstream on Demand Path Vector Limit: 255
LDP for targeted sessions
LDP initial/maximum backoff: 15/120 sec
LDP loop detection: off
r1#

we can see our session parameters

I will configure the rest of the mpls ldp neighbors on r1
r1(config)#int fa0/0.12
r1(config-subif)#mpls ip
r1(config-subif)#int fa0/0.13
r1(config-subif)#mpls ip
r1(config-subif)#int fa0/0.16
r1(config-subif)#mpls ip

r2
---

r2#config t
Enter configuration commands, one per line.  End with CNTL/Z.
r2(config)#ip cef
r2(config)#mpls ip
r2(config)#mpls label protocol ldp
r2(config)#int fa0/0.12
r2(config-subif)#mpls ip
r2(config-subif)#int fa0/
*Mar  1 01:44:18.231: %LDP-5-NBRCHG: LDP Neighbor 1.1.1.1
r2(config-subif)#int fa0/0.23
r2(config-subif)#mpls ip
r2(config-subif)#int fa0/0.24
r2(config-subif)#mpls ip
r2(config-subif)#

r4
--

r4(config)#mpls ip
r4(config)#mpls label protocol ldp
r4(config)#int fa0/0.24
r4(config-subif)#mpls ip
r4(config-subif)#

r4#sh mpls ldp ne
    Peer LDP Ident: 2.2.2.2:0; Local LDP Ident 4.4.4.4:0
        TCP connection: 2.2.2.2.646 - 4.4.4.4.55869
        State: Oper; Msgs sent/rcvd: 26/26; Downstream
        Up time: 00:09:58
        LDP discovery sources:
          FastEthernet0/0.24, Src IP addr: 155.0.7.2
        Addresses bound to peer LDP Ident:
          155.0.3.2       155.0.4.2       155.0.7.2       2.2.2.2
r4#

notice on r4 it has the address the directly connected neighbor has 155.0.3.2 which link between r2 - r1  155.0.4.2 which is the link between r3 - r2
155.0.7.2 - which is the link between r4 and r2 it will use these when building it mpls forwarding table, i will finish off the config and we will look at the forwarding table
r3
---
r3(config)#mpls ip
r3(config)#mpls label protocol ldp
r3(config)#int fa0/0.13
r3(config-subif)#mpls ip
r3(config-subif)#int fa9
*Mar  1 01:57:41.676: %LDP-5-NBRCHG: LDP Neighbor 1.1.1.1:
r3(config-subif)#int fa0/0.23
r3(config-subif)#mpls ip
r3(config-subif)#int fa0/0.23
*Mar  1 01:57:59.341: %LDP-5-NBRCHG: LDP Neighbor 2.2
r3(config-subif)#int fa0/0.35
r3(config-subif)#mpls ip
r3(config-subif)#

r5
---
r5(config)#mpls ip
r5(config)#mpls label protocol ldp
r5(config)#ip cef
r5(config)#do sh ip int brief
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            unassigned      YES TFTP   up                    up 
FastEthernet0/0.35         155.0.6.5       YES manual up                    up 
FastEthernet0/1            unassigned      YES NVRAM  administratively down down
Serial0/0/0                unassigned      YES TFTP   up                    down
Serial0/1/0                unassigned      YES TFTP   up                    up 
Loopback0                  5.5.5.5         YES NVRAM  up                    up 
r5(config)#int fa0/0.35
r5(config-subif)#mpls ip
r5(config-subif)#
*Jan 30 20:49:12.583: %LDP-5-NBRCHG: LDP Neighbor 3.3.3.3:0 (1) is UP


r5#sh mpls ldp neigh
    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: 15/15; Downstream
        Up time: 00:00:29
        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#

r5#sh mpls forwarding-table
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#
r5#sh mpls ldp bindingS 6.6.6.6 255.255.255.255
  tib entry: 6.6.6.6/32, rev 24
        local binding:  tag: 25
        remote binding: tsr: 3.3.3.3:0, tag: 23
r5#

Lets take r6 loopback and trace the path to it
we router 5 has assigned a local label of 25 to the network 6.6.6.6 if we recieve traffic for 6.6.6.6 we will send it out fa0/0.35 with a label of 23


r3
--
r3#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.13   155.0.5.1
17     Pop tag     2.2.2.2/32        0          Fa0/0.23   155.0.4.2
18     Pop tag     155.0.3.0/24      0          Fa0/0.13   155.0.5.1
       Pop tag     155.0.3.0/24      0          Fa0/0.23   155.0.4.2
19     Pop tag     155.0.2.0/24      0          Fa0/0.13   155.0.5.1
20     Pop tag     155.0.7.0/24      0          Fa0/0.23   155.0.4.2
21     19          4.4.4.4/32        0          Fa0/0.23   155.0.4.2
22     Pop tag     5.5.5.5/32        0          Fa0/0.35   155.0.6.5
23     20          6.6.6.6/32        0          Fa0/0.13   155.0.5.1
r3#

ok on r3 if we recieve an incoming label of 23 we will swap the label putting on label 20 and send it out int fa0/0.13 which is the link to r1


r1
---
r1#sh mpls forwarding
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      0          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        0          Fa0/0.12   155.0.3.2
20     Pop tag     6.6.6.6/32        0          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
if we recieve a label of 20 we will remove the label and send it out fa0/0.16 which is the link to r6

we will reach r6 6.6.6.6 so the mpls switching is done

r1#sh mpls ldp bind
  tib entry: 1.1.1.1/32, rev 2
        local binding:  tag: imp-null
        remote binding: tsr: 6.6.6.6:0, tag: 16
        remote binding: tsr: 2.2.2.2:0, tag: 16
        remote binding: tsr: 3.3.3.3:0, tag: 16
  tib entry: 2.2.2.2/32, rev 4
        local binding:  tag: 16
        remote binding: tsr: 6.6.6.6:0, tag: 17
        remote binding: tsr: 2.2.2.2:0, tag: imp-null
        remote binding: tsr: 3.3.3.3:0, tag: 17
  tib entry: 3.3.3.3/32, rev 22
        local binding:  tag: 22
        remote binding: tsr: 6.6.6.6:0, tag: 24
        remote binding: tsr: 2.2.2.2:0, tag: 22
        remote binding: tsr: 3.3.3.3:0, tag: imp-null
  tib entry: 4.4.4.4/32, rev 16
        local binding:  tag: 19
        remote binding: tsr: 6.6.6.6:0, tag: 22
        remote binding: tsr: 2.2.2.2:0, tag: 19
        remote binding: tsr: 3.3.3.3:0, tag: 21
  tib entry: 5.5.5.5/32, rev 24
        local binding:  tag: 23
        remote binding: tsr: 6.6.6.6:0, tag: 25
        remote binding: tsr: 2.2.2.2:0, tag: 23
        remote binding: tsr: 3.3.3.3:0, tag: 22
  tib entry: 6.6.6.6/32, rev 18
        local binding:  tag: 20
        remote binding: tsr: 6.6.6.6:0, tag: imp-null
        remote binding: tsr: 2.2.2.2:0, tag: 20
        remote binding: tsr: 3.3.3.3:0, tag: 23
  tib entry: 155.0.2.0/24, rev 8
        local binding:  tag: imp-null
        remote binding: tsr: 6.6.6.6:0, tag: imp-null
        remote binding: tsr: 2.2.2.2:0, tag: 17
        remote binding: tsr: 3.3.3.3:0, tag: 19
  tib entry: 155.0.3.0/24, rev 6
        local binding:  tag: imp-null
        remote binding: tsr: 6.6.6.6:0, tag: 18
        remote binding: tsr: 2.2.2.2:0, tag: imp-null
        remote binding: tsr: 3.3.3.3:0, tag: 18
  tib entry: 155.0.4.0/24, rev 14
        local binding:  tag: 18
        remote binding: tsr: 6.6.6.6:0, tag: 21
        remote binding: tsr: 2.2.2.2:0, tag: imp-null
        remote binding: tsr: 3.3.3.3:0, tag: imp-null
  tib entry: 155.0.5.0/24, rev 12
        local binding:  tag: imp-null
        remote binding: tsr: 6.6.6.6:0, tag: 20
        remote binding: tsr: 2.2.2.2:0, tag: 18
        remote binding: tsr: 3.3.3.3:0, tag: imp-null
  tib entry: 155.0.6.0/24, rev 20
        local binding:  tag: 21
        remote binding: tsr: 6.6.6.6:0, tag: 23
        remote binding: tsr: 2.2.2.2:0, tag: 21
        remote binding: tsr: 3.3.3.3:0, tag: imp-null
  tib entry: 155.0.7.0/24, rev 10
        local binding:  tag: 17
        remote binding: tsr: 6.6.6.6:0, tag: 19
        remote binding: tsr: 2.2.2.2:0, tag: imp-null
        remote binding: tsr: 3.3.3.3:0, tag: 20
r1#
we will locally generate label for each network in the cef table see above.

No comments:

Post a Comment