この文書はRFC1624の日本語訳(和訳)です。 この文書の翻訳内容の正確さは保障できないため、 正確な知識や情報を求める方は原文を参照してください。 翻訳者はこの文書によって読者が被り得る如何なる損害の責任をも負いません。 この翻訳内容に誤りがある場合、訂正版の公開や、 誤りの指摘は適切です。 この文書の配布は元のRFC同様に無制限です。
Network Working Group A. Rijsinghani, Editor
Request for Comments: 1624 Digital Equipment Corporation
Updates: 1141 May 1994
Category: Informational
Computation of the Internet Checksum
via Incremental Update
逐次更新によるインターネットチェックサム計算
Status of this Memo
この文書の状態
This memo provides information for the Internet community. This memo
does not specify an Internet standard of any kind. Distribution of
this memo is unlimited.
このメモはインターネット共同体のための情報を供給します。このメモはイ
ンターネット標準を指定しません。このメモの配布は無制限です。
Abstract
概要
This memo describes an updated technique for incremental computation
of the standard Internet checksum. It updates the method described
in RFC 1141.
このメモは標準的なインターネットチェックサムの逐次計算のための更新技
術を記述します。これはRFC1141で記述された方法を更新します。
Table of Contents
目次
1. Introduction
1. はじめに
2. Notation and Equations
2. 表記と方程式
3. Discussion
3. 論議
4. Examples
4. 例
5. Checksum verification by end systems
5. 終端システムによるチェックサム検査
6. Historical Note
6. 歴史的メモ
7. Acknowledgments
7. 謝辞
8. Security Considerations
8. セキュリティの考察
9. Conclusions
9. 結論
10. Author's Address
10. 著者のアドレス
11. References
11. 参考文献
1. Introduction
1. はじめに
Incremental checksum update is useful in speeding up several
types of operations routinely performed on IP packets, such as
TTL update, IP fragmentation, and source route update.
逐次チェックサム更新は、TTL更新やIPパケット分割やソースルート更
新のような、IPパケット上のいくつかの種類の定常処理を速めることに有
用です。
RFC 1071, on pages 4 and 5, describes a procedure to
incrementally update the standard Internet checksum. The
relevant discussion, though comprehensive, was not complete.
Therefore, RFC 1141 was published to replace this description
on Incremental Update. In particular, RFC 1141 provides a
more detailed exposure to the procedure described in RFC 1071.
However, it computes a result for certain cases that differs
from the one obtained from scratch (one's complement of one's
complement sum of the original fields).
RFC1071の4頁と5頁は標準的インターネットチェックサムを更新す
る手順を記述します。適切な論議は、包括的であるが、完全ではありません
でした。それ故に、RFC1141が逐次更新の記述の置換えとして公表さ
れました。特に、RFC1141がRFC1071で記述された手順のより
詳細な描写を供給します。しかしながら、それはゼロから得られたものでは
ないある特定の場合のの結果を計算します(元のフィールドの1の補数の合
計の1の補数)。
For the sake of completeness, this memo briefly highlights key
points from RFCs 1071 and 1141. Based on these discussions,
an updated procedure to incrementally compute the standard
Internet checksum is developed and presented.
完全性のために、このメモはRFC1071とRFC1141の要点を手短
かに示します。これらの議論に基づいて、標準インターネットチェックサム
の逐次更新を計算する手順が開発され、提出されます。
2. Notation and Equations
2. 表記と方程式
Given the following notation:
次の表記で:
HC - old checksum in header
古いヘッダのチェックサム
C - one's complement sum of old header
古いヘッダの1の補数の合計
HC' - new checksum in header
新しいヘッダのチェックサム
C' - one's complement sum of new header
新しいヘッダの1の補数の合計
m - old value of a 16-bit field
16ビットフィールドの古い値
m' - new value of a 16-bit field
16ビットフィールドの新しい値
RFC 1071 states that C' is:
RFC1071はC'を以下と述べます:
C' = C + (-m) + m' -- [Eqn. 1]
= C + (m' - m)
As RFC 1141 points out, the equation above is not useful for direct
use in incremental updates since C and C' do not refer to the actual
checksum stored in the header. In addition, it is pointed out that
RFC 1071 did not specify that all arithmetic must be performed using
one's complement arithmetic.
RFC1141が指摘するように、上記方程式は、CとC’がヘッダに設定さ
れている実際のチェックサムでないので、逐次更新での直接使用には役立ち
ません。加えて、RFC1071が1の補数演算を使ってすべての演算が行
われなくてはならないと明示しなかったことを指摘します。
Finally, complementing the above equation to get the actual checksum,
RFC 1141 presents the following:
最後に、実際のチェックサムを得るために上記の方程式を補完して、RFC
1141は次を提示します:
HC' = ~(C + (-m) + m')
= HC + (m - m')
= HC + m + ~m' -- [Eqn. 2]
3. Discussion
3. 論議
Although this equation appears to work, there are boundary conditions
under which it produces a result which differs from the one obtained
by checksum computation from scratch. This is due to the way zero is
handled in one's complement arithmetic.
この方程式が働くように思われるけれども、ゼロからのチェックサム計算に
よって得られたものと違う結果を作り出す境界状態があります。これはゼロ
を1の補数演算で処理する方法のためです。
In one's complement, there are two representations of zero: the all
zero and the all one bit values, often referred to as +0 and -0.
One's complement addition of non-zero inputs can produce -0 as a
result, but never +0. Since there is guaranteed to be at least one
non-zero field in the IP header, and the checksum field in the
protocol header is the complement of the sum, the checksum field can
never contain ~(+0), which is -0 (0xFFFF). It can, however, contain
~(-0), which is +0 (0x0000).
1の補数で、ゼロの2つの表現があります:しばしば+0と-0と述べられる、
すべて0とすべて1の値です。ゼロ以外の入力の1の補数の加算は、-0の結
果を生成する事はありますが、決して+0にはなりません。IPヘッダに少な
くとも1つのゼロ以外のフィールドであり、そしてプロトコルヘッダでの
チェックサムフィールドは合計の補数なので、チェックサムフィールドは決
して~(+0)つまり-0 (0xFFFF)を含みません。しかし、~(-0)つまり+0 (0x0000)
を含みえます。
RFC 1141 yields an updated header checksum of -0 when it should be
+0. This is because it assumed that one's complement has a
distributive property, which does not hold when the result is 0 (see
derivation of [Eqn. 2]).
RFC1141は+0であるべきである時に-0の更新されたヘッダチェックサ
ムを生じます。これは1の補数が分配法則を満たすと仮定したからで、結果
が0の時は満たしません([Eqn. 2]の導出を参照)。
The problem is avoided by not assuming this property. The correct
equation is given below:
問題はこの法則を仮定しないことで避けられます。正しい方程式は下に与え
られます:
HC' = ~(C + (-m) + m') -- [Eqn. 3]
= ~(~HC + ~m + m')
4. Examples
4. 例
Consider an IP packet header in which a 16-bit field m = 0x5555
changes to m' = 0x3285. Also, the one's complement sum of all other
header octets is 0xCD7A.
16ビットのフィールドm = 0x5555がm' = 0x3285に変わるIPパケットヘッ
ダを考えます。同じく、全ての他のヘッダオクテットの1の補数の合計は
0xCD7Aです。
Then the header checksum would be:
それでヘッダチェックサムは以下でしょう:
HC = ~(0xCD7A + 0x5555)
= ~0x22D0
= 0xDD2F
The new checksum via recomputation is:
再計算による新しいチェックサムは以下です:
HC' = ~(0xCD7A + 0x3285)
= ~0xFFFF
= 0x0000
Using [Eqn. 2], as specified in RFC 1141, the new checksum is
computed as:
RFC1141で示されるように[Eqn. 2]を使用して新しいチェックサムは
以下の様に計算されます:
HC' = HC + m + ~m'
= 0xDD2F + 0x5555 + ~0x3285
= 0xFFFF
which does not match that computed from scratch, and moreover can
never obtain for an IP header.
これはセロから計算したものと一致せず、さらにIPヘッダで使うことがで
きません。
Applying [Eqn. 3] to the example above, we get the correct result:
上記例の[Eqn. 3]を適用し、正しい結果を得ます:
HC' = ~(C + (-m) + m')
= ~(0x22D0 + ~0x5555 + 0x3285)
= ~0xFFFF
= 0x0000
5. Checksum verification by end systems
5. 終端システムによるチェックサム検査
If an end system verifies the checksum by including the checksum
field itself in the one's complement sum and then comparing the
result against -0, as recommended by RFC 1071, it does not matter if
an intermediate system generated a -0 instead of +0 due to the RFC
1141 property described here. In the example above:
もし終端システムが1の補数の合計のチェックサムフィールドを含むチェッ
クサムの検査をし、そしてRFC1071で勧められるように-0と比較する
なら、もし中間システムがRFC1141のここで記述した性質により+0の
代わりに-0を生成したら、これに対応すべきです。上記例で:
0xCD7A + 0x3285 + 0xFFFF = 0xFFFF
0xCD7A + 0x3285 + 0x0000 = 0xFFFF
However, implementations exist which verify the checksum by computing
it and comparing against the header checksum field.
しかしながら、チェックサムを計算しヘッダのチェックサムフィールドと比
較する実装が存在します。
It is recommended that intermediate systems compute incremental
checksum using the method described in this document, and end systems
verify checksum as per the method described in RFC 1071.
中間システムがこの文書で記述された方法で逐次チェックサムを計算するこ
とが勧められます、そして終端システムがRFC1071で記述された方法
に従ってチェックサムを検証します。
The method in [Eqn. 3] is slightly more expensive than the one in RFC
1141. If this is a concern, the two additional instructions can be
eliminated by subtracting complements with borrow [see Sec. 7]. This
would result in the following equation:
[Eqn. 3]の方法はわずかにRFC1141よりも高価です。もしこれを心配
するなら、2つの加算命令はボローと共に補数を減算する事で除去できます
[7章参照]。これは次の方程式をもたらすでしょう:
HC' = HC - ~m - m' -- [Eqn. 4]
In the example shown above,
HC' = HC - ~m - m'
= 0xDD2F - ~0x5555 - 0x3285
= 0x0000
6. Historical Note
6. 歴史的メモ
A historical aside: the fact that standard one's complement
arithmetic produces negative zero results is one of its main
drawbacks; it makes for difficulty in interpretation. In the CDC
6000 series computers [4], this problem was avoided by using
subtraction as the primitive in one's complement arithmetic (i.e.,
addition is subtraction of the complement).
歴史的余談:標準の1の補数演算が負のゼロの結果となる事実は欠点の1つ
です;それは判断を困難にします。CDC6000のシリーズコンピュータ
[4]で、この問題は1の補数演算で減算をプリミティブとして用いることで避
けられました(すなわち、加算は減算の補数です)。
7. Acknowledgments
7. 謝辞
The contribution of the following individuals to the work that led to
this document is acknowledged:
この文書に導いた仕事への次の人の貢献に感謝します:
Manu Kaycee - Ascom Timeplex, Incorporated
Paul Koning - Digital Equipment Corporation
Tracy Mallory - 3Com Corporation
Krishna Narayanaswamy - Digital Equipment Corporation
Atul Pandya - Digital Equipment Corporation
The failure condition was uncovered as a result of IP testing on a
product which implemented the RFC 1141 algorithm. It was analyzed,
and the updated algorithm devised. This algorithm was also verified
using simulation. It was also shown that the failure condition
disappears if the checksum verification is done as per RFC 1071.
失敗条件はRFC1141のアルゴリズムを実装した製品上のIPテストの
結果として暴露されました。これは分析され、そして更新されたアルゴリズ
ムが考案されました。このアルゴリズムはシミュレーションを使って検証さ
れました。もしチェックサム検査がRFC1071に従ってされるなら、失
敗状態が姿を消すことが同じく示されました。
8. Security Considerations
8. セキュリティの考察
Security issues are not discussed in this memo.
セキュリティ問題がこの文書で論じられません。
9. Conclusions
9. 結論
It is recommended that either [Eqn. 3] or [Eqn. 4] be the
implementation technique used for incremental update of the standard
Internet checksum.
[Eqn. 3]か[Eqn. 4] が標準インターネットチェックサムの逐次更新で使われ
る実装技術であることが勧められます。
10. Author's Address
10. 著者のアドレス
Anil Rijsinghani
Digital Equipment Corporation
550 King St
Littleton, MA 01460
Phone: (508) 486-6786
EMail: anil@levers.enet.dec.com
11. References
11. 参考文献
[1] Postel, J., "Internet Protocol - DARPA Internet Program Protocol
Specification", STD 5, RFC 791, DARPA, September 1981.
[2] Braden, R., Borman, D., and C. Partridge, "Computing the Internet
Checksum", RFC 1071, ISI, Cray Research, BBN Laboratories,
September 1988.
[3] Mallory, T., and A. Kullberg, "Incremental Updating of the
Internet Checksum", RFC 1141, BBN Communications, January 1990.
[4] Thornton, J., "Design of a Computer -- the Control
Data 6600", Scott, Foresman and Company, 1970.