1. Overview

There are several terms used to describe the performance of a network. Some of them are bandwidth, throughput, latency, jitter, and packet loss.

In this tutorial, we’ll learn what they mean, how to measure them, and what causes them in a computer network.

2. Bandwidth and Throughput

Bandwidth is the maximum amount of information transmitted over a network in a specific time period.

While bandwidth refers to capacity, throughput describes how much data is actually sent over the network. Therefore, other factors, like latency, jitter, and packet loss, affect throughput. As a result, throughput is almost always lower than bandwidth:

Bandwidth

In addition, since throughput shows the actual performance of a network rather than its theoretical capacity, it’s often a better measure of network performance.

3. Packet Loss

Packet loss happens when one or more packets fail to reach their destination when they are transmitted over a network.

The biggest victims of packet loss are applications that need real-time data. Some examples are online video games, video calls, and audio calls.

ping command is a tool used to test the reachability of a host in a network. Let’s use it to check for packet loss:

$ ping -c 4 google.com
PING google.com (172.217.17.110) 56(84) bytes of data.
64 bytes from sof02s47-in-f14.1e100.net (172.217.17.110): icmp_seq=1 ttl=111 time=31.7 ms
64 bytes from sof02s47-in-f14.1e100.net (172.217.17.110): icmp_seq=2 ttl=111 time=33.9 ms
64 bytes from sof02s47-in-f14.1e100.net (172.217.17.110): icmp_seq=3 ttl=111 time=32.1 ms
64 bytes from sof02s47-in-f14.1e100.net (172.217.17.110): icmp_seq=4 ttl=111 time=33.5 ms

--- google.com ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3005ms
rtt min/avg/max/mdev = 31.716/32.812/33.912/0.920 ms

We can see that we had 0% packet loss when pinging google.com.

Furthermore, packet loss can be caused by network congestion, faulty or outdated network hardware, and software bugs.

4. Latency

Latency is the time it takes for a data packet to travel from A to B.

Round-trip time (RTT), however, is the time it takes for a network request to go from A to B and response to come from B to A.

Moreover, both latency and RTT are measured in milliseconds (ms):

Latency and RTT

Data travels at the speed of light (roughly 300’000 km/s), but its actual speed depends on the material being used to transfer data. For instance, the data transfer speed in fiber optic cables is 2/3 the speed of light.

A fiber optic cable is made up of glass or plastic core surrounded by glass cladding. Further, the core carries light, and the cladding reflects light into the core. As a result, the light will travel through the cable.

A hop is an action that happens when a packet travels through a networking device (like a router or a switch). With each hop, a packet is delayed by the switch, which increases the latency. Therefore, the latency increases if the distance between the source and the destination is increased.

The ping command also measures the RTT between our machine and a remote IP address:

$ ping -c 4 google.com
PING google.com (172.217.17.110) 56(84) bytes of data.
64 bytes from ams15s29-in-f110.1e100.net (172.217.17.110): icmp_seq=1 ttl=111 time=31.3 ms
64 bytes from ams15s29-in-f110.1e100.net (172.217.17.110): icmp_seq=2 ttl=111 time=34.4 ms
64 bytes from ams15s29-in-f110.1e100.net (172.217.17.110): icmp_seq=3 ttl=111 time=33.7 ms
64 bytes from ams15s29-in-f110.1e100.net (172.217.17.110): icmp_seq=4 ttl=111 time=33.7 ms

--- google.com ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3005ms
rtt min/avg/max/mdev = 31.349/33.295/34.366/1.153 ms

Here, we used ping to send 4 packets to google.com. As we can see, ping gave us the RTT for each request and the minimum, average, and maximum RTT.

Furthermore, the ping command sends ICMP Echo request packets to the destination and receives ICMP Echo response packets from the destination, and then calculates latency.

5. Jitter

Jitter is the latency difference among the packets that are traveling between two systems in a network. Further, it’s caused by network congestion, poor hardware performance, and route changes. In addition, high jitter can lead to packet loss and reduced audio and video quality.

Let’s see an example:

$ ping -c 4 google.com
PING google.com (172.217.17.110) 56(84) bytes of data.
64 bytes from ams15s29-in-f110.1e100.net (172.217.17.110): icmp_seq=1 ttl=111 time=31.3 ms
64 bytes from ams15s29-in-f110.1e100.net (172.217.17.110): icmp_seq=2 ttl=111 time=33.0 ms
64 bytes from ams15s29-in-f110.1e100.net (172.217.17.110): icmp_seq=3 ttl=111 time=34.0 ms
64 bytes from ams15s29-in-f110.1e100.net (172.217.17.110): icmp_seq=4 ttl=111 time=34.0 ms

Here, the jitter is 1.7 ms between packet 1 and packet 2 and 2.7 ms between packet 1 and packet 3.

A jitter of 30 ms or less is considered acceptable.

6. Conclusion

In this article, we learned about several terminologies that are used to describe network performance.


» 下一篇: 临时编程