欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  网络运营

OSPF:MTU不一致探究实验

程序员文章站 2022-07-07 22:20:21
  1.Router-ID大的设备拥有更大MTU 1.1实验拓扑   1.2实验需求 (1)按拓扑完成基本IP地址配置 (2)修改R1接口MTU值为10...

 

1.Router-ID大的设备拥有更大MTU

1.1实验拓扑


OSPF:MTU不一致探究实验
 

1.2实验需求

(1)按拓扑完成基本IP地址配置

(2)修改R1接口MTU值为1000byte

(3)开启OSPF邻接关系调试,运行OSPF,但拓扑指定Router-ID,观察实验现象

(4)解决出现的问题  www.2cto.com  
 

1.3实验步骤

(1)修改MTU

R1(config-if)#ip mtu ?

  <68-1500>  MTU (bytes)

 

R1(config-if)#ip mtu 1000

 

(2)调试现象

R1

*Mar  1 00:02:42.427:        DR: 2.2.2.2 (Id)   BDR: 2.2.2.2 (Id)

*Mar  1 00:02:42.431: OSPF: Send DBD to 2.2.2.2 on FastEthernet0/0 seq 0x21D opt 0x52 flag 0x7 len 32

确定了R2的接口角色后,向其发送DD消息,本地将其状态置为Exstart

*Mar  1 00:02:42.795: OSPF: Rcv DBD from 2.2.2.2 on FastEthernet0/0 seq 0x2405 opt 0x52 flag 0x7 len 32  mtu 1500 state EXSTART

*Mar  1 00:02:42.795: OSPF: Nbr 2.2.2.2 has larger interface MTU

 

来自R2的DD消息,其Interface MTU值大于本地,忽略该DD消息

 

*Mar  1 00:02:47.431: OSPF: Send DBD to 2.2.2.2 on FastEthernet0/0 seq 0x21D opt 0x52 flag 0x7 len 32

*Mar  1 00:02:47.431: OSPF: Retransmitting DBD to 2.2.2.2 on FastEthernet0/0 [1]

*Mar  1 00:02:47.771: OSPF: Rcv DBD from 2.2.2.2 on FastEthernet0/0 seq 0x2405 opt 0x52 flag 0x7 len 32  mtu 1500 state EXSTART

*Mar  1 00:02:47.775: OSPF: Nbr 2.2.2.2 has larger interface MTU

在重传计时器内未收到来自邻居的有效DD,重传该DD,然而接收到的DD消息的Interface MTU值依然大于本地接口值,再次忽略此消息  www.2cto.com  

此后该现象多次发生,R1本地不断重传该DD消息

 

R2

*Mar  1 00:02:42.247: OSPF: Rcv DBD from 1.1.1.1 on FastEthernet0/0 seq 0x21D opt 0x52 flag 0x7 len 32  mtu 1000 state 2WAY

*Mar  1 00:02:42.251: OSPF: Nbr 1.1.1.1 has smaller interface MTU

*Mar  1 00:02:42.251: OSPF: Nbr state is 2WAY

R2本地在未选举出接口角色时,就接收到DD消息,此时不会读取其中内容

 

*Mar  1 00:02:42.587:        DR: 2.2.2.2 (Id)   BDR: 1.1.1.1 (Id)

*Mar  1 00:02:42.587: OSPF: Send DBD to 1.1.1.1 on FastEthernet0/0 seq 0x2405 opt 0x52 flag 0x7 len 32

本地在确定R1接口角色后,向其发送DD消息,将R1状态置为Exstart

 

*Mar  1 00:02:47.255: OSPF: Rcv DBD from 1.1.1.1 on FastEthernet0/0 seq 0x21D opt 0x52 flag 0x7 len 32  mtu 1000 state EXSTART

*Mar  1 00:02:47.255: OSPF: Nbr 1.1.1.1 has smaller interface MTU

*Mar  1 00:02:47.259: OSPF: First DBD and we are not SLAVE

 

接收到来自R1的DD消息,实际上该消息已经是R1的重传消息了,该消息MTU值更小,但是有效,读取后确定we are not SLAVE

*Mar  1 00:02:47.587: OSPF: Send DBD to 1.1.1.1 on FastEthernet0/0 seq 0x2405 opt 0x52 flag 0x7 len 32

*Mar  1 00:02:47.587: OSPF: Retransmitting DBD to 1.1.1.1 on FastEthernet0/0 [1]

此时恰好之前发送的DD消息超时,本地重传该消息

   www.2cto.com  

(3)邻接关系

R1#sho ip ospf neighbor

Neighbor ID     Pri   State           Dead Time   Address         Interface

2.2.2.2           1   EXSTART/DR      00:00:38    31.31.12.2      FastEthernet0/0

 

R2#show ip ospf nei

Neighbor ID     Pri   State           Dead Time   Address         Interface

1.1.1.1           1   EXSTART/BDR     00:00:38    31.31.12.1      FastEthernet0/0

