hping occasionally reports RTT+1s instead of real RTT
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 55/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 停滞
- 技術スタック
- c
- 領域
- networking
調査の方向性
issue で説明されている送信パケットのタイムスタンプコードから始め、time() と get_usec() が別々に呼び出されている箇所を確認し、RTT の計算にタイムスタンプがどのように使用されているかを調べてください。分割された時刻の読み取りを 1 つの gettimeofday() の結果に置き換え、その後、秒の境界付近の応答で余分な 1000ms が報告されなくなることを確認してください。
索引モデルが issue の本文から書いたものです。
説明
Sometimes hping reports an RTT that is 1000ms larger than all the other values. However, it doesn't actually pause for 1s at that line, it appears that the time is misreported.
HPING 10.65.1.1 (eth0 10.65.1.1): S set, 40 headers + 0 data bytes
len=44 ip=10.65.1.1 ttl=63 DF id=0 sport=3000 flags=SA seq=0 win=29200 rtt=3.9 ms
len=44 ip=10.65.1.1 ttl=63 DF id=0 sport=3000 flags=SA seq=1 win=29200 rtt=1003.7 ms
len=44 ip=10.65.1.1 ttl=63 DF id=0 sport=3000 flags=SA seq=2 win=29200 rtt=3.4 ms
len=44 ip=10.65.1.1 ttl=63 DF id=0 sport=3000 flags=SA seq=3 win=29200 rtt=3.0 ms
len=44 ip=10.65.1.1 ttl=63 DF id=0 sport=3000 flags=SA seq=4 win=29200 rtt=2.7 ms
len=44 ip=10.65.1.1 ttl=63 DF id=0 sport=3000 flags=SA seq=5 win=29200 rtt=2.3 ms
len=44 ip=10.65.1.1 ttl=63 DF id=0 sport=3000 flags=SA seq=6 win=29200 rtt=2.0 ms
...
After digging in the codebase, it looks like the problem is this: when storing the timestamp of the outgoing ping, hping does
secs = time(NULL);
usecs = get_usec();
This can fail if the time wraps to the next second between the call to time() and get_usecs().
About to send packet:
-
clock is at 9.999999s, we read the second part as 9
-
clock wraps to 1.000000, we read the usec part as 0
-
record that packet was sent at 9.000000s
Receive response
-
clock is at 10.001000
-
read seconds as 10
-
read usec as 1000
Incorrectly calculate RTT as 10.001000 - 9.000000 = 1.001sec.
Best fix would be to remove the get_usec utility function and call gettimeofday() exactly once and to use the returned tv_sec and tv_usec from the same call.
- 主要言語
- C
- スター
- 1.7k
- フォーク
- 367
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
antirez/hping のほかの issue
-
fix typo: "tramitted" --> "transmitted"対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 48/100
-
Website different?オープン
難易度 5/5 1週間以上 初心者へのやさしさ 20/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
-
IPV6 Support?オープン
難易度 5/5 1週間以上 初心者へのやさしさ 20/100
似ている issue
-
http_fetch tests: the two no-child rows fail, not skip, where a task's children file does not exist対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンarea:http kind:gate-defect
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
InauguralSystems/EigenScript#2397 ·
メンテナーはふだん 1 日以内に返信
-
Add SECURITY.mdオープンenhancement
難易度 1/5 1〜3時間 初心者へのやさしさ 65/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
-
modem: ppp: CMUX DLCI receive buffer overruns on large downlink packets対応中かも @pedrohqr が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
zephyrproject-rtos/zephyr#126195 ·
メンテナーはふだん 3 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
ly05010419/MacNativeGames#2271 ·
メンテナーはふだん 1 日以内に返信