Ping Console



  1. Ping Console Browser
  2. Pong Home Console

SEGA MEGA DRIVE 2 CONSOLE BUILT IN GAMES SONIC PING PONG OLD GAMES UK US. Extremely Rare Sampo Paddle Controller I My For Home Pong Tv Console. Atari Flashback Blast Vol.3 PONG Classic Retro Video Game Console 20 Games. Probably you already know what ping is: it is a command that you can run on your terminal to see if a host is up and running. It works by sending some packets to the host and waiting for a response, and it measures the round-trip time that the message takes to go to the host and come back to the client. An example can be ping code4it.dev.

Probably you already know what ping is: it is a command that you can run on your terminal to see if a host is up and running.

It works by sending some packets to the host and waiting for a response, and it measures the round-trip time that the message takes to go to the host and come back to the client.

An example can be

that can return something like

PSSS! Remember not to include the protocol!

ICMP

More in detail, ping sends an ICMP echo request to a specified interface and waits for a reply.

Just as a reminder, ICMP (Internet Control Message Protocol) is a network protocol that is at the same level as TCP and UDP on the networking stack, but it is typically not used for exchanging data between endpoints but only for sharing errors or information.

Azure and ICMP

The problem comes when you want to ping a service hosted on Azure: in order to avoid DDoS attacks, the Azure team decided to block ICMP packets.

As stated by the Azure Networking Team:

Unfortunately ICMP presents risks and problems for our underlying network infrastructure.

So you cannot ping them.

In fact, if you try it from your system, you will receive Request time out.

But at least you can try to reach it using a browser!

A simple use case

Let's say that you have a website, mysite.azurewebsites.net, that must communicate with an API hosted at myapi.azurewebsites.net. Now you want to check if the networking between the two systems works well and check if everything is well configured.

Of course, you can't open a browser inside the Azure portal. So what?

PongMac console ping

TCPPing - the solution for you

First of all, you should try to ping the service within the Azure Portal, so that you are sure you're running the commands in the cloud environment. Azure Portal allows you to use multiple tools to interact and analyze what's going on on your App: just open your resource and head to Development Tools

You will find both a Console and an external tool called Advanced Tools: you can use both, but here I'm using the Console tool:

If you try to ping myapi from Azure, you won't receive a Request time out, but a different error:

That's because the ping command has directly been disabled.

So how can we solve it?

Well, the solution is pretty easy! There is a command called tcpping that allows you to do something similar, and that can be called by both the Console and the Kudu advanced tool, accessible in the Development Tools section.

Csgo

By running tcpping myapi.azurewebsites.net, you can get something similar:

That, in the console, looks like this:

If you wanna have more info about this command, you can simply type tcpping.

First of all, it explains what it is: Opens a TCP socket to a target host:port and returns whether the initial handshake was successful and a connection was established.

That's the way to avoid ICMP packets! Just use TCP!

There are also some flags that can be set:

Pong
  • -n: the number of pings to perform. If not specified, the value is 4
  • -t: loop infinitely
  • -s: run for the specified seconds

Conclusion

Here we've seen how you can ping an Azure App Service inside the Azure Portal. This is a tiny tool that you must know if you want to check if your architecture is well configured. Do you know other ways?

The internet has fundamentally changed the majority of the applications we develop. Rarely is an application designed to exist in isolation. Instead, most apps rely on other networked apps to retrieve and store information. In this post, we’ll explore the network utility ping and how we can utilize a C# library to test the reachability of any network host.

What Is Ping?

Written in 1983 by Mike Muuss, the design of the ping utility is one that allows network administrators to measure, diagnose, and troubleshoot network issues. Being developed in the military, ping naturally gets its name after the sound sonar makes and mimics the behavior of sonar itself.

Ping is a computer network administration software utility used to test the reachability of a host on an Internet Protocol (IP) network. It is available for virtually all operating systems that have networking capability, including most embedded network administration software. –Wikipedia

When invoked, ping transmits a set of bytes, and the output shows information including the host’s IP address, the Internet Control Message Protocol (ICMP) sequence, the Time To Live (TTL), and the total response time in milliseconds.

As we can see, the output can help us diagnose whether our target host is up and responding expectedly.

Ping with .NET

While being a command-line utility on most operating systems, ping is also implementable. The .NET Framework has an implementation of Ping under the System.Net.NetworkInformation namespace. We can use this class to perform the same ping actions from our C# applications.

We get the following results from running our console application.

Ping Console Browser

One strange behavior we notice is the reply buffer length is always 0. The odd behavior is because the Ping class behaves differently based on our operating system. On Unix systems (Linux and macOS), the .NET Framework delegates to the UnixCommandLinePing class, which does not map PingOptions and does not read the response byte array. The difference in behavior across operating systems should be accounted for, as it could cause null reference exceptions`.

Pong Home Console

The cool thing about the Ping implementation in .NET is the presence of the IPStatus enum, which makes it clear what kind of response we are dealing with.

There we have it! We can ping a network host and wait for a response right from our .NET code. Give it a try and leave a comment below.





Comments are closed.