两台设备,此时均卡在Exstart状态

 

(4)解决问题

R1(config-if)#ip ospf mtu-ignore

 

*Mar  1 00:09:12.615: %OSPF-5-ADJCHG: Process 1, Nbr 2.2.2.2 on FastEthernet0/0 from LOADING to FULL, Loading Done

 

 

2.Router-ID小的设备拥有更大MTU

2.1实验拓扑


OSPF:MTU不一致探究实验
 

2.2实验需求

(1)按拓扑完成基本IP地址配置

(2)修改R2接口MTU值为1000byte

(3)开启OSPF邻接关系调试,运行OSPF,但拓扑指定Router-ID,观察实验现象

2.3实验步骤  www.2cto.com  

(1)调试现象

R1

*Mar  1 00:01:21.015:        DR: 2.2.2.2 (Id)   BDR: 2.2.2.2 (Id)

*Mar  1 00:01:21.019: OSPF: Send DBD to 2.2.2.2 on FastEthernet0/0 seq 0x1E88 opt 0x52 flag 0x7 len 32

确定了接口角色后,就像对应邻居发送DD消息,本地将其状态置为Exstart

 

*Mar  1 00:01:21.795: OSPF: Rcv DBD from 2.2.2.2 on FastEthernet0/0 seq 0x1C10 opt 0x52 flag 0x7 len 32  mtu 1000 state EXSTART

*Mar  1 00:01:21.795: OSPF: Nbr 2.2.2.2 has smaller interface MTU

*Mar  1 00:01:21.795: OSPF: NBR Negotiation Done. We are the SLAVE

 

由于接收到的DD消息的MTU值更小,本地读取此消息,通过比较Router-ID,确定本地为Slave

*Mar  1 00:01:21.799: OSPF: Send DBD to 2.2.2.2 on FastEthernet0/0 seq 0x1C10 opt 0x52 flag 0x2 len 52

向邻居发送带有LSA头部信息的DD消息,此时已经将邻居的状态置为Exchange

 

*Mar  1 00:01:26.791: OSPF: Rcv DBD from 2.2.2.2 on FastEthernet0/0 seq 0x1C10 opt 0x52 flag 0x7 len 32  mtu 1000 state EXCHANGE  www.2cto.com  

*Mar  1 00:01:26.791: OSPF: Nbr 2.2.2.2 has smaller interface MTU

*Mar  1 00:01:26.795: OSPF: Send DBD to 2.2.2.2 on FastEthernet0/0 seq 0x1C10 opt 0x52 flag 0x2 len 52

此后收到来自邻居的重传DD消息,本地也不断发送带有LSA头部信息的DD消息作为回应

 

R2

*Mar  1 00:01:19.631: OSPF: Rcv DBD from 1.1.1.1 on FastEthernet0/0 seq 0x1E88 opt 0x52 flag 0x7 len 32  mtu 1500 state 2WAY

*Mar  1 00:01:19.635: OSPF: Nbr 1.1.1.1 has larger interface MTU

 

*Mar  1 00:01:20.379:        DR: 2.2.2.2 (Id)   BDR: 1.1.1.1 (Id)

*Mar  1 00:01:20.379: OSPF: Send DBD to 1.1.1.1 on FastEthernet0/0 seq 0x1C10 opt 0x52 flag 0x7 len 32

*Mar  1 00:01:20.455: OSPF: Rcv DBD from 1.1.1.1 on FastEthernet0/0 seq 0x1C10 opt 0x52 flag 0x2 len 52  mtu 1500 state EXSTART  www.2cto.com  

*Mar  1 00:01:20.455: OSPF: Nbr 1.1.1.1 has larger interface MTU

由于邻居DD消息具有更高的Interface MTU,因此忽略的消息

 

*Mar  1 00:01:25.379: OSPF: Send DBD to 1.1.1.1 on FastEthernet0/0 seq 0x1C10 opt 0x52 flag 0x7 len 32

*Mar  1 00:01:25.379: OSPF: Retransmitting DBD to 1.1.1.1 on FastEthernet0/0 [1]

*Mar  1 00:01:25.435: OSPF: Rcv DBD from 1.1.1.1 on FastEthernet0/0 seq 0x1C10 opt 0x52 flag 0x2 len 52  mtu 1500 state EXSTART

*Mar  1 00:01:25.435: OSPF: Nbr 1.1.1.1 has larger interface MTU

由于始终未收到有效的DD消息,本地将重传此前发送的DD  www.2cto.com  

 

(2)邻接关系

R1#show ip ospf neighbor

Neighbor ID     Pri   State           Dead Time   Address         Interface

2.2.2.2           1   EXCHANGE/DR     00:00:39    31.31.12.2      FastEthernet0/0

 

R2#show ip ospf nei

Neighbor ID     Pri   State           Dead Time   Address         Interface

1.1.1.1           1   EXSTART/BDR     00:00:39    31.31.12.1      FastEthernet0/0

此时,邻接关系卡在了Exstart/Exchange状态