How did SSH connect without Internet?

I have a WiFi router, connected by Ethernet cable to my Ubuntu desktop and Android mobile. I have sshd set up.

The telephone-line-in cable to the router was cut. But both devices were still connected to it, but unable to access the Internet.

So, just to test, I tried to establish an SSH connection from my mobile to the desktop (using the ConnectBot Android app). To my utter astonishment, I got a successful SSH session.

Why were the two devices able to connect through SSH?


Solution 1:

Your router is only a Gateway to another WAN network; the router in itself is just another node on the local network. As your other nodes have the same network settings, they should be able to connect just fine. Since they are indeed connected, you have a valid local area network (LAN).

However, if you try to connect to a WAN, you wont be able to do so.

Here is the definition of SSH.

Secure Shell, or SSH, is a cryptographic (encrypted) network protocol operating at layer 7 of the OSI Model to allow remote login and other network services to operate securely over an unsecured network

An internet connection is not required to SSH into your device, unless you are trying to do it through the internet!

Solution 2:

Your mobile (WiFi) and your desktop (Ethernet) are in the same local network. There is no magic at all.

Solution 3:

I've heard this question many times and its hard to explain to someone with little networking experience. This is how I explain it, via a simple diagram.

Gets Both LAN and WAN, because all lines are intact.

     ISP (internet)
          |
          |
          |
     Modem/Router/Switch
      /    |    \
     /     |     \
Mobile  Desktop  Laptop

Gets Only LAN but Does Not get WAN, because the lines to the router are still intact. Doesn't get WAN (internet) because line to ISP is cut.

     ISP (internet)
          |
          x
          |
     Modem/Router/Switch
      /    |    \
     /     |     \
Mobile  Desktop  Laptop

Good luck!

Solution 4:

Your "WiFi" router actually incorporates several functions into one device. In the past these functions would have required separate devices in separate boxes

  • broadband modem - communicates with ADSL or similar long-haul service.
  • router - connects internal network(s) to wider world
  • ethernet switch or hub - connects locally wired ethernet computers together
  • wireless access point (WAP) - connects local wireless devices together
  • DHCP server - assigns IP-addresses (etc) to local devices
  • DNS server - allows local devices to locate each other and locate Internet servers
  • NTP server - provides time to local devices.
  • etc (print server, USB NAS, ...)

When your broadband cable is disconnected, only the broadband modem function is put out of service, the router function then has little to do. The switch and WAP functions (etc) can continue to work, enabling local devices to talk to each other.

In short, the local area network (LAN) is autonomous and can mostly function without the wide area network (WAN).