No constant pinging needed
Your computer first detected loss of ethernet layer connectivity - meaning electrical current was no longer present on its ethernet port (physical socket where the cable is plugged in). You will also notice the green light by the ethernet port went off - this happens when ethernet cable is pulled out from either of the 2 ends. Later when your router went back online, the electricity was detected first and the light went green. Very shortly after that also the icon in your PC system tray showed that network connection is working. At that point IP layer can be said to be operational and the computer knows can send and receive IP packets as it knows it can connect to the router.
Have a look at OSI network layer model. http://en.wikipedia.org/wiki/OSI_model
The answer is that ping program operates on network layer level, but your computer (as a system using its different parts integrated by the software) is "aware" of all the layers. So if the most basic layer is disrupted upon disconnecting the wire - that happens at the physical layer level (on the wire - most usually Ethernet). The network adapter is constantly receiving sending signals on the physical layer. You can compare it to the carrier on analogue telephone network. If you pick up a landline telephone receiver you can hear the carrier tone. If you don't hear it, you know the telephone line is not working. Similarly computer "knows" the ethernet wire is disconnected at either end, because there is no "carrier" (if we use this simile). So there is no need to constantly use ping for the computer to know it is connected to a physical network.
Also remember when we speak of ping we are only talking about TCP/IP protocol stack (particularly its ICMP protocol). To illustrate how internet connections work for web browsers, consider this. Typically when your Firefox browser wants to fetch a page from an URL (e.g. http://tinyurl.com) it first asks the computer what is the IP address of tinyurl.com. The system using its resolver library then queries a DNS server who gives the answer such as 195.66.135.249. Firefox then asks your computer to get the default webpage from tinyurl.com. Your computer establishes a TCP connection with the computer with IP 195.666.135.249 and delivers the http protocol message asking for the default webpage. tinyurl.com then sends back the default page over the http protocol that travels the virtual "pipeline" created by TCP protocol. This perhaps gives you a feel how different parts of TCP/IP protocols interoperate and illustrates that there are multitude of ways how a computer can "know" if it is connected to physical network, to local network and to the Internet.
For better concept of layers, you perhaps should look at some diagrams and more theory at http://www.hardwaresecrets.com/article/The-OSI-Reference-Model-for-Network-Protocols/431/1. The key idea would be that protocols on each level can "pretend" to talk to the same level protocol on the remote computer and do not really need to know much about other protocols, only how to receive/pass messages to the upper/lower level protocols. I am sure you will find analogy with letters stuffed in each other, quite handy.
You will see in OSI model - TCP/IP suite are not the only network protocols around. Some years ago Netware IPX/SPX protocols were better established in office networking settings and TCP/IP was a newcomer of sorts. The cable then often was coaxial not ethernet twisted pair.
1The "TV" show, and the actual "Division" of the US Navy that the show portrays, is
"NCIS"
, not"NCSI"
(the"S"
and"I"
are exchanged).NCIS
stands for "Naval Criminal Investigative Service", which is a civilian U.S. agency that investigates crimes that occur in the United States Navy or Marines Corps. – Kevin Fegan – 2014-01-22T15:10:35.1531@KevinFegan, yes I know, that’s why I said similar instead of identical. Regardless, they look similar so most people won’t immediately notice that and will think of the show. – Synetech – 2014-01-22T16:07:53.747