That First Hop

In the last post we talked about how your data moves around the Internet, which is neat and all, but how does your computer know how to take that first hop?  Somehow your data has to get onto the route to get to www.google.com.  When you get into a car to take a ride to the comic book store, or the gaming store, or the computer store, you open the door to your home and step out through that.  That’s what your computer does, it takes the gateway to the Internet to get anywhere on the Internet.

Like in Star Trek, when they step onto the transporter to go somewhere, that’s their first hop.  Or in Portal, when you jump through the portal to go anywhere, that’s your first hop.

But what’s the computer’s first hop? If you’re reading this blog from your home Linux® system, you had to get here somehow.

And of course, there’s a command for that!  It’s called netstat.

Alpha:~ computerlamp$ netstat -rn
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
0.0.0.0         192.0.2.0       0.0.0.0         UG        0 0          0 eth0

Now the next question:  What in the world does that mean?  Looks kind of like nonsense, right?  Kind of what you’d see when watching The Avengers, they’d show it on one of the screens so it would look official, even if it is just a status report.

The Iface at the end of the report is the hardware that the computer uses to connect to the Internet.  It’s usually called eth0, or ethernet 0.  If you have multiple interfaces on your computer, you might see eth1, eth2, eth3, or more.  Sometimes you’ll see lo0 as an interface.  That’s the interface that the computer uses to talk to itself on the Internet.  Isn’t that weird?  Your computer talks to itself on the network and to make that happen, it has a hardware interface to do it.

The IP address under Gateway is the IP address that your computer uses as its first hop.  We’ll talk about masks next time, for now, you can read more in the man page.  Of course there’s a man page, there’s always a man page!

 

One thought on “That First Hop

  1. Pingback: Netmask - ComputerLamp

Leave a Reply

Your email address will not be published. Required fields are marked *