Home  >  Learning Center  >  Round Trip Time (RTT)  

Article's content

Round trip time (rtt), what is round trip time.

Round-trip time (RTT) is the duration, measured in milliseconds, from when a browser sends a request to when it receives a response from a server. It’s a key performance metric for web applications and one of the main factors, along with Time to First Byte (TTFB), when measuring  page load time  and  network latency .

Using a Ping to Measure Round Trip Time

RTT is typically measured using a ping — a command-line tool that bounces a request off a server and calculates the time taken to reach a user device. Actual RTT may be higher than that measured by the ping due to server throttling and network congestion.

Example of a ping to google.com

Example of a ping to google.com

Factors Influencing RTT

Actual round trip time can be influenced by:

  • Distance  – The length a signal has to travel correlates with the time taken for a request to reach a server and a response to reach a browser.
  • Transmission medium  – The medium used to route a signal (e.g., copper wire, fiber optic cables) can impact how quickly a request is received by a server and routed back to a user.
  • Number of network hops  – Intermediate routers or servers take time to process a signal, increasing RTT. The more hops a signal has to travel through, the higher the RTT.
  • Traffic levels  – RTT typically increases when a network is congested with high levels of traffic. Conversely, low traffic times can result in decreased RTT.
  • Server response time  – The time taken for a target server to respond to a request depends on its processing capacity, the number of requests being handled and the nature of the request (i.e., how much server-side work is required). A longer server response time increases RTT.

See how Imperva CDN can help you with website performance.

Reducing RTT Using a CDN

A CDN is a network of strategically placed servers, each holding a copy of a website’s content. It’s able to address the factors influencing RTT in the following ways:

  • Points of Presence (PoPs)  – A CDN maintains a network of geographically dispersed PoPs—data centers, each containing cached copies of site content, which are responsible for communicating with site visitors in their vicinity. They reduce the distance a signal has to travel and the number of network hops needed to reach a server.
  • Web caching  – A CDN  caches  HTML, media, and even dynamically generated content on a PoP in a user’s geographical vicinity. In many cases, a user’s request can be addressed by a local PoP and does not need to travel to an origin server, thereby reducing RTT.
  • Load distribution  – During high traffic times, CDNs route requests through backup servers with lower network congestion, speeding up server response time and reducing RTT.
  • Scalability  – A CDN service operates in the cloud, enabling high scalability and the ability to process a near limitless number of user requests. This eliminates the possibility of server side bottlenecks.

Using tier 1 access to reduce network hops

Using tier 1 access to reduce network hops

One of the original issues CDNs were designed to solve was how to reduce round trip time. By addressing the points outlined above, they have been largely successful, and it’s now reasonable to expect a decrease in your RTT of 50% or more after onboarding a CDN service.

Latest Blogs

Bridge covered in fog

Grainne McKeever

Feb 26, 2024 3 min read

Women's hand holding a mobile phone and checking out of an eCommerce store.

Erez Hasson

Jan 18, 2024 3 min read

High-speed band of light passing by a city skyline

Luke Richardson

Dec 27, 2023 6 min read

Application Security default image

Dec 21, 2023 2 min read

Web Code

Dec 13, 2023 5 min read

is web scraping illegal

Dec 7, 2023 6 min read

Women at laptop making an online purchase

  • Imperva Threat Research

packet round trip time ping

, Gabi Stapel

Nov 8, 2023 13 min read

Satellite image of Earth

Nov 7, 2023 1 min read

Latest Articles

  • Network Management

169.2k Views

152.5k Views

102.2k Views

97.9k Views

58.4k Views

54.5k Views

Protect Against Business Logic Abuse

Identify key capabilities to prevent attacks targeting your business logic

The 10th Annual Bad Bot Report

The evolution of malicious automation over the last decade

The State of Security Within eCommerce in 2022

Learn how automated threats and API attacks on retailers are increasing

Prevoty is now part of the Imperva Runtime Protection

Protection against zero-day attacks

No tuning, highly-accurate out-of-the-box

Effective against OWASP top 10 vulnerabilities

An Imperva security specialist will contact you shortly.

Top 3 US Retailer

ClouDNS Blog

Written by Vasilena Markova • September 27, 2023 • 12:58 pm • Internet

Round-Trip Time (RTT): What It Is and Why It Matters

Round-Trip Time (RTT) is a fundamental metric in the context of network performance, measuring the time it takes for data packets to complete a round trip from source to destination and back. Often expressed in milliseconds (ms), RTT serves as a critical indicator for evaluating the efficiency and reliability of network connections. In today’s article, we dive into the concept of RTT, exploring how it works, why it matters in our digital lives, the factors that influence it, and strategies to enhance it. Whether you’re a casual internet user seeking a smoother online experience or a network administrator aiming to optimize your digital infrastructure, understanding this metric is critical in today’s interconnected world.

Table of Contents

What is Round-Trip Time (RTT)?

Round-Trip Time is a network performance metric representing the time it takes for a data packet to travel from the source to the destination and back to the source. It is often measured in milliseconds (ms) and is a crucial parameter for determining the quality and efficiency of network connections.

To understand the concept of RTT, imagine sending a letter to a friend through the postal service. The time it takes for the letter to reach your friend and for your friend to send a reply back to you forms the Round-Trip Time for your communication. Similarly, in computer networks, data packets are like those letters, and RTT represents the time it takes for them to complete a round trip.

How Does it Work?

The concept of RTT can be best understood by considering the journey of data packets across a network. When you request information from a web server, for example, your device sends out a data packet holding your request. This packet travels through various network devices in between, such as routers and switches, before reaching the destination server. Once the server processes your request and prepares a response, it sends a data packet back to your device.

Round-Trip Time is determined by the time it takes for this data packet to travel from your device to the server (the outbound trip) and then back from the server to your device (the inbound trip). The total RTT is the sum of these two one-way trips.

Let’s break down the journey of a data packet into several steps so you can better understand the RTT:

  • Sending the Packet: You initiate an action on your device that requires data transmission. For example, this could be sending an email, loading a webpage, or making a video call.
  • Packet Travel: The data packet travels from your device to a server, typically passing through multiple network nodes and routers along the way. These middle points play a significant role in determining the RTT.
  • Processing Time: The server receives the packet, processes the request, and sends a response back to your device. This processing time at both ends also contributes to the Round-Trip Time.
  • Return Journey: The response packet makes its way back to your device through the same network infrastructure, facing potential delays on the route.
  • Calculation: It is calculated by adding up the time taken for the packet to travel from your device to the server (the outbound trip) and the time it takes for the response to return (the inbound trip).

Why does it matter?

At first look, Round-Trip Time (RTT) might seem like technical terminology, but its importance extends to various aspects of our digital lives. It matters for many reasons, which include the following:

  • User Experience

For everyday internet users, RTT influences the sensed speed and responsiveness of online activities. Low Round-Trip Time values lead to a seamless experience, while high RTT can result in frustrating delays and lag during tasks like video streaming, online gaming, or live chats.

  • Network Efficiency

Network administrators and service providers closely monitor RTT to assess network performance and troubleshoot issues. By identifying bottlenecks and areas with high RTT, they can optimize their infrastructure for better efficiency.

  • Real-Time Applications

Applications that rely on real-time data transmission, such as VoIP calls, video conferencing, and online gaming, are highly sensitive to RTT. Low RTT is crucial for smooth, interruption-free interactions.

In cybersecurity, Round-Trip Time plays a role in detecting network anomalies and potential threats. Unusually high RTT values can be a sign of malicious activity or network congestion.

Factors Affecting Round-Trip Time (RTT)

Several factors can influence the metric, both positively and negatively. Therefore, understanding these factors is crucial, and it could be very beneficial for optimizing network performance:

  • Distance: The physical distance between the source and destination plays a significant role. Longer distances result in higher RTT due to the time it takes for data to travel the network.
  • Network Congestion: When a network experiences high volumes of traffic or congestion, data packets may be delayed as they wait for their turn to be processed. As a result, it can lead to packet delays and increased RTT.
  • Routing: The path a packet takes through the network can significantly affect RTT. Efficient routing algorithms can reduce the time, while not-so-optimal routing choices can increase it.
  • Packet Loss: Packet loss during transmission can occur due to various reasons, such as network errors or congestion. When lost, packets need to be retransmitted, which can seriously affect the Round-Trip Time.
  • Transmission Medium: It is a critical factor influencing RTT, and its characteristics can vary widely based on the specific medium being used. Fiber optic cables generally offer low RTT due to the speed of light in the medium and low signal loss. In contrast, wireless mediums can introduce variable delays depending on environmental factors and network conditions.

How to improve it?

Improving Round-Trip Time (RTT) is a critical goal for network administrators and service providers looking to enhance user experiences and optimize their digital operations. While some factors affecting it are beyond our control, there are strategies and practices to optimize Round-Trip Time for a smoother online experience:

  • Optimize Routing: Network administrators can optimize routing to reduce the number of hops data packets take to reach their destination. This can be achieved through efficient routing protocols and load balancing .
  • Optimize Network Infrastructure: For businesses, investing in efficient network infrastructure, including high-performance routers and switches, can reduce internal network delays and improve RTT.
  • Upgrade Hardware and Software: Keeping networking equipment and software up-to-date ensures that you benefit from the latest technologies and optimizations that can decrease RTT.
  • Implement Caching: Caching frequently requested data closer to end-users can dramatically reduce the need for data to travel long distances. The result really helps with lowering RTT.
  • Monitor and Troubleshoot: Regularly monitor your network for signs of congestion or packet loss. If issues arise, take steps to troubleshoot and resolve them promptly.

Discover ClouDNS Monitoring service!

Round-Trip Time (RTT) is the silent force that shapes our online experiences. From the seamless loading of web pages to the quality of our video calls, RTT plays a pivotal role in ensuring that digital interactions happen at the speed of thought. As we continue to rely on the Internet for work, entertainment, and communication, understanding and optimizing this metric will be crucial for both end-users and network administrators. By reducing it through strategies, we can have a faster, more responsive digital world where our online activities are limited only by our imagination, not by lag.

Vasilena Markova

Hello! My name is Vasilena Markova. I am a Marketing Specialist at ClouDNS. I have a Bachelor’s Degree in Business Economics and am studying for my Master’s Degree in Cybersecurity Management. As a digital marketing enthusiast, I enjoy writing and expressing my interests. I am passionate about sharing knowledge, tips, and tricks to help others build a secure online presence. My absolute favorite thing to do is to travel and explore different cultures!

domain parking

Related Posts

Ping traffic monitoring

Ping Traffic Monitoring: Ensuring Network Health and Efficiency

March 28, 2024 • Monitoring

In an era where digital connectivity is the lifeline of businesses and individuals alike, maintaining optimal network performance is more ...

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts

  • Network Monitoring: Ensuring the Pulse of Digital Communications
  • rDNS explained in detail
  • What is Authoritative DNS server?
  • IPv4 vs IPv6 and where did IPv5 go?
  • What is a Secondary DNS server?
  • Cloud Computing
  • DNS Records
  • Domain names
  • Load balancing
  • SSL Certificates
  • Web forwarding
  • DNS Services
  • Managed DNS
  • Dynamic DNS
  • Secondary DNS
  • Reverse DNS
  • DNS Failover
  • Anycast DNS
  • Email Forwarding
  • Enterprise DNS
  • Domain Names

packet round trip time ping

  • Skip to main content
  • Skip to search
  • Skip to select language
  • Sign up for free
  • English (US)

Round Trip Time (RTT)

Round Trip Time (RTT) is the length time it takes for a data packet to be sent to a destination plus the time it takes for an acknowledgment of that packet to be received back at the origin. The RTT between a network and server can be determined by using the ping command.

This will output something like:

In the above example, the average round trip time is shown on the final line as 26.8ms.

  • Time to First Byte (TTFB)

TecAdmin

Understand Ping Command

As a Linux, Windows or macOS user, one of the most essential skills you can develop is the ability to troubleshoot network issues. The ping command is a versatile and powerful tool that can help you diagnose and resolve a variety of connectivity problems. This comprehensive guide will help you understand the fundamentals of the ping command, including its various options, use cases, and best practices for network troubleshooting.

1. What is the Ping Command?

The ping command is a network diagnostic tool that allows you to test the reachability of a host on an Internet Protocol (IP) network. By sending Internet Control Message Protocol (ICMP) Echo Request packets to the target host and waiting for an ICMP Echo Reply, the ping command can determine if a network connection exists, measure the round-trip time for the packets to travel from the source to the destination host, and report any packet loss.

2. Basic Usage of the Ping Command

The basic syntax of the ping command is:

The destination can be either an IP address or a domain name. For example, to ping Google’s public DNS server, you can use:

Or, to ping a domain name:

By default, the ping command will keep sending packets until you stop it manually by pressing Ctrl+C. To specify a limited number of packets, use the -c option followed by the desired count:

3. Understanding Ping Output

When you run the ping command, it will display a series of output lines. Here’s an example of a typical output:

Each line contains the following information:

  • Packet size: The number of bytes in the ICMP packet (e.g., 64 bytes).
  • Source IP: The IP address of the responding host (e.g., 8.8.8.8).
  • ICMP sequence number: A unique identifier for each packet sent (e.g., icmp_seq=1).
  • Time to Live (TTL): The remaining number of hops the packet can take before being discarded (e.g., ttl=119).
  • Round-trip time: The time it takes for a packet to travel to the destination and back, measured in milliseconds (e.g., time=10.5 ms).

4. Advanced Ping Options

The ping command offers a variety of options that allow you to customize its behavior and gather more information about network connections. Some useful options include:

  • `-i` : Specifies the interval between packets (in seconds). For example, to set a 2-second interval: ping -i 2 www.example.com
  • `-t` : Sets the Time to Live (TTL) value for the ICMP packets. This can help you identify the maximum number of hops a packet can take before being discarded: ping -t 5 www.example.com
  • `-s` : Changes the size of the ICMP data payload (in bytes). This can be useful for testing the impact of larger packets on network performance: ping -s 1024 www.example.com
  • `-W` : Sets the timeout for waiting for a response (in seconds): ping -W 2 www.example.com

5. Troubleshooting Network Issues with Ping

The ping command can help you identify and resolve various network problems, such as:

  • Connectivity issues: If you don’t receive any ICMP Echo Reply packets, it may indicate a connectivity problem between the source and the destination.
  • High latency: If the round-trip time is consistently high, it may indicate network congestion, misconfigured routers, or other performance issues.
  • Packet loss: If you notice a significant percentage of packet loss, it could signify network congestion, faulty hardware, or other problems affecting the connection.
  • Traceroute: If you need more information about the network path between the source and the destination, consider using the traceroute command, which provides details about each hop along the route.

6. Best Practices for Using Ping

When using the ping command for network troubleshooting, consider the following best practices:

  • Be mindful of ICMP blocking: Some hosts or networks may block ICMP traffic as a security measure. In such cases, the ping command might not provide accurate information about the target host’s reachability.
  • Use domain names cautiously: When pinging domain names, remember that DNS resolution might affect the results. If you suspect DNS issues, consider pinging the IP address directly.
  • Combine with other tools: The ping command is a powerful tool, but it’s not the only one available for network troubleshooting. Use it in conjunction with other tools like traceroute, netstat, and nmap for a comprehensive view of your network’s health.

The ping command in Linux, Windows and macOS is an invaluable tool for network troubleshooting, offering insights into connectivity, latency, and packet loss. By understanding its basic usage, advanced options, and best practices, you can effectively diagnose and resolve a wide range of network issues. As you continue to work with Linux, Windows or macOS, remember to leverage the ping command alongside other network diagnostic tools for a complete understanding of your network’s performance and stability.

Related Posts

How to remove files and directories in linux, (resolved) “-bash: ping: command not found” error in docker, linux: a guide to extracting lines between matching patterns.

Save my name, email, and website in this browser for the next time I comment.

Type above and press Enter to search. Press Esc to cancel.

How ping measures network round-trip time accurately using SO_TIMESTAMPING | Coroot

While working on node-agent , we set out to measure network latency between containers and the services they communicate with. Since the agent has already discovered the endpoints that each container communicates with, we just need to measure network latency. We embedded "pinger" directly into the agent to measure end-to-end latency because the ICMP Echo requests should be sent from within the network namespace of each container.

I've looked at the most popular pinger implementations on Go, and unfortunately, all of them use userspace-generated timestamps to calculate RTTs (Round-Trip Times). This can lead to significant measurement errors, especially in the case of a lack of CPU time on the node due to throttling or high utilization.

Let's look at how ping actually measures RTT.

Though it looks simple enough, the devil is in the details. First, let's see how a packet is sent:

The main problem here is that a considerable amount of time can elapse between the request for a current timestamp and the actual sending of a packet. We can also see the same error in the receiving stage:

To illustrate the case where the error is quite noticeable, let's run ping in a container that is limited in CPU time. The -U flag tells ping to use userspace-generated timestamps.

Then I'll start a CPU-consuming app in the same container:

Here is the output:

As you can see, the measurement results were severely affected. If we run ping without -U , stress does not affect RTT at all. How does ping generate timestamps to exclude extra time spent before the packet is actually sent or after it is received?

There is an interface called SO_TIMESTAMPING that allows a userspace program to request the transmission/reception timestamp of a particular packet from the kernel. SO_TIMESTAMPING supports multiple timestamp sources, but we will only use those that do not require special hardware or device driver support.

  • SOF_TIMESTAMPING_TX_SCHED : Request tx timestamps prior to entering the packet scheduler.
  • SOF_TIMESTAMPING_RX_SOFTWARE : These timestamps are generated just after a device driver hands a packet to the kernel receive stack.

SO_TIMESTAMPING can be enabled for a particular packet (by using control messages ) or for every packet passing through the socket:

Immediately after we have sent a packet to the socket, we can request the kernel for the timestamp of the packet transmission:

Then parsing the received message to extract the timestamp:

Upon receiving, ancillary data is available along with the packet data, so there is no need to read anything from the socket error queue:

And finally, we can calculate the RTT:

Another thing worth noting is that the timestamp of when the packet has been sent must be stored in the app's memory, not in the packet's payload. Otherwise, it can lead to funny consequences .

The resulting round-trip time reflects the real network latency much more accurately and is not subject to the mentioned errors. The agent uses this method to collect the metric for each container. Since this metric is broken down by destination_ip , you can always find out what the network latency between the container and each one of the services it communicates with is. The limitation of this method is that it doesn't work if ICMP traffic is blocked, such as in the case of Amazon RDS instances.

Useful links

  • Get started with Coroot
  • node-agent mdi-github (Apache-2.0 License)

Network Encyclopedia Logo

Round-Trip Time (RTT)

Last Edited

In the intricate domain of computer networking, Round-Trip Time, popularly known as RTT, plays an instrumental role. RTT signifies the time it takes for a data packet to travel from a source to a destination and back again. It serves as a key performance metric in networking, helping diagnose network speed and efficiency.

Round-Trip Time (RTT)

What is RTT?

To understand what RTT is, envision playing catch with a ball. You throw the ball (this represents the data packet), and your friend catches it (this is the packet reaching its destination). Then, your friend throws the ball back to you (the packet’s return journey). The total time from the initial throw to catching the ball again is akin to RTT in networking.

RTT is not about how quickly the ball is thrown or caught; rather, it’s about the total duration of the journey. Similarly, in the digital world, RTT measures the full journey of a data packet, irrespective of the data size or transmission speed.

The Importance of Round-Trip Time

RTT is pivotal for network administrators because it helps to measure network latency or delay. It’s a vital metric used to determine the performance of network connections, allowing administrators to identify potential issues and gauge the quality of the network.

A lower Round-Trip Time indicates a faster connection, resulting in improved data transfer and a superior user experience. Conversely, a high RTT may suggest network congestion, poor routing, or other issues leading to increased latency.

How to Measure RTT?

A common method to measure RTT is by using the ‘ping’ command . This command sends an Internet Control Message Protocol (ICMP) request to a specified server, which then sends an ICMP reply back. The time it takes for this round-trip journey is the RTT, typically measured in milliseconds (ms).

Another method involves using Traceroute, a command-line tool that displays the path that a packet takes to reach its destination, recording the latency at each hop.

RTT and Its Impact on Applications

RTT is particularly critical for real-time applications such as video conferencing, VoIP calls, online gaming, and live streaming. High Round-Trip Time values in these applications can lead to noticeable delays, buffering, and synchronization issues, disrupting the user experience.

In non-real-time applications, like email or file transfer, high RTT might not be immediately noticeable to the user but could slow down overall data transfer rates.

Understanding RTT is a fundamental aspect of grasping how networks operate. It allows us to measure and diagnose network performance, directly impacting how we experience the internet and online services. By paying attention to RTT, network administrators can ensure optimal network performance, paving the way for efficient, seamless digital communication.

  • RFC 7982 – Measurement of Round-Trip Time and Fractional Loss Using Session Traversal Utilities for NAT (STUN)

Stack Exchange Network

Stack Exchange network consists of 183 Q&A communities including Stack Overflow , the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Calculating the round trip time for ping packets

I am currently practicing for my network & communications course and have managed to confuse myself slightly on a question about packet round trip time. I have made a start but am now a bit stuck!

Disclaimer: This is not homework, just a practice question I am having a go at.

If all subnets operate at 100Mb/s, the maximum length of any subnet is 200m, and signal propagation speed is 200 x 10^6m/s, estimate the round-trip time that would be reported by ping when using 50,000 byte sized packets between H3.1 and H1.1 (such that 50,000 bytes have to be sent from H3.2 to H1.1 and back again).

Information Provided

The information we are provided is that the network is a class B network with address 146.169.0.0 and the subnet mask is 255.255.255.0

(There are therefore 256 subnets, 146.169.0.0 -> 146.169.255.0 each with 256 addresses)

The network layout diagram given in the question

How far I've got

I have managed to work out that to go from H3.2 to H1.1, there will be the following route:

H3.2 -> R3 -> R1 -> H1.1 which is 3 packets. Therefore with 3 packets back, thats 6 in total.

Since the maximum length is 200m, this suggests that the total distance form H3.2 to H1.1 and back cannot exceed 1200m.

It also suggests that since there are 6 packets, each carrying 50,000 byte packets, thats a total of (50000 * 6) * 8 bits transferred in total.

From here I'm at a bit of a loss as to how to proceed. I could theoretically do S = D/T rearranged to be T = D/S and therefore T = 1200 / 200*10^6 but that seems too simplistic and doesn't use the network speed in any way, nor the number of bits.

I'm sure I'm missing something simple here but I figured a network guru here would probably be able to solve this in 10 seconds so it was probably worth asking!

Will continue my trials and come back to this if I get an answer!

Pete Hamilton's user avatar

  • Calculate the time until the first bit reaches the next hop. Then calculate the time between when the first bit gets somewhere and when the last bit gets somewhere. Sum them, and you have the time it takes a packet to go one hop. –  David Schwartz May 6, 2012 at 21:40
  • 1 Oh, academia. They're still putting classed networks in example questions? Do some yelling about CIDR . –  Shane Madden May 6, 2012 at 21:58
  • 1 Ah, the ever-popular 50kB ping. The real-world answer is that you're never going to be able to pass a ping that big anywhere. –  wfaulk May 7, 2012 at 0:51
  • @ShaneMadden They teach that as well. Thank god... –  Pete Hamilton May 7, 2012 at 13:03

You must log in to answer this question.

Browse other questions tagged networking ping subnet packet ..

  • The Overflow Blog
  • How to succeed as a data engineer without the burnout
  • How do you evaluate an LLM? Try an LLM.
  • Featured on Meta
  • New Focus Styles & Updated Styling for Button Groups
  • Upcoming initiatives on Stack Overflow and across the Stack Exchange network

Hot Network Questions

  • How can my book purchase get the most money to an author?
  • Why is my car paint not so "shiny"?
  • “Choose Your Own Adventure” with time travel and some very bizarre scenes in it from the 1980s or early 1990s
  • Converting "4.8 million" into an actual number
  • Is a new Tourney rear hub better than a 15 year old Deore hub?
  • Simplest way to create a clickable list in MacOS that will cause selected programs to run
  • pandoc does not seem to include .rtf files. Can I add them?
  • Can a Venus-like planet be habitable if it was farther from the sun?
  • How many lanes of PCIe does Thunderbolt 4 use?
  • Password checker using Decorator Pattern
  • Can we use "It varies a lot" at the beginning of a new paragraph?
  • If a Dragonborn is affiliated with a particular dragon race, is it more likely to inherit that race's alignment?
  • What do we mean when we ask "What's the – fundamental – nature of reality?"
  • Can the composition law of a group be defined only when considering a representation or realisation of the Group?
  • Simple problems that calculators get wrong
  • Story about alien contact, a 'Gehenna' bioweapon and the moon being destroyed as a warning shot
  • On track with my travel agent
  • Why did the USA provide a $1 billion Patriot battery but not a $34 million F-16 to Ukraine?
  • Examples of concrete games to apply Borel determinacy to
  • Prepositions after, before etc. as temporal determiners
  • What kind of lightbulb is pictured here, having a clear bulb window and 4 yellow vertical rods?
  • Safe to remove out-of-service 3-line landline junction box by myself?
  • How can the depolarizing channel be a quantum operation?
  • When incrementing a private key by 1, by how much is the public key Incremented?

packet round trip time ping

It's FOSS

Ping Command Examples

Sagar Sharma

The ping command is probably the first tool every user would use or get suggested if they are having an issue with the network.

In simple terms, it is a tool that everyone relies on to check network availability .

So in this tutorial, I will walk you through how the ping command works including multiple examples of how you can use the ping command.

How does ping command work?

Ever heard of SONAR ? It is a tool that sends sound waves underwater which bounce off and return as echoes, which allows us to find the nearest objects and their distance.

Ping does a similar job but for computers, obviously.

When you execute the echo command, it sends a small data packet (32 bytes is the default value) to the specified target.

ICMP packet transfer with ping command

We are talking about the internet here, which is nothing but millions of computers interacting with each other over a network so in order to reach the target, it goes through several hops (routers or intermediate devices).

It also works for local networks.

Once it reaches the destination and if it is working, the target will send the response packet.

The total time it took from sending the packet to receiving a response packet is called round trip time (often measured in milliseconds).

Once you stop the ping command, it will list the sent and received packets which should be the same in ideal condition.

But if you see the difference in sent and received packets, it indicates a hardware problem, congested network traffic, filtering, and more.

Now, let's look at how you use the ping command.

How to use the ping command

To use the ping command, you need to follow the given command syntax:

  • [OPTIONS] : it is used to modify the default behavior of the ping command.
  • HOSTNAME_OR_IP_ADDRESS : it is where you specify the IP address or domain name of the target.

0. Check if a remote system or website is available

You can use the ping command without any options and it will continue to ping to the specified address:

Use ping command to specific address

To stop the running command, use Ctrl + C .

As you can see, in the above screenshot, I've sent 5 packets and all were transmitted with 0% packet loss. This means the host is up without any issues.

Also, the time it shows for every packet is round trip time for every packet. The first packet took 5.79 milliseconds to get there and get back.

But there's a lot more you can do with the ping command. Let me show you how.

1. Get gateway IP

You can use the ping command to get the default gateway of your network :

ping gateway

As you can see, it only pings the gateway, which is your router's IP address' usually. This is a handy way of knowing if your system is connected to the router or not.

2. Specify the number of ICMP echo requests

The ICMP (Internet Control Message Protocol) echo requests are nothing but the packets we send to the target to know if it is up or not.

By default, the ping command will send packets endlessly which is not ideal for most users. In that case, you can use the -c flag and specify the number of the echo requests as shown here:

For example, here, I sent 5 ICMP echo packets to itsFOSS.com :

Specify the number of the ICMP echo packets using the ping command

3. Set intervals between sending packets

The default interval between sending is one second which should be fine for most users but if you want to increase the time, you need to use the -i flag in the following manner:

For example, here, I set the interval for 2 seconds:

4. Ping flooding using the ping command

This is more like a DOS attack , where you send the packets without waiting for the response of the target.

It can be used to test how your system behaves with intense load.

To use the ping command this way, it needs to be executed with the -f flag as shown:

When executed, you will see constant blinking of . indicating ping flooding is active.

5. Change the TTL value

The TTL (Time To Live) defines the lifespan of a packet on how many hops it will go through before reaching the final destination.

You can choose a value of TTL between 1 to 255.

To change the TTL value, use the -t flag with the ping command in the following manner:

Change the TTL value using the ping command

6. Change the size of ICMP packets

By default, the ping command will send packages of 32 or 64 bytes which is fine for the majority of users.

But there are times when you want to increase/decrease the size of the ICMP echo package which can be done using the -s flag:

For example, here, I went for a packet size of 124 bytes:

Change the size of packets in ping command

7. Preload packets to send

When preload is enabled, you can send the specified number of packages in a single attempt without waiting for the response of the target.

To preload packets, you'd need to use the -p flag in the following manner:

For example, here, I choose 100 packets to preload:

preload packets in the ping command

If you want, you can also combine the -p flag with the -f to have more intensive testing:

flood ping requests with the preloading of packets in the ping command

8. Specify the timeout to wait for response

With the ping command, you can also specify the time to wait for the response from the target. And for that, you have to use the W flag as shown here:

For example, here, I configured ping to wait for the 3 seconds:

Specify the wait time from terget with the ping command

9. Set timeout for the ping command

The ping command allows you to set a timeout (in seconds) for a long the ping command will actively send and receive packets.

Don't get confused with the -c flag. It is used to specify the number of packages whereas the -w flag works as a timer.

To set the timeout for the ping command, use the -w flag in the following manner:

For example, here, I wanted to set the timeout after the 3 seconds, so used the following:

Set timeout in ping command

10. Suppress output with the quite mode

Most users are only interested in the final result of the ping showing how many packets were transferred and if there was a packet loss or not.

Or you just want to save the output of the ping command by redirecting the output.

To enable the quiet output with the ping command, use the -q flag as shown:

For example, here, I configured ping to send 5 packets with the -c flag and then used the -q flag to quite the output:

quite output with the ping command

As you can see, it only gave me the final output-cutting those lines that you get by default!

This is what you've learned so far

Here's a summary of what I explained in this ping command tutorial with different flags:

More on commands

Ping is one of the essential Linux networking commands . A must have for troubleshooting network connections.

packet round trip time ping

If you are just getting started with a Linux terminal, we made a series for users like you who are eager to learn but can't find a place to start:

packet round trip time ping

I hope you will find this guide helpful.

Sagar Sharma

A software engineer who loves to write about his experience with Linux. While reviving my crashed system, you can find me reading literature, manga, or watering my plants.

How to Install Fish Shell on Ubuntu

Install latest obs studio in ubuntu, install freeoffice on ubuntu linux, check file size in linux command line, how to check if an array is empty in bash, it's foss.

Making You a Better Linux User

It's FOSS

Great! You’ve successfully signed up.

Welcome back! You've successfully signed in.

You've successfully subscribed to It's FOSS.

Your link has expired.

Success! Check your email for magic link to sign-in.

Success! Your billing info has been updated.

Your billing was not updated.

Linux ping Command

Last updated: March 18, 2024

packet round trip time ping

1. Overview

In this quick tutorial, we’ll explore how the Linux ping command can help us to diagnose and troubleshoot network issues.

Let’s start by having a look at the basic syntax:

The  ping (Packet INternet Groper) command uses the ICMP (Internet Control Message) protocol to send packets to a server.

To illustrate the ping command, let’s try pinging www.baeldung.com :

First, the ping command determines the IP address from the given domain name.

Next, it starts sending ICMP packets to the server. When our packet reaches the destination, then the server responds, and the ping command prints a line to our console.

By default, it prints a line that includes the following information:

  • Number of bytes sent , which is 64 ICMP data bytes, by default
  • IP Address of destination , in this case, 104.18.63.78
  • ICMP packet Sequence Number , for example, icmp_seq=0
  • Time to live (TTL) , it indicates the number hops before the packet is dropped, here it’s 54
  • Ping command round trip time , in this case, 203.928 ms

So, we can see it sends ICMP packets continuously and we have to manually stop sending the packets using Control + C (Windows) or Command + C (Mac).

Also, it shows the percentage of packets lost due to network issues.

3. Basic Usage

Now that we’ve seen the default output, it’s time to see a few of the options in action.

3.1. Specifying the Interval Between Packets

By default, the ping command sends a new packet every second.

Let’s use  -i  flag to change the ping interval : 

Now there’s no output to prove this, but by running, we can see that we get a new line output every three seconds.

3.2. Controlling the Number of Packets

In practice, we often use the   -c option to specify the number of ICMP packets that we want to send to the destination server:

As we can see above, we have only sent 3 ICMP packets rather than a continuous stream of packets.

3.3. Specifying the Packet Size

Additionally,  ping also allows us to  specify the packet size using the -s flag :

Here, we have used both -s and -c option together in the above example. As a result, it only sent four packets each of size 40 bytes (ICMP: 48 bytes).

This can be used to determine the latency in the network at different packet sizes. For example, in many complex networks, we start running into issues when the packet size is over 1500 bytes. By changing the packet size, we can determine the ideal packet size for our system.

4. Advanced Usage

Let’s now take a look at more advanced options.

4.1. Specify a Timeout

In practice, on a congested network, it might be useful to timeout the response after waiting for a specific time duration .   We can do this with the -W option:

First, we send the request to the server. Then, we waited for two seconds to receive a response.

Due to low latency in our network we received all the packets successfully without any packet loss.

4.2. Flooding the Network Using Ping

Sometimes we want to test the network performance by sending as many packets as possible.

To illustrate, let’s run the ping command using the  -f option:

In this particular case, we have sent 271 packets with an average round trip time of 0.019 sec.

4.3. Retrieving the Network Summary

Next, we can retrieve the network summary using the command with the help of the  -q flag:

First, let’s run the ping command using both the -c and -q flags:

As such, this option is used to run the command in a quiet mode. Here, we get only a summary, and we don’t see details of individual packets being sent.

4.4. Audible Ping Usage

Let’s run the ping utility in an audible mode using -a flag:

Here, we can hear a beep sound whenever our client can reach the host server.

5. Conclusion

In this quick tutorial, we’ve seen how to use the ping  command.

We first covered how to control the interval, size, and a number of packets that we send in the command.

Finally, we explored some advanced uses like retrieving the network summary and flooding the network.

IMAGES

  1. Round-Trip Time (RTT)

    packet round trip time ping

  2. Measuring RTT (Round Trip Time) using Ping utility

    packet round trip time ping

  3. Explaining RTT (Round Trip Time) or PING

    packet round trip time ping

  4. What is RTT (Round-Trip Time) and How to Reduce it?

    packet round trip time ping

  5. How ping measures network round-trip time accurately using SO

    packet round trip time ping

  6. Determining TCP Initial Round Trip Time

    packet round trip time ping

VIDEO

  1. Valorant but its 3000ms (Network Round Trip Time/ping/latency)

  2. Day 145: Road trip to packet pick up #run #travelrunning #clearwaterflorida #halfmarathon #runlife

  3. Story time Ping and ling in the woods

  4. Round Trip Time (RTT) part-2 in computer network in bangla

  5. playing swing time ping khelne kids children

  6. PING command #computer

COMMENTS

  1. ping (networking utility)

    ping is a computer network administration software utility used to test the reachability of a host on an Internet Protocol (IP) network. It is available for virtually all operating systems that have networking capability, including most embedded network administration software. Ping measures the round-trip time for messages sent from the ...

  2. What is Round Trip Time (RTT)

    Factors Influencing RTT. Actual round trip time can be influenced by: Distance - The length a signal has to travel correlates with the time taken for a request to reach a server and a response to reach a browser.; Transmission medium - The medium used to route a signal (e.g., copper wire, fiber optic cables) can impact how quickly a request is received by a server and routed back to a user.

  3. What Is Round Trip Time?

    3. Round Trip Time. The RTT is the time between sending a message from a source to a destination (start) and receiving the acknowledgment from the destination at the source point (end). We can also see RTT referred to as Round Trip Delay (RTD). Sometimes, the acknowledgment is sent from the destination to the source almost immediately after the ...

  4. Round-Trip Time (RTT): What It Is and Why It Matters

    Round-Trip Time is a network performance metric representing the time it takes for a data packet to travel from the source to the destination and back to the source. It is often measured in milliseconds (ms) and is a crucial parameter for determining the quality and efficiency of network connections. To understand the concept of RTT, imagine ...

  5. Round Trip Time (RTT)

    Round Trip Time (RTT) is the length time it takes for a data packet to be sent to a destination plus the time it takes for an acknowledgment of that packet to be received back at the origin. The RTT between a network and server can be determined by using the ping command. This will output something like: In the above example, the average round ...

  6. What is RTT (Round-Trip Time) and How to Reduce it?

    In networking, round-trip time ( RTT ), also known as round-trip delay time ( RTD) is defined as a metric that measures in milliseconds the amount of time it takes for a data packet to be sent plus the amount of time it takes for acknowledgement of that signal to be received. This time delay includes propagation times for the paths between the ...

  7. How to Calculate Packet Time from Latency and Bandwidth

    Round trip time (RTT) is the time it takes for a message to reach its destination from a source and then reach back from destination to source. Network ping time is very similar to round trip time. Round trip time is related to network latency. It's not precisely double the network latency as there could be asymmetric latencies in both ...

  8. What is RTT?

    Round-trip time (RTT) in networking is the time it takes to get a response after you initiate a network request. When you interact with an application, like when you click a button, the application sends a request to a remote data server. Then it receives a data response and displays the information to you. RTT is the total time it takes for ...

  9. What is round-trip time?

    The ping utility, available on virtually all computers, is a method of estimating round-trip time. Here's an example of several pings to Google with the round-trip time calculated at the bottom. Notice that one of the ping times - 17.604ms - is higher than the rest.

  10. Understand Ping Command

    Round-trip time: The time it takes for a packet to travel to the destination and back, measured in milliseconds (e.g., time=10.5 ms). 4. Advanced Ping Options. The ping command offers a variety of options that allow you to customize its behavior and gather more information about network connections. Some useful options include:

  11. How ping measures network round-trip time accurately using SO ...

    Using SO_TIMESTAMPING to obtain the accurate timestamp of when a packet was sent/received. How ping measures network round-trip time accurately using SO_TIMESTAMPING | Coroot While working on node-agent , we set out to measure network latency between containers and the services they communicate with.

  12. Ping Command in Linux

    The ICMP sequence number for each packet. icmp_seq=1. The Time to Live. - ttl=53 - How does TTL work?. The ping time, measured in milliseconds which is the round trip time for the packet to reach the host, and the response to return to the sender. - time=41.4 ms. By default, the interval between sending a new packet is one second.

  13. What's the difference between `Latency` and `Round Trip Time`?

    Round-trip time and ping time are often considered synonymous. While ping time may provide a good RTT estimate, it differs in that most ping tests are executed within the transport protocol using ICMP packets. ... Latency is the time it takes for a packet to go from the sending endpoint to the receiving endpoint. Many factors may affect the ...

  14. Round-Trip Time (RTT)

    Round-Trip Time (RTT) In the intricate domain of computer networking, Round-Trip Time, popularly known as RTT, plays an instrumental role. RTT signifies the time it takes for a data packet to travel from a source to a destination and back again. It serves as a key performance metric in networking, helping diagnose network speed and efficiency.

  15. Calculating the round trip time for ping packets

    Question. If all subnets operate at 100Mb/s, the maximum length of any subnet is 200m, and signal propagation speed is 200 x 10^6m/s, estimate the round-trip time that would be reported by ping when using 50,000 byte sized packets between H3.1 and H1.1 (such that 50,000 bytes have to be sent from H3.2 to H1.1 and back again).

  16. TCP Based Ping

    ping is a network command tool that's widely used to test the network reachability and quality between two hosts.. It works by sending an ICMP echo request to a network host and waiting for a reply. Then, ping displays several statistics such as the round trip time (RTT) of the packet, as well as the percentage of packets being dropped. Interestingly, the word "ping" is also commonly ...

  17. Ping Command Examples in Linux

    The total time it took from sending the packet to receiving a response packet is called round trip time (often measured in milliseconds). Once you stop the ping command, it will list the sent and received packets which should be the same in ideal condition. ... For example, here, I went for a packet size of 124 bytes: ping -s 124 itsfoss.com 7 ...

  18. Round-trip delay

    In telecommunications, round-trip delay (RTD) or round-trip time (RTT) is the amount of time it takes for a signal to be sent plus the amount of time it takes for acknowledgement of that signal having been received. This time delay includes propagation times for the paths between the two communication endpoints. In the context of computer networks, the signal is typically a data packet.

  19. Measuring RTT (Round Trip Time) using Ping utility

    🎦 Playlist for the "Computer Networking" https://youtube.com/playlist?list=PLWkguCWKqN9MdQXjSM5DE17NU7_RQA_MH🔥 Full-length "World of Computer Networking" c...

  20. Linux ping Command

    ICMP packet Sequence Number, for example, icmp_seq=0; Time to live (TTL), it indicates the number hops before the packet is dropped, here it's 54; Ping command round trip time, in this case, 203.928 ms; So, we can see it sends ICMP packets continuously and we have to manually stop sending the packets using Control + C (Windows) or Command + C ...

  21. What is the difference between a "ping" and "RTT" (round-trip time)?

    A ping is a method to measure round trip time. The process of "pinging" is to send a "ping". A "ping" is a network message which serves no other purpose than to get an immediate response from the receiver. This can be used to measure the round trip time. ... Multiple small UDP packets vs One big constant UPD packet. Hot Network Questions

  22. how the ping implementation calculating the round trip time?

    The two times are subtracted and convert that subtracted time into micro seconds. The triptime variable contains that micro seconds. For example, take the below output for calculating the rtt. The trip time for the first packet is 42573, and second packet 43707, third packet 48047, and fourth packet 42559. Using this how they calculate the ...