Store link-layer timestamp in icmp_echo_time module#726
Conversation
Contributor
Author
|
I've made a few tweaks to my original commit:
{
"saddr": "8.8.8.8",
"saddr_raw": 134744072,
"daddr": "198.19.249.210",
"daddr_raw": 3539538886,
"ipid": 3099,
"ttl": 116,
"type": 0,
"code": 0,
"icmp_id": 22402,
"seq": 17877,
"sent_timestamp_ts": 1692376823,
"sent_timestamp_us": 100749,
"recv_timestamp_ts": 1692376823, // Added in this PR
"recv_timestamp_us": 123706, // Added in this PR
"rtt_us": 22957, // Added in this PR
"dst_raw": 134744072,
"classification": "echoreply",
"success": 1,
"repeat": false,
"cooldown": true,
"timestamp_str": "2023-08-18T18:40:24.161+0200",
"timestamp_ts": 1692376824,
"timestamp_us": 161167
} |
zakird
approved these changes
Aug 18, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes inaccurate RTTs when using the
icmp_echo_timemodule (#562).This follows up on #607 which passes the pcap/pf_ring timestamp to the packet handler. The information was there but was seemingly never used.
This adds two fields to the output of the
icmp_echo_timemodule based on the capture timestamp:recv_timestamp_tsandrecv_timestamp_ns.Test:
./src/zmap -M icmp_echo_time -O json 8.8.8.8 \ -f sent_timestamp_ts,sent_timestamp_us,timestamp_ts,timestamp_us,recv_timestamp_ts,recv_timestamp_ns > res.jsonRTT with original timestamp:
jq '((.timestamp_ts * 1e6 + .timestamp_us) - (.sent_timestamp_ts * 1e6 + .sent_timestamp_us)) / 1e3' res.json 1044.48RTT with link-layer timestamp:
jq '((.recv_timestamp_ts * 1e6 + .recv_timestamp_ns / 1e3) - (.sent_timestamp_ts * 1e6 + .sent_timestamp_us)) / 1e3' res.json 17.838RTT with ping: