nt (Net Test) - A versatile network testing tool that supports ICMP, HTTP(s), DNS, TCP, and MTU testing
nt
is a versatile tool for network troubleshooting and testing written in Go. It provides continuous testing of network connectivity using various protocols using subcommands, including icmp
, tcp
, http
, and dns
. Monitor round-trip times (RTT), track packet loss rates, and log high latency events with timestamps to ensure your network's reliability.
- Subcommands for Protocols: Use specific subcommands (
icmp
,tcp
,http
,dns
) to perform tests. - Continuous ICMP Ping: Monitor network latency and packet loss using ICMP echo requests.
- TCP Connectivity Testing: Check the availability and response times of TCP ports.
- HTTP/HTTPS Testing: Test web server availability and measure HTTP/HTTPS response times.
- DNS Ping: Verify DNS server responsiveness and resolve lookup times.
- MTU Testing: Determine the Maximum Transmission Unit (MTU) size to a given destination host/IP.
- TCP Port Testing: Test if the remote server is listening on one or multiple given TCP ports.
- Recording and Logging: Save test results to a CSV file for later analysis.
- Customizable Output: Adjust the number of rows displayed in the terminal during live tests.
- Cross-Platform: Compatible with Windows and Linux.
- For Option 1 & 2, Go 1.18 or higher is required on your system.
The compiled executable will be placed in $GOPATH/bin
go install github.com/djian01/nt@latest
git clone https://github.com/djian01/nt.git
cd nt
go build .
The compiled executable will be placed in \executable\
inside the code folder
git clone https://github.com/djian01/nt.git
cd nt
make build-linux
or
git clone https://github.com/djian01/nt.git
cd nt
make build-windows
- Visit the Releases page of the repository.
- Download the
nt_linux_amd64_x.x.x.tar.gz
file for Linux or thent_windows_amd64_x.x.x.zip
file for Windows
nt [flags] <sub-command: icmp/tcp/http/dns/mtu/tcpscan> [args]
-
-r
: Enable Recording Save the test results to a CSV file for future analysis. -
-p <number>
: Rows Displayed Specify the number of rows displayed in the terminal during live tests. Default is10
.
-
-c
: ICMP Ping Count
Number of ICMP ping requests to send. Default is0
, which means it will run non-stop until interrupted withCtrl+C
. -
-d
: ICMP Ping Do Not Fragment*
Sets the "Do Not Fragment" flag in the ICMP request. Default isfalse
. -
-h
: Help
Display help information for theicmp
subcommand. -
-i
: ICMP Ping Interval
Interval between ICMP ping requests in seconds. Default is1
second. -
-s
: ICMP Ping Payload Size
Size of the ICMP ping payload in bytes. Default is32
bytes. -
-t
: ICMP Ping Timeout
Timeout for each ICMP ping request in seconds. Default is4
seconds.
nt -r icmp google.com
nt icmp -c 10 -i 2 -s 48 10.2.3.10
-
-c
: TCP Ping Count
Number of TCP ping requests to send. Default is0
, which means it will run non-stop until interrupted withCtrl+C
. -
-h
: Help
Display help information for thetcp
subcommand. -
-i
: TCP Ping Interval
Interval between TCP ping requests in seconds. Default is1
second. -
-s
: TCP Ping Payload Size
Size of the TCP ping payload in bytes. Default is0
bytes (no payload). -
-t
: TCP Ping Timeout
Timeout for each TCP ping request in seconds. Default is4
seconds.
nt -r tcp google.com 443
nt tcp -c 10 -i 2 10.2.3.10 22
Note:
- If custom port is not specificed, the test will use the default ports (HTTP 80, HTTPS 443).
- The default interval for HTTP Ping is 5 seconds.
-
-c
: HTTP Ping Count
Number of HTTP ping requests to send. Default is0
, which means it will run non-stop until interrupted withCtrl+C
. -
-h
: Help
Display help information for thehttp
subcommand. -
-i
: HTTP Ping Interval
Interval between HTTP ping requests in seconds. Default is5
seconds. -
-m
: HTTP Ping Method
HTTP request method to use (e.g.,GET
,POST
). Default is"GET"
. -
-t
: HTTP Ping Timeout
Timeout for each HTTP ping request in seconds. Default is4
seconds.
π» Example 1: HTTP ping to "https://google.com" with recording enabled (With default values: Port-443, Method-GET, Count-0, Interval-5s, Timeout-4s)
nt -r http https://google.com
π» Example 2: HTTP ping to POST "http://10.2.3.10:8080/token" with count: 10 and interval: 2 sec
nt http -c 10 -i 2 -m POST http://10.2.3.10:8080/token
-
-c
: DNS Ping Count
Number of DNS ping requests to send. Default is0
, which means it will run non-stop until interrupted withCtrl+C
. -
-h
: Help
Display help information for thedns
subcommand. -
-i
: DNS Ping Interval
Interval between DNS ping requests in seconds. Default is1
second. -
-o
: DNS Ping Protocol Type
Protocol to use for DNS queries (e.g.,udp
,tcp
). Default is"udp"
. -
-t
: DNS Ping Timeout
Timeout for each DNS ping request in seconds. Default is4
seconds.
nt -r dns 8.8.8.8 google.com
nt dns -c 10 -i 2 4.2.2.2 abc.com
-
-s
: Ceiling Test Size
The maximum MTU size to test, in bytes. Default is1500
bytes. -
-h
: Help
Display help information for themtu
subcommand.
nt mtu google.com
π» Example 2: MTU check for destination 192.168.1.10 with user defined ceiling test size 9000 set (for Jumbo Frame enabled environment)
nt mtu -s 9000 192.168.1.10
Note:
- The maximum number of tested ports for each command run is 50.
-
-t
: **TCP Ping test Timeout **
TCP Ping test Timeout (default: 4 sec) (default 4) -
-h
: Help
Display help information for themtu
subcommand.
π» Example 1: TCP Scan to "10.123.1.10" for port "80, 443, 8080 & 1500-1505" with recording enabled
nt -r tcpscan 10.123.1.10 80 443 8080 1500-1505
nt tcpscan -t 5 10.2.3.10 22 1522-1525 8433
When the -r
option is enabled, all test results are saved to a CSV file in the same directory as the executable.
During the testing/recording process, the CSV file is named in the following format:
[recording...]_Record_<test type>_<test target host>_<timestamp>.csv
When the testing/recording is completed, the file name will be like this:
Record_<test type>_<test target host>_<timestamp>.csv
During testing/recording, the file name will be prefixed with "[recording...]_". Please DO NOT open this CSV file at that time, as doing so will prevent test records from being saved to the file and will interrupt the test process.
- Example:
Record_icmp_google.com_20211012T101530.csv
The CSV file captures the detailed test results based on the test type.
This project is licensed under the MIT License.
- Email: dennis.jian@packetstreams.net
- GitHub: djian01