Networking 101: Ethernet, LANs, and How They Work
In the early days of the web, users connected to the internet by dialing from a PC directly into their internet service provider (ISP) of choice. Can you hear the nostalgic screeching of a modem? But for today’s users having all of their devices “on the network” is a given. Businesses have been doing this for many years in the form of using Ethernet-based LANs… but “LAN” and “Ethernet” are not synonymous.
Let’s take a look at how each one contributes to your ability to watch funny cat videos.
What Is a LAN?
A Local Area Network (LAN) is a network whose members are known to one another, but not the rest of the world. LANs pre-date the internet’s predecessor by a decade or so. For example, an older type called token ring allowed you to connect the network in a big loop. Traffic circled the various network members (or nodes) until it reached its destination.
Modern LAN-connected machines can talk to each other as well as external computers (such as the web servers housing awesome sites like MakeUseOf). But those other computers can’t initiate contact in return. How is this possible? It’s because your local network is designated “private” by the IPv4 standard.
What Is a Private IPv4 Network?
Networks that use the internet Protocol version 4 (IPv4) use familiar addresses such as “192.168.0.25” for each network node. The IPv4 standard dictates that members of private local networks use a particular range of addresses, as follows:
- 172.16.*.* to 172.31.*.*
When you’re trying to contact one of the above addresses, your computer will look towards the other devices it’s connected to directly. In other words, it won’t go outside looking for these nodes (more on what “outside” means in a moment).
Say you want to look at a web page. When you type in its URL, your computer will try to figure out its IP address using a DNS search . If that IP ends up being one of those above (i.e. a local address), your computer will attempt to contact that machine directly. Since they’re members of the same private network, it will find that node.
Otherwise, your computer will need to venture into the internet to contact it. One of the nodes on the LAN is designated as the gateway and all the other machines are configured to use this gateway. A gateway will receive these outgoing requests (such as “fetch me the home page of MUO”) and determine where to send it next. Then it’ll send the request, receive the response, and forward that back along to the machine that asked for it. (This process is called network address translation .)
The result is your device has one IP address locally, but appears to external machines to have a different one. To see how this works, try the following:
- Look for the IP address of your computer on the LAN. Take a look at past MUO articles to do this on Windows using ipconfig or on Linux and Mac using ifconfig .
- Now, go to the site What Is My IP. The premise of this site is simple: your request is coming from your public address, and the site simply shows this back to you.
See how the two are different?
When you request the MUO home page, our web server sees a request coming from the external address, not your local one. It also means the web server can’t try to connect to your machine on its own. The gateway (which is typically a router) by default will not forward an incoming request anywhere. In the next section we’ll examine how these two addresses work.
Local (Private) and Public Addresses in Action
Let’s try a little experiment to demonstrate this difference. If you have a Wi-Fi network, connect your phone to it and ping your PC (there are terminal applications available for both iOS and Android) with the following command:
ping [your internal IP address, e.g. 10.30.30.90]
You should get output like that shown above (i.e. that the ping command was successful). Now disconnect from Wi-Fi and try it using the external address you saw earlier (e.g. “8.14.*.*”). You’ll likely get no response, because the command is hitting your router and being ignored (hit Ctrl + C when you get tired of waiting).
Accessing Your LAN From Outside
So what use is a network if no one from the outside can ever get into it? They can, but it needs to happen in a controlled manner. Routers can be configured to open specific ports to incoming traffic and direct it to a specific machine within your local network, a process called port forwarding .
Consider your home network’s SSH server , which likely has an internal IP such as “192.168.0.2.” You can configure your router to forward port 22 to this particular local machine. Now when you contact the SSH port of your external address (“8.14.*.*:22”), the router forwards this along to your local machine.
The result is you can reach your machine from the outside via the external address because your router will pass the request along to the LAN. This is also how MakeUseOf’s network can forward port 80 to a web server, allowing you to read this article right now.
Advanced LAN Configurations
In addition to your basic home or business network, there are a couple of other LAN configurations you may not even know you’re using. The following are some of the most common.
Tethering a device to your smartphone actually creates a (Wi-Fi based) LAN between the two devices. The phone then acts as a gateway, routing the requests it receives to the mobile carrier network (i.e. the “public” network).
Most home networking routers assume they will be the only device playing the role of both wired and wireless gateway. But it’s possible to set up a wireless router to serve only as an “access point.” This means it will then take any traffic it receives and forward it on to the “main” router. It’s a fine use for an older router, to act as a “range extender” of sorts.
Most operating systems will allow you to directly connect two devices together, although this typically comes with some caveats. Firstly, you’ll need to configure them by hand — there won’t be any fancy router doling out IP addresses automatically (unless of course you set up one of the two devices as a DHCP server ).
Second, when you do configure them, you’ll need to do it right. If you set them up with addresses from different ranges (e.g. one with an address of 192.168.3.1 and the other 10.30.30.90), they won’t be able to see each other. Lastly, by using the network connections of each to connect to the other, you’ll need to take additional steps if any of them are to reach the internet (such as turning your Windows PC into a wireless router ).
What About Ethernet?
A LAN, then, is a network configuration, or topology. So what is Ethernet? Ethernet is one medium (of several) you can use to create a LAN. Others include Wi-Fi, Bluetooth, and USB. These can all be used to create a local network, or can even all co-exist within the same one. While wireless has its conveniences, Ethernet still serves several important roles, as follows:
- Ethernet is still the de facto connection for workstations in corporate networks.
- Even in fully wireless networks (e.g. home networks), the connection between the cable/DSL modem and the router is Ethernet.
- Bandwidth-sensitive activities like gaming or streaming still benefit from a wired Ethernet connection .
- Ethernet networks continue to offer the benefit of physical security.
The main pieces of networking gear in an Ethernet network is the Category-5 cable that runs between two RJ-45 ports. A very basic Ethernet network could consist of just three parts: two nodes with RS-45 ports and the cable running between them. In a home network, this is the equivalent of plugging your device (e.g. an Xbox) directly into the port on your cable modem.
More complex networks make use of other elements such as hubs and routers. These two terms are easy to mix up, but we’ve explained the difference in greater detail . The important thing to remember is that hubs connect the network internally, and routers connect it with other outside networks. All of the above can also be combined, with a network containing Ethernet connections to devices like desktop PCs or servers and wireless connections to printers, phones/tablets, and devices outside the reach of wired drops.
Basically, Not All LANs Are Ethernet
Ethernet is one of the oldest, and in many ways still one of the best, media for LANs today. But networks have grown beyond just this one type of connection. And while Ethernet is still a key element in most LANs both at home and at the office, they are not one and the same.
What does your home network look like? Do you have any devices still hard-wired over Ethernet? Prefer Ethernet to other types of connections for certain applications? Let us know in the comments!