Send a suggestion!

We're building a brand new version of the site, and we'd love to hear your ideas

Members

Technology Zones

IBM Learning Center

Articles

Hosted By

MaximumASP

Info

Rated
Read 127,401 times

Contents

Related Categories

How to PING - Introduction

randy

Introduction

I have often been asked how to replicate the PING command-line utility. I often ignored the request and went on to subject that I was more familiar with. But the question has been increasing in frequency over the last few months. I family sat down and tried to hack something together that could be re-used.

The usefulness of the class is limited. The only use I've been able to ascertain is to determine if a particular server is responding to ICMP requests. So, I don't think I'll be able to talk long about how useful this re-usable code is. What's that? ICMP? You don't know what ICMP is? Ok! I'll fill the article with random gibberish about ICMP and its use on the Internet.

Let's start with the basics. What exactly is a PING? A little known fact is the PING is actually a short-form acronym for Packet Internet (or Inter-Network) Groper. The PING utility is most often used in diagnosing network problems. The utility sends one packet of data to the target host and waits for an identical (or echoed) reply from the host. The idea behind the PING is that responding to one packet of data is generally the lowest common denominator in diagnosing network presence. If the host can reply to one packet, then you can be reassured that the host exist. Imagine the situation where a user is having difficulty navigating the corporate website. The user can determine minimal network presence by trying to PING the website.

The PING utility can generally send more than one request and this can also be used to determine if the network is intermittently dropping packets. Last, the PING utility can also be used to determine if the naming service is properly translating names into IP addresses.

ICMP

Now I'm pretty certain you already knew what the PING utility did. You are more likely interested in finding out the how than the what. Here 'tis in black and white. The PING utility does not use TCP (Transmission Control Protocol) like most other network traffic. Neither does it use UDP (User Datagram Protocol). Rather it uses an often forgotten Internet protocol called ICMP (Internet Control Message Protocol). The intent of ICMP has always been in diagnosing IP-network issues. The entire protocol is a quick low-level access point into the IP-network. If you are familiar with the OSI Reference Model, then skip the next couple of paragraphs.

The OSI Reference Model divides the task of communicating over a network into seven layers, application, presentation, session, transport, network, data-link and physical. The TCP, UDP and ICMP protocol are transport layers, whereas the IP protocol is network layer. Much of the IP traffic these days is TCP, a connection-oriented transport layer for the Internet. The TCP connection-oriented protocol provides a lot of services not provided by the IP layer, like ports, checksums, framing and sequencing packets. The UDP connectionless protocol on the other hand does not provide framing or sequencing of packets, but does provide minimal services like ports and checksums. ICMP is yet another step down from UDP and provides only a checksum service. ICMP is really a higher-level tap into the low-level IP-network.

Randy's article are Copyright 1998-2003 Randy Charles Morin

Comments

  • Re: [4628] How to PING

    Posted by usul on 31 Jul 2007

    You can also see a screencast how to ping .

  • Re: network utilities - HELP needed

    Posted by Konio on 28 Mar 2006

    hfhg

  • network utilities - HELP needed

    Posted by Konio on 30 Nov 2005

    Hi Everyone.I'm kind a newbie in C++ but recently I got a special task and I need to develop a ping plotter, a route tracer and a netstat utility in C++. I would really appreciate any kind of help (so...

  • Includes

    Posted by thesun on 14 Nov 2005

    What is the name of library to include ?

    #include ???

    In the icmp.h and ping.cpp

    Thanks

  • PIng plotter in C#

    Posted by Gulfam on 14 Oct 2004

    HI everyone,
    i need to develop a ping plotter + a route tracer in c # but the problem is i am a newbie and dont know much so how do i go about this or if any source code is available for pining in c ...