RFC1141 日本語訳
1141 Incremental updating of the Internet checksum. T. Mallory, A.Kullberg. January 1990. (Format: TXT=3587 bytes) (Updates RFC1071) (Updated by RFC1624) (Status: INFORMATIONAL)
プログラムでの自動翻訳です。
英語原文
Network Working Group T. Mallory Request for Comments: 1141 A. Kullberg Obsoletes: RFC 1071 BBN Communications January 1990
コメントを求めるワーキンググループT.マロリー・ワイス症候群要求をネットワークでつないでください: 1141A.Kullbergは以下を時代遅れにします。 RFC1071BBNコミュニケーション1990年1月
Incremental Updating of the Internet Checksum
インターネットチェックサムの増加のアップデート
Status of this Memo
このMemoの状態
This memo correctly describes the incremental update procedure for use with the standard Internet checksum. It is intended to replace the description of Incremental Update in RFC 1071. This is not a standard but rather, an implementation technique. Distribution of this memo is unlimited.
このメモは標準のインターネットチェックサムで正しく使用のためのアップデート増加手順について説明します。 RFC1071のIncremental Updateの記述を取り替えるのは意図しています。 これは規格ではなく、むしろ実現のテクニックです。 このメモの分配は無制限です。
Description
記述
In RFC 1071 on pages 4 and 5, there is a description of a method to update the IP checksum in the IP header without having to completely recompute the checksum. In particular, the RFC recommends the following equation for computing the update checksum C' from the original checksum C, and the old and new values of byte m:
4と5ページのRFC1071に、IPヘッダーで完全にrecomputeにチェックサムを持っていなくてIPチェックサムをアップデートする方法の記述があります。 '特に、RFCはオリジナルのチェックサムCからアップデートチェックサムC'を計算するための以下の方程式、およびバイトmの古くて新しい値を推薦します:
C' = C + (-m) + m' = C + (m' - m)
'C'はC+(-m)+mと等しいこと'がC+と等しいです。'、(m、'、--、m)
While the equation above is correct, it is not very useful for incremental updates since the equation above updates the checksum C, rather than the 1's complement of the checksum, ~C, which is the value stored in the checksum field. In addition, it suffers because the notation does not clearly specify that all arithmetic, including the unary negation, must be performed one's complement, and so is difficult to use to build working code. The useful calculation for 2's complement machines is:
上の方程式は正しいのですが、アップデートチェックサムの1の補数よりむしろチェックサムC、~Cを超えたチェックサム分野に格納された値である方程式以来それはそれほどアップデート増加の役に立ちません。 さらに、記法が、働くコードを築き上げるために単項否定を含むすべての演算は使用するのが実行された1の補数でなければならないので難しいと明確に指定しないので、それに苦しみます。 2がマシンの補足となるので、役に立つ計算は以下の通りです。
~C' = ~(C + (-m) + m') = ~C + (m - m') = ~C + m + ~m'
'~C'が~、と等しい、(C+(-m)+m、'、)、=~C+、(m--、m、'、)、=~C+m+~m、'
In the oft-mentioned case of updating the IP TTL field, subtracting one from the TTL means ADDING 1 or 256 as appropriate to the checksum field in the packet, using one's complement addition. One big-endian non-portable implementation in C looks like:
IP TTL分野をアップデートするしばしば言及された場合では、TTLからの1つを引き算すると、ADDING1か256は適宜パケットのチェックサム分野に意味します、1の補数添加を使用して。 Cでの1つのビッグエンディアンの非携帯用の実現に似ています:
unsigned long sum; ipptr->ttl--; /* decrement ttl */ sum = ipptr->Checksum + 0x100; /* increment checksum high byte*/ ipptr->Checksum = (sum + (sum>>16)) /* add carry */
無記名の長い合計。 ipptr>のttl--、。 /*減少ttl*/合計はipptr>Checksum+0x100と等しいです。 (合計+(合計>>16))/*増分のチェックサム高バイトipptr*/>Checksum=/*は、*/を運ぶように言い足します。
This special case can be optimized in many ways: for instance, you
様々な意味でこの特別なケースを最適化できます: 例えば、あなた
Mallory & Kullberg [Page 1] RFC 1141 Incremental Updating January 1990
アップデート1990年1月の増加のマロリー・ワイス症候群とKullberg[1ページ]RFC1141
can bundle updating and checking the ttl. Compiler mileage may vary. Here is a more general and possibly more helpful example which updates the ttl by n seconds:
ttlをアップデートして、チェックしながら、荷物をまとめることができます。 コンパイラマイル数は異なるかもしれません。 ここに、n秒までにttlをアップデートするより一般的でことによるとより有用な例があります:
UpdateTTL(iph,n) struct ip_hdr *ipptr; unsigned char n; { unsigned long sum; unsigned short old;
UpdateTTL(iph、n)struct ip_hdr*ipptr。 無記名の炭n。 無記名の長い合計(無記名の背の低い老人)
old = ntohs(*(unsigned short *)&ipptr->ttl); ipptr->ttl -= n; sum = old + (~ntohs(*(unsigned short *)&ipptr->ttl) & 0xffff); sum += ntohs(ipptr->Checksum); sum = (sum & 0xffff) + (sum>>16); ipptr->Checksum = htons(sum + (sum>>16)); }
古い=はntohsされます(*(無記名の短い*)とipptr->はttlされます)。 ipptr>のttl-=n。 =老人のために+ (~ntohs(*(無記名の短い*)とipptr->はttlされる)と0xffff)をまとめてください。 合計+=は(ipptr>のChecksum)をntohsします。 合計は(合計と0xffff)+(合計>>16)と等しいです。 ipptr>のChecksumはhtons(合計+(合計>>16))と等しいです。 }
Security Considerations
セキュリティ問題
Security issues are not addressed in this memo.
安全保障問題はこのメモに記述されません。
Authors' Addresses
作者のアドレス
Tracy Mallory BBN Communications Corporation 50 Moulton Street Cambridge, MA 02238
トレーシーマロリー・ワイス症候群BBNコミュニケーション社50のモールトン・通りケンブリッジ、MA 02238
Phone: (617) 873-3193
以下に電話をしてください。 (617) 873-3193
EMail: tmallory@CCV.BBN.COM
メール: tmallory@CCV.BBN.COM
A. Kullberg BBN Communications Corporation 50 Moulton Street Cambridge, MA 02238
A.Kullberg BBNコミュニケーション社50のモールトン・通りケンブリッジ、MA 02238
Phone: (617) 873-4000
以下に電話をしてください。 (617) 873-4000
EMail: akullberg@BBN.COM
メール: akullberg@BBN.COM
Mallory & Kullberg [Page 2]
マロリー・ワイス症候群とKullberg[2ページ]
一覧
スポンサーリンク