查看MPLS中各指令及含义

查看MPLS中各指令及含义_第1张图片

配置MPLS过程:

1)IGP内部全部联通,包括loopback口也要通;

2)在全局或者接口启用LDP协议:mpls label protocol ldp

3)在接口模式下,启用hello邻居发现:MPLS ip

4)修改MTU值:mpls mtu 1508


一、查看邻居

R3#sh mpls ldp neighbor

    Peer LDP Ident: 2.2.2.2:0; Local LDP Ident 3.3.3.3:0

        TCP connection: 2.2.2.2.646 - 3.3.3.3.20883

        State: Oper; Msgs sent/rcvd: 1988/1991; Downstream

        Up time: 1d04h

        LDP discovery sources:

          FastEthernet0/0, Src IP addr: 23.1.1.2

        Addresses bound to peer LDP Ident:

          12.1.1.2        23.1.1.2        2.2.2.2

    Peer LDP Ident: 4.4.4.4:0; Local LDP Ident 3.3.3.3:0

        TCP connection: 4.4.4.4.63772 - 3.3.3.3.646

        State: Oper; Msgs sent/rcvd: 1992/1989; Downstream

        Up time: 1d04h

        LDP discovery sources:

          FastEthernet1/0, Src IP addr: 34.1.1.4

        Addresses bound to peer LDP Ident:

          34.1.1.4        46.1.1.4        4.4.4.4

从上面的显示可以看到 R3路由器总共有2个邻居,分别是R2和R4,都是通过TCP连接通告的 通过了23.1.1.2和34.1.1.4两个IP地址获得的邻居更新,最后一行:

        Addresses bound to peer LDP Ident:

          12.1.1.2        23.1.1.2        2.2.2.2

显示的是和这个路由器绑定的接口IP地址,用于判断该路由器是否是倒数第二跳,从而用于将标签弹出,最终在边界路由器中只查找FIB一张表就行了,不必查找FIB和LIB两张表。

二、显示FIB表

R3# sh ip cef detail 

截取部分显示内容如下:

IP CEF with switching (Table Version 22), flags=0x0

  19 routes, 0 reresolve, 0 unresolved (0 old, 0 new), peak 0

  22 leaves, 32 nodes, 36272 bytes, 25 inserts, 3 invalidations

  0 load sharing elements, 0 bytes, 0 references

  universal per-destination load sharing algorithm, id E6B80BFB

  2(0) CEF resets, 0 revisions of existing leaves

  Resolution Timer: Exponential (currently 1s, peak 1s)

  0 in-place/0 aborted modifications

  refcounts:  8459 leaf, 8448 node

  Table epoch: 0 (22 entries at this epoch)

Adjacency Table has 4 adjacencies

0.0.0.0/0, version 0, epoch 0, attached, default route handler

0 packets, 0 bytes

  via 0.0.0.0, 0 dependencies

    valid no route adjacency

0.0.0.0/32, version 0, epoch 0, receive

1.1.1.1/32, version 19, epoch 0, cached adjacency 23.1.1.2

0 packets, 0 bytes

  tag information set

    local tag: 19

    fast tag rewrite with Fa0/0, 23.1.1.2, tags imposed: {19}

  via 23.1.1.2, FastEthernet0/0, 0 dependencies

    next hop 23.1.1.2, FastEthernet0/0

    valid cached adjacency

    tag rewrite with Fa0/0, 23.1.1.2, tags imposed: {19}

2.2.2.2/32, version 20, epoch 0, cached adjacency 23.1.1.2

0 packets, 0 bytes

  tag information set

    local tag: 20

  via 23.1.1.2, FastEthernet0/0, 0 dependencies

    next hop 23.1.1.2, FastEthernet0/0

    valid cached adjacency

tag rewrite with Fa0/0, 23.1.1.2, tags imposed: {}

FIB表其实是路由表的一个复制,但是添加了mpls的标签信息,从蓝色的信息看出,针对路由2.2.2.2/32,R3的本地标签为20,出站标签为空,因为是倒数第二条路由器,所以标签弹出;从红色信息看出,针对1.1.1.1/32路由,本地标签为19,出站标签也为19,由于标签只是针对本地有意义,所以可以相同,出站标签的19是从R2那里通过LDP协议传来的。

三、查看LIB表

