PING プログラムの由来(本文のみ)

Mike Muuss, The Story of the PING Program (1999)
http://ftp.arl.mil/~mike/ping.html

an unauthorized Japanese translation by TuvianNavy

付録が面白いんですが、ちょっと後回しで、さしあたり拙訳を晒してみるテスト。翻訳の公開について、故 Muuss 氏の関係者に承諾はとっていません。


Yes, it's true! I'm the author of ping for UNIX. Ping is a little thousand-line hack that I wrote in an evening which practically everyone seems to know about. :-)

ええそうですとも、私が UNIXping の作者です。ping は私が一晩で書いた1000行ばかりのハックですが、実際上 *すべての人が* このプログラムのことを知っているようです。


I named it after the sound that a sonar makes, inspired by the whole principle of echo-location. In college I'd done a lot of modeling of sonar and radar systems, so the "Cyberspace" analogy seemed very apt. It's exactly the same paradigm applied to a new problem domain: ping uses timed IP/ICMP ECHO_REQUEST and ECHO_REPLY packets to probe the "distance" to the target machine.

音響探知の原理にヒントを得て、ソナー音にちなんだ ping という名前を付けました。大学時代、私は山ほどソナーやレーダーのモデル化をやりましたから、その「サイバースペース版」というのは実にぴったりに思えたのです。まさしく同じパラダイムの新しい問題領域への適用です。ping は時刻計測つきの IP/ICMP ECHO_REQUEST と ECHO_REPLY のパケットを、ターゲットとなる計算機への「距離」を測るために使うのですから。


My original impetus for writing PING for 4.2a BSD UNIX came from an offhand remark in July 1983 by Dr. Dave Mills while we were attending a DARPA meeting in Norway, in which he described some work that he had done on his "Fuzzball" LSI-11 systems to measure path latency using timed ICMP Echo packets.

私が 4.2a BSD UNIX 用に PING を書こうと思ったそもそもの動機は1983年7月、Dave Mills 博士 [NTP の開発で知られる] がなにげなく指摘したことから来ています。我々はノルウェーDARPA の会議に出席しており、そこでかれはかれ自身の作った DEC LSI-11 上のFuzzball 間で、経路の遅延測定を ICMP Echo パケットを使って実現した方法について説明したのでした。[fuzzball はルーティングテストベッド。LSI-11 は PDP-11 のワンボード版]


In December of 1983 I encountered some odd behavior of the IP network at BRL. Recalling Dr. Mills' comments, I quickly coded up the PING program, which revolved around opening an ICMP style SOCK_RAW AF_INET Berkeley-style socket(). The code compiled just fine, but it didn't work -- there was no kernel support for raw ICMP sockets! Incensed, I coded up the kernel support and had everything working well before sunrise. Not surprisingly, Chuck Kennedy (aka "Kermit") had found and fixed the network hardware before I was able to launch my very first "ping" packet. But I've used it a few times since then. *grin* If I'd known then that it would be my most famous accomplishment in life, I might have worked on it another day or two and added some more options.

1983年12月に私は BRL [米陸軍弾道研究所、現陸軍研究所(ARL)] のIP ネットワークの妙な挙動に遭遇しました。Mills 博士のコメントを思い出し、私はPING プログラムをさくっと書き上げました。[API の] socket() の引数にSOCK_RAW と AF_INET を指定して ICMP 用にソケットをオープンする部分が重要でした。コードは問題なくコンパイルを通ったのですが、動きません‥ raw ICMP ソケットのカーネルサポートはなかったのです! かっとなってカーネルサポートを書き上げ、日の出前には全てがちゃんと動くようになりました。ありがちな話ですが、私が最初の "ping" パケットを投げたときには既に Chuck Kennedy(Kermit ファイル転送プログラムで有名、[comp.sys.sgi FAQ 管理人だった])がネットワークハードウェアの故障を見つけて直した後でした。ですがそれ以来、私は何度かそれを使いました(自慢)。もしも当時これが自分の生涯で最も賞賛される業績になると知っていたら、翌日かその次の日も作業を続け、オプションをいくつか追加していたことでしょう。


The folks at Berkeley eagerly took back my kernel modifications and the PING source code, and it's been a standard part of Berkeley UNIX ever since. Since it's free, it has been ported to many systems since then, including Microsoft Windows95 and WindowsNT. You can identify it by the distinctive messages that it prints, which look like this:

バークレイの人々は私がカーネルに加えた変更と PINGソースコードを進んで取り入れ、それ以来ずっとこれは BSD UNIX の標準の一部になっています。無料だったので、Microsoft Windows95WindowsNT を含む、他の多くのシステムにも移植されました。PING のメッセージ出力は特徴的なものなのでそれとわかります。こんな感じです。

