此产品的文档集力求使用非歧视性语言。在本文档集中,非歧视性语言是指不隐含针对年龄、残障、性别、种族身份、族群身份、性取向、社会经济地位和交叉性的歧视的语言。由于产品软件的用户界面中使用的硬编码语言、基于 RFP 文档使用的语言或引用的第三方产品使用的语言,文档中可能无法确保完全使用非歧视性语言。 深入了解思科如何使用包容性语言。
思科采用人工翻译与机器翻译相结合的方式将此文档翻译成不同语言,希望全球的用户都能通过各自的语言得到支持性的内容。 请注意:即使是最好的机器翻译,其准确度也不及专业翻译人员的水平。 Cisco Systems, Inc. 对于翻译的准确性不承担任何责任,并建议您总是参考英文原始文档(已提供链接)。
思科定位器/ID分离协议(LISP)通过创建两个新命名空间来更改当前IP地址语义:分配给终端主机的终端标识符(EID)和分配给组成全局路由系统的设备(主要是路由器)的路由定位器(RLOC)。
当路由器具有完整的互联网路由表时,它需要内存和进程利用率,LISP可帮助降低内存利用率。
思科建议您具备LISP的基本知识。
本文档不限于特定的软件和硬件版本。
本文档中的信息都是基于特定实验室环境中的设备编写的。本文档中使用的所有设备最初均采用原始(默认)配置。如果您使用的是真实网络,请确保您已经了解所有命令的潜在影响。
网络图
以下图像将用作文档其余部分的示例拓扑:
xTR = LISP路由器可以是ITR或ETR,具体取决于流量方向。如果流量从LISP路由器流出,它将成为该流的ITR,而接收端LISP路由器将成为该路由器的ETR。
ITR =入口隧道路由器
ETR =出口隧道路由器
映射解析器(MR) =映射解析器是LISP站点ITR在解析EID到RLOC映射时向其发送LISP映射请求查询的LISP基础设施设备。R5是本文中的MR。
映射服务器(MS) =映射服务器是LISP站点ETR使用其EID前缀注册到的LISP基础设施设备。映射服务器将注册的EID前缀的聚合通告给LISP映射系统。所有LISP站点都使用LISP映射系统来解析EID到RLOC的映射。R7是本文中的MS。
终端标识符(EID)地址:EID地址包括IP地址和标识终端的前缀。通过解析EID到RLOC的映射,可实现LISP站点间的EID可达性。
路由定位器(RLOC)地址:RLOC地址包括IP地址和标识IP网络中不同路由器的前缀。RLOC空间内的可达性通过传统路由方法实现。
ALT(备用逻辑拓扑):连接映射解析器和映射服务器的链路通过R6,是此图中的ALT,仅用于两者之间的控制平面通信。此链路从不用于xTR之间的实际流量。
alt-vrf:此虚拟路由和转发(VRF)用于配置定位器/ID分离协议(LISP)在通过IPv4端点标识符到路由定位器(EID到RLOC)映射直接发送映射请求时应使用的支持IPv4地址系列的VRF实例备用逻辑拓扑(ALT)
!
router lisp
database-mapping 172.16.1.1/32 10.1.12.1 priority 5 weight 100 ------> EID Mapping with RLOC
ipv4 itr map-resolver 192.168.5.5
ipv4 itr
ipv4 etr map-server 192.168.7.7 key cisco ---> ETR will send the map-register message to map server for EID
ipv4 etr
exit
!
!
router lisp
database-mapping 172.16.4.4/32 10.1.34.4 priority 5 weight 100 ------> EID Mapping with RLOC
ipv4 itr map-resolver 192.168.5.5
ipv4 itr
ipv4 etr map-server 192.168.7.7 key cisco ---> ETR will send the map-register message to map server for EID
ipv4 etr
exit
!
在Map-Resolved下,它强制将vrf定义为alt-vrf,该alt-vrf将用于在MR和MS之间形成MPBGP对等,然后用于共享通过xTR注册到MS的远程站点的EID。
!
vrf definition lisp
rd 100:1
!
address-family ipv4
route-target export 100:1
route-target import 100:1
exit-address-family
!
!
interface Tunnel1
vrf forwarding lisp
ip address 10.1.45.4 255.255.255.0
tunnel source Ethernet0/1
tunnel destination 10.1.67.7
!
!
router lisp
ipv4 map-resolver
ipv4 alt-vrf lisp >>> This command defines "lisp" as the alt-vrf.
exit
!
router bgp 65000
!
address-family ipv4 vrf lisp
neighbor 10.1.45.5 remote-as 65000
neighbor 10.1.45.5 activate
exit-address-family
!
与MR类似,在MS上也需要配置alt-vrf。
!
router lisp
site 1
authentication-key cisco
eid-prefix 172.16.4.4/32 accept-more-specifics
exit
!
site 2
authentication-key cisco
eid-prefix 172.16.1.1/32 accept-more-specifics
exit
!
ipv4 map-server
ipv4 alt-vrf lisp >>>>>>> ALT VRF is lisp
exit
!
vrf definition lisp
rd 100:1
!
address-family ipv4
route-target export 100:1
route-target import 100:1
exit-address-family
!
!
interface Tunnel1
vrf forwarding lisp
ip address 10.1.45.5 255.255.255.0
tunnel source Ethernet0/0
tunnel destination 10.1.56.5
!
router bgp 65000
!
address-family ipv4 vrf lisp
redistribute lisp
neighbor 10.1.45.4 remote-as 65000
neighbor 10.1.45.4 activate
exit-address-family
!
end
验证
要触发LISP通信,需要满足以下条件之一:
以下是操作顺序:
R1_XTR#sh ip route 172.16.4.4 -----> R4's EID
% Subnet not in table
R1_XTR#sh ip route 0.0.0.0
Routing entry for 0.0.0.0/0, supernet
Known via "static", distance 1, metric 0 (connected), candidate default path
Routing Descriptor Blocks:
* directly connected, via Null0
Route metric is 0, traffic share count is 1
如上所示,路由到R4的EID:17.16.4.4不在路由表中。而是静态配置了指向null0的默认路由。满足必要的触发条件后,对17.16.4.4执行ping操作将触发LISP封装。
R1_XTR#ping 172.16.4.4 source lo1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.4.4, timeout is 2 seconds:
Packet sent with a source address of 172.16.1.1
..!!!
Success rate is 60 percent (3/5), round-trip min/avg/max = 1/4/7 ms
R1_XTR#
为了使上述ping工作,R4通过LISP通信将有关目的xTR的信息发送到R1:
R1_XTR#sh ip lisp map-cache
LISP IPv4 Mapping Cache for EID-table default (IID 0), 2 entries
0.0.0.0/0, uptime: 06:10:24, expires: never, via static send map-request
Negative cache entry, action: send-map-request
172.16.4.4/32, uptime: 05:55:27, expires: 18:04:32, via map-reply, complete
Locator Uptime State Pri/Wgt
10.1.34.4 05:55:27 up 1/100
以下是一些调试输出和数据包捕获,用于检查LISP数据包流。已启用以下debug命令以捕获信息:“debug lisp control-plane all”。
注意:请注意,debug命令会生成大量数据,需要在受控环境中运行。
在下面的调试消息中,R1正在向MS注册其EID,然后MS将确认。同样,R4也将向MS注册其EID。
*Oct 16 12:46:09.398: LISP-0: IPv4 Map Server IID 0 192.168.7.7, Sending map-register (src_rloc 10.1.15.1) nonce 0xBEB73F0C-0xFE3EBC4E.
*Oct 16 12:46:09.403: LISP: Processing received Map-Notify message from 192.168.7.7 to 10.1.15.1
现在,从R1向R4的EID发起ping,源自R1的EID,R1立即向MR发送映射请求数据包。
R1_XTR#ping 172.16.4.4 source 172.16.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.4.4, timeout is 2 seconds:
Packet sent with a source address of 172.16.1.1
*Oct 16 12:46:23.380: LISP: Send map request type remote EID prefix
*Oct 16 12:46:23.380: LISP: Send map request for EID prefix IID 0 172.16.4.4/32
*Oct 16 12:46:23.380: LISP-0: Remote EID IID 0 prefix 172.16.4.4/32, Send map request (1) (sources: <signal>, state: incomplete, rlocs: 0).
*Oct 16 12:46:23.380: LISP-0: AF IPv4, Sending map-request from 10.1.12.1 to 172.16.4.4 for EID 172.16.4.4/32, ITR-RLOCs 1, nonce 0x99255979-0x30A1BAC1 (encap src 10.1.15.1, dst 192.168.5.5).
收到数据包时,MR与MS联系以标识为此EID注册的xTR,并将映射请求消息转发到R4。R4作为回报,将映射应答发送回R1,其RLOC为:
*Oct 16 12:46:23.389: LISP: Processing received Map-Reply message from 10.1.34.4 to 10.1.12.1
*Oct 16 12:46:23.389: LISP: Received map reply nonce 0x99255979-0x30A1BAC1, records 1
*Oct 16 12:46:23.389: LISP: Processing Map-Reply mapping record for IID 0 172.16.4.4/32, ttl 1440, action none, authoritative, 1 locator
10.1.34.4 pri/wei=1/100 LpR
*Oct 16 12:46:23.389: LISP-0: Map Request IID 0 prefix 172.16.4.4/32 remote EID prefix[LL], Received reply with rtt 9ms.
*Oct 16 12:46:23.389: LISP: Processing mapping information for EID prefix IID 0 172.16.4.4/32
如下所示,MR首先收到来自R1的映射请求消息,以了解172.16.4.4的RLOC。然后,在从MS获取的EID中检查其BGP lisp vrf表是否匹配,并在发现匹配时MR将映射请求转发到MS:
LISP_Resolver#show ip bgp vpnv4 vrf lisp
BGP table version is 3, local router ID is 192.168.5.5
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found
Network Next Hop Metric LocPrf Weight Path
Route Distinguisher: 100:1 (default for vrf lisp)
*>i 172.16.1.1/32 10.1.45.5 1 100 0 ?
*>i 172.16.4.4/32 10.1.45.5 1 100 0 ?
*Oct 16 12:46:23.384: LISP: Processing received Map-Request message from 10.1.12.1 to 172.16.4.4
*Oct 16 12:46:23.384: LISP: Received map request for IID 0 172.16.4.4/32, source_eid IID 0 172.16.1.1, ITR-RLOCs: 10.1.12.1, records 1, nonce 0x99255979-0x30A1BAC1
*Oct 16 12:46:23.384: LISP-0: AF IID 0 IPv4, Forwarding map request to 172.16.4.4 on the ALT.
注意:即使日志消息显示映射请求正被转发到172.16.4.4,它实际上也会根据BGP表中的下一跳条目发送到MS。
在MS上运行的调试显示先从R1和R4注册各自ETR的映射注册消息:
*Oct 16 12:46:09.398: LISP: Processing Map-Register mapping record for IID 0 172.16.1.1/32, ttl 1440, action none, authoritative, 1 locator
10.1.12.1 pri/wei=5/100 LpR
*Oct 16 12:46:09.398: LISP-0: MS registration IID 0 prefix 172.16.1.1/32 10.1.15.1 site 2, Updating.
*Oct 16 12:46:41.445: LISP: Processing Map-Register mapping record for IID 0 172.16.4.4/32, ttl 1440, action none, authoritative, 1 locator
10.1.34.4 pri/wei=1/100 LpR
*Oct 16 12:46:41.445: LISP-0: MS registration IID 0 prefix 172.16.4.4/32 10.1.47.4 site 1, Updating.
现在,两个xTR均已成功注册其EID:
R7#show lisp site detail
LISP Site Registration Information
Site name: 1
Allowed configured locators: any
Allowed EID-prefixes:
EID-prefix: 172.16.4.4/32
First registered: 05:02:48 Routing table tag: 0
Origin: Configuration, accepting more specifics
Merge active: No
Proxy reply: No
TTL: 1d00h
State: complete
Registration errors:
Authentication failures: 0
Allowed locators mismatch: 0
ETR 10.1.47.4, last registered 00:00:21, no proxy-reply, map-notify
TTL 1d00h, no merge, hash-function sha1, nonce 0x56D89121-0xC39C2892
state complete, no security-capability
xTR-ID 0xF7DE6C93-0x06F8DDA4-0x7D6400B1-0x19EC9669
site-ID unspecified
Locator Local State Pri/Wgt
10.1.34.4 yes up 1/100
Site name: 2
Allowed configured locators: any
Allowed EID-prefixes:
EID-prefix: 172.16.1.1/32
First registered: 05:02:46
Routing table tag: 0
Origin: Configuration, accepting more specifics
Merge active: No
Proxy reply: No
TTL: 1d00h
State: complete
Registration errors:
Authentication failures: 0
Allowed locators mismatch: 0
ETR 10.1.15.1, last registered 00:00:50, no proxy-reply, map-notify
TTL 1d00h, no merge, hash-function sha1, nonce 0xBEB73F0C-0xFE3EBC4E
state complete, no security-capability
xTR-ID 0xCF7E1300-0x302FF91A-0x1C2D0499-0x8A105258
site-ID unspecified
Locator Local State Pri/Wgt
10.1.12.1 yes up 5/100
当从R1执行ping操作,MR向MS发送映射请求消息时,MS上可以看到以下日志:
*Oct 16 12:46:23.388: LISP: Processing received Map-Request message from 10.1.12.1 to 172.16.4.4
*Oct 16 12:46:23.388: LISP: Received map request for IID 0 172.16.4.4/32, source_eid IID 0 172.16.1.1, ITR-RLOCs: 10.1.12.1, records 1, nonce 0x99255979-0x30A1BAC1
*Oct 16 12:46:23.388: LISP-0: MS EID IID 0 prefix 172.16.4.4/32 site 1, Forwarding map request to ETR RLOC 10.1.34.4.
R4上发生以下事件:
*Oct 16 13:32:40.700: LISP: Processing received Encap-Control message from 10.1.47.7 to 10.1.34.4
*Oct 16 13:32:40.702: LISP: Processing received Map-Request message from 10.1.12.1 to 172.16.4.4
*Oct 16 13:32:40.702: LISP: Received map request for IID 0 172.16.4.4/32, source_eid IID 0 172.16.1.1, ITR-RLOCs: 10.1.12.1, records 1, nonce 0x188823A0-0xAFF029C8
*Oct 16 13:32:40.702: LISP: Processing map request record for EID prefix IID 0 172.16.4.4/32
*Oct 16 13:32:40.702: LISP-0: Sending map-reply from 10.1.34.4 to 10.1.12.1.
下面的数据包捕获用于从R1发出的R4的映射请求:
Internet Protocol Version 4, Src: 10.1.15.1 (10.1.15.1), Dst: 192.168.5.5 (192.168.5.5)
Version: 4
Header Length: 20 bytes
Differentiated Services Field: 0xc0 (DSCP 0x30: Class Selector 6; ECN: 0x00: Not-ECT (Not ECN-Capable Transport))
Total Length: 120
Identification: 0x1446 (5190)
Flags: 0x00
Fragment offset: 0
Time to live: 31
Protocol: UDP (17)
Header checksum: 0xa7c0 [validation disabled]
Source: 10.1.15.1 (10.1.15.1)
Destination: 192.168.5.5 (192.168.5.5)
[Source GeoIP: Unknown]
[Destination GeoIP: Unknown]
User Datagram Protocol, Src Port: 4342 (4342), Dst Port: 4342 (4342)
Locator/ID Separation Protocol
Internet Protocol Version 4, Src: 10.1.12.1 (10.1.12.1), Dst: 172.16.4.4 (172.16.4.4)
Version: 4
Header Length: 20 bytes
Differentiated Services Field: 0xc0 (DSCP 0x30: Class Selector 6; ECN: 0x00: Not-ECT (Not ECN-Capable Transport))
Total Length: 88
Identification: 0x1445 (5189)
Flags: 0x00
Fragment offset: 0
Time to live: 32
Protocol: UDP (17)
Header checksum: 0xbf7a [validation disabled]
Source: 10.1.12.1 (10.1.12.1)
Destination: 172.16.4.4 (172.16.4.4)
[Source GeoIP: Unknown]
[Destination GeoIP: Unknown]
User Datagram Protocol, Src Port: 4342 (4342), Dst Port: 4342 (4342)
Locator/ID Separation Protocol
映射寄存器数据包捕获如下:
Internet Protocol Version 4, Src: 10.1.47.4 (10.1.47.4), Dst: 192.168.7.7 (192.168.7.7)
User Datagram Protocol, Src Port: 4342 (4342), Dst Port: 4342 (4342)
Locator/ID Separation Protocol
0011 .... .... .... .... .... = Type: Map-Register (3)
.... 0... .... .... .... .... = P bit (Proxy-Map-Reply): Not set
.... .0.. .... .... .... .... = S bit (LISP-SEC capable): Not set
.... ..1. .... .... .... .... = I bit (xTR-ID present): Set
.... ...0 .... .... .... .... = R bit (Built for an RTR): Not set
.... .... 0000 0000 0000 000. = Reserved bits: 0x000000
.... .... .... .... .... ...1 = M bit (Want-Map-Notify): Set
Record Count: 1
Nonce: 0x56d89121c39c2892
Key ID: 0x0001
Authentication Data Length: 20
Authentication Data: ce8f37f14c76d49e52717d1c5407e638e2733015
Mapping Record 1, EID Prefix: 172.16.4.4/32, TTL: 1440, Action: No-Action, Authoritative
Record TTL: 1440
Locator Count: 1
EID Mask Length: 32
000. .... .... .... = Action: No-Action (0)
...1 .... .... .... = Authoritative bit: Set
.... .000 0000 0000 = Reserved: 0x0000
0000 .... .... .... = Reserved: 0x0000
.... 0000 0000 0000 = Mapping Version: 0
EID Prefix AFI: IPv4 (1)
EID Prefix: 172.16.4.4 (172.16.4.4)
Locator Record 1, Local RLOC: 10.1.34.4, Reachable, Priority/Weight: 1/100, Multicast Priority/Weight: 255/0
xTR-ID: f7de6c9306f8dda47d6400b119ec9669
Site-ID: 0000000000000000
从R4接收R1上捕获的映射应答消息
Internet Protocol Version 4, Src: 10.1.34.4 (10.1.34.4), Dst: 10.1.12.1 (10.1.12.1)
User Datagram Protocol, Src Port: 4342 (4342), Dst Port: 4342 (4342)
Locator/ID Separation Protocol
0010 .... .... .... .... .... = Type: Map-Reply (2)
.... 0... .... .... .... .... = P bit (Probe): Not set
.... .0.. .... .... .... .... = E bit (Echo-Nonce locator reachability algorithm enabled): Not set
.... ..0. .... .... .... .... = S bit (LISP-SEC capable): Not set
.... ...0 0000 0000 0000 0000 = Reserved bits: 0x000000
Record Count: 1
Nonce: 0xe9ee73f07b0cb7d6
Mapping Record 1, EID Prefix: 172.16.4.4/32, TTL: 1440, Action: No-Action, Authoritative
Record TTL: 1440
Locator Count: 1
EID Mask Length: 32
000. .... .... .... = Action: No-Action (0)
...1 .... .... .... = Authoritative bit: Set
.... .000 0000 0000 = Reserved: 0x0000
0000 .... .... .... = Reserved: 0x0000
.... 0000 0000 0000 = Mapping Version: 0
EID Prefix AFI: IPv4 (1)
EID Prefix: 172.16.4.4 (172.16.4.4)
Locator Record 1, Local RLOC: 10.1.34.4, Reachable, Priority/Weight: 1/100, Multicast Priority/Weight: 255/0