Created
October 5, 2012 00:21
-
-
Save perone/3837297 to your computer and use it in GitHub Desktop.
Scapy RTT
This file contains 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
$~ sudo scapy | |
>>> from datetime import datetime | |
>>> pkt = IP(dst="www.google.com", ttl=1) / ICMP() | |
>>> ans,unans = sr(pkt*3) | |
Begin emission: | |
.**Finished to send 3 packets. | |
* | |
Received 4 packets, got 3 answers, remaining 0 packets | |
>>> sent = datetime.fromtimestamp(ans[0][0].sent_time) | |
>>> received = datetime.fromtimestamp(ans[0][1].time) | |
>>> print (received-sent) | |
0:00:00.001820 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How accurate is this RTT value. I am trying to calculate it via scapy and wireshark both. But values seem to differ.