Advertisement

java重定向layui请求_Layer 3 层网络中的重定向

阅读量:

问题:

CPU

Peak

解决:

该设备从指定端口接收的数据包经路由转发后返回同一端口,并由此引发重定向行为;关闭相关重定向机制后,CPU状态恢复正常。那么究竟是什么数据包导致CPU出现异常呢?我们发现是CPU发送的ICMP流量控制报文引起的

type5)?用下面的实验来确认到底是什么包punt到了cpu。

Topology:

7609(10.1.1.1)——-(10.1.1.2)PC

Default

Configuration:

在7609接口的默认路由处,请您注意其出口端口配置为10.1.1.2。可通过以下指令验证软件与硬件转发是否已正确应用该默认路由。

Router#sh ip cef exact-route 2.2.2.2 1.1.1.1

2.2.2.2 -> 1.1.1.1 => IP adj out of GigabitEthernet5/2, addr 10.1.1.2

Router#

Router#sh mls cef exact-route 2.2.2.2 1.1.1.1

Interface: Gi5/2, Next Hop: 10.1.1.2, Vlan: 4084, Destination Mac: 0023.7d29.d8c3

Router#

Router#sh vlan internal usage

VLAN Usage

---- --------------------

4084 GigabitEthernet5/2

步骤:

在PC上向7609打源地址为“2.2.2.2”,目的地址为“1.1.1.1”的ICMP数据包,netdr分析如下:

------- dump of outgoing inband packet -------

destmac 00.23.7D.29.D8.C3, srcmac 00.1E.F7.41.3C.80, protocol 0800

protocol ip: version 0x04, hlen 0x05, tos 0x00, totlen 46, identifier 0

df 1, mf 0, fo 0, ttl 63, src 2.2.2.2, dst 1.1.1.1

icmp type 0, code 8

------- dump of incoming inband packet -------

destmac 00.1E.F7.41.3C.80, srcmac 00.23.7D.29.D8.C3, protocol 0800

protocol ip: version 0x04, hlen 0x05, tos 0x00, totlen 46, identifier 0

df 1, mf 0, fo 0, ttl 64, src 2.2.2.2, dst 1.1.1.1

icmp type 0, code 8

打开“debug ip

在尝试配置网络接口时使用了"icmp"命令,并未成功找到任何icmp重定向的包。有关于icmp重定向提示包的问题,请查阅之前的文章《ICMP...》

重定向的一些问题》

在PC上向7609打源地址为“10.1.1.254”,目的地址为“1.1.1.1”的ICMP数据包,netdr分析如下:

------- dump of outgoing inband packet -------

destmac 00.23.7D.29.D8.C3, srcmac 00.1E.F7.41.3C.80, protocol 0800

protocol ip: version 0x04, hlen 0x05, tos 0x00, totlen 46, identifier 0

df 1, mf 0, fo 0, ttl 63, src 10.1.1.254, dst 1.1.1.1

icmp type 0, code 8

------- dump of incoming inband packet -------

destmac 00.1E.F7.41.3C.80, srcmac 00.23.7D.29.D8.C3, protocol 0800

protocol ip: version 0x04, hlen 0x05, tos 0x00, totlen 46, identifier 0

df 1, mf 0, fo 0, ttl 64, src 10.1.1.254, dst 1.1.1.1

icmp type 0, code 8

打开“debug ip

在研究"ICMP"协议时发现了一类"ICMP"重定向响应报文(RDI),但使用"netdr"进行扫描时并未成功捕获此类数据报文(RDI)。这类数据报文的产生机制是什么?为何未能捕获这些数据报文?

*Feb 14 23:09:45.417: ICMP: redirect sent to 10.1.1.254 for dest 1.1.1.1, use gw 10.1.1.2

*Feb 14 23:09:46.429: ICMP: redirect sent to 10.1.1.254 for dest 1.1.1.1, use gw 10.1.1.2

3. 在7609上配置“no ip

red”,重复1&2,没有发现路由包punt到cpu,一切正常。

结论:

通过上述实验结果可以看出, ICMP重定向不仅在Layer2层还涉及到了Layer3层的具体表现上存在显著差异

1. 路由器首先确认是否触发重定向

当发生触发事件时,在CPU上将数据包丢弃以检测其来源IP。

当源IP地址与目标端口位于同一网络段时,则会发送ICMP重定向提醒报文;CPU将原始数据包转发出去,并向目标系统发送ICMP分组请求

当两个设备不在同一网络段时,数据包可以直接由CPU处理而无需发送ICMP重定向提示报文。

补充:

My opinion is that sending an ICMP redirect packet to the SA of

the packet doesn’t make any sense. It just make sense to send such

redirect packets to the “last hop device” which send the packet to

the router, which should be in the same subnet of the router.

Router can use ASIC to hardware loop up the destination port for

a receiving packet, if it is the port the packet comes in, router

will consider to send ICMP redirect packet, however, due to sending

to the SA of the packet doesn’t make sense, so router will check if

the SA is in the same subnet with the router. I believe our router

can’t do this in hardware, that’s why we see high cpu. And in your

test 1, CPU found the SA is not in the same subnet of it’s

interface, so didn’t send the ICMP redirect. In test 2, SA in same

subnet, so router send ICMP redirect.

全部评论 (0)

还没有任何评论哟~