How to Test UDP Connectivity on Linux with nping and hping3
This guide explains what UDP is, when UDP Ping is useful, and provides step‑by‑step Linux commands using nping and hping3 to test UDP connectivity and diagnose network latency or packet loss.
What is UDP
UDP (User Datagram Protocol) is a connection‑less transport‑layer protocol that provides only minimal services for sending packets. It does not guarantee reliable delivery, making it well‑suited for real‑time applications such as voice calls and video streaming.
When to use UDP Ping
UDP Ping is a diagnostic technique that checks whether UDP traffic can reach a specific host. It is commonly used for network troubleshooting and performance testing.
Diagnosing latency or disconnections in online games by testing UDP traffic.
Verifying that VoIP audio/video applications can transmit data without excessive delay or loss.
Testing DNS servers, which rely on UDP for query and response handling.
Performing UDP Ping on Linux
Linux users can use the command‑line tools nping (included with Nmap) or hping3 to send UDP probes.
Using nping
Install nping if it is not already present (it ships with the Nmap package):
sudo apt-get install nmap # Debian/Ubuntu
# or
sudo yum install nmap # RHEL/CentOSBasic syntax for a UDP Ping: nping --udp -p <port> <target IP> Example – probe the DNS service (port 53) on the host 192.0.2.1: nping --udp -p 53 192.0.2.1 The command sends UDP packets to the specified port and prints any replies. Receiving a reply indicates that UDP traffic reaches the target; no reply may mean the port is filtered or the host is unreachable.
Using hping3
Install hping3 if it is not already present:
sudo apt-get install hping3 # Debian/Ubuntu
# or
sudo yum install hping3 # RHEL/CentOSBasic syntax for a UDP Ping with hping3: hping3 -p <port> --udp <target IP> Example – probe DNS (port 53) on 192.0.2.1: hping3 -p 53 --udp 192.0.2.1 Like nping, hping3 displays any UDP replies. A successful reply confirms that UDP communication to the target and port is functional.
Note: Both tools may require root privileges to send raw packets; prepend sudo if necessary.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Liangxu Linux
Liangxu, a self‑taught IT professional now working as a Linux development engineer at a Fortune 500 multinational, shares extensive Linux knowledge—fundamentals, applications, tools, plus Git, databases, Raspberry Pi, etc. (Reply “Linux” to receive essential resources.)
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
