TCPオプションのTSOPT(Time Stamp Option)の値の進み方

タイプスタンプオプションはシーケンス番号を補助する役割をするのだが、この値がどう増えるのか、よく分からなかった。
んで、検索してみるのだが、これもやはりよく分からない。
いちおう分かったのは「あまり決まってない」ということ。

●シーケンス・テスト(SEQ,OPS,WIN,T1)
 nmap第2世代OS検出エンジンの最初のテストは,6種類のTCP SYN パケットを使ったテストである。これら6種類のパケットにはさまざまなTCPオプションが設定されており,それを110ミリ秒間隔でターゲットの開いているTCPポートに送信する。ここでは複数のテストが同時に実行される。

 まずSEQカテゴリのテストだが,6種類のパケットの応答をすべてを使う。SEQカテゴリには時間や各種カウンタの更新周期や更新方法にかかわるようなテストが含まれている。カウンタの更新周期を計算するには,多くの検査パケットを使用し多くのデータを収集した方が統計的に信頼性が高い値を算出できる。この点ではパケットは6種類より多くても構わない。6種類になっているのは,時間がかからない程度に少ない数という考えだと思われる。

 SEQテストの一つにTSテストがある。このテストでは,OSがTCP Timestampオプションに使われるカウンタ値をどの程度の間隔で更新しているかという周期を調査する。よくある実装は500ミリ秒に一つだけ Timestampカウンタを更新するというもので,ほかにも10ミリ秒周期などOSによっていろいろなパターンがある。
第2回 OS情報検出のひみつ | 日経 xTECH(クロステック)

OS検出するための手段になる、と言うことは、逆に各OSでTimestampオプションの値の増やし方が異なる、と言うことですよね。

ではRFC1323に当たってみましょう。

Jacobson, Braden, & Borman

RFC 1323          TCP Extensions for High Performance           May 1992

	  4.2.2  Timestamp Clock

         It is important to understand that the PAWS algorithm does not
         require clock synchronization between sender and receiver.  The
         sender's timestamp clock is used to stamp the segments, and the
         sender uses the echoed timestamp to measure RTT's.  However,
         the receiver treats the timestamp as simply a monotone-
         increasing serial number, without any necessary connection to
         its clock.  From the receiver's viewpoint, the timestamp is
         acting as a logical extension of the high-order bits of the
         sequence number.
         The receiver algorithm does place some requirements on the
         frequency of the timestamp clock.

         (a)  The timestamp clock must not be "too slow".

              It must tick at least once for each 2**31 bytes sent.  In
              fact, in order to be useful to the sender for round trip
              timing, the clock should tick at least once per window's
              worth of data, and even with the RFC-1072 window
              extension, 2**31 bytes must be at least two windows.

              To make this more quantitative, any clock faster than 1
              tick/sec will reject old duplicate segments for link
              speeds of ~8 Gbps.  A 1ms timestamp clock will work at
              link speeds up to 8 Tbps (8*10**12) bps!

         (b)  The timestamp clock must not be "too fast".

              Its recycling time must be greater than MSL seconds.
              Since the clock (timestamp) is 32 bits and the worst-case
              MSL is 255 seconds, the maximum acceptable clock frequency
              is one tick every 59 ns.

              However, it is desirable to establish a much longer
              recycle period, in order to handle outdated timestamps on
              idle connections (see Section 4.2.3), and to relax the MSL
              requirement for preventing sequence number wrap-around.
              With a 1 ms timestamp clock, the 32-bit timestamp will
              wrap its sign bit in 24.8 days.  Thus, it will reject old
              duplicates on the same connection if MSL is 24.8 days or
              less.  This appears to be a very safe figure; an MSL of
              24.8 days or longer can probably be assumed by the gateway
              system without requiring precise MSL enforcement by the
              TTL value in the IP layer.

         Based upon these considerations, we choose a timestamp clock
         frequency in the range 1 ms to 1 sec per tick.  This range also
         matches the requirements of the RTTM mechanism, which does not
         need much more resolution than the granularity of the
         retransmit timer, e.g., tens or hundreds of milliseconds.

         The PAWS mechanism also puts a strong monotonicity requirement
         on the sender's timestamp clock.  The method of implementation
         of the timestamp clock to meet this requirement depends upon
         the system hardware and software.

         *    Some hosts have a hardware clock that is guaranteed to be
              monotonic between hardware resets.

         *    A clock interrupt may be used to simply increment a binary
              integer by 1 periodically.

         *    The timestamp clock may be derived from a system clock
              that is subject to being abruptly changed, by adding a
              variable offset value.  This offset is initialized to
              zero.  When a new timestamp clock value is needed, the
              offset can be adjusted as necessary to make the new value
              equal to or larger than the previous value (which was
              saved for this purpose).

規定してあるのは(a)遅すぎないこと(b)速すぎないこと、そして「1msから1sの間が良いんじゃないか」という記載ぐらいでしょうか。



追記:
タイムスタンプオプションはミリ秒単位で計測するが、最上位ビットが1ならば任意の間隔で値を進めても良い、ってな記載が
マスタリングTCP/IP 応用編

マスタリングTCP/IP 応用編

に有ったような…。ちゃんと覚えてないm(_ _)m。

すみません↑はIPのタイムスタンプオプションでした。http://elend.sakura.ne.jp/?p=99の一番下のほうをご覧ください。
2014 徹底解説ネットワークスペシャリスト本試験問題 (本試験問題シリーズ)

2014 徹底解説ネットワークスペシャリスト本試験問題 (本試験問題シリーズ)