latency

Measure network round-trip latency by sending a TCP SYN packet.

  • Owner: grahamking/latency
  • Platform:
  • License:: GNU General Public License v3.0
  • Category::
  • Topic:
  • Like:
    0
      Compare:

Github stars Tracking Chart

Install: go get github.com/grahamking/latency

Run: sudo latency [hostname].

Example output:

$ sudo ./latency github.com

Measuring round-trip latency from 192.168.1.26 to 192.30.252.131 on port 80

Latency: 116.601914ms

The sudo is needed to open a raw socket. If you know how to do this with capabilities, please do tell.

latency can also run in auto mode, where it tests a range of well known sites (which will be geo-balanced), and some servers in specific locations. It's fun, try it! sudo latency -a

latency sends a TCP SYN packet (the opening of the three-way handshake) to a remote host on port 80. That host will respond with either a RST (if the port is closed), or a SYN/ACK (if the port is open). Either way, we time how long it takes between sending the SYN and receiving the response. That's your network latency.

There are of course many other ways to measure this (mtr is nice), but this is a fun exercise in using raw sockets and binary encoding in Go.

License: GPL.

Main metrics

Overview
Name With Ownergrahamking/latency
Primary LanguageGo
Program languageGo (Language Count: 1)
Platform
License:GNU General Public License v3.0
所有者活动
Created At2014-01-01 20:08:55
Pushed At2016-03-30 16:50:50
Last Commit At2016-03-30 09:50:49
Release Count0
用户参与
Stargazers Count188
Watchers Count2
Fork Count37
Commits Count15
Has Issues Enabled
Issues Count2
Issue Open Count2
Pull Requests Count4
Pull Requests Open Count0
Pull Requests Close Count0
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private