R3# sh mpls ldp bindings

  tib entry: 1.1.1.1/32, rev 14

        local binding:  tag: 19

        remote binding: tsr: 2.2.2.2:0, tag: 19

        remote binding: tsr: 4.4.4.4:0, tag: 19

  tib entry: 2.2.2.2/32, rev 16

        local binding:  tag: 20

        remote binding: tsr: 2.2.2.2:0, tag: imp-null

        remote binding: tsr: 4.4.4.4:0, tag: 20

  tib entry: 3.3.3.3/32, rev 4

        local binding:  tag: imp-null

        remote binding: tsr: 2.2.2.2:0, tag: 20

        remote binding: tsr: 4.4.4.4:0, tag: 21

  tib entry: 4.4.4.4/32, rev 18

        local binding:  tag: 21

        remote binding: tsr: 4.4.4.4:0, tag: imp-null

        remote binding: tsr: 2.2.2.2:0, tag: 21

  tib entry: 12.1.1.0/24, rev 8

        local binding:  tag: 16

        remote binding: tsr: 2.2.2.2:0, tag: imp-null

        remote binding: tsr: 4.4.4.4:0, tag: 17

  tib entry: 15.1.1.0/24, rev 12

        local binding:  tag: 18

        remote binding: tsr: 2.2.2.2:0, tag: 18

        remote binding: tsr: 4.4.4.4:0, tag: 18

  tib entry: 23.1.1.0/24, rev 6

        local binding:  tag: imp-null

        remote binding: tsr: 2.2.2.2:0, tag: imp-null

        remote binding: tsr: 4.4.4.4:0, tag: 16

  tib entry: 34.1.1.0/24, rev 2

        local binding:  tag: imp-null

        remote binding: tsr: 2.2.2.2:0, tag: 16

        remote binding: tsr: 4.4.4.4:0, tag: imp-null

  tib entry: 46.1.1.0/24, rev 10

        local binding:  tag: 17

        remote binding: tsr: 2.2.2.2:0, tag: 17

        remote binding: tsr: 4.4.4.4:0, tag: imp-null

1)首先,从显示结果中可以看到,总共有9条标签信息,为什么是9条呢,其实是包含了5个网络信息和4个loopback网络信息,因为R5和R6是在区域mpls区域外的,没有启用mpls协议,其实是属于用户侧了,不属于运营商区域,所以R5和R6的loopback网段(如果R5和R6还有其他网段,也不会添加进来)没有加进来。

2)其次,针对每一条记录,例如:

  tib entry: 1.1.1.1/32, rev 14

        local binding:  tag: 19

        remote binding: tsr: 2.2.2.2:0, tag: 19

        remote binding: tsr: 4.4.4.4:0, tag: 19

可以看到,对于R3来讲,针对1.1.1.1/32这条路由,他自己会产生一个标签信息为19(local binding:  tag: 19),从他的邻居2.2.2.2也会传来一个针对1.1.1.1的标签信息(LDP协议发现),也为19(remote binding: tsr: 2.2.2.2:0, tag: 19),从他的邻居4.4.4.4也会传来一个标签信息,也为19(remote binding: tsr: 4.4.4.4:0, tag: 19)。

其他的路由条目也是一样的,都有一个本地标签,两个从两边邻居获得的标签,这里有一点需要注意的是,例如2.2.2.2/32那里,有一条记录是这样的:remote binding: tsr: 2.2.2.2:0, tag: imp-null,从这里可以看到,针对这条路由产生的标签,是R2自己产生的,也就是说,2.2.2.2这个网段是和R2是直连的,那么标签一旦传到这里,就要弹出了,所以显示的是空(imp-null)。

四、查看FLIB表

R3#sh mpls forwarding-table

Local  Outgoing    Prefix            Bytes tag  Outgoing   Next Hop

tag    tag or VC   or Tunnel Id      switched   interface

16     Pop tag     12.1.1.0/24       0          Fa0/0      23.1.1.2

17     Pop tag     46.1.1.0/24       0          Fa1/0      34.1.1.4

18     18          15.1.1.0/24       0          Fa0/0      23.1.1.2

19     19          1.1.1.1/32        0          Fa0/0      23.1.1.2

20     Pop tag     2.2.2.2/32        0          Fa0/0      23.1.1.2

21     Pop tag     4.4.4.4/32        0          Fa1/0      34.1.1.4

1)首先,总共有6个条目,为什么是6个呢,就是除了直连的3个网段外的其他6个网段,直连的话就不需要标签转发了。

2)对于每一条记录来讲,例如:

Local  Outgoing    Prefix            Bytes tag  Outgoing   Next Hop

tag    tag or VC   or Tunnel Id      switched   interface

16     Pop tag     12.1.1.0/24       0          Fa0/0      23.1.1.2

可以看到,对于网段12.1.1.0/24网段,R3路由器的本地标签为16。出战标签为Pop tag,也就是标签弹出了,为什么会弹出呢,因为根据拓扑图来看,R3针对12.1.1.0/24网段来说,是倒数第二跳路由器,根据第二跳机制,就把标签弹出了。

再看下面一条信息:

Local  Outgoing    Prefix            Bytes tag  Outgoing   Next Hop

tag    tag or VC   or Tunnel Id      switched   interface

18     18          15.1.1.0/24       0          Fa0/0      23.1.1.2

可以看到针对15.1.1.0/24路由,结合LIB表中的信息,最终选择了出站标签为18.


你可能感兴趣的:(网络知识)