字号·· | 护眼
theregister

致敬TCP/IP的绝妙实用主义与全球联网Celebrating the brilliant pragmatism of TCP/IP, the wiring of the world

点「原文对照」整页切到原文,或双击某段只看那段的原文。

1988 年。Windows 2.0 是运行在双软盘 8086 PC 上的 DOS 外壳。VGA 是人们向往的视频标准。东伦敦的一家三人创业公司决定打造低成本局域网。当时局域网并不普遍,也没有多少标准可言,这也是为什么一位年轻程序员对一种名为 TCP/IP 的新兴竞争者感到格外兴奋。他之所以如此关注,是因为他刚刚完成了 IBM PC 联网 API NetBIOS 的实现,而将任何形式的网络与 DOS 集成同样令人头疼。

It's 1988. Windows 2.0 is a DOS shell that runs on a dual-floppy 8086 PC. VGA is the aspirational video standard. A three-man startup in East London has decided to create low-cost LANs. There's not much of that and not much by way of standards, which is why a young programmer is rather excited by an emerging contender called TCP/IP. He's particularly keen because he's just finished implementing IBM's PC networking API, NetBIOS, which hurt almost as much as integrating any sort of networking with DOS.

研究意味着翻阅图书、查阅杂志文章,以及通过千兆比特拨号上网在 Usenet 上提问。理解错误很容易。尝试在 ISO/OSI 七层模型上构建 TCP/IP 协议栈会带来更多痛苦,但理智最终占了上风,没过多久,一个可工作的网络就诞生了。近 40 年过去了,当年那个年轻的程序员如今已成为一位爱抱怨的《注册报》专栏作家。

Research means library books, magazine articles, and asking questions on Usenet over kilobit dial-up. Getting the wrong idea is easy. Trying to build the TCP/IP stack on the ISO/OSI seven-layer model produces more pain, but sanity prevails, and after a bit, there's a working network. Nearly 40 years later, the once-young programmer is now a curmudgeonly Reg columnist.

软盘已经变成了太字节 U 盘。千兆比特调制解调器演变为千兆光纤和 Wi-Fi。图形技术也有了长足进步。而且他多年未曾碰过 Windows 或英特尔 CPU。世界已经发生了翻天覆地的变化。除了这一点——一切设施都通过 TCP/IP 相互通信。是时候庆祝全球数据生态系统的数字氧气了。TCP/IP 仍然具有新闻价值。任何看似试图替代其部分功能的尝试都值得报道,在此案例中,一种名为 Homa 的缓解拥塞协议正在取代 TCP。

Floppies have become terabyte thumb drives. Kilobit modems are gigabit fiber and Wi-Fi. Graphics have come on a bit too. And he hasn't touched Windows or an Intel CPU in years. It is a transformed world. Except for one thing – everything talks to everything over TCP/IP. It's time to celebrate the digital oxygen of the global data ecosystem. TCP/IP is still newsworthy. Any apparent attempt to replace part of it is worth reporting, in this case a congestion-easing protocol called Homa superseding TCP.

但事实上它并不是替代品,而是一种设计用来与 TCP 并行运行的替代方案。之所以能够实现这一点,归功于 TCP/IP 演变过程中做出的一个天才决策——将原本单一的协议拆分为两个:TCP 和 IP。IP,即互联网协议,仅在两个地址之间尽力发送数据包,不保证何时到达、以什么顺序到达,甚至是否能够到达。传输控制协议(TCP)使用 IP 但提供可靠的有序字节流,并安排重传丢失的数据。

Only it's not a replacement, just an alternative designed to run alongside. That this is possible is due to one of the genius decisions made as TCP/IP evolved – splitting what was one protocol into two: TCP and IP. IP, the Internet Protocol, just sends packets between two addresses, best effort, no guarantees when, in what order, or even if they'll get through. The Transmission Control Protocol uses IP but delivers a reliable, ordered stream of bytes, arranging retransmission of missing data.

因此,如果你不喜欢 TCP 的工作方式,你可以添加自己的能够使用 IP 的协议,使其与 TCP 并行运行。

Thus, if you don't like how TCP does things, you can add your own IP-speaking protocol to run alongside.

这种方法还见证了TCP/IP击败了来自行业巨头的竞争协议,例如IBM的系统网络体系结构(SNA),以及来自电信领域的异步传输模式(ATM)。他们曾说,数据包交换的IP凭借其未知延迟的非确定性传输,根本不可能成功。在那种基础上建立不起任何可靠的东西。TCP/IP由于是开放的、灵活的,并且由充满灵感的个人工程师通过共识构建而成,它只是径直发挥了实用价值。

This approach also saw TCP/IP vanquish rival protocols from very large industry incumbents, such as IBM's Systems Network Architecture (SNA) and ATM – Asynchronous Transfer Mode – from the telecoms side. Packet-switched IP can't possibly succeed, they said, with its non-deterministic transmissions of unknown latency. Nothing reliable could be built on that. TCP/IP, being open, flexible, and built by consensus by individual, inspired engineers, just got on with being useful.

这一点在1983年1月1日得到了证明,当时阿帕网(ARPANET,即互联网的雏形)在全面从其自身的NCP切换到TCP/IP时,去掉了“雏形”的标签。这类被称为“标志日”的事件并不罕见,因为此前相互隔离的早期网络为了适应新的互联世界,不得不选择适应或是消亡。正如文顿·瑟夫(Vint Cerf)和鲍勃·卡恩(Bob Kahn)在1974年发表的具有开创性的论文(PDF)中所明确的那样,TCP/IP在设计之初就是为了实现网络互联。

