IPv4 首部中的 Evil bit

本贴最后更新于 975 天前,其中的信息可能已经时移世异

今天突然了解到 IPv4 中有一个“彩蛋”:Evil bit. 觉得很有意思所以在这里记下来。

首部结构

我们先看一下维基百科 IPv4 给出的 IPv4 首部结构:

image.png

可以看到其中有一个 3 位的 Flags 标志,flags 的第一位就是我们的 Evil bit, 第二位是 DF(不分片),第三位是 MF(还有分片)。

Evil bit 来源

维基百科 Evil bit 中说到了 Evil bit 来源于 RFC 3514, 是一个愚人节的幽默玩笑,用于指出 ip 数据包是不是有恶意的,因为有了这个字段,所以接收方只需要检查 Evil bit 就可以知道数据包是否是恶意数据包。

The evil bit is a fictional IPv4 packet header field proposed in RFC 3514, a humorous April Fools' Day RFC from 2003 authored by Steve Bellovin. The RFC recommended that the last remaining unused bit, the "Reserved Bit"^[1]^ in the IPv4 packet header, be used to indicate whether a packet had been sent with malicious intent, thus making computer security engineering an easy problem – simply ignore any messages with the evil bit set and trust the rest.

当然了,都说了是愚人节玩笑了,那怎么可能有用嘛,不过倒是真的有这个字段,就是没啥用,一般博客或者文章也不会提及这个字段是干嘛的。

而在 RFC 3514 中煞有其事地提到:

Currently-assigned values are defined as follows:

0x0 If the bit is set to 0, the packet has no evil intent. Hosts, network elements, etc., SHOULD assume that the packet is harmless, and SHOULD NOT take any defensive measures. (We note that this part of the spec is already implemented by many common desktop operating systems.)

0x1 If the bit is set to 1, the packet has evil intent. Secure systems SHOULD try to defend themselves against such packets. Insecure systems MAY chose to crash, be penetrated, etc.

协议不冰冷

平时发现一些有意思的东西的时候,反应大多数都是 “卧槽还有这种操作”,又或者是“迷惑,但不说”。

但是却很少会看到 Evil bit 这种带有一点恶趣味的东西,这种感觉就像忽然置身与 2003 年的愚人节,看着设计者把这样一个“恶趣味”亲手放进去 IPv4 一样有意思。

也许在不久的未来,我们也可以在自己所创造的东西中,加一点毒蘑菇再加一点旧鞋跟似的加入一点有意思的彩蛋进去。

  • 彩蛋

    一些有趣的隐藏信息或功能。

    8 引用 • 44 回帖
  • 网络
    128 引用 • 177 回帖 • 3 关注

欢迎来到这里!

我们正在构建一个小众社区,大家在这里相互信任,以平等 • 自由 • 奔放的价值观进行分享交流。最终,希望大家能够找到与自己志同道合的伙伴,共同成长。

注册 关于
请输入回帖内容 ...