PING vapor.arl.army.mil (128.63.240.80): 56 data bytes
64 bytes from 128.63.240.80: icmp_seq=0 time=16 ms
64 bytes from 128.63.240.80: icmp_seq=1 time=9 ms
64 bytes from 128.63.240.80: icmp_seq=2 time=9 ms
64 bytes from 128.63.240.80: icmp_seq=3 time=8 ms
64 bytes from 128.63.240.80: icmp_seq=4 time=8 ms
^C
----vapor.arl.army.mil PING Statistics----
5 packets transmitted, 5 packets received, 0% packet loss
round-trip (ms)  min/avg/max = 8/10/16


In 1993, ten years after I wrote PING, the USENIX association presented me with a handsome scroll, pronouncing me a Joint recipient of The USENIX Association 1993 Lifetime Achievement Award presented to the Computer Systems Research Group, University of California at Berkeley 1979-1993. ``Presented to honor profound intellectual achievement and unparalleled service to our Community. At the behest of CSRG principals we hereby recognize the following individuals and organizations as CSRG participants, contributors and supporters.'' Wow!

1993年、私が PING を書いてから 10 年が経っていましたが、USENIX 協会は立派な賞状で私を表彰してくれました。バークレイの CSRG の 1979年〜1993年の[BSD UNIX への貢献に対する] 生涯功労賞の共同受賞でした。「深い知的達成と我々のコミュニティに対する無二の貢献を賞します。CSRG の主要メンバーの強い要望により、以下の個人と組織を、CSRG の参加者、貢献者、支援者としてここに記します」やったね!


Want to see the source code ? (40k)

ソースコードを見てみたいかたは
こちら(40KB)。

[中身については
http://alohakun.blog7.fc2.com/blog-entry-429.html
に解説あり]


From my point of view PING is not an acronym standing for Packet InterNet Grouper, it's a sonar analogy. However, I've heard second-hand that Dave Mills offered this expansion of the name, so perhaps we're both right. Sheesh, and I thought the government was bad about expanding acronyms! :-)

私にとって PING は Packet InterNet Grouper の略語ではなく、ソナー音になぞらえた名称です。しかし、人伝に聞いた話では Dave Mills 博士がこの展開型を提案したということなので、たぶん我々両方が正しいのでしょう。ええ。それにしてもですよ、政府ってのはなんてうまくない展開型を作るんでしょうね?[Grouper原文ママ、正しくは Groper]


Phil Dykstra added ICMP Record Route support to PING, but in those early days few routers processed them, making this feature almost useless. The limitation on the number of hops that could be recorded in the IP header precluded this from measuring very long paths.

Phil DykstraPING にICMP Record Route サポートを追加しましたが、当時これを処理するルータは少なく、結果としてこの機能はほとんど使えませんでした。当時 IP ヘッダに記録できたホップ数の制限から、長い経路の測定には[いずれにせよ]使えなかったのです。


I was insanely jealous when Van Jacobson of LBL used my kernel ICMP support to write TRACEROUTE, by realizing that he could get ICMP Time-to-Live Exceeded messages when pinging by modulating the IP time to life (TTL) field. I wish I had thought of that! :-) Of course, the real traceroute uses UDP datagrams because routers aren't supposed to generate ICMP error messages for ICMP messages.

死ぬほど悔しかったのは、Van Jacobson が私の追加した ICMP カーネルサポートを使って、TRACEROUTE を実装したことです。IP ヘッダの time to life (TTL) フィールドを増やしながら ping して、それに対するICMP TTL 超過メッセージを受け取る機構を実現したのです。私が考えついていれば‥!
ただし、実際の traceroute は UDP データグラムを使います。ルータは ICMPメッセージに対しては ICMP エラーメッセージを生成しないようになっていますから。[time to life は原文ママ、正しくは time to live]


The best ping story I've ever heard was told to me at a USENIX conference, where a network administrator with an intermittent Ethernet had linked the ping program to his vocoder program, in essence writing:

今までに ping について聞いた中で最高の話は、USENIX 会場で聞いたのですが、あるネットワーク管理者が、時々通信できなくなるイーサネットの切り分けのために ping をかれの音声合成プログラムと連携させた、というものです。本質的にはこういうことです

ping goodhost | sed -e 's/.*/ping/' | vocoder

He wired the vocoder's output into his office stereo and turned up the volume as loud as he could stand. The computer sat there shouting "Ping, ping, ping..." once a second, and he wandered through the building wiggling Ethernet connectors until the sound stopped. And that's how he found the intermittent failure.

かれは音声合成出力をかれのオフィスのステレオにつなぎ、ボリュームを耐えられる最大まで上げました。コンピュータはそこから1秒おきに "Ping, ping, ping..." と叫び、かれは建物の中を巡って、音が止まるまで[経路上の]イーサネットコネクタを揺らして回りました。そうして故障箇所を特定したのです。