Network reliability is essential for maintaining responsive websites, database synchronization, and remote administration. In virtualized hosting environments, network performance can vary due to ISP routing paths, datacentre carrier issues, or local network bottlenecks. When network issues occur, administrators can experience high latency (ping lag), packet loss, or disconnected remote sessions, affecting site availability.
Diagnosing network issues requires isolating the problem to your local ISP connection, intermediate routing hops, or the hosting datacentre network interface. In this guide, we will analyze network routing, explore diagnostic tools, and walk through the commands needed to trace connections, diagnose packet loss, and troubleshoot latency issues.
1. Understanding Network Latency and Packet Loss
To diagnose network issues, it is important to understand the key performance metrics:
- Network Latency: The time (measured in milliseconds) it takes for a data packet to travel from your computer to the server and back. Latency is affected by physical distance, network congestion, and the number of routing hops.
- Packet Loss: The percentage of data packets sent that fail to reach their destination. Packet loss indicates network congestion, hardware issues, or firewall blocks along the routing path.
- Routing Bottlenecks: Points in the network path where data transmission is delayed or dropped, often due to overloaded carrier nodes.
2. Step-by-Step Diagnostics via SSH
To troubleshoot network issues, run diagnostic tests from both your local computer and your VPS server via SSH. Use these commands to trace connections and analyze performance.
Step 2.1: Run a Ping Test
Run a ping test to check network availability and baseline latency. Send a series of echo requests (e.g., 50 packets) to measure performance and look for packet loss:
ping -c 50 server_ip_address
Review the output statistics. If the test shows 0% packet loss and stable round-trip times (rtt), the baseline network connection is stable. If you see high packet loss or variable latency (jitter), proceed with the routing traces below.
Step 2.2: Trace the Network Route (Traceroute)
Use the traceroute command to view the hop-by-hop network path from your local computer to the server, helping identify which node in the path is introducing delays or dropping packets:
traceroute server_ip_address # On Linux/macOS
tracert server_ip_address # On Windows command prompt
Review the output list of hops. If latency spikes at a specific intermediate IP address, the bottleneck is located at that carrier node, rather than on your local network or the server itself.
Step 2.3: Run a My Traceroute (MTR) Test
The best tool for diagnosing network routing issues is **MTR (My Traceroute)**. MTR combines ping and traceroute functions, continually querying the network path to collect statistics on packet loss and latency for all hops.
Install MTR on your server using your package manager:
yum install mtr -y # On RHEL/AlmaLinux
apt-get install mtr -y # On Debian/Ubuntu
Run MTR in report mode, sending 100 packets to your target destination to compile performance statistics:
mtr -r -c 100 target_ip_address
Analyze the report. Look for packet loss trends. If packet loss starts at a specific hop and persists through the remaining hops to the destination, that node is experiencing congestion or dropping packets. If loss occurs at only one intermediate hop but drops to 0% on subsequent hops, the node is likely rate-limiting ICMP traffic, which does not represent actual packet loss.
Step 2.4: Check Server Network Interface Statistics
If network diagnostics indicate issues close to your server, check the server's network interface configuration and look for errors on the network adapter:
ip -s link show eth0 # Replace eth0 with your active interface name
Review the RX/TX error counts. If you see high drop or collision counts, the issue may be due to local network interface card (NIC) bottlenecks or host node issues, requiring assistance from your VPS hosting provider.
3. Network Diagnostic Tools Summary
| Diagnostic Tool | Key Metric Measured | Primary Use Case |
|---|---|---|
| Ping | Uptime and round-trip time latency | Verify basic server connectivity |
| Traceroute | Hop-by-hop network routing path | Locate network routing failures and loops |
| MTR (My Traceroute) | Continual packet loss and latency per hop | Analyze network congestion and routing bottlenecks |
Frequently Asked Questions (FAQ)
What is a normal network latency score?
Normal latency depends on physical distance. Local network connections typically have latencies under 20ms. Connections across countries or regions can range from 50ms to 150ms, while international connections across oceans can range from 150ms to 300ms.
Why do some traceroute hops show asterisks (*)?
Asterisks (*) in a traceroute indicate that the carrier node at that hop did not respond to the query packet within the timeout window. This is common, as many routers are configured to drop ICMP query packets to protect resources and prevent scanning.
Can a DDoS attack cause packet loss?
Yes. If a server or network is targeted by a DDoS attack, the high volume of traffic can saturate network bandwidth and exhaust server resources. When this occurs, legitimate data packets are dropped, resulting in high packet loss and latency.
