By the end of this lesson you will be able to
- tell end devices (computers, printers, servers) from network devices (switches, routers)
- explain what a switch does and what a router does
- use the words interface, port, cable and link correctly
- read the practice network map and look at a device's settings with
show - test whether two devices can reach each other with
ping
“Everything goes through this cupboard”
After lunch on her first day at Bellflower Design, Charlotte Reed follows William Ashby into the small cupboard by the kitchen. A grey box with a row of blinking lights sits on a shelf, a smaller box sits beside it, and a bundle of blue cables disappears into the wall.
“Everything in the studio talks through this cupboard,” William says. “Before you can fix anything, you need to know what each box does and how they are joined. Let's start with a map.”
Two kinds of device
Everything on a network is either a device that people use, or a device whose job is to carry messages for others.
- End devices are where messages start and finish: desktop computers, laptops, phones, printers and servers. A server is simply a computer whose job is to provide something for others, such as shared files or a web page. At Bellflower Design the server called
filesholds the studio's shared folders and its intranet, a small website that only staff can see. - Network devices sit in the middle and pass messages along. Nobody sits at them. The two you will meet most are the switch and the router.
The switch joins devices in one place
A switch is a box with a row of sockets called ports. Each computer, printer and server in the office is cabled to one port. When a message arrives on one port, the switch sends it out of the port where the right device is connected. Everything cabled to the same switch is on the same local network, the LAN you met in lesson 1.1.
The studio's switch is called sw1. It has eight ports, named p1 to p8 in the practice network.
The router joins networks together
A router connects different networks and decides which way each message should go next. The studio's router is called edge, because it sits at the edge of the studio's network. One side is plugged into the switch; the other side is connected to the studio's internet provider. Every message that leaves the building for the internet passes through edge.
An easy way to remember the difference: a switch joins devices into one network; a router joins networks to each other. The box most homes call a “router” actually contains a router, a small switch and a wireless radio in one case. In an office they are usually separate boxes.
Interfaces, cables and links
Every device that connects to a network has at least one network interface: the hardware, and its socket, that sends and receives messages. A desktop computer usually has one wired interface, called eth0 in the practice network. A router has several, one for each network it joins, so edge has eth0 (towards the studio's switch) and eth1 (towards the internet provider).
A cable plugged into an interface at each end makes a link. A link is “up” when both ends are plugged in, switched on and able to hear each other. On real equipment a small light beside the socket usually shows this. In the practice network, the show command tells you.
| Word | What it means |
|---|---|
| Interface | A device's connection point to a network: its network socket and the hardware behind it. |
| Port | One socket on a switch or router. On a switch, each port is an interface. |
| Link | A working connection between two interfaces, usually made with a cable. |
| Link up / no link | Whether the two ends can talk to each other right now. |
Your practice network
Every lesson in this course has practice networks like the one below. Each is a pretend network that runs entirely inside your web browser: nothing you type can affect a real computer or network, so experiment freely. If you get into a muddle, press Reset this network.
- The map shows the devices, with each one's name and address underneath. Lines are cables. The small labels near each end of a line are the names of the interfaces the cable is plugged into. The cloud on the right stands for the internet. On a phone, slide the map sideways to see all of it.
- The dark box under the map is the command box. Type a command there and press Enter (or Run). The prompt, such as
charlotte>, shows which device you are working on. - To work on a different device, click it on the map, or type
onand its name, for exampleon sw1. - The buttons after Try: run a suggested command for you. Type
helpat any time to see all the commands for the device you are on.
Try show first. On Charlotte's laptop it lists the interface eth0, says whether its link is up and how fast it is, and gives its addresses. Don't worry about the numbers yet: modules 2 and 3 explain every one of them. Then switch to sw1 and type show there. You get a table of the eight ports, showing which device is plugged into each one.
Testing a connection with ping
The quickest way to find out whether two devices can reach each other is ping. It sends a small test message to another device and waits for a reply, rather like calling “Are you there?” across a room. Type ping followed by the other device's address:
charlotte> ping 192.168.10.40
Pinging 192.168.10.40:
Reply from 192.168.10.40: time=0.8 ms TTL=64
Reply from 192.168.10.40: time=0.4 ms TTL=64
Reply from 192.168.10.40: time=0.4 ms TTL=64
Reply from 192.168.10.40: time=0.4 ms TTL=64
4 sent, 4 received, 0% lost, average time 0.5 ms.
Each “Reply” line means one test message reached the printer and an answer came back. The time is how long the round trip took, in milliseconds (thousandths of a second). Inside one office, replies usually take well under a millisecond. The first one is a little slower because the laptop first has to find the printer on the network; lesson 4.1 explains exactly what happens then. TTL is explained in module 4.
If no reply comes back, ping says so, and that is useful too: it tells you where to start looking. Real computers have a ping command that works in the same way, although the exact wording of its messages varies from one system to another.
After a successful ping, the map draws the path the reply took in blue. Ping the printer, then the server, then news.example (a website on the pretend internet) and compare the three paths. Only the last one goes through the router.
When a cable comes out
Much of a network engineer's day is spent finding out why something that worked yesterday has stopped working. The simplest fault of all is a cable that has come out. In the network below, somebody has unplugged the cable of the computer called rose, so on the map rose is no longer joined to anything. Ping Rose's computer (192.168.10.32) from Charlotte's laptop, then run show on rose and on sw1 to see how the fault shows up.
The laptop reports “destination host unreachable”: nothing on the network answered for that address. On rose, show says “nothing plugged in”, and on sw1 port p4 is now empty. You will put the cable back yourself in Exercise 4, with the plug command. On the switch, plug p4 rose:eth0 means “plug port p4 of this switch into interface eth0 of the device rose”.
Exercises
Exercise 1 · Which box does which job?
The studio needs one box that joins all the computers, the printer and the server in the office into one local network. Which device does that job?
Exercise 2 · Read a device's address
Use the practice network below. Switch to the printer (click it, or type on printer) and run show. What is the printer's IPv4 address? Type just the four numbers with dots, without the /24.
Exercise 3 · Match each device to its job
Choose the job each device does on the studio's network.
Exercise 4 · Plug Rose's computer back in
Rose Mitchell says her computer, rose, cannot open anything on the network this morning. Somebody has pulled her cable out of the switch. Plug it back in so that rose can reach the server files (192.168.10.5) again, then test it with ping from rose.
Exercise 5 · Follow a ping across the office
Charlotte's laptop (plugged into port p1) pings the printer (plugged into port p6). Put the steps in the order they happen.
Quick check
Choose an answer to see whether you are right and why.
What is the main job of a router?
A router joins networks, such as the studio's network and the internet provider's, and decides which way each message should go. Joining the devices in one place is the switch's job.
In the practice network, what does the prompt sw1> tell you?
The prompt always shows the device you are working on. Click another device on the map, or type on and its name, to change it.
A ping to the printer reports 4 sent, 4 received, 0% lost. What does that tell you?
Each reply is a test message that reached the printer and came back. Ping tests the network connection, not whether the printer can actually print.
Which of these is an end device rather than a network device?
A server is an end device: messages start or finish there. Switches and routers are network devices that pass messages along for other devices.
Summary
- End devices (computers, laptops, printers, servers) are where messages start and finish; network devices (switches, routers) carry them.
- A switch joins the devices in one place into a local network (LAN). A router joins different networks, such as the studio and the internet.
- Each device connects through a network interface. A cable between two interfaces makes a link, which is either up or not.
- In the practice network,
showdisplays a device's interfaces and settings,onswitches to another device, andpingtests whether another device answers.
Found a mistake on this page, or something unclear? Report a problem and mention “Computer Networking Fundamentals Lesson 1.2”.