That had been proved on January 1, 1983, when ARPANET – the proto internet – dropped the proto when it switched over wholesale from its own NCP to TCP/IP. Known as flag days, such events weren't uncommon as previously isolated early networks had to adapt or die to the new interconnected world. TCP/IP was explicitly designed to inter-network, from the seminal paper [PDF] in 1974 by Vint Cerf and Bob Kahn.

从那份13页的论文到被阿帕网全面采纳,历时九年。五年后,一名初出茅庐的程序员就能在三个月内为完全崭新的硬件构建出协议栈。而要想为IBM的PS/2微通道架构(Micro Channel Architecture)开发出一个可安装的驱动程序,花费的时间还要更长。未来并不难看清。在战胜了竞争对手之后,TCP/IP极其务实、极其开放的灵魂多次将它从其最大的敌人手中拯救出来——也就是它自己。

From that 13-page paper to adoption across ARPANET took nine years. Five years later, a greenhorn coder could build the stack for completely novel hardware in three months. It took longer to work out how to build an installable driver for IBM's PS/2 Micro Channel Architecture. The future wasn't hard to see. Once it had beaten the opposition, the extremely practical, extremely open soul of TCP/IP repeatedly saved it from its biggest enemy. Itself.

事实证明,一旦我们拥有一种能够将任意数量的设备端到端地自由连接在一起的技术,我们就会非常渴望这样做。互联网摆脱了中央控制和把关者的束缚,呈指数级增长,尤其是当另一个协议HTTP羞涩地栖息在TCP之上后。反对者曾预测,让普通人使用这个网络会将其堵塞,以至于图像标签的引入曾被视为末日来临的预兆。拥塞崩溃可能会让这一切彻底瘫痪。

It turned out that once we had a technology that could freely connect any number of devices to each other, end to end, we wanted to do that very much. The internet, freed of central control and gatekeepers, grew exponentially, especially after another protocol, HTTP, shyly perched on top of TCP. Naysayers predicted letting ordinary people use this would clog the internet, to the point that the introduction of image tags was seen as portending the End Times. Congestion collapse could close it all down.

幸运的是,在蒂姆·伯纳斯-李开始着手研发万维网不久前,范·雅各布森和迈克·卡尔斯于1988年发表了一篇题为《拥塞避免与控制》的论文(附PDF),提出了一套针对TCP的策略和调整方案,自此将该问题一直控制在可控范围内。一个没有中央控制的全球网络,能够在运行中解决阻碍业务推进、与规模相关的问题,真是一个奇迹。

Fortunately, shortly before Tim Berners-Lee began work on the Web, a 1988 paper by Van Jacobson and Mike Karels, Congestion Avoidance and Control [PDF], came up with a set of strategies and tweaks to TCP that has kept the problem at bay ever since. A global network with no central control that can fix show-stopping, scale-related problems on the fly is a true wonder.

同样,IPv4拥有43亿个地址的32位地址字段曾看似供应过剩,直到突然之间远远不够。1995年,新版本的IP协议IPv6推出,其地址之多如同撒哈拉沙漠中的沙粒。问题在于,如果你拥有数十亿台设备,你就无法做到统一的改版日(flag day)。事实证明,IPv6对基础设施非常出色,但对边缘设备则不然。幸运的是,大约在同一时间,出现了一种名为网络地址转换(NAT)的路由器临时修补方案。

Similarly, IPv4's 32-bit address field with 4.3 billion addresses seemed an over-provision, until suddenly it was nowhere near enough. A new version of IP, IPv6, was introduced in 1995 with addresses as plentiful as grains of sand in the Sahara. The trouble was that if you've got billions of devices, you can't do a flag day. IPv6 proved great for infrastructure, but not the edge. Fortunately, a router kludge called Network Address Translation (NAT) appeared, again at roughly the same time.

它对端到端原则做出了微小的破坏,但却让旧版本的IP协议IPv4得以原封不动地运行。坦白地说,它极其丑陋。但它允许多个设备共享单个公共IP地址,这就是为什么面向普通大众开箱即用的所有设备至今仍像1981年那样使用IPv4的原因。只是别去问IPv5发生了什么。

It broke the end-to-end principle only a little bit, but let the old version of IP, IPv4, run untouched. Let's be frank. It's fugly. But it let many devices share a single public IP address, which is why everything that comes out of the box for normies still rocks IPv4 like it's 1981. Just don't ask what happened to IPv5.

TCP/IP已经通过成千上万种方式演进,其中许多微不足道,也有少数极其荒谬,例如RFC 1149(基于信鸽传输的IP协议),撰写本文时,与该协议相关的资料正在佳士得拍卖行进行拍卖。从本质上讲,它是人类最辉煌的技术成就之一,是互联世界所能做的一切的基础支撑,由智慧、远见、开放性、迭代、思想自由、行动自由、粗略共识以及可运行的代码构建而成。它理应拥有属于自己的全球统一庆祝日。让我们把它定在1月1日。让我们称之为改版日(Flag Day)。®

There are thousands of ways TCP/IP has evolved, many tiny and a few deeply silly, like RFC 1149 (IP over Avian Carriers), material relating to which is, at the time of writing, up for auction at Christie's. At heart, it is one of mankind's most brilliant technical achievements, the underpinning of everything the connected world can do, built from intelligence, vision, openness, iteration, freedom of thought, freedom of action, a rough consensus and running code. It deserves its own universal day of celebration. Let's make it January 1. Let's call it Flag Day. ®