路由器情况二

本文详细描述了R1与R4之间通过R2和R3进行通信的过程,涉及EIGRP路由协议、CEF转发及IP数据包的二、三层封装。R1通过网关R2与R4交互时,部分数据包丢失,原因可能是R3缺少目的MAC地址。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

 

R1R2段是12.1.1.0/24

R2R3段是23.1.1.0/24

R3R4段是34.1.1.0/24

R2R3之间运行EIGRP路由协议,发布的网段是0.0.0.0

R1设置网关地址是12.1.1.2

R4设置网关地址是34.1.13

 

R112.1.1.1要和R434.1.1.4发生通信,会丢一两个包,具体通信过程如下

1.R1先把对方的IP地址和自己的mask计算,然后把自己的IP地址和自己mask计算,发现不相同,就知道和自己不是同个网段的,发现自己有网关地址,

所以发送icmp包时先查询网关的mac地址,然后二层封装的源地址是自己的mac地址,目的地址是R2F1/0mac地址,把icmp请求包发给R2F1/0

 

2.R2收到该数据包,发现是发给自己的,然后检查FCS域,没错的话,就去掉二层头部,裸露三层包头和ICMP数据,检查IP包头的校验和,没错的话,就查看目的地址

发现是34.1.1.4,然后查找FIB(FIB其实就是路由表的拷贝,是在控制层面把路由表拷贝进FIB这个硬件区域中的),并行操作,符合最长掩码符合原则,最后查找到要去34.1.1.4

要从F1/1出去,下一跳地址是23.1.13,所以自己的三层源目地址不变,然后TTL减掉一,变为254,重新计算ip包头校验和,然后二层需要封装R2F1/1mac地址和

R3F1/1mac地址,通过adj表可以直接进行mac地址重写,然后计算FCS,从R2F1/1发送出去

 

R2开启debug ip packets,发现R1ping R4CEF传送数据包

R2#

*Feb  8 11:06:15.363: CEF: Try to CEF switch 34.1.1.4 from FastEthernet1/0

*Feb  8 11:06:15.363: CEF: CEF switched to FastEthernet1/1

*Feb  8 11:06:15.451: CEF: Try to CEF switch 12.1.1.1 from FastEthernet1/1

*Feb  8 11:06:15.451: CEF: CEF switched to FastEthernet1/0

*Feb  8 11:06:15.483: CEF: Try to CEF switch 34.1.1.4 from FastEthernet1/0

*Feb  8 11:06:15.483: CEF: CEF switched to FastEthernet1/1

*Feb  8 11:06:15.527: CEF: Try to CEF switch 12.1.1.1 from FastEthernet1/1

*Feb  8 11:06:15.527: CEF: CEF switched to FastEthernet1/0

*Feb  8 11:06:15.547: CEF: Try to CEF switch 34.1.1.4 from FastEthernet1/0

*Feb  8 11:06:15.547: CEF: CEF switched to FastEthernet1/1

*Feb  8 11:06:15.567: CEF: Try to CEF switch 12.1.1.1 from FastEthernet1/1

*Feb  8 11:06:15.567: CEF: CEF switched to FastEthernet1/0

*Feb  8 11:06:15.599: CEF: Try to CEF switch 34.1.1.4 from FastEthernet1/0

*Feb  8 11:06:15.599: CEF: CEF switched to FastEthernet1/1

*Feb  8 11:06:15.619: CEF: Try to CEF switch 12.1.1.1 from FastEthernet1/1

*Feb  8 11:06:15.619: CEF: CEF switched to FastEthernet1/0

*Feb  8 11:06:15.679: CEF: Try to CEF switch 34.1.1.4 from FastEthernet1/0

*Feb  8 11:06:15.679: CEF: CEF switched to FastEthernet1/1

*Feb  8 11:06:15.699: CEF: Try to CEF switch 12.1.1.1 from FastEthernet1/1

*Feb  8 11:06:15.699: CEF: CEF switched to FastEthernet1/0

*Feb  8 11:06:16.447: CEF: Try to CEF switch 224.0.0.10 from FastEthernet1/1

 

通过show ip cef查看FIB区域里面的内容

R2#sh ip cef

Prefix              Next Hop             Interface

0.0.0.0/0           drop                 Null0 (default route handler entry)

0.0.0.0/32          receive

12.0.0.0/8          0.0.0.0              Null0

12.1.1.0/24         attached             FastEthernet1/0

12.1.1.0/32         receive

12.1.1.1/32         12.1.1.1             FastEthernet1/0

12.1.1.2/32         receive

12.1.1.255/32       receive

23.0.0.0/8          0.0.0.0              Null0

23.1.1.0/24         attached             FastEthernet1/1

23.1.1.0/32         receive

23.1.1.2/32         receive

23.1.1.3/32         23.1.1.3             FastEthernet1/1

23.1.1.255/32       receive

34.0.0.0/8          23.1.1.3             FastEthernet1/1

224.0.0.0/4         drop

224.0.0.0/24        receive

255.255.255.255/32  receive

 

R2#sh adjacency detail

Protocol Interface                 Address

IP       FastEthernet1/0           12.1.1.1(5)

                                   8 packets, 912 bytes

                                   CA0013FC001C

                                   CA0113FC001C0800

                                   ARP        never    

                                   Epoch: 0

IP       FastEthernet1/1           23.1.1.3(7)

                                   10 packets, 1140 bytes

                                   CA02030C001D

                                   CA0113FC001D0800

                                   ARP        never    

                                   Epoch: 0

 

3.R3收到该数据包,检查FCS,无错,拆掉二层,裸露ip包头和icmp数据,检查ip包头检验和,无错,就查看目的地址,然后通过CEF进行相关操作,把数据包从R3F1/0发送出去

 

4.R3F1/1收到该数据包,检查FCS,无错,拆掉二层,裸露ip包头和icmp数据,检查ip包头检验和,无错,查看目的地址,发现就是从自己这里出去,然后查看mac地址,发现自己没有34.1.1.4mac地址,所以会丢包,同时进行arp查询

 

 

R1会收到R2EIGRP的数据包,是因为没有配置被动接口

 

这里的回应包TTL253是因为经过了R2R3两个路由器

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值