【Hacker News搬运】幻数
-
Title: Magic Numbers
幻数
Text:
Url: https://exple.tive.org/blarg/2024/04/24/magic-numbers/
标题:Magic Numbers | blarg 内容总结: 2024年4月24日,作者讨论了以太网帧的最大传输单元(MTU)为何是1500字节。这个数字看似不寻常,尤其是对于那些每天与计算机打交道的人来说。1500字节并不是2的幂,也不是非常接近,而且计算机并不太关心十进制,那么这个数字是如何确定下来的呢? 作者指出,以太网头部的尺寸——36字节——源于MTU加上以太网头部总共是1536字节,这是12288位,以3Mb/秒的速度传输需要2^12微秒。这是因为发明以太网的Xerox Alto计算机有一个运行频率为3MHz的内部数据路径,所以接口能够刚好以数据到达的速度将位写入Alto的内存中,从而节省了当时非常昂贵的额外硅芯片接口或任何缓冲硬件的成本。 作者表示,对于现代人来说,“我们需要在这里选择一个正确的魔法数字,这样我们就可以直接从线上取数据,并将其直接吹送到那边特定机器的内存中”这一想法显然是疯狂的,甚至是危险的。但在当时,由于计算机几乎不存在,网络也大多不存在,未经审核和授权的网络访问肯定不存在,所以这可能看起来是一个相当合理的妥协。 最后,作者强调了众多我们现在视为标准的 things 实际上只是因为当时发明它们的技术人员利用了一些现在看似神秘的硬件的特性,从而节省了一些成本。
Post by: todsacerdoti
Comments:
thayne: At least there was a technical reason, even if it no longer makes sense. The ATM[1] protocol has a packet size of 48 bytes. Why? Because the US wanted 64 and france wanted 32. So a compromise was made that pleased no one and the standard used the average of the two, which of course isn't a power of 2.<p>[1]: <a href="https://en.m.wikipedia.org/wiki/Asynchronous_Transfer_Mode" rel="nofollow">https://en.m.wikipedia.org/wiki/Asynchronous_Transfer_Mode</a>
thayne: 至少有一个技术原因,即使它不再有意义。ATM[1]协议的数据包大小为48字节。为什么?因为美国想要64个,法国想要32个。因此,做出了一个没有人满意的折衷方案,标准使用了两者的平均值,当然这不是;t为2的幂。<p>[1]:<a href=“https://;/;en.m.wikipedia.org//:wiki/,Asynchronous_Transfer_Mode”rel=“nofollow”>https:///;en.m.wikipedia.org/;wiki/;异步传输模式</a>
risenshinetech: What's the point of articles like this? I see them crop up all the time where someone from the future looks back on some distant past WAY out of context, and says things like "This was INSANE!" "Who would ever design something like this!?" "Look at how much smarter this other idea would have been!". It's not constructive or interesting.<p>The answer is universally this: whoever designed <thing> at the time couldn't even fathom <modern thing>, and didn't need to fathom <modern thing> while they were designing <thing>. What they did at the time made perfect sense for the constraints they were aware of.
risenshinetech: 什么;这样的文章有什么意义?我看到它们总是突然出现,来自未来的人断章取义地回顾遥远的过去,并说这样的话:;这简直是疯了"";谁会设计这样的东西"";看看这个其他想法会多么聪明";。它;It’没有建设性或趣味性<p> 答案是普遍的:谁设计了<;事情>;当时不能;甚至无法理解<;现代事物>;,并且没有;不需要深究<;现代事物>;当他们设计<;事情>;。他们当时所做的一切完全符合他们所意识到的限制条件。
mehulashah: This is similar to why booster rockets are a certain width — they needed to be moved by trains that went through tunnels carved by the Romans. Those tunnels were the width of two horses pulling a chariot.
mehulashah: 这类似于为什么助推火箭有一定的宽度——它们需要通过罗马人开凿的隧道的火车来移动。那些隧道有两匹马拉着一辆战车那么宽。
dhosek: The bit about security is rather telling. I can remember in the early days of the internet almost every system on the internet had its telnet ports open. I would often telnet into my alma mater’s VAX systems from work to read Usenet news. I also had write access to system directories on the VAX that we used at work, which I never abused, but which in retrospect seems distressingly trusting. I have no idea how we qualified for ISO-9001 certification with that level of security.
dhosek: 关于安全的一点很能说明问题。我记得在互联网的早期,几乎互联网上的每个系统都打开了telnet端口。我经常下班后远程登录母校的VAX系统,阅读Usenet新闻。我还可以写访问我们在工作中使用的VAX上的系统目录,我从未滥用过这些目录,但现在回想起来,我似乎非常信任这些目录。我不知道我们是如何在这样的安全级别下获得ISO-9001认证的。
****:
****: