<![CDATA[jsDelivr CDN Blog]]>https://jsdelivr-blog.ghost.io/https://jsdelivr-blog.ghost.io/favicon.pngjsDelivr CDN Bloghttps://jsdelivr-blog.ghost.io/Ghost 5.94Mon, 09 Sep 2024 06:29:58 GMT60<![CDATA[jsDelivr May outage postmortem]]>During the night, on May 2, 2024, the jsDelivr CDN domain cdn.jsdelivr.net started serving an expired SSL certificate to clients connecting from certain regions. 

The outage lasted for more than 5 hours and affected users mostly in Africa, Asia, and certain countries in Europe and Latin America.

]]>
https://jsdelivr-blog.ghost.io/jsdelivr-may-outage-postmortem/663371a6d016c200019ce43aThu, 02 May 2024 10:59:12 GMTDuring the night, on May 2, 2024, the jsDelivr CDN domain cdn.jsdelivr.net started serving an expired SSL certificate to clients connecting from certain regions. 

The outage lasted for more than 5 hours and affected users mostly in Africa, Asia, and certain countries in Europe and Latin America. 

Users from the USA, Canada, western Europe, Brazil, and many other countries were not affected.

This disparity was due to our routing between our main CDN providers. Users that were hitting our Fastly CDN endpoint were unaffected.

The root cause of the outage was Cloudflare’s switch from DigiCert’s certificate authority to Google Trust Services. While the switch itself was benign, it also changed the domain validation method.

Since we’re a multi-CDN, with the traffic being routed between providers based on our own internal rules, we can’t use Cloudflare DNS hosting and have a special setup where they only act as the CDN, with DNS being hosted elsewhere.

To allow Cloudflare to automatically issue and manage our certificates, we added the proper DNS records to our third-party DNS providers. This system worked great for almost 10 years now. 

Unfortunately, this migration of certificate authorities also made those validation records obsolete, and switched to HTTP validation instead. This would never work in our case, as depending on where the verification test came from, it could hit a different CDN provider and fail. 

We were not aware of this change, so what ended up happening was the following:

  • The previous working DigiCert was set to expire, as it has happened many times over the years
  • Some time shortly before the expiration, Cloudflare tried to issue the new certificate using HTTP validation and failed
  • After it failed, it reverted to an old certificate expired in 2020
  • None of us or our systems ever expected the managed SSL system to fail
  • This resulted in an error message to all of our users hitting Cloudflare’s CDN based on our routing

I want to note that Cloudflare is at no fault here, and they have no obligation towards anyone to validate rare client configs, especially free sponsored ones.

I, @jimaek, take full responsibility for this outage. I should’ve not made any assumptions about the migration and should’ve taken extra precautions. 

This outage is embarrassing, and I apologize to everyone who was affected! 

The goal of jsDelivr was always to be a production-ready, most reliable, and fastest open-source CDN for anyone to use. This never changed and never will. 

The next steps are:

  • Short-term:
    • Review the full system to ensure that similar issues are automatically handled and re-routed
    • From now on, any critical changes by CDN providers will immediately result in their deactivation from jsDelivr and manual verification after the fact to ensure the CDN’s stability with our specific setup
  • Long-term:
    • Optimize, automate, and simplify our DNS, load-balancing, and failover systems and components to prevent other theoretically possible but unknown edge cases
    • We will integrate our own Globalping service for even better and more reliable monitoring and failover. Consider joining the project by hosting a Docker probe on your network!

Thank you to everyone for being with us for so many years, and hope to see you all continue this journey forward.

]]>
<![CDATA[Common Network Troubleshooting Use Cases: Traceroute]]>In the realm of network troubleshooting, mastering various tools is indispensable. Today, we're focusing on an essential command: traceroute. This tool offers a unique perspective by providing detailed route analysis, helping you efficiently identify and troubleshoot network issues. Regardless of your experience level, understanding the capabilities of traceroute

]]>
https://jsdelivr-blog.ghost.io/common-network-troubleshooting-use-cases-traceroute/659ff37948c5b300015c35fbThu, 11 Jan 2024 13:59:08 GMT

In the realm of network troubleshooting, mastering various tools is indispensable. Today, we're focusing on an essential command: traceroute. This tool offers a unique perspective by providing detailed route analysis, helping you efficiently identify and troubleshoot network issues. Regardless of your experience level, understanding the capabilities of traceroute is key to unraveling the complexities of network diagnostics.

Let's explore how it can support you with troubleshooting network issues and how you can use it with Globalping to take measurements worldwide.

Common Issues Addressed by Traceroute

If you’re new to traceroute, check out our blog post to learn how to use traceroute and how to read its results!

Identifying Network Hops

One everyday use case for traceroute is identifying the network hops between your device and a destination host. Each hop represents an intermediate point through which your data travels. This information is valuable for pinpointing where connectivity issues may arise. Here's an example of a traceroute result:


Common Network Troubleshooting Use Cases: Traceroute


In this example, the traceroute command illustrates the path taken from the initiating device to the web server. Each hop is distinctly presented, accompanied by its corresponding IP address and response time. This straightforward representation facilitates a clear understanding of the network's architecture and serves as a foundation for troubleshooting. You can discern potential problematic points by dissecting these hops, helping you pinpoint issues and optimize your network for optimal performance.

Detecting Packet Loss at Specific Hops

Traceroute can also help identify packet loss at specific hops along the route. If a particular router or node is causing packet loss, it could indicate a network problem. Here's an example:


Common Network Troubleshooting Use Cases: Traceroute


In this scenario, the asterisks (*) alongside the 'problem-router' signify packet loss at that specific hop. Traceroute helps us play detective by showing exactly where these losses are happening. When we find the spot, we can focus on fixing it, ensuring our data gets to its destination without any disappearances. It's like making sure our messengers reach their target safely!

Identifying High Latency Points

Traceroute is not just a map for your data's journey; it's also a timekeeper, helping us spot places where our data might take too long to reach its destination. We call this "latency," and identifying high latency points is crucial for ensuring a smooth and speedy data transfer.

Let's take a look at this example traceroute result:


Common Network Troubleshooting Use Cases: Traceroute

The 'high-latency-router' is our culprit, causing potential delays with response times like 50.123 ms. Traceroute spots these slow areas, allowing us to address them. Fixing high-latency points is like smoothing out a bumpy road – it ensures a faster and more efficient data journey for a smoother online experience.

Introducing Globalping for Traceroute

Now that we've explored traceroute's troubleshooting capabilities, let's introduce how Globalping takes this functionality to the next level.

Globalping is a network testing platform for monitoring, debugging, and benchmarking your internet infrastructure from a globally distributed probe network. Anybody can use Globalping for free to perform crucial tests such as ping, traceroute, mtr, and dig effortlessly.

Why Use Globalping for Troubleshooting?

Let's explore some advantages of running traceroute with Globalping:

  1. Global Insights: Globalping lets you perform traceroute tests from multiple spots worldwide simultaneously. This means you get a global view of your network, making it easier to pinpoint issues accurately.

  2. Boost Efficiency: Streamline troubleshooting by identifying problematic hops, packet losses, or latency points from different locations across the globe.

  3. In-depth Understanding: Gain comprehensive insights into your network's performance. Test routes from diverse locations, identify bottlenecks and optimize your network for a smoother user experience.

How to Use Traceroute with Globalping

Let's dive into Globalping's capabilities with an example using the Globalping CLI tool. If you're not yet on board, check out the installation guide here or explore other official integrations on the same page.


Let's say we want to trace the route to a website from two distinct locations: Tokyo and North America. Open your terminal, input, and execute the following command:


globalping traceroute jsdelivr.com from Tokyo,North America --limit 2


Feel free to swap out the domain and locations based on your use case. The `--limit` flag lets us specify the number of desired results, defaulting to one (1).


Here's our result:

Common Network Troubleshooting Use Cases: Traceroute

As you can see, we have traced the route from a probe in Tokyo and a probe in North America to the specified destination, resulting in two sets of results. Also, note that the structure is the same as you are familiar with when using the traditional traceroute command on Linux-based systems!


Explore our GitHub repository for a deeper dive into the platform and how to make the most of it.

Conclusion

And there you have it – the power of traceroute at your fingertips. From unraveling the path of your data to identifying hiccups along the way, it's a tool every network troubleshooter should have in their kit.


With Globalping, we're taking traceroute to new heights: Run simultaneous tests from different corners of the globe, making troubleshooting more efficient and helping you gain a comprehensive understanding of your network's performance. Why not give Globalping a try and see for yourself?

Happy testing!

]]>
<![CDATA[Common Network Troubleshooting Use Cases: Ping]]>In the vast networking landscape, the ability to troubleshoot issues effectively is a crucial skill. Whether you're a beginner or a seasoned professional, understanding how to identify and resolve common network problems is essential. In this blog post, we'll dive into the network testing tool "

]]>
https://jsdelivr-blog.ghost.io/common-network-troubleshooting-use-cases-ping/659ff28b48c5b300015c35ddThu, 11 Jan 2024 13:55:00 GMT

In the vast networking landscape, the ability to troubleshoot issues effectively is a crucial skill. Whether you're a beginner or a seasoned professional, understanding how to identify and resolve common network problems is essential. In this blog post, we'll dive into the network testing tool "ping", how it can help you troubleshoot networking issues, and how Globalping lets you take troubleshooting on a global level.

Common Issues Addressed by Ping

Before starting, you should know what a ping is and how to read its results. You can find out more about it in our blog post here.

Unreachable Hosts

Picture this: you're trying to connect to a server, and it seems to have vanished into the digital abyss. This is where the 'ping' command becomes your ally. You can determine if a host is reachable by sending a simple ping request. If the destination is accessible, the ping command will return a series of responses, indicating a healthy connection. If there's an issue, you'll receive an error message, helping you pinpoint the problem area.

Common Network Troubleshooting Use Cases: Ping

In this example, we attempt to ping the host "www.unreachable-host.com". The response indicates that the host is unreachable, as each attempt to send a ping request results in a "Request timeout" message. This type of response is typical when there is a connectivity issue, such as a network problem, a firewall blocking the communication, or the host being down.

Packet Loss

Think of packet loss like sending a letter through the mail only to find that parts of the message got lost along the way. In networking terms, it means that data packets are not reaching their destination intact. Ping can be a handy detective in such scenarios. By monitoring the responses, you can identify packet loss issues. Frequent timeouts or "Request Timed Out" messages indicate that some packets didn't reach their destination, guiding you toward potential connectivity problems.

Common Network Troubleshooting Use Cases: Ping

In this example, the response shows successful replies for some packets but also indicates packet loss with "Request timeout" messages for one packet. The summary at the end reveals that out of 6 packets transmitted, 5 were received, resulting in a 16.67% packet loss. This can indicate network issues, causing packets to be dropped during transmission.

High Latency

Have you ever experienced a laggy video call or slow-loading web pages? That's latency in action. Ping measures the round-trip time for a packet to travel from your device to the destination and back. High latency can indicate network congestion or other issues. By using ping, you can quantify the delay and take steps to address it, ensuring a smoother user experience.

Common Network Troubleshooting Use Cases: Ping

In this example, the response shows that each ping has a higher-than-usual round-trip time, ranging from around 98 ms to 109 ms. The summary at the end provides the average round-trip time (avg), indicating that the network has high latency. High latency can result in slow responsiveness and delays in data transmission.

Introducing Globalping

Now that we've covered how 'ping' can be your go-to troubleshooter let's talk about how Globalping takes network testing to the next level. Globalping is a global network testing platform that can also help you make troubleshooting more straightforward and comprehensive.

Thanks to our vast probe network, you can run measurement requests from any location worldwide, even running multiple at once.

Let's discover how Globalping can help you troubleshoot using ping!

How Globalping Boosts Troubleshooting Efforts

Improved Accuracy

In the world of networking, accuracy is paramount. Globalping elevates the accuracy of your troubleshooting efforts by allowing you to test from multiple locations worldwide. This ensures a more comprehensive view of your network's health. Instead of relying on a single test point, you get a global perspective, reducing the chances of overlooking potential issues.

Efficiency in Troubleshooting

Time is often of the essence when dealing with network issues. Globalping offers a streamlined workflow for troubleshooting. Simultaneous testing from different locations means you can identify and address issues more efficiently. Why test one location at a time when you can tackle multiple potential problem areas simultaneously?

Global Network Insights

Networks are becoming increasingly global, and understanding the nuances of different regions is crucial. Globalping provides valuable insights into the performance of your network from diverse locations. This global perspective helps you make informed decisions to optimize network performance and resolve issues effectively.

How to Use Ping with Globalping

To begin using the capabilities of Globalping, we'll be working with the Globalping CLI tool. If you haven't installed it yet, you can find installation instructions here or discover other official integrations on the same page.

Now, let's imagine a scenario where we want to ping a website from two distinct locations—let's say, South America and Berlin. In your terminal, enter and execute the following command:

globalping ping jsdelivr.com from Berlin,South America --limit 2

Feel free to replace the domain and location parameters based on your use case. The --limit flag allows us to specify the number of desired results, with the default set to one (1).

Here's a sample result:

Common Network Troubleshooting Use Cases: Ping

As expected, we obtained two ping results. The structure of these results aligns with what we're accustomed to when using the traditional ping command on Linux-based systems. This means that when troubleshooting network issues with ping using Globalping, you can seamlessly apply your existing knowledge and expertise.

Head over to our GitHub repository to learn more about the platform and how to get the most out of it!

Conclusion

Ping is a straightforward tool to use for resolving common network issues. Whether you're dealing with unreachable hosts, packet loss, or high latency, ping provides valuable insights. With the added capabilities of Globalping, you can take your troubleshooting game to the next level and ping from virtually any location you want.

Globalping is free to use, so why not give it a try?

Happy testing!

]]>
<![CDATA[Understanding Network Latency: A Guide for Beginners]]>Are you new to the world of network testing? If the term "network latency" seems like a puzzle, fear not – we're here to untangle it for you. This blog post is your guide to understanding network latency, how to measure and improve it, and how

]]>
https://jsdelivr-blog.ghost.io/understanding-network-latency-a-guide-for-beginners/6579b56148c5b300015c35b8Wed, 13 Dec 2023 13:48:56 GMT

Are you new to the world of network testing? If the term "network latency" seems like a puzzle, fear not – we're here to untangle it for you. This blog post is your guide to understanding network latency, how to measure and improve it, and how to use Globalping to measure latency on a global scale.

What is Network Latency?

Network latency is the delay between sending and receiving data over a network. It's like the lag you experience in a video call – that tiny delay between speaking and your friend hearing your words. In networking, latency is measured in milliseconds (ms), and lower values are generally better.

How to Measure Network Latency

In the upcoming section, we'll delve into useful commands for measuring network latency. Keep in mind that these commands might not be pre-installed on your Linux or macOS machine. For Windows users, be aware that command names and outputs may vary.

Ping

Ping is a fundamental tool for measuring network latency. It works by sending a small packet of data to a target server and measuring the time it takes for the packet to make the round trip. The command is straightforward:

ping google.com

Look for the "Round-Trip Time" or "RTT" values in the results. These values represent the time the data travels from your computer to the target server and back. Lower RTT values indicate better network responsiveness.

Example Result:


64 bytes from 93.184.216.34: icmp\_seq=1 ttl=56 time=14.2 ms
64 bytes from 93.184.216.34: icmp\_seq=2 ttl=56 time=13.8 ms
64 bytes from 93.184.216.34: icmp\_seq=3 ttl=56 time=15.0 ms

Learn more about ping and how to read its results.

Traceroute

Traceroute visualizes the path your data takes to reach its destination. It displays the latency at each hop along the way, helping you identify potential bottlenecks. Execute the following command:

traceroute google.com

Look for the time values in each hop. If you see sudden spikes, it could indicate network congestion or a problematic router.

Example Result:
Understanding Network Latency: A Guide for Beginners

Learn more about traceroute and how to read its results.

Dig

Dig is useful for examining DNS query times. While it may not directly measure network latency, slow DNS resolution can contribute to overall delays. Use the following command:

dig google.com

Look for the "Query time" field, which indicates the time the DNS query takes to resolve.

Example Result:


;; Query time: 20 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)

Learn more about dig and how to read its results.

MTR

MTR combines the functionality of Ping and Traceroute in a single command, offering a more dynamic and real-time view of network performance. To use MTR, simply run:

mtr google.com

MTR continuously updates the information, showing the packet loss and latency at each hop in the network. This live updating feature makes it easier to identify intermittent issues or changes in network performance over time.

Example result:

Understanding Network Latency: A Guide for Beginners

Learn more about mtr and how to read its results.

Interpreting Results

As you analyze the results, focus on consistency and any irregularities in latency values. Low and stable values are generally desired. If you notice sudden spikes or prolonged delays, it's worth investigating further to identify and address potential network issues. Regularly performing these tests and monitoring the results over time will help you maintain a healthy and responsive network.

Improving Network Latency

Now that you understand how to measure latency, let's explore some ways to improve it:

Optimize Your Network

Ensure that your network infrastructure is optimized for performance. This includes using quality networking equipment, optimizing router settings, and maintaining a reliable internet connection.

Choose the Right Service Provider

Different internet service providers (ISPs) offer varying levels of service. Research and choose a provider with a reputation for low latency and high reliability.

Content Delivery Network (CDN)

Consider using a Content Delivery Network. CDNs distribute content across multiple servers globally, reducing the physical distance data travels and, consequently, lowering latency.

Introducing Globalping

Now that you've got a handle on measuring network latency let's explore how Globalping takes your testing capabilities to the next level by allowing you to test globally.

What is Globalping?

Globalping is a network testing platform that lets you run tests from anywhere worldwide. Whether you're a seasoned professional or a curious newcomer, Globalping empowers you to perform crucial tests such as ping, traceroute, mtr, and dig effortlessly.

How Does Globalping Work?

Globalping relies on a network of distributed probes strategically located around the world. This means you can run tests from different geographic locations, providing a comprehensive view of your network's performance. Here's why this global testing capability is a game-changer:

  • Identifying Regional Latency Issues: Network latency is affected by physical distance. You can pinpoint regions with higher latency by running tests from various locations. This information is invaluable for businesses with a global user base, helping them optimize their infrastructure for better user experiences worldwide.

  • Replicating User Experiences: Globalping allows you to mimic the experiences of users in different locations. For example, this is crucial for businesses that provide online services or applications. By understanding the latency users' experience in other regions, you can tailor your network optimization strategies for a more inclusive and responsive service.

  • Benchmarking Against Global Standards: Comparing your network's performance against global standards provides context for improvement. Globalping enables you to assess how your network measures up on a global scale, helping you set realistic goals for latency reduction and overall performance enhancement.

Exploring Latency Measurement with Globalping

Let's delve into running network testing commands using Globalping. You can use the Command Line Interface (CLI) tool to get started.

If you haven't installed it yet, check out the CLI installation instructions here or explore one of our other available integrations to follow along.

Now, let's craft our first test, focusing on running a ping from a probe located in New York.

In your terminal, type and execute the following command:

globalping ping jsdelivr.com from New York

Swap out the domain and location as needed for your case.

The result structure should look familiar to you (see our tests above!), making it straightforward to analyze:

Understanding Network Latency: A Guide for Beginners

Moving beyond ping, you can run other tests like mtr, traceroute, and dns (for dig) in a similar way, for example:

globalping traceroute domain.com from Berlin

But wait, there's more! You can enhance your testing experience by exploring features like testing from multiple locations simultaneously, focusing exclusively on data-center-hosted probes, and more. Visit our GitHub repository for additional insights on making the most out of Globalping for your network testing needs!

Conclusion

Congratulations! You've taken the first step into the world of network testing by understanding what network latency is, how to measure it, and even how to improve it.

You've also learned how to level up your testing capabilities with Globalping and how to run the same network tests from anywhere in the world. Give Globalping a try – it's free!

Happy testing!

]]>
<![CDATA[How to Read a Dig Result: A Guide for Network Novices]]>Dig, short for Domain Information Groper, is a powerful command-line tool used for querying DNS (Domain Name System) servers. It provides detailed information about domain names, IP addresses, and DNS records.

In this article, we'll explore how to run a dig command and, more importantly, how to read

]]>
https://jsdelivr-blog.ghost.io/how-to-read-a-dig-result-a-guide-for-network-novices/655789f1dc7f4b000110f792Fri, 17 Nov 2023 15:45:00 GMT

Dig, short for Domain Information Groper, is a powerful command-line tool used for querying DNS (Domain Name System) servers. It provides detailed information about domain names, IP addresses, and DNS records.

In this article, we'll explore how to run a dig command and, more importantly, how to read and interpret the results. We will also explore using Globalping to run dig from anywhere worldwide.

What is Dig?

Dig is a versatile tool that helps you retrieve DNS information for a specific domain. Whether you're looking for the IP address associated with a domain, querying different types of DNS records, or investigating the authoritative DNS servers for a domain, dig has you covered.

Are you new to DNS? Check out our blog post, What is a DNS Record, and Which Ones Are There? to learn the basics!

Running a Dig Command

The basic syntax for running a dig command is as follows:

dig [options] [domain]
  • `domain`: This is the domain name you want to query.
  • `options`: You can use optional parameters to customize your dig command, such as specifying the type of DNS record to query or choosing a specific DNS server.

Note: Windows does not have the dig command by default. Alternatively, you can use nslookup or Resolve-DnsName (in PowerShell). It's important to note that the result from these Windows system commands looks different from the examples provided in this guide, demonstrating the command's usage on a Linux machine.

Example: Running Dig to Query A Records for jsdelivr.com

Let's say you want to query the A records (Address records) for the domain "jsdelivr.com." You can do this by running the following dig command:

dig jsdelivr.com A

Understanding Dig Results

Interpreting dig results may seem complex at first, but breaking it down step by step makes it more manageable. Here are the key components you'll encounter in a typical dig result:

  1. Header Section: The header section provides information about the dig query, including the query time, the server used, and flags.
  2. Question Section: The question section displays the domain, and the type of record queried.
  3. Answer Section: The answer section contains the information retrieved from the DNS server, such as IP addresses or other DNS records.
  4. Authority Section: The authority section lists the authoritative DNS servers for the queried domain.
  5. Additional Section: The additional section includes any other information provided by the DNS server, such as IP addresses of authoritative servers.

Example: Reading Dig Results for jsdelivr.com

Here's an example of a dig result for "jsdelivr.com":

How to Read a Dig Result: A Guide for Network Novices

In this example:

  • The "QUESTION SECTION" indicates that the query was for A records of "jsdelivr.com."
  • The "ANSWER SECTION" provides the IP addresses associated with the domain: 104.21.23.24 and 172.67.208.113.

By understanding these sections, you can extract valuable information about the queried domain from the dig result.

Gaining Global Insights with Globalping and Dig

Globalping is a free network testing platform enabling you to run common measurement commands like ping, traceroute, or dig from anywhere.

How to Use Globalping for Dig

Using dig with Globalping is almost identical to what you've learned in this guide. The significant difference is, that the command name is different:

  • use dns instead of dig!

To get started, get your preferred Globalping integration. For this guide, we'll be using the CLI tool, but we also have a Slack app, web form, and Github bot available that work basically the same.

To install the CLI, follow the instructions to our GitHub repo.

Ready? Then, let's write our first command!

In your terminal, write and run the following command to run dig from a specific location, such as Vienna:

globalping dns jsdelivr.com --from Vienna

In this command:

  • Replace "jsdelivr.com" with the domain you want to query.
  • Modify the location ("Vienna" in this case) to specify the origin of the dig command.

The result should look similar to the dig output we examined earlier in this guide:

How to Read a Dig Result: A Guide for Network Novices

If you want to learn more about the dns command and what options you can use with Globalping, run globalping dns --help or check out our documentation.

Using Dig Effectively

Dig is a versatile tool, and here are some tips for using it effectively:

  1. Specify Record Type: Use the -t option to specify the type of DNS record you want to query (e.g., A, MX, NS). For example: dig -t MX example.com
  2. Query Specific DNS Servers: Use the @ symbol followed by the IP address of a DNS server to query a specific server. For example: dig @8.8.8.8 example.com
  3. Reverse DNS Lookup: Perform reverse DNS lookups using -x and the IP address to query. For example: dig -x 123.456.789.3
  4. Limit Response: Often, you are not interested in reviewing the entire response. Luckily, you can “turn off” sections as needed; for example this command will only show you the answer section: dig example.com +nocomments +noquestion +noauthority +noadditional +nostats

Conclusion

Whether you find yourself troubleshooting DNS issues, validating DNS configurations, or merely delving into the intricacies of the DNS landscape, dig offers a valuable tool for gaining comprehensive insights into the DNS records and configurations of your target domain.

For a global perspective, consider using Globalping to run dig from anywhere in the world. Why not give Globalping a try and see for yourself?

]]>
<![CDATA[New Globalping feature: Eyeball and data center network tags]]>Today, we're happy to announce the release of a new Globalping feature that has been highly requested by our community: the ability to run network measurement commands from probes within eyeball or data center networks! You can combine these new tags with any existing Globalping feature and use

]]>
https://jsdelivr-blog.ghost.io/new-globalping-feature-eyeball-and-data-center-network-tags/654ce1c8712b7400012320bdThu, 09 Nov 2023 13:47:15 GMT

Today, we're happy to announce the release of a new Globalping feature that has been highly requested by our community: the ability to run network measurement commands from probes within eyeball or data center networks! You can combine these new tags with any existing Globalping feature and use them in any of our integrations, such as the CLI tool or Slack app.

In this blog post, we'll introduce you to these new tags and explore different ways you can use them.

Background: Understanding eyeball and data center network tags

We've assigned new system tags to each probe in the Globalping network that identify it as part of an eyeball network (your regular ISP) or data center network so you can run your test commands from one or the other. Let's talk more about these networks and the assigned tags:

Eyeball networks

Eyeball network probes are typically hosted in real-world environments like peoples’ homes and offices. Many of our users asked for a way to assess network performance from the perspective of everyday internet users and their regular IPSs, and that's exactly what the eyeball tag enables you to do.

For example, imagine you're a streaming platform looking to enhance streaming quality for your users or a Content Delivery Network (CDN) provider aiming to reduce latency and optimize content delivery, especially from ISPs. The eyeball tag is what helps in both cases.

Data center networks

In addition to the eyeball tag, we've introduced the data center tag for probes within data centers. These probes are especially useful if you want to learn more about a cloud provider's performance, routing, and data center-to-data center communications.

For example, using the data center tag can help you determine which hosting company is the best origin for your CDN or identify the optimal AWS region. It can also be useful when you want to optimize the overall performance of your network without a specific bias towards regular ISPs.

In action: Using our new eyeball and data center tags

Naturally, you can use the new tags across any of our integrations, whether through the web-based tool, CLI tool, Slack app, or GitHub bot.

Note that we'll be using the CLI tool in our upcoming examples – but feel free to follow along with your favorite integration!

The two new tags at your disposal for writing measurement requests are:

eyeball

datacenter

These tags are combinable with all of Globalping's existing features, and they can be paired with location types in various ways, which we'll explore in a moment.

The important point to remember is to define the tag together with the location from which you want to run a measurement request.

The basic structure of a command looks like this:

globalping [command] [target] --from [location & tag combos] [options]

Let's check out some examples!

Combining with the `world` location

The world location is the default setting used by our API, but you can also specifically define it in your requests. This comes in handy when you want to run tests from random global locations while keeping a balanced probe count across continents.

So, for example, to request traceroute measurements from 10 probes around the globe, all of which are from eyeball network probes, run the following command:

globalping traceroute jsdelivr.com --from world+eyeball --limit 10

Since world is the default location used if you don’t specify a specific location, you can also simplify the above command and use the eyeball tag by itself:

globalping traceroute jsdelivr.com --from eyeball --limit 10

Combining with a specific location

Like the previous example, you can also set a specific location instead of letting the API select a random one.

Remember, valid locations include countries, continents, cities, US states, regions (Western Europe), ASNs, ISP names, and cloud region names (us-east-2).

For example, let's say you want to run a ping test from Berlin and limit the probe selection to eyeball network probes; use the following command:

globalping ping jsdelivr.com --from Berlin+eyeball --limit 1

Here's what the result could look like:

New Globalping feature: Eyeball and data center network tags

Stacking filters

In the examples above, we've already utilized the "+" sign to combine a location and tag. You can also use the "+" sign to stack various locations and tags to create filters to refine your queries.

For example, to run two ping tests from eyeball network probes in North America within the ASN137409, run:

globalping ping jsdelivr.com --from "North America+eyeball+as137409" --limit 2

The result looks something like this:

New Globalping feature: Eyeball and data center network tags

Stacking filters and combining locations

You may have already executed a measurement request from multiple locations by listing them with a comma like this:

globalping ping jsdelivr --from "Berlin,USA,South Africa" --limit 3

This command results in three ping tests: one from Berlin, one from the USA, and another from South Africa.

Combining locations and defining filters using the "+" sign enables you to create even more fine-tuned requests. For example, to perform ping tests from an eyeball network probe in Berlin and a data center network in New York, use the following command:

globalping ping jsdelivr.com --from "Berlin+eyeball,New York+datacenter" --limit 2

The result looks something like this:

New Globalping feature: Eyeball and data center network tags

Conclusion

Our new system tags allow you to run measurement commands from data center and eyeball networks, opening up valuable perspectives for network analysis. Whether you want to improve your users' experience or delve into infrastructure details, these tags can help you get the needed insights.

Visit us on GitHub to learn more about Globalping features and best practices, and leave us your feedback so we can make Globalping a better platform for everyone!

Happy testing!

]]>
<![CDATA[How to Read MTR Results: A Beginner’s Guide]]>MTR, short for "My TraceRoute," is a powerful network diagnostic tool that combines the features of both ping and traceroute. It offers a detailed view of network performance by continuously probing the route between your computer and a target device.

In this article, we will explore how to

]]>
https://jsdelivr-blog.ghost.io/how-to-read-mtr-results-a-beginners-guide/653a636cd217af0001ccf2c8Thu, 26 Oct 2023 13:04:53 GMT

MTR, short for "My TraceRoute," is a powerful network diagnostic tool that combines the features of both ping and traceroute. It offers a detailed view of network performance by continuously probing the route between your computer and a target device.

In this article, we will explore how to run an MTR command, read and interpret the results, and leverage mtr from any location with Globalping.

What is MTR?

MTR is a network utility that provides real-time insights into the path your data takes to reach its destination. Unlike traditional traceroute, which displays a static snapshot of the route, MTR constantly monitors the network, providing dynamic statistics about each hop. This dynamic nature makes it exceptionally valuable for identifying network issues and pinpointing performance bottlenecks.

Running MTR

Executing an MTR command is similar to running a traceroute or ping command. The basic syntax is as follows:

mtr [options] target
  • target: This is the hostname or IP address of the device or server you want to probe.
  • options: You can use optional parameters to customize your MTR command, such as setting the report interval or specifying the maximum number of packets to send.

Note: If you're on Windows, you need to download and install an application such as WinMTR, which comes with a graphical interface. However, if you know how to run MTR on Linux-based systems, you can also read the results with WinMTR.

Example: Running an MTR to google.com

Let's say you want to run an MTR to Google's website. You can initiate the MTR process by executing the following command:

mtr google.com

This command starts MTR and provides dynamic statistics about the route to Google.

Understanding MTR Results

MTR results may appear complex at first glance, but breaking down the information makes it more approachable. MTR generates a continuously updating table that can look something like this:

How to Read MTR Results: A Beginner’s Guide

Let's see what we can learn from the result:

1. Host: IP address or hostname of a hop.

2. Loss%: indicates the percentage of packets lost at each hop. It's a critical measure of network reliability. Lower loss percentages are preferable.

3. Snt: "Snt" stands for "Sent," displaying the number of packets sent to each hop.

4. Last: represents the last recorded round-trip time (RTT) to the hop.

5. Avg: the average RTT for packets sent to that hop.

6. Best: shows the best (lowest) RTT recorded for that hop.

7. Wrst: represents the worst (highest) RTT recorded for that hop.

8. StDev: is the standard deviation, indicating the variance in RTT values.

By analyzing these components of the MTR result, you can assess network reliability, identify delays or packet loss, and pinpoint potential trouble spots in the network.

Note: Use the option -o to define the list of fields and their order that you want to retrieve. For example, -o "LSD AW  X" will display loss ratio, sent packets, dropped packets, average RTT, worst RTT, and worst jitter. Type mtr man in your terminal to learn more about the available options.

Using MTR with Globalping: Gain Global Insights

Just as we introduced you to Globalping for running ping and traceroute tests, our platform also lets you run MTR commands, offering you the ability to monitor network performance from virtually any location globally for free.

How to Use Globalping for MTR

1. Install the CLI Tool: To start, visit our GitHub page and follow the step-by-step instructions to set up the Globalping CLI tool on your machine.

2. Run your first MTR: Once the CLI tool is successfully installed, you're ready to run your first MTR command. Open your terminal and execute the following to initiate an MTR from a specific location, such as London:

globalping mtr jsdelivr.com --from London

In this command:

  • Replace "jsdelivr.com" with the domain or IP address you want to monitor.
  • Modify the location ("London" in this case) to specify the starting point of the MTR.

The result you receive will closely resemble the familiar traceroute output we explored earlier in this article. Some of the fields are different from the standard MTR results and are customized to provide the most useful data right off the bat for most use cases.

How to Read MTR Results: A Beginner’s Guide

Run globalping mtr --help to learn more about all the options you can use with the command and how to customize it. Alternatively, you can also check out our documentation to learn more.

Using MTR Effectively

Finally, here are some tips for using MTR effectively:

1. Identify Packet Loss: Pay close attention to the "Loss%" column at each hop. If you notice packet loss, investigate further to determine the source of the issue.

2. Check for Consistency: Look for hops with stable and consistent RTT values, which indicate a healthy network segment.

3. Evaluate Variance: The "StDev" column provides insights into RTT variance. Smaller standard deviation values suggest more predictable network performance.

4. Adjust Reporting: You can customize MTR to report specific parameters or display the output at different intervals. Experiment with these settings to gather the information you need.

5. Use It for Diagnosis: MTR is a valuable diagnostic tool for identifying network problems and tracking their progression over time. It's especially useful when you need continuous monitoring.

Conclusion

MTR is a potent tool for network professionals and enthusiasts, enabling in-depth network performance analysis. Armed with the knowledge of how to run an MTR command and interpret the results, you'll be well-equipped to monitor, diagnose, and optimize network connections effectively.

If you want to expand MTR's capabilities, use Globalping to explore networks from almost any global location. Why not give Globalping a try and see for yourself?

]]>
<![CDATA[Joining forces with Algolia for an even better npm search]]>Utilized by jsDelivr, Yarn, CodeSandbox, and several other open-source projects, Algolia’s npm search has been an essential part of the user experience for developers searching for npm packages for almost seven years now. Today, we are excited to announce that we are becoming co-maintainers of the project!

The

]]>
https://jsdelivr-blog.ghost.io/joining-forces-with-algolia-for-an-even-better-npm-search/6535338898bcce0001da3d56Sun, 22 Oct 2023 15:33:59 GMT

Utilized by jsDelivr, Yarn, CodeSandbox, and several other open-source projects, Algolia’s npm search has been an essential part of the user experience for developers searching for npm packages for almost seven years now. Today, we are excited to announce that we are becoming co-maintainers of the project!

The project was started by Algolia in 2016 with the goal of providing faster and more relevant search results than npm’s official API. Built on top of Algolia’s search platform, it offers real-time full-text search with typo tolerance and advanced ranking based on package popularity.

We use the search on our website and in many of our integrations, and have already contributed with several features in the past. Having a more active role in the project’s development will allow us to bring new features and improvements faster than before. In fact, we have already shipped an extensive set of changes aimed at improving the project’s reliability, and you can read more about those below 🚀


Diving into the original indexing process

To provide a lightning-fast search, Algolia must have all the data in its indices. But how does the data get there? That is the main task of the npm search project – collecting data from the original sources and inserting it into the search index. The data sources are:

  1. The npm replication API, which provides both the list of all packages and the metadata for individual packages (which roughly match data from `package.json`).
  2. The npm downloads API, which provides download statistics for packages used for ranking the results.
  3. The jsDelivr API, which provides jsDelivr download statistics also used for ranking the results.
  4. GitHub, GitLab, and Bitbucket, which are used to retrieve the package changelog in case it is not included in the published files.

The indexing process is further split into two phases:

  1. The bootstrap phase covers creating the initial index from an empty state. It processes several packages in parallel to finish faster.
  2. The watch phase starts after the bootstrap, continuously listens for changes in the npm registry, and applies those changes to the Algolia index. To guarantee consistency, this process is sequential, and changes are processed one by one.

In both phases, “processing a package” means retrieving data from all the relevant data sources, building the final record, and inserting it into the search index.
While the process as described here seems fairly straightforward, one of the issues the project had come to face over the years is caused by the sheer amount of data – with about 2.5 million packages in the public npm registry, even making a single HTTP request per package to get its metadata means making 2.5 million requests in total. Add in the requests needed to periodically update download statistics and detect changelogs, and the number goes higher and higher.

This problem has been made worse by the fact that every service providing the data has its own rate limits, meaning that even if we were able to process the data faster, we could not retrieve it fast enough. Furthermore, since data for a single package are considered an atomic unit, the rate of processing is effectively reduced to that of the slowest external service, and there is a very limited time window for retries in case of temporary failures without blocking the whole process.

The indexing process reimagined

To address the existing issues, we have redesigned the process so that data are fetched in multiple stages, and the performance or downtime of a single data source does not impact the whole process. We have also made changes to avoid repeatedly requesting data we already have.

The key ideas are inspired by traditional message queue systems, but to avoid new dependencies, the queues are implemented on top of additional Algolia indices.

Joining forces with Algolia for an even better npm search

The bootstrap phase

The bootstrap now runs in four independent queues. This allows for better retry handling, more specific rate-limiting control, and better performance for indexing the most essential data. The new .periodic-data and .one-time-data indices significantly reduce the number of requests we need to make in the case of a repeated full bootstrap.

The four bootstrap queues are used for:

  1. Listing the packages: instead of being queued in memory and processed right away, discovered packages are written to the bootstrap queue and processed later. The listing process continues as soon as the packages are safely stored in the queue.
  2. Indexing data from the registry: packages are picked from the bootstrap queue, prioritizing those with a lower retries counter. The indexer retrieves the full document from npm, formats it, and stores it in the main index. This is similar to before, except we do not query the additional data sources at this point. The external data are added later by additional indexers.
  3. Indexing npm downloads: packages have an internal field indicating the time of the last update, and the third queue processes all packages with this value exceeding 30 days. This process runs concurrently with the main indexer and relies on partialUpdateObject and IncrementFrom Algolia operations to perform atomic updates. If the background indexer attempts to update a record that has been changed by the main indexer, the update is discarded. The downloads data are also stored in a separate .periodic-data index to reduce calls to the npm API and speed up the indexing in case of repeated bootstraps or package updates. Whenever we process a package, the .periodic-data index is checked first. The npm downloads API is only queried if we do not have the data yet or if it is older than 30 days. The data index is shared between the bootstrap and watch modes.
  4. Indexing changelogs: packages have an internal field indicating if we have already attempted to find the changelog, and the fourth queue processes all packages where this has a non-zero value. Similar to the downloads indexer, this process runs concurrently with the main indexer and uses the .one-time-data index as a cache to reduce calls to the external services on repeated bootstraps.

The watch phase

The watch phase received a similar set of changes, along with the ability to process multiple updates in parallel while keeping the consistency guarantees it had before. This has been made possible by combining the advanced partialUpdateObject, IncrementFrom, and deleteBy Algolia features.

Additional improvements

On top of the described performance and reliability changes, we have also made several smaller improvements:

  • Detection of unpublished packages: they should now be correctly removed from the index in all cases.
  • Using jsDelivr downloads for awarding the “popular” badge: the top 1k jsDelivr packages are now marked as popular, along with the packages that were previously marked as popular based on npm downloads.
  • Switched to a new source of DefinitelyTyped data as the previous one was no longer available.
  • Reduced HTTP requests to npm downloads API by using batched requests where possible.

If you are interested in even more technical details, check out the full changes and discussion at https://github.com/algolia/npm-search/pull/1140, and be sure to follow us on Twitter for future posts!

]]>
<![CDATA[How to Read Traceroute Results: A Guide for Network Novices]]>

Traceroute is a powerful network diagnostic tool that allows you to trace the path of your data packets as they travel across the internet. It's like a road map for your data, showing each hop it makes from your computer to its final destination. Understanding how to read

]]>
https://jsdelivr-blog.ghost.io/how-to-read-traceroute-results-a-guide-for-network-novices/651ea26a5f791e000102679fThu, 05 Oct 2023 11:49:50 GMTHow to Read Traceroute Results: A Guide for Network Novices

Traceroute is a powerful network diagnostic tool that allows you to trace the path of your data packets as they travel across the internet. It's like a road map for your data, showing each hop it makes from your computer to its final destination. Understanding how to read traceroute results is vital for troubleshooting network issues and gaining insights into a network's performance.

This guide will walk you through the basics of running traceroute, interpreting its results, and running traceroute from any global location with Globalping. Let's go!

What is Traceroute?

Traceroute is a network utility that helps you visualize the route packets of data take from your computer to a target device or server on the internet. It reveals every intermediate router or "hop" along the way, displaying vital information such as IP addresses and response times for each hop. This information is invaluable for diagnosing network issues and optimizing network performance.

Running Traceroute

Running a traceroute command is straightforward and similar to running a ping command. The basic syntax is as follows:

traceroute [options] target
  • target: This is the hostname or IP address of the device or server you want to trace the route to.
  • options: These are optional parameters that allow you to customize your traceroute. For example, you can specify the number of packets to send per hop or set a maximum response timeout.

Note: If you're on Windows, use the command tracert instead!

Example: Tracing the Route to google.com

Let's say you want to trace the route from your computer to Google's website. To do this, run the following command:

traceroute google.com

This will initiate the traceroute process, and you'll see a list of hops displayed on your terminal.

Understanding Traceroute Results

Interpreting traceroute results may seem a bit daunting at first, but breaking down the information step by step makes it much more manageable. Each line in the traceroute output corresponds to a hop along the path to the target.

Here's a sample traceroute result:

How to Read Traceroute Results: A Guide for Network Novices

And here's what you can read from the result:

  1. Hop Number: The leftmost column displays the hop number, starting from 1 and increasing for each subsequent hop.
  2. Router IP Address (or Hostname): The second column shows the router's IP address (or hostname, if available) at each hop.
  3. RTT (Round-Trip Time): The next columns display the round-trip time for packets sent to that hop. You'll see three values:
  • Minimum: The shortest RTT recorded for packets sent to that hop.
  • Average: The average RTT over all packets sent to that hop.
  • Maximum: The longest RTT recorded for packets sent to that hop.

Note: If you're on Windows, you'll see the RTTs after the hop number and the router IP address comes last.

By examining the traceroute results, you can gain valuable insights into the path your data takes to reach its destination, the response times at each hop, and potential network bottlenecks or delays.

Run traceroute from Anywhere with Globalping

Globalping allows traceroute tests (and other network measurement commands) from virtually any location worldwide. This is an invaluable resource for network enthusiasts and professionals alike, and the best part is that it's absolutely free!

How to Use Globalping for Traceroute

Leveraging the versatility of Globalping for traceroute tests is straightforward, particularly when you use our Command Line Interface (CLI) tool. To get started, visit our GitHub page and follow the step-by-step instructions for setting up the CLI tool on your machine.

Once you've successfully installed the CLI tool, you're ready to run your first traceroute! In your terminal, issue the following to initiate a traceroute from a specific location, let's say London:

globalping traceroute jsdelivr.com --from London

In this command:

  • Replace "jsdelivr.com" with the domain or IP address you want to trace the route to.
  • Modify the location ("London" in this case) to specify the origin of the traceroute.

Your result will resemble the familiar traceroute output we explored earlier in this article. It unveils every hop along the path, complete with IP addresses or hostnames and response times, providing you with a comprehensive picture of the route taken to your target.

How to Read Traceroute Results: A Guide for Network Novices

Globalping goes beyond the basics, offering advanced features and customization options for traceroute tests. With Globalping, you can trace routes from multiple locations simultaneously or specify the protocol you want to use. Check out our documentation to learn more!

Final Tips for Using Traceroute Effectively

Finally, we want to share some tips to consider when using traceroute:

  1. Identify Slow Hops: Pay attention to hops with unusually high RTT values. These could indicate network congestion or issues at specific points in the route.
  2. Check for Consistency: Look for hops with stable and consistent RTT values. Consistency is a good sign of a healthy network.
  3. Investigate Timeouts: If you encounter hops with asterisks (*) or timeouts, it may suggest a router that doesn't respond to traceroute requests. Often, this is normal, but it could indicate a problem.
  4. Analyze the Destination: The final hop in the traceroute result should be the destination server or device. Verify that the IP address or hostname matches your intended target.
  5. Run Multiple Traceroutes: Running traceroute from different locations or times can provide a more comprehensive view of network performance.

Conclusion

By understanding how to run a traceroute command and interpret the results, you can become adept at diagnosing network issues, optimizing routes, and ensuring smooth data transmission across the internet. Traceroute is a valuable tool for network professionals and enthusiasts alike, enabling you to explore the intricacies of the global network.

Using Globalping, you can conveniently evaluate network performance from anywhere in the world, and best of all, it’s free! Whether you're troubleshooting network issues or simply eager to explore your network's capabilities, why not give Globalping a spin today?

]]>
<![CDATA[How to Read Ping Results: A Beginner's Guide]]>

Ping is one of the most fundamental tools in a network engineer's toolkit. It's like the "Hello World" of networking, allowing you to test the basic connectivity between your device and another on the network. Whether you're a seasoned network pro or

]]>
https://jsdelivr-blog.ghost.io/how-to-read-ping-results-a-beginners-guide/651c158a1217450001593d3eTue, 03 Oct 2023 13:23:25 GMTHow to Read Ping Results: A Beginner's Guide

Ping is one of the most fundamental tools in a network engineer's toolkit. It's like the "Hello World" of networking, allowing you to test the basic connectivity between your device and another on the network. Whether you're a seasoned network pro or just dipping your toes into the world of networking, understanding how to read ping results is an essential skill.

In this blog post, we'll walk you through running a ping command, deciphering the results, and even introduce you to a handy tool called Globalping that lets you ping from anywhere in the world.

What is Ping?

Ping is a simple yet powerful network utility that sends a small packet of data to a target device and waits for a response. The response time, or latency, helps you gauge the speed and reliability of your network connection. It's like shouting "Are you there?" into the network and listening for an "I'm here!" return.

Running a Ping Command

Before reading ping results, let's learn how to run a ping command. The process is similar on most operating systems, including Linux, macOS, and Windows.

Basic Ping Syntax

The basic syntax for running a ping command is:

ping [options] target
  • target: This is the hostname or IP address of the device you want to ping. It can be a website, a server, or any other device on the network.
  • options: These are additional parameters to customize your ping command. For example, you can set the number of ping requests, adjust the packet size, or specify a timeout period.

Example: Pinging a Website

Let's say you want to ping the jsdelivr website. You would run the following command:

ping jsdelivr.com

This sends a series of ping requests to the website's servers and displays the results.

Now that you know how to run a ping command, let's decipher the results.

Understanding Ping Results

You'll see a series of lines in the output when you run a ping command.

The following example shows our results for running the command ping jsdelivr.com on Ubuntu:

How to Read Ping Results: A Beginner's Guide

Let's break down this output step by step:

  1. Destination IP Address or Hostname: The first line typically shows the IP address or hostname of the target device.
  2. Packet Size: At the end of the first line, you can read the size of each ICMP (Internet Control Message Protocol) packet sent. In this case, the packet size is 56 bytes.
  3. Ping Responses: The following lines represent the responses received from the target device. Let's analyze one of them in detail:
  • 64 bytes from IP_ADDRESS: This part confirms that we received a response from the target as a 64-byte packet.
  • icmp_seq: This is the sequence number of the ping packet. It starts at 0 and increments with each new packet sent.
  • ttl: TTL, or Time-to-Live, is the number of hops (routers) the packet traveled through before reaching the destination. This number can help you understand the network's complexity and identify potential bottlenecks.
  • time: The most crucial part of the response is the round-trip time (RTT), measured in milliseconds. It tells us how long it took for the packet to travel from our computer to the destination and back.

At the end of the result, you'll see a summary including the following data:

  • Packet Loss: This indicates the percentage of packets lost. If you see non-zero packet loss, it shows some packets didn't make it, suggesting potential network issues.

  • Round-Trip Time (RTT): This shows the time it takes for a packet to travel from your computer to the target device and back. These values indicate the speed and stability of your network connection. Lower RTT values are generally better, but occasional fluctuations are normal. You'll see four values:

    • Minimum: The shortest time recorded.
    • Average: The average time over all ping requests.
    • Maximum: The longest time recorded.
    • Mean Deviation: The spread of RTT values. ****

Using Globalping: Ping from Anywhere in the World

Now that you're familiar with how to run a basic ping command and interpret the results let's introduce you to a handy tool called Globalping. It's a great resource for network enthusiasts; the best part is that it's free!,

Globalping allows you to run ping tests from virtually any location worldwide. This is incredibly useful if you want to check how your network performs in different regions. Whether you're troubleshooting network issues or testing the latency of a server in a remote location, Globalping has you covered.

How to Use Globalping

Utilizing Globalping is a breeze, especially when you harness the power of its Command Line Interface (CLI) tool. To get started, head to our GitHub page and follow the instructions for setting up the CLI tool on your machine.

Once you've successfully set up the CLI tool, you can write your first ping command. Open your terminal and type the following command to initiate a ping from a specific location, let's say London:

globalping ping jsdelivr.com --from London

In this command:

  • Replace "jsdelivr.com" with the domain or IP address you want to ping.
  • Modify the location ("London" in this case) to specify where you want the ping to originate.

The result you receive closely resembles the familiar ping results we've explored earlier in this article. In addition, it includes essential information about the Globalping probe on which the command was executed.

How to Read Ping Results: A Beginner's Guide

Globalping offers a wealth of additional features and customization options. You can take your network diagnostics to the next level by pinging from multiple locations simultaneously or adjusting the number of packets sent per ping. To explore these advanced capabilities, dive into our documentation!

Conclusion

Understanding how to read ping results is fundamental for anyone working with networks. By running ping commands and interpreting the results, you can diagnose network issues, assess latency, and ensure the smooth operation of your systems.

And with Globalping, you have the added benefit of testing network performance from anywhere globally, all for free. So, whether you're troubleshooting network problems or just curious about your network's performance, give it a try.

]]>
<![CDATA[Network troubleshooting in Slack made easy with Globalping]]>

With about 20 million active users, Slack is one of the most popular digital communication tools, especially for tech industry teams. It's an invaluable platform for collaborative work, idea sharing, and issue troubleshooting, bringing teams together regardless of location.

Thanks to this popularity, more than 1300 Slack apps

]]>
https://jsdelivr-blog.ghost.io/network-troubleshooting-in-slack-made-easy-with-globalping/651c126b1217450001593d05Tue, 03 Oct 2023 13:17:09 GMTNetwork troubleshooting in Slack made easy with Globalping

With about 20 million active users, Slack is one of the most popular digital communication tools, especially for tech industry teams. It's an invaluable platform for collaborative work, idea sharing, and issue troubleshooting, bringing teams together regardless of location.

Thanks to this popularity, more than 1300 Slack apps have emerged, mainly designed to boost productivity within workspaces. And since Globalping aims to improve users' productivity and collaboration on network-related challenges, we've developed our very own Globalping Slack app.

So, in this article, we'll explore the Globalping Slack app, how to use it, and how it can help your team collaborate on network issues directly in Slack.

Exploring the Globalping Slack app

First of all, what exactly is a Slack app? Basically, these apps allow you to connect other services to your Slack workspace, such as Google Calendar or Jenkins CI. You can find them in the Slack App Directory and install them in one of your workspaces to make them available to everyone.

So, what can you do with the Globalping Slack app?

To ensure you enjoy a consistent experience with Globalping, we've designed all our integrations to run the same network measurement commands consistently. So, if you're familiar with our CLI tool, you can seamlessly transition to using the GitHub bot or the Slack app. The main difference is the collaborative aspect, which can be valuable for all types of technical teams, especially for network engineers, DevOps, and support teams:

  • Share relevant data in one place: Tackling challenging network issues often requires teamwork. With the Slack app, you can run network measurement commands directly in chat, ensuring everyone can access the results without switching between tools or tiresome copy-pasting of data.
  • View network issues from any location: Many teams don't share an office or even live in the same country – Slack is a great tool for bringing everyone together in one place. Globalping also works globally, enabling you to run commands from anywhere, whether it's the city of one of your colleagues or the location of a user experiencing network issues.
  • Involve the right people: By installing the Slack app, everyone in your workspace can use it, regardless of their technical skills. So, even those unfamiliar with CLI tools can use Globalping to run network measurement requests. This helps team members troubleshoot issues independently or quickly engage in network-related discussions.

Using the Globalping Slack app

In the upcoming sections, we'll show you how to install and use the Globalping Slack app and walk you through running network measurement commands. All you need to get started is Slack and a workspace allowing you to install apps.

Installing the Slack app

To get the Globalping Slack app into your workspace, follow these steps:

  1. Open your browser and navigate to the Globalping Slack app within the Slack App Directory. (Ensure you're in the workspace where you want to install the app!),

Network troubleshooting in Slack made easy with Globalping

  1. Click the "Add to Slack" button on the left side of the page and grant Globalping the requested permissions on the following screen to start the installation.
  2. Finally, back in Slack, in the navigation menu on the left-hand side, you should now see "Globalping" listed under "Apps". This means that the Globalping app is installed and ready for use!

Network troubleshooting in Slack made easy with Globalping

Using Globalping in Slack

The best way to get started with Globalping is by using the handy help command, which provides information about using the tool.

Here's how you can do this using Slack's well-known / commands:

  1. Navigate to a public channel such as #general or start chatting with the app itself if you prefer to keep things private
  2. Trigger the app by typing a new message in the chat. Start with the command /globalping followed by the parameters. In this case, we're using help as an example:
 /globalping help
  1. Hit enter and give the app a moment to process your command.
  2. And that's that! The Globalping app promptly posts a new message within the chat, delivering the requested information.

Network troubleshooting in Slack made easy with Globalping

Notice that at the top of the message, it says, "Only visible to you". This ensures that this information remains private and doesn't clutter the Slack channel. However, the results are visible to all channel members when running actual measurement commands like ping or mtr.

Before we explore how to execute actual network measurement commands with the Globalping Slack app, let's explore what you need to know to leverage the app:

  • Direct Messages: You can't trigger the app in private direct messages it's not a part of. So make sure you add the Globalping app to a direct message before you call on it. But don't worry if you forget: The Slack app will remind you what to do:

Network troubleshooting in Slack made easy with Globalping

  • Threads: When using Globalping inside a Thread, remember to mention the app with @globalping instead of using the slash command /globalping. Otherwise, it works the same way, and you write measurement requests as you usually would with the app.

Network troubleshooting in Slack made easy with Globalping

Also, ensure you've added the Globalping as an "Integration" in the channel's settings for this to work!

Network troubleshooting in Slack made easy with Globalping

Running measurement commands with Globalping

Now that we've explored the basics, we're ready to execute actual network measurement commands with the Globalping Slack app.

Example: Ping a target from Berlin using two probes.

Let's go through a practical example of using the Globalping Slack app. In this case, we want to run ping from two available probes in Berlin. This means we'll get two ping results from two different spots within Berlin. Globalping sets the default number of probes to one, but we can adjust this with the --limit option.

Here's the command to achieve this:

/globalping ping jsdelivr.com from Berlin --limit 2

The app will present the ping results in a moment, which should look something like this:

Network troubleshooting in Slack made easy with Globalping

Feel free to replace "Berlin" with virtually any other location you have in mind. This includes countries, continents, cities, US states, regions, ASNs, ISP names, and cloud region names. If you want to define multiple locations, list them with a comma (e.g., Berlin, South America) or combine them with the + sign to fine-tune your request (e.g., aws+montreal).

Example: Resolve DNS from Berlin and South America using the resolver 1.1.1.1

In this following example, we want to use Globalping's "dns" command, which essentially works like the "dig" tool, to resolve a DNS request from Berlin and South America. Plus, we want to use a specific resolver server for this, which we define with its IP address 1.1.1.1.

Let's run the following command in Slack:

/globalping dns jsdelivr.com --from "Berlin, South America" --resolver 1.1.1.1 --limit 2

The result will look something like this:

Network troubleshooting in Slack made easy with Globalping

Sharing Globalping Slack app results beyond Slack

What if you want to share the network measurement results with someone who's not a member of your Slack workspace?

As you've seen in our examples above, Globalping offers a range of options that you can include in your commands. While some are specific to certain commands, others are globally available. One such global option is the "--share" option, which adds a link to a measurement result that you can then share with anyone.

For example, let's revisit the ping example from earlier and add the "--share" option:

/globalping ping jsdelivr.com --from Berlin --limit 2 --share

This time, you can find a link at the bottom of the result. Clicking this link opens a new tab in your browser, taking you to our website, where you can view the result on a map and see more detailed information below.

Network troubleshooting in Slack made easy with Globalping

Note: To explore all available options for a command, add the "help" option to the command itself. For example, you can use /globalping ping help to learn about all the options available to ping.

Conclusion

The Globalping Slack app leverages the collaborative capabilities of Slack, enabling teams to actively work together during critical moments, whether it's troubleshooting outages or fixing complex CDN routing issues.

We believe that the Globalping Slack app has the potential to become an indispensable tool for many teams, especially for network engineers, DevOps professionals, and technical support teams. Why not give it a try and see for yourself? (It's free!)

Happy testing!

]]>
<![CDATA[Understanding Packet Loss: Causes, Impacts, and Remedies]]>

You've probably heard of packet loss if you're new to network engineering or just trying to troubleshoot some internet connectivity issues. It's one of those technical terms that can sound intimidating, but fear not – we're here to break it down in

]]>
https://jsdelivr-blog.ghost.io/understanding-packet-loss-causes-impacts-and-remedies/650c25983ae99100014fbb5eThu, 21 Sep 2023 11:17:03 GMTUnderstanding Packet Loss: Causes, Impacts, and Remedies

You've probably heard of packet loss if you're new to network engineering or just trying to troubleshoot some internet connectivity issues. It's one of those technical terms that can sound intimidating, but fear not – we're here to break it down in this blog post, exploring causes, impacts, and remedies.

What is Packet Loss?

Let's start with the basics. In computer networks, data is broken down into smaller chunks called packets that are sent and received across the internet. Packet loss occurs when some of these packets don't make it to their destination.

Imagine you're mailing a letter, and it gets lost in transit – that's a bit like packet loss in the digital world. These lost packets can lead to various issues, but we'll get into that in a moment.

Causes of Packet Loss

Packet loss can happen for various reasons, and understanding these causes is crucial for effective troubleshooting. Here are some common culprits:

  1. Network Congestion: When there's too much traffic on a network, it can become overwhelmed. Think of it as a busy highway during rush hour: some will get lost if too many cars (or data packets) try to squeeze through.
  2. Faulty Hardware: Routers, switches, and cables can malfunction, leading to packet loss. Just like a broken bridge can disrupt traffic, a malfunctioning router can drop packets.
  3. Wireless Interference: In wireless networks, interference from other devices, like microwave ovens or cordless phones, can disrupt data transmission.
  4. Jitter and Latency: High levels of jitter (inconsistent packet arrival times) and latency (delays in packet delivery) can contribute to packet loss. These issues often arise in long-distance connections or poorly optimized networks.
  5. Software Bugs: Sometimes, it's not the hardware but the software itself causing problems. Bugs in network protocols or applications can result in packet loss.

Impacts of Packet Loss

Now that we can identify packet loss, let's dive into why it's a concern. Packet loss can have several negative impacts on your network and user experience:

  1. Reduced Throughput: When packets are lost, the data needs to be retransmitted, leading to slower data transfer rates. It's like taking a detour on your journey – it takes longer to reach your destination.
  2. Audio and Video Issues: For real-time applications like video conferencing or online gaming, packet loss can result in choppy audio and video, making communication difficult.
  3. Web Page Loading: Slow-loading web pages or incomplete loading can be attributed to packet loss. Imagine trying to read a book with missing pages.
  4. Interrupted Downloads: If you're downloading a file and experience packet loss, the download may pause or fail, requiring you to start over.
  5. Frustrated Users: Consistent packet loss can lead to frustrated users who may abandon your services or website in search of a smoother experience.

Detecting Packet Loss With Ping

Detecting packet loss is a critical step in troubleshooting network issues. There are various methods and tools at your disposal, but let's start with a widely-used and straightforward technique: ping.

Using ping to detect packet loss

Ping is like the "Hello, are you there?" of the networking world. It's a simple command that sends an Internet Control Message Protocol (ICMP) packet to a target and waits for a response. If the target receives the packet and responds, you're in luck – no packet loss! However, if there's no reply, it indicates that some packets may have been lost in transit.

Here's how to use ping:

Open a command prompt or terminal window on your computer (you can do this on Windows, macOS, or Linux). Then, type the following command:

ping [target_address]

Replace [target_address] with the server or device's IP address or domain name you want to test. For example, if you want to ping Google's DNS server, you'd enter:

ping 8.8.8.8

Hit Enter, and you'll see a series of responses showing the time it took for each ping to reach the target and return. Look for lines that say "Request timed out" or "Destination host unreachable." These indicate packet loss.

Once the ping command is finished, you will get a summary with the Round Trip Time (RTT) and the packet loss percentage.

Understanding Packet Loss: Causes, Impacts, and Remedies

Use Globalping to ping from anywhere

While running ping from your machine helps test networks, it has a limitation – it only tells you about packet loss from your local location. What if you want to know how your network performs globally? This is where Globalping comes in.

Globalping is a free global network testing tool enabling you to run commands like ping, traceroute, and more from anywhere.

Here are some scenarios where Globalping can be particularly helpful:

  1. Global User Base: If your website or application serves users worldwide, you'll want to ensure a smooth experience for everyone. Globalping lets you see if packet loss is affecting users in different regions.
  2. Troubleshooting Regional Issues: If you suspect that packet loss is specific to a particular geographic area, Globalping allows you to confirm and pinpoint the problem.
  3. Network Provider Assessment: You can use Globalping to evaluate the performance of different network providers in various locations, helping you make informed decisions about your network infrastructure.

Here's how to use ping with Globalping:

First, make sure that you install the CLI tool. Visit Globalping on GitHub and follow the installation instructions. Alternatively, you can use the form on our website, which is a quick way to get started but has fewer options than our CLI tool.

With the CLI tool ready, type the following into your terminal to send a ping to a target from London:

globalping ping jsdelivr.com --from London

Replace the target with a domain or IP address you want to ping and change the location from which the ping should be executed.

The result looks quite similar to the ping result on Linux machines, including some information about the Globalping probe on which the command was run.

Understanding Packet Loss: Causes, Impacts, and Remedies

With Globalping, you can do much more and refine your commands, e.g., ping from multiple locations at once or set the number of packets to send per ping. Read our documentation to learn more!

Remedies for Packet Loss

So, what can you do when you encounter packet loss? Here are some strategies to mitigate its impact:

  1. Check Your Hardware: Ensure that your network hardware is in good shape. Replace faulty cables or malfunctioning routers.
  2. Reduce Network Congestion: Implement Quality of Service (QoS) policies to prioritize critical traffic. This can help prevent congestion-related packet loss.
  3. Optimize Your Network: Analyze your network for bottlenecks and optimize its configuration. This might involve upgrading your internet plan or reconfiguring routers.
  4. Packet Loss Compensation: Certain techniques, like forward error correction (FEC), can be applied to mitigate the impact of packet loss in real-time applications.
  5. Monitor and Test: Regularly monitor your network performance and use tools like Globalping to promptly identify and address packet loss issues.

Conclusion

In conclusion, packet loss is a common issue in computer networks, and it can significantly affect your network's performance and user experience. However, armed with knowledge about its causes, detection methods, and remedies, you can proactively manage and mitigate packet loss.

Remember that tools like Globalping can be invaluable in assessing your network's health from various locations worldwide. So, the next time you suspect packet loss, don't hesitate to give it a try!

]]>
<![CDATA[What is a DNS Record, and Which Ones Are There]]>If you're new to the world of networking or website management, you've probably heard the term "DNS" thrown around quite a bit. DNS stands for Domain Name System, and it's a fundamental part of how the Internet functions. In this blog post,

]]>
https://jsdelivr-blog.ghost.io/what-is-a-dns-record-and-which-ones-are-there/64fb3566f0267a00015876faFri, 08 Sep 2023 14:58:09 GMT

If you're new to the world of networking or website management, you've probably heard the term "DNS" thrown around quite a bit. DNS stands for Domain Name System, and it's a fundamental part of how the Internet functions. In this blog post, we will talk more about DNS records, explain what they are, and provide an overview of the most important types of DNS records. We'll also introduce you to how to query DNS worldwide using your terminal and the Globalping network testing CLI.

Understanding DNS in a Nutshell

Before diving into DNS records, let's quickly grasp the essence of what DNS is.

When you type a website's URL into your browser (e.g., www.example.com), your computer doesn't understand it in the form of words; it needs an IP address to reach the website's server. Here's where DNS (Domain Name System) comes to the rescue. DNS acts as the internet's address book, translating user-friendly domain names into IP addresses (like "192.168.1.1"). Think of DNS as the postal service for the internet, helping route your request to the right destination.

To understand this process better, let's break it down into a few key steps:

  1. You type a web address: You open your browser and type in a web address (e.g., www.example.com) or click on a link.
  2. Your computer checks its cache: Your computer first checks its local DNS cache. If it recently looked up the same domain, it might have the IP address saved. If not, it moves to the next step.
  3. Asking the recursive DNS server: Your computer contacts a Recursive DNS Server (usually provided by your ISP or a public DNS service like Google DNS or Cloudflare DNS). It asks, "Hey, do you know the IP address for www.example.com?"
  4. Recursive DNS server searches: The Recursive DNS Server might have the IP address cached or might need to find it. It follows a trail of DNS queries, starting from the root DNS servers, then to the top-level domain (TLD) servers (like .com), and finally to the authoritative DNS server for "example.com."
  5. Authoritative DNS server response: The authoritative DNS server for "example.com" provides the correct IP address, which the Recursive DNS Server caches and sends back to your computer.
  6. Your computer can now connect to the website hosting server, and you see the web page you requested.

Using the "dig" Command for DNS Queries

Now that you understand the basics of DNS, you might wonder how to explore DNS records for a domain. This is where the "dig" command comes in handy. "Dig" is a command-line tool that allows you to query DNS information for a domain.

For example, if we run the command:

dig jsdelivr.com

… we get the following result:

What is a DNS Record, and Which Ones Are There

For example, if you run "dig example.com," you might see output that includes A records, AAAA records, NS records, and other DNS-related data for the domain.

"Dig" is a valuable tool for network administrators, webmasters, or anyone curious about a website's DNS configuration. It helps you gain insights into how a domain is set up and can be essential for troubleshooting DNS-related issues.

Let’s explore some of the most important DNS records in the next section!

What DNS records are there?

Each DNS record contains specific information about a domain, helping direct internet traffic to the right destination. Here's a breakdown of some common DNS records:

1. A Record (Address Record)

The A record is the most fundamental DNS record. It links a domain name to an IPv4 address. For example, if you have a website hosted at 192.168.1.1, the A record for your domain would associate www.example.com with that IP address.

www.example.com.    IN    A    192.168.1.1

2. AAAA Record

Similar to the A record, the AAAA record links a domain to an IPv6 address. IPv6 is the newer version of the internet protocol and uses longer addresses. Here's how an AAAA record looks:

www.example.com.    IN    AAAA    2001:0db8:85a3:0000:0000:8a2e:0370:7334

3. CNAME Record (Canonical Name)

CNAME records are like aliases. They point one domain to another domain's A or AAAA record. For instance, you could use a CNAME to have "blog.example.com" point to the same IP address as "www.example.com."

blog.example.com.    IN    CNAME    www.example.com.

4. MX Record (Mail Exchanger)

MX records handle email routing. They specify which mail servers are responsible for receiving emails on behalf of a domain. MX records have priority values to determine the order in which servers are used.

example.com.    IN    MX    10    mail.example.com.

5. TXT Record (Text Record)

TXT records contain text information, often used for adding extra information about a domain. They're commonly used for email verification, SPF (Sender Policy Framework), and DKIM (DomainKeys Identified Mail) settings.

example.com.    IN    TXT    "v=spf1 mx -all"

6. NS Record (Name Server)

NS records specify the authoritative name servers for a domain. These servers hold the official DNS records for the domain. They are essential for delegating subdomains or transferring domain control.

example.com.    IN    NS    ns1.example.com.

Global DNS Testing with Globalping

Understanding DNS is one thing, but what if you want to check how your DNS records perform from different locations around the globe? This is where Globalping comes in handy.

Globalping is a free network testing platform that allows you to run network measurement requests from anywhere. So, for example, if you want to run "dig" from a location in South Africa, Berlin, or a specific ISPN, you can easily do so!

Note: The "dig" command is actually called "dns" in Globalping. But don't get confused; they differ only in their names.

To use Globalping, follow these steps:

  1. Follow the installation instructions explained on Github to set up Globalping on your machine.

  2. Open your terminal and type the following to run dig (dns) from South Africa:

    globalping dns jsdelivr.com from "South Africa"

  3. View the results!

What is a DNS Record, and Which Ones Are There

Want to learn how to read dig/dns results? Check out our guide here.

Wrapping Up

In summary, DNS records are the backbone of the internet, translating human-readable domain names into machine-friendly IP addresses. Understanding the various types of DNS records, such as A, AAAA, CNAME, MX, TXT, and NS, is essential for managing your online presence effectively.

Additionally, the "dig" command is a valuable tool for querying DNS information, and Globalping offers a convenient way to test the global accessibility of your DNS records.

If you want to learn more about Globalping or even want to contribute, visit us on GitHub – we’d be happy to see you there!

]]>
<![CDATA[Automating latency and uptime checks with Globalping on Linux and macOS]]>

Whenever you need to test or troubleshoot your network, the ping command comes to the rescue, providing insights into the latency and availability of a target host.
But imagine you want to use ping to monitor your website's uptime – repeatedly running ping manually is too impractical, and

]]>
https://jsdelivr-blog.ghost.io/automating-latency-and-uptime-checks-with-globalping-on-linux-and-macos/64edf548ab4e90000136f762Tue, 29 Aug 2023 16:03:35 GMTAutomating latency and uptime checks with Globalping on Linux and macOS

Whenever you need to test or troubleshoot your network, the ping command comes to the rescue, providing insights into the latency and availability of a target host.
But imagine you want to use ping to monitor your website's uptime – repeatedly running ping manually is too impractical, and investing in a full-scale monitoring tool is overkill for such a small task. Another challenge arises when you want to test from different locations, as ping is usually limited to where it's executed, like your laptop or a remote server.

So, in this guide, we'll explore a solution to this problem and show you how to run ping commands from any location using our network testing platform Globalping. Moreover, we'll explore how to automate the command to run on Linux and macOS, building the foundation for simple uptime monitoring and latency measurement over time.

Getting started with Globalping

Globalping is an open-source network testing platform with a vast network of global probes hosted by community members. Thanks to this network, you can use the Globalping API, CLI tool, or Slack app to define almost any location from which you want to run a network measurement command, such as ping or traceroute. The platform then picks probes from the specified places, lets them execute the command, retrieves the results, and delivers them back to you.

So let's get you started with the Globalping CLI tool and see the platform's functionality in action!

First, you need to install the Globalping CLI tool on your system. Open your terminal and execute the appropriate command for your operating system:

Ubuntu/Debian (deb):

```
curl -s https://packagecloud.io/install/repositories/jsdelivr/globalping/script.deb.sh | sudo bash
apt install globalping
```

macOS (Homebrew):

```
brew tap jsdelivr/globalping
brew install globalping
```

Note: If you're having trouble, refer to the README on GitHub for the most up-to-date instructions on installing and running the Globalping CLI tool.

Once you have set up the CLI tool, it's time to run your first ping command with Globalping. How about pinging the jsdelivr.com website from two probes, one in Germany and one in South America? Give it a try with the following command:

globalping ping jsdelivr.com --from "Germany, South America" --limit 2

The result should look something like this (please note that the results may vary depending on the probes the API utilizes!):

Automating latency and uptime checks with Globalping on Linux and macOS

Note: We won't go into reading ping results in this guide, so check out blog posts like this one written by Nicholas to learn more.

Let's take another look at the command:
The --from option allows us to specify the location from which to execute the command. Valid locations are countries, continents, cities, US states, regions (Western Europe), ASNs, ISP names, and cloud region names (us-east-2). The Globalping API smartly interprets the provided location, so feel free to experiment with different inputs!

We used the --limit option to specify the number of probes to use (by default, the limit is set to 1). And since we set the limit to 2 and defined two locations, the API selected one probe from each place to execute the command.

Note: All Globalping CLI commands support a variety of options. To learn more about the Globalping ping command, see some usage examples, and view all available options, run ping with the --help option:

globalping ping --help

Creating a script to automate ping tests

Now that we know how to run a single ping test using the Globalping CLI, it's time to explore automation.

Step 1:

First, let's decide on the ping command we want to automate. For this example, we'll go with the following one:

globalping ping jsdelivr.com --from Berlin --ci --json

We use the --ci option, which eliminates any coloring from the output and ensures that the command waits for all data to arrive before returning it. This waiting step is essential to process the data within our script!

Additionally, we use the --json flag to retrieve the ping results in JSON from the Globalping API. By doing so, we gain access to additional data not part of a traditional ping output, such as details about the used probes. Moreover, having the data as JSON makes it easy for us to parse and process the data in a script.

Step 2:

Next, we'll create a script that runs the ping command automatically. Depending on your programming skills and operating system, you have several options, such as writing the script in Python, Bash, or PowerShell (if you're on Windows).

