how does Ping resolve website

3

When I do ping stackoverflow.com from command window in Windows, how does it get the ip address of stackoverflow. Basically how does the entire thing work ?

Prashant

Posted 2010-07-15T14:34:44.837

Reputation: 157

7Isn't anybody going to start w/ the keyboard controller and work out from there? He did say "the entire thing"... – Evan Anderson – 2010-07-15T14:39:25.793

1Heh, I was thinking about it, Evan, but then realized it would be a big pain in the rear to explain. :) – EEAA – 2010-07-15T14:40:40.550

1Sometimes the time and effort is not deserved. – Warner – 2010-07-15T14:41:30.670

Evan, I would have thought you could explain all of it, including the keyboard controller within 5 mins of the question being asked! – Nick Kavadias – 2010-07-15T14:44:26.843

@Evan Anderson = sic – Campo – 2010-07-15T14:49:53.070

The entire thing? Don't forget the CS, EE and Physics guys over on the Area51 SE site. – jscott – 2010-07-15T14:51:01.663

@Evan I gave it my best shot :) @ErikA & @Warner Aww common the effort is almost always worth it :) – Zypher – 2010-07-15T14:57:05.877

Although it made me a little sad to cast a close to SU vote after i wrote it. – Zypher – 2010-07-15T14:57:41.240

@Zypher - we appreciate your contribution on SU too. – Gnoupi – 2010-07-15T15:45:17.160

Answers

16

For @Evan (because I'm waiting for rm -rf to finish before i can do work):

Here is the process of ping resolving a website:

  1. An electrical signal in your brain generates what is known as an idea.
  2. This idea is converted to another electrical signal, that travels from your brain, down your spine and into the nerves in your hands where it is processed by the muscles in your fingers.
  3. Your fingers convert this electrical energy into mechanical energy which forces the proper key down on your keyboard.
  4. The depression of the switch on the keyboard triggers another electrical signal to travel down the wire (or over the airwaves) from your keyboard which triggers an interrupt at the hardware level.
  5. This interrupt alerts the operating system of a pending action it needs to take.
  6. The kernel process the signal from the keyboard and outputs feed back to the screen
  7. the light energy on the screen is converted into electrical energy by your eye and sent to the brain for processing
  8. Once the brain has processed and confirmed the readout from the screen is what you want, repeat steps 1-8 until you send the signal to depress the "enter" key
  9. The ping command then takes the input - in this case ping serverfault.com - and sends a signal to the Operating system to do a DNS LOOKUP
  10. The operating system sends a signal to the DNS subsystem, which generates a packet and sends it down the OSI model until it reaches the hardware
  11. an electrical signal is generated on the nic and sent out the ethernet cable (or whatever physical connectivity if fiber s/electrical/optical )
  12. The signal goes through intermediary network connectivity (switches/routes/etc) until it reaches the DNS SERVER
  13. The DNS SERVER processes the request and reverses steps 10-11 to get back to your machines where it is processed by the OS and passed back to ping.

(I skimped on a couple of places mostly because i ran out of juice and only have 1/2 a cup of coffee in me)

Zypher

Posted 2010-07-15T14:34:44.837

Reputation: 2 077

Skimping or no skimping, that was impressive considering it's not even Friday. – Kara Marfia – 2010-07-15T15:01:14.370

@Zypher = > was a great answer. Though when I said the entire thing I did not expect electric signal from brain in the answer :). – Prashant – 2010-07-15T17:52:36.183

4

It is called DNS.

Campo

Posted 2010-07-15T14:34:44.837

Reputation: 484

and http://en.wikipedia.org/wiki/Ping

– runlevelsix – 2010-07-15T14:36:52.117

If I wouldn't have hit the captcha, it would have been a simul-post. :) +1. – jscott – 2010-07-15T14:37:14.863

Yah damn thing! hahaha. I think you beat me.. +1 for you too! – Campo – 2010-07-15T14:37:45.767

3

First it uses your local host file then it uses your primary dns server, if that fails it goes to the secondary dns server.

The Digital Ninja

Posted 2010-07-15T14:34:44.837

Reputation: 217

Why others forget the host file. – Pipe – 2010-07-15T16:29:42.827

1

Take a look at the following...

http://en.wikipedia.org/wiki/Routing_table

http://compnetworking.about.com/od/hardwarenetworkgear/f/routing_table.htm

Also look up routing metric's

These are some fundemental networking

Matthew Zielonka.co.uk

Posted 2010-07-15T14:34:44.837

Reputation: 111

2Although these links may answer the question, it is preferred for you to summarize the links so we have a actual answer here – Canadian Luke – 2012-10-08T18:54:50.420