AP Computer Science Principles · Unit 4 lecture · Part 1 of 11 · 8 min

4.1 Computing devices, systems and networksWhat the internet actually is

By the end: Explain how data crosses the internet in packets using open protocols, analyze a network drawing for paths, redundancy and single points of failure, and compute the time and speedup of sequential, parallel and distributed solutions.
Mr. Thompkins
Hi, I'm Mr. Thompkins, Mr. T for short. Quick puzzle to start: when you tap play on a video, the video lives on a computer that might be a thousand miles away. How does it find your phone, out of billions of phones? By the end of today you'll be able to explain that, and also why the whole thing keeps working when a cable gets cut.

Let's build the vocabulary from the bottom up, because the exam uses these words exactly. A computing device is a physical thing that can run a program. Your phone and laptop count, but so do servers in a data center, the router on your shelf and a smart thermostat. A computing system is a group of computing devices and programs working together for a common purpose, like a school's grading system with its servers, teacher laptops and the app parents check.

A computer network is a group of interconnected computing devices that can send or receive data. So a network is one kind of computing system. Your home Wi-Fi and everything on it is a network. The internet is a computer network made of interconnected networks: a network of networks. Your home network connects to your internet provider's network, which connects to other providers, which connect to the network of the company that stores the video.

phonelaptoprouterR1R2R3routerserverserverhome networkinternet routersvideo service networkmany networks, joined= the internetmore than one route between them
Your home network (blue) and a video service's network (green) are joined through routers that belong to other networks. Notice there is more than one route through the middle.
TermWhat it meansExample
Computing deviceA physical thing that can run a programPhone, laptop, server, router, smart thermostat
Computing systemDevices and programs working together for one purposeA school's grading system
Computer networkConnected computing devices that can send and receive dataYour home Wi-Fi and everything on it
The internetA network of networks, joined by open protocolsBillions of devices, millions of networks
PathA sequence of directly connected devices from sender to receiverphone, router, R1, R2, router, server
RoutingFinding a path from sender to receiverEach router picks the next hop for a packet
The vocabulary of Topic 4.1. A network is a kind of computing system, and the internet is a network of networks.
?Wait, what's an abstraction again?
An abstraction hides the details you don't need so you can use something without knowing how it works inside. You used procedures as abstractions in Unit 3. The internet is full of them: you send a message without knowing which cables it crosses, and the app doesn't need to know either.

Two more words. A path between two devices, a sender and a receiver, is a sequence of directly connected devices that begins at the sender and ends at the receiver. Routing is the process of finding a path. In a network drawing, the boxes are devices and the lines are direct connections, so a path is any way to walk along the lines from one box to the other without visiting the same box twice.

Here's the part that surprises people. On the internet, routing is dynamic: the path is not fixed in advance. Each router looks at where the data is going and forwards it to a neighbor that is closer, based on what it knows right now. If a link is busy or broken, the next piece of data can go a different way. We'll come back to that in the next two sections.

?Wait, what's a router?
A router is a computing device whose job is forwarding data between networks. It reads where each piece of data is going and sends it out on the connection that leads closer to that destination. The box your home Wi-Fi comes from is a small router; the internet's backbone uses huge ones.
Pause and think
Look at the network of A to F below. Before counting carefully, guess: is there exactly one way to get from A to F, or more than one? Why would engineers want more than one?
I thought about it. Show me
More than one. A can go up through B or down through C, and B also connects across to E. Engineers want several paths so that if one connection fails, data can still get through another way. That idea is called redundancy, and it is Topic 4.2.
Count the paths
In the network shown, how many different paths are there from A to F? A path cannot visit the same device twice.
ABCDEF
  1. Sort the paths by their first step. A connects only to B and C, so every path starts A-B or A-C.
    Why?
    Being systematic is the whole trick. If you just hunt for paths, you will miss one or count one twice.
  2. Starting A-B: from B you can go to D or E. A-B-D-F works. A-B-E-F works. That is 2.
  3. Starting A-C: C connects only to E (and back to A). From E, go straight to F: A-C-E-F. Or go from E up to B, then D, then F: A-C-E-B-D-F. That is 2 more.
    Why?
    This last one is the path students miss. Nothing says a path has to move left to right. It only has to avoid repeating a device.
  4. Check for repeats: A-C-E-B-E would revisit E, so it does not count. Total: 2 + 2 = 4 paths.

Answer: 4 paths: A-B-D-F, A-B-E-F, A-C-E-F and A-C-E-B-D-F.

Stuck? Get a hint
  1. A has only two connections. Start every path with one of them.
  2. From B there are two ways onward, D and E. From C there is only one, E.
  3. From E you can go to F, or up to B and then D and F. Don't forget that one.
Check yourself
Which statement best describes the internet?
  1. AA single very large computer that stores every website
  2. BA network of interconnected networks that follow common protocols
  3. CThe collection of linked web pages you open in a browser
  4. DOne fixed cable route between every pair of devices
Show the answer

B. The internet is a network of networks, joined by shared rules called protocols. The third choice is the top trap: linked pages are the World Wide Web, which runs on the internet but is not the internet. The fourth is wrong twice: routes are not fixed, and there are usually many.

  • Computing device: a physical thing that runs programs. Computing system: devices and programs working toward one purpose. Network: connected devices that send and receive data.
  • The internet is a network of networks.
  • A path is a sequence of directly connected devices from sender to receiver, with no device repeated. Routing is finding a path.
  • Routing on the internet is dynamic: paths are chosen along the way and can change.