4.1 Devices, Systems & Networks
Key Definitions
Computing device: physical artifact that can run a program, e.g. laptop, phone, server, router, smart sensor.
Computing system: group of devices + programs working together for a common purpose, e.g. a school grade system = servers + laptops + gradebook app.
Computer network: interconnected devices that can send or receive data. A network is a type of computing system.
Paths & Routing
Path: sequence of directly connected devices that starts at the sender + ends at the receiver; each link crossed = 1 hop.
Routing: finding a path from sender → receiver. On the internet it's dynamic: not set in advance; routers pick each next hop from current traffic + failures.
Shortest ≠ used: a longer path may carry data if the short one is busy or down; routing adapts packet by packet.
| Term | Means | Measured in |
|---|---|---|
| Bandwidth | max data per time | bits/sec (bps) |
| Bit rate | data sent per sec | Mbps, Gbps |
| Latency | delay to arrive | milliseconds |
| Path length | # of hops | links crossed |
| Packet loss | data that's lost | % of packets |
Bandwidth Math
Bandwidth: max data sent in a fixed time, in bits per second. 1 Mbps = 106 bits/s; 1 byte = 8 bits; 1 MB = 8 Mb.
Calc e.g.: 40 MB file at 8 Mbps → 40 × 8 = 320 Mb ÷ 8 Mbps = 40 s. Always convert bytes → bits first (× 8). Double the bandwidth → half the transfer time, all else equal.
4.1 The Internet & Protocols
What the Internet Is
Internet: network of interconnected networks that use standardized, open (nonproprietary) protocols.
Access: a device joins by connecting to an internet-connected device (Wi-Fi router, cell tower, ISP modem); from there it can reach any other connected device.
Protocol: agreed-upon set of rules that specify how a system behaves (message format, order, errors).
Open protocols → anyone can build compatible devices + software → easy to add new devices; no 1 company controls the rules, so the network keeps growing.
Key Protocols
| Protocol | Does | Used for |
|---|---|---|
| IP | address + route | every packet |
| TCP | ordered, resends | web, email, files |
| UDP | fast, no resend | video, games |
| HTTP | requests pages | the WWW |
| HTTPS | encrypted HTTP | secure sites |
IP: gives each device an IP address + moves packets toward it. Every packet on the internet uses IP.
TCP: numbers packets; receiver confirms; missing ones are resent, then all reassembled in order. Slower but complete.
UDP: sends w/o checks → less delay; a few lost packets are OK (live audio, video calls, online games).
Layers: HTTP runs on TCP, TCP runs on IP → each protocol does 1 job + can change w/o breaking the others.
IETF (Internet Engineering Task Force): develops + maintains open standards; anyone can join the process.
4.1 Packets & Data Streams
Packet Switching
Data stream: info sent over the internet, split into chunks; each chunk is wrapped in a packet before it's sent.
Packet = chunk of data + metadata (source, destination, sequence #) used to route it + reassemble.
Arrival: packets may arrive in order, out of order, or not at all, b/c each one can take a different path.
Reassembly: receiver uses sequence #s in the metadata to rebuild the message (TCP asks for lost ones).
Why Packets?
| Benefit | Why |
|---|---|
| Shared links | many users interleave |
| Route around failure | each packet rerouted |
| Cheap recovery | resend only lost packet |
| Scales | no dedicated line needed |
Trace e.g.
Msg "HELLO" sent as 3 packets (1: HE, 2: LL, 3: O). They arrive 3, 1, 2 → receiver sorts by # → HELLO.
Split paths: packets 1 + 3 go via router X, packet 2 via router Y; if Y is busy, 2 shows up last, but TCP still rebuilds the right order before the app ever sees the message.
Why packets get lost: an overloaded router drops them, a link fails mid-trip, or data arrives corrupted + is thrown out.
Packet 2 lost: w/ TCP, receiver spots the gap + asks for a resend; w/ UDP, gap stays (a glitch in the video).
Data vs. metadata: data = the content (photo, text); metadata = info about it (addresses, order #, size).
4.1 The Web & Scalability
Internet vs. World Wide Web
| Internet | WWW | |
|---|---|---|
| What | network of nets | linked pages/files |
| Protocols | IP, TCP, UDP | HTTP |
| Role | infrastructure | service on top |
| Uses | email, VoIP, web | sites, links |
| Began | 1960s–80s | 1990s |
World Wide Web: system of linked pages, programs + files. Uses HTTP to request + send pages; runs on the internet.
Page load e.g.: browser sends an HTTP request → server sends the page back as packets over TCP/IP → browser reassembles + displays it; each image may be its own request, sent + received at the same time.
Not the web: email apps, streaming, online games + file transfer use the internet but not necessarily the WWW.
Scalability
Scalability: capacity of a system to change in size + scale to meet new demands. The internet was built to scale.
What makes it scale: open protocols, packet switching, dynamic routing, redundant paths, no central control point.
Growth e.g.: billions of devices joined since the 1990s w/o a redesign, b/c any device that follows the protocols can connect + talk to every other device on the network.
Routers & ISPs
Router: device that forwards packets toward their destination, picking the next hop from current conditions.
ISP (Internet Service Provider): links homes + schools to the internet; ISPs connect to each other → network of networks.
4.2 Fault Tolerance & Redundancy
Core Ideas
Redundancy: extra components that can take over if others fail. In networks: more than 1 path between any 2 devices.
Fault tolerant: system keeps working when parts fail. On the internet, data reroutes around a failed device or link, if another path exists; users may never notice.
Why it matters: devices + links on the internet will fail (power loss, cut cable, overload, natural disaster, attack).
Trade-off: redundancy costs extra resources (hardware, cables, money) but ↑ reliability of the system.
| Term | Meaning |
|---|---|
| Redundancy | extra parts/paths (cause) |
| Fault tolerance | keeps working (result) |
| Rerouting | data takes another path |
| Reliability | how often it works |
| Single pt. of failure | 1 loss → others cut off |
Redundancy Helps Scaling
Scale: more routing options → traffic spreads out + more devices and people can join w/o bottlenecks.
Single point of failure: a device or link whose loss disconnects others. Fault-tolerant designs remove these.
Reroute e.g.: cable from Chicago to Denver is cut → routers send packets via Dallas; users notice, at most, a short delay.
Beyond Networks
Examples: backup servers + data centers, mirrored drives, cloud copies of files, 2 power supplies in 1 server, backup generators, offsite copies of key data.
4.2 Network Diagram Problems
Method
Step 1: list every path between the 2 devices asked about; no device can appear twice within 1 path.
Step 2: test each choice: remove that device or link, then check if any path still connects the pair.
Min failures to cut = fewest links (or devices) whose removal breaks every path between the 2 devices.
Worked e.g.
Network: A–B, A–C, B–D, C–D, D–E. Paths A→D: A-B-D + A-C-D (2) → A, D survive any 1 link failure.
But E: its only link is D–E → if D–E or device D fails, E is cut off. D is a single point of failure for device E.
| Fails | A↔D? | D↔E? |
|---|---|---|
| A–B | yes (via C) | yes |
| C–D | yes (via B) | yes |
| A–B + C–D | no | yes |
| D–E | yes | no |
| device D | no | no |
Min to cut A↔D = 2 links (A–B + C–D, or A–C + B–D). Min to cut E = 1 link (D–E), so E is the most fragile device.
Common Q Types
Q types: "which removal disconnects X + Y?", "min # of links that must fail", "which new link ↑ fault tolerance most?"
Adding a link: best choice gives a 2nd path to a device that now has only 1 connection (removes a weak spot).
Device vs. link: losing device C removes A–C + C–D at once → 1 device loss can cut more than any 1 link loss.
4.3 Sequential, Parallel & Distributed
3 Computing Models
| Model | How | Time |
|---|---|---|
| Sequential | 1 op at a time | sum of all steps |
| Parallel | some at once | seq + max(par) |
| Distributed | many devices | huge problems |
Sequential: operations run in order, 1 at a time, on 1 processor. Total time = the sum of every step's time.
Parallel: program broken into smaller sequential ops, some run at the same time (multiple cores or processors).
Distributed: multiple devices (often over a network) run 1 program, e.g. search engines, cloud servers, SETI@home.
Timing Rules
Parallel time = sequential portion + the longest of the parallel tasks (the slowest processor sets the pace).
Worked e.g.: tasks 30, 50, 20, 40 s on 2 processors, all independent. Sequential time = 30 + 50 + 20 + 40 = 140 s.
Best split: {50, 20} + {40, 30} → 70 s each → parallel time = 70 s. A split of {50, 40} + {30, 20} = 90 s.
4 processors: 1 task each → time = 50 s, the longest single task. No # of processors can beat the longest task.
W/ sequential steps: 10 s setup → {50, 20} + {40, 30} → 5 s merge = 10 + 70 + 5 = 85 s total, vs. 155 s done fully sequentially (speedup = 155 ÷ 85 ≈ 1.8).
Uneven tasks: 60, 10, 10, 10 s on 2 processors → {60} + {10, 10, 10} → 60 s. The 60 s task sets the floor; adding more processors can't cut the time below it.
Assigning tasks: balance loads; put the longest tasks on different processors 1st, then fill the gaps.
4.3 Speedup, Limits & Exam Moves
Speedup
Speedup = sequential time ÷ parallel time. e.g. 140 s ÷ 70 s = speedup of 2. It's a ratio, so it has no units.
Dependencies: if task B needs A's output, B waits for A → they can't run in parallel; adds to sequential time.
Limit: efficiency is capped by the sequential portion. At some point, more processors stop helping much.
| Processors | Time | Speedup |
|---|---|---|
| 1 | 90 s | 1 |
| 2 | 50 s | 1.8 |
| 4 | 30 s | 3 |
| 8 | 20 s | 4.5 |
| ∞ | → 10 s | → 9 max |
Table setup: 10 s sequential + 80 s of evenly splittable work. Time = 10 + 80 ÷ n; speedup never passes 9.
Diminishing returns: going 1 → 2 processors saves 40 s, but 4 → 8 saves only 10 s (see the table above).
Why Distributed?
Distributed: solves problems too big for 1 computer (processing time or storage) + solves large ones faster.
Scaling: parallel solutions scale better than sequential ones: add more processors as the data grows.
Distributed e.g.: climate models + protein folding split data across 1000s of cloud or volunteer computers.
Exam Moves
MCQ: ~8–10 of 70 Qs. Expect a network diagram Q, a timing/speedup calc + definition-match Qs.