Let's start by creating a simple Bash script that executes the command and presents the results:

```
#!/bin/bash

# Define the ping command
ping_function(){
    globalping ping jsdelivr.com --from Berlin --ci --json
}

# Execute the ping command and capture the output
ping_result=$(ping_function)

# Display the result
echo "$ping_result"
```

Save the file somewhere on your system with the name "globalping-ping.sh" and make it executable with the following command:

chmod +x globalping-ping.sh

Let's test the script! You can execute the script directly from the folder where it's stored:

./globalping-ping.sh

Running the script should return the ping results as JSON. Check out our API reference to learn more about the response data.

Enhancing our script

Let's elevate the usefulness of our script!

Before we start, ensure you have installed the CLI tool JQ, allowing us to extract and process the JSON data we get from the Globalping API in our terminal and script. We also recommend that you familiarize yourself with the basic functionality of JQ before moving forward.

Ready? Let's explore two typical monitoring scenarios:

1) Latency checks

Monitoring round trip times (RTT) in ping results helps detect network congestion, high server loads, or delays in DNS resolution, all of which may lead to heightened latency.

In this scenario, we want to identify abnormally high RTT in ping results by comparing them against a custom threshold value. If the maximum RTT surpasses this threshold, we'll extract relevant data from the Globalping API response for further processing.

First, let's use JQ to extract the maximum RTT (in milliseconds) from the ping result JSON:

max_value=$(echo $ping_result | jq '.results[].result.stats.max')

Next, we compare the extracted max_value with a threshold RTT value you can customize according to your needs. For testing, start with a low value (e.g., 2 ms) and adjust it for production use.

If the check passes, we create a new JSON object containing data from the API response, including details about the probe, ping statistics, and the raw ping result text. Finally, we display this JSON in the terminal but feel free to modify the script to store it in a file or send it via email.

```
# Check if the max RTT is > 2 ms (adapt this number to your use case)
if (( $(echo "$max_value > 2" |bc -l) )); then
 # Use JQ to extract data from the API's JSON response; For example:
 # Get the ping's stats, including min, max, and average RTT
 stats=$(echo $ping_result | jq '.results[].result.stats')
 # Get details about the used probe
 probe=$(echo $ping_result | jq '.results[].probe')
 # Let's also include the ping's raw output
 raw_output=$(echo $ping_result | jq '.results[].result.rawOutput')

# Create a new JSON object with the extracted data
 new_json=$(jq -n --argjson probe "$probe" --argjson stats "$stats" --argjson rawOutput "$raw_output" '{probe: $probe, stats: $stats, rawOutput: $rawOutput}')

# Take action: send the data via email or store it in a file
 # For testing, let's output it to the terminal:
 echo "$new_json"
fi
```

Let's briefly examine the line in which we construct the new JSON object with JQ:

new_json=$(jq -n --argjson probe "$probe" --argjson stats "$stats" --argjson rawOutput "$raw_output" '{probe: $probe, stats: $stats, rawOutput: $rawOutput}')

In this line, we use the jq command with the -n flag to generate new JSON and the --argjson flag to pass the JSON data extracted from the API response as arguments ($probe, $stats, and $raw_output). Then, we use these arguments to create the desired JSON structure.

2) Simple uptime checks

In this second scenario, we want to detect failed pings and extract the raw ping output, which contains details about the error, for further processing. The most common reasons why a ping fails include an unavailable host, unresolved hostname, or network glitches.

Let's start by extracting the ping result status from the API response. In case a ping fails, the status value within the result object will be set to failed.

Note: Still running tests have a status of in-progress, and successfully completed tests are finished.

ping_status=$(echo $ping_result | jq -r '.results[].result.status')

Note: Using the -r option outputs strings directly to standard output without JSON formatting, i.e., without the quotes.

Next, we check if the status is set to "failed". If so, we extract the raw ping output from the JSON object and display it in the terminal. Again, you can modify this to your needs, for example, by sending an alert via email.

```
# Check if status is failed
if [ "$ping_status" == "failed" ]; then
 # Get the ping's raw output
 raw_output=$(echo $ping_result | jq '.results[].result.rawOutput')

# Take action: send the data via email or store it in a file
 # For testing the script, let's output it to the terminal:
 echo "$raw_output"
fi
```

If you can’t manipulate the availability of your target host to test the script, you can provide an invalid target address, which also makes the ping fail.

Note: You can find the entire example script here.

Congratulations on reaching this point! We're now ready for the final segment of this guide: automating the execution of our script. Let's go!

Running our ping script automatically

Let's learn how you can schedule and run the script automatically. Before we start, take a moment to decide on the execution period. For example, you can run the script every hour, every five minutes, or at any frequency that best suits your needs. For this guide, we'll schedule it to run once an hour.

Scheduling on Linux using crontab:

Cron is a job scheduler that automatically executes tasks according to a set schedule, and crontab (cron table) lists the commands or tasks to be completed.

So to have our script run automatically, we need to add it to crontab:

Step 1:

Open your terminal and use the following command to edit crontab:

crontab -e

When prompted, choose an editor of your choice.

Step 2:

You can now see the contents of the crontab file, which may already contain entries. Add a new line at the end to schedule our ping script (don't forget to update the path):

0 * * * * /path/to/globalping-ping.sh

This example schedules the script to run every hour. You can modify the schedule to match your desired period based on the logic explained in more detail here.

Step 3:

Save the file and close the editor. Cron will now automatically run your script at the specified intervals.

Note: If you encounter problems, ensure that the ping script is executable (check the permissions) and that you have specified the correct paths for Linux or macOS.

And that's it! With this automated setup, your Globalping ping script will run according to the set schedule.

Conclusion

Congratulations, you have just created a straightforward script to automate ping tests using Globalping, empowering you to monitor latency and uptime!

If you're eager to further explore scripting, you can customize your Bash script to add more functionality. Also, feel to try other network measurements using the Globalping CLI tool, such as traceroute, dns, or HTTP HEAD requests.

We'd love to hear from you! Visit us on GitHub to share your thoughts and ideas or even contribute to the Globalping community.

]]>
<![CDATA[What Are HTTP GET and HEAD Requests and How to Leverage Their Power]]>

Welcome back to another Networking 101 guide! Today, we will explore the world of HTTP requests and dive into the functionalities of HTTP GET and HEAD requests. If you've ever wondered what they are, how they work, and what makes them essential in web development and troubleshooting, then

]]>
https://jsdelivr-blog.ghost.io/what-are-http-get-and-head-requests-and-how-to-leverage-their-power/64c7a9e010dfc60001223470Mon, 31 Jul 2023 12:35:09 GMTWhat Are HTTP GET and HEAD Requests and How to Leverage Their Power

Welcome back to another Networking 101 guide! Today, we will explore the world of HTTP requests and dive into the functionalities of HTTP GET and HEAD requests. If you've ever wondered what they are, how they work, and what makes them essential in web development and troubleshooting, then this guide is for you. We'll walk you through everything you need to know about these HTTP methods, their significance, and how to make the most of them in various scenarios. So, let's get started and uncover the power of HTTP GET and HEAD requests!

What are HTTP GET and HEAD requests?

HTTP GET, and HEAD requests are two of the most commonly used HTTP methods in web development and communication between clients and servers.

HTTP GET Request:

You can use HTTP GET requests to retrieve data from a specified resource on a web server. For example, when you enter a URL into your web browser's address bar and hit Enter, your browser sends an HTTP GET request to the web server hosting that URL. The server processes the request and responds with the requested resource, typically a web page, in the HTTP response.

HTTP HEAD Request:

The HTTP HEAD request is similar to the GET request but only retrieves the response's headers and not the actual content. This makes the HEAD request useful when you need specific information about a resource, such as its Content-Type, Content-Length, or last modified date, without actually downloading the full content.

Why are HTTP GET and HEAD requests important?

HTTP GET, and HEAD requests play a crucial role in web development and various use cases, including:

  • Retrieving web pages and resources: When you click on a link or type a URL in your browser, an HTTP GET request is made to fetch the web page's content. GET requests are fundamental to web browsing, enabling users to access the desired resources from web servers.
  • API integration: Many web APIs utilize HTTP GET requests to provide data to consumers. APIs often return data in JSON or XML format, allowing applications to consume and process the information efficiently.
  • Caching and performance: The HEAD request is valuable for checking whether a resource has been modified since the last visit without downloading it. This helps implement caching mechanisms and optimize website and app performance by reducing unnecessary data transfer.
  • Testing API endpoints: HTTP GET requests are commonly used to interact with different API endpoints and validate their responses when developing or testing APIs. This enables developers to ensure API functionality and data accuracy.

How to make HTTP GET and HEAD requests

Let's walk through some examples of how to make HTTP GET and HEAD requests using the terminal!

HTTP GET Request

To make an HTTP GET request using the terminal, you can utilize tools like curl or wget. Here's an example using curl to fetch the contents of the jsDelivr website's homepage:

curl https://www.jsdelivr.com

After executing this command, you'll see the HTML content of the jsDelivr homepage displayed in your terminal.

Or to do the same, but from a different location, you can run this command using the Globalping CLI tool:

globalping http https://www.jsdelivr.com --from Germany --method GET

HTTP HEAD Request

You can use the -I option with curl for an HTTP HEAD request. Let's retrieve the headers of the same webpage:

curl -I https://www.jsdelivr.com

By running this command, you'll receive the headers of the jsDelivr homepage, providing information such as the Content-Type and Content-Length, but without the actual page content.

Do you want to execute the command from another location? Again, you can use the Globalping CLI tool with the following command to run the GET request from, let’s say, East Asia:

globalping http https://jsdelivr.com --from "East Asia" --method HEAD

Troubleshooting with HTTP HEAD and GET requests

HTTP GET, and HEAD requests are valuable tools for troubleshooting various scenarios:

  • Content verification: Use HTTP HEAD requests to verify if the content of a resource has been modified. This can help detect changes or potential issues with cached data.
  • API endpoint testing: When developing or testing APIs, make HTTP GET requests to examine the responses and ensure that the API returns the expected data.
  • Website performance: You can assess website performance metrics by analyzing the response headers using HTTP HEAD requests, such as cache expiration and compression settings.
  • Data validation: When working with APIs, HTTP GET requests are handy for retrieving data and validating its accuracy against expected results.

Conclusion

In conclusion, HTTP GET, and HEAD requests are fundamental components of web development and troubleshooting. GET requests to retrieve data from web servers, making them essential for browsing the web and integrating with APIs. On the other hand, HEAD requests provide valuable information about resources without transferring unnecessary data.

Ready to harness the power of HTTP GET and HEAD requests? Take your web development and troubleshooting skills to the next level with Globalping, which allows you to make HTTP requests from anywhere in the world. Try Globalping and explore the potential of HTTP GET and HEAD requests globally. Happy testing!

]]>