I need to measure certain statistics, such as latency, packet delay, and jitter. Would it be possible to measure these statistics between 2 nodes by sniffing traffic on both ends and then comparing times between when the packets were captured? BTW It is likely the two nodes won't be able to see each other, but they could later down the road.
You can't measure these statistics by sniffing traffic because most of packets would normally pass thru OSI layer 7 and response could be delayed due to application responding slowly and many other factors.
As Ron mentioned you can use IP SLA and draw graphs for example in Cacti or nProbe, NTOP could be as well used to collect jitter statistics. Netflow would be good source of information. For very simple measurments you can use tools like mtr.
You can't guarantee that the two hosts where the traffic were captured had their clocks synced. There could be 10s of ms of deviations between the two hosts even with NTP enabled on them. Now, if the two hosts were synced to the same NTP source (stratum0) and are on the same LAN network, we can ensure that they are precise to within a few ms. If they are synced to WAN based NTP sources available on the internet (like pool.ntp) which usually have stratum1/2 and different NTP sources. the deviations could be in 10s of ms. So your latency packet-delay and jitter will be quite off
You can use tshark (or wireshark) which has some options to get latency, jitter and other metrics:
-z icmp,srt[,filter] Compute total ICMP echo requests, replies, loss, and percent loss, as well as minimum, maximum, mean, median and sample standard deviation SRT statistics typical of what ping provides. -z rtp,streams Collect statistics for all RTP streams and calculate max. delta, max. and mean jitter and packet loss percentages.
Note that for the above 2 options to work, you will need to respectively have ICMP and RTP packets in your network capture.
Example using ICMP and RTP sample captures from Wireshark Sample Captures:
$ tshark -qr nflog.pcap -z icmp,srt ========================================================================== ICMP Service Response Time (SRT) Statistics (all times in ms): Filter: <none> Requests Replies Lost % Loss 6 4 2 33.3% Minimum Maximum Mean Median SDeviation Min Frame Max Frame 0.000 1116.657 279.166 0.003 558.328 29 37 ========================================================================== $ tshark -qr aaa.pcap -z rtp,streams ========================= RTP Streams ======================== Src IP addr Port Dest IP addr Port SSRC Payload Pkts Lost Max Delta(ms) Max Jitter(ms) Mean Jitter(ms) Problems? 192.168.1.2 30000 18.104.22.168 40392 0x3796CB71 ITU-T G.711 PCMA 9 0 (0.0%) 69.95 7.80 18.02 ==============================================================