Networks: LANs and WANs
One printer, one set of files and one internet connection can serve a whole office once its computers are linked. A network connects two or more devices so that they can communicate and share data and resources.
Two LANs, one in each city, each wired and owned by the company. The dashed link between the routers is the WAN: lines leased from a telecoms provider.
Why connect devices in a network?
Six benefits. Be able to give two and say what each lets the users do.
- Share files: one up-to-date copy for everyone
- Share hardware: one printer for many computers
- Share software: install it once on a server
- Communicate: email, messages, video calls
- Manage centrally: security, updates, backups
- Log on anywhere: reach your files from any PC
LAN or WAN?
Size is only one difference: a LAN and a WAN are also owned, wired and secured differently. Be able to compare the two on one feature at a time: area, infrastructure, media, speed, security.
| Feature | LAN (local area network) | WAN (wide area network) |
|---|---|---|
| Geographical area | small: one room, building or site | large: towns, cities or countries apart |
| Infrastructure | normally privately owned, dedicated | uses external or leased links; may use shared hardware |
| Transmission media | copper or fibre-optic cables and WiFi | leased lines, telephone network, satellite |
| Typical transfer rate | higher | lower; actual speed depends on the links |
| Security | easier: one organisation controls it all | harder: data crosses other owners’ lines |
1 A college links the computers in its one building with cables it laid itself. LAN or WAN?
2 A bank links its branches in three cities over lines rented from a telecoms company. LAN or WAN? Give the two features that decide it.
3 Give two benefits of connecting the college’s computers in a network.
- 1a LAN: one site, and the college owns the cables
- 2a WAN: the branches are far apart (a large geographical area), and the lines are leased, not owned
- 3any two: share files, share a printer, install software once, communicate, manage security and backups centrally, log on from any PC
Client-server and peer-to-peer
On any network, some computer has to hold the files and answer the requests. A network model sets the role of each computer. In client-server the roles are fixed: one serves, the others ask. In peer-to-peer every computer has the same status.
Follow the numbers in client-server: request, processing, response. In peer-to-peer, find B: it supplies A and asks D at the same time.
Roles of the computers
Learn the server and the client first; a peer is both of them at once.
Server
- Holds the shared files, data and applications.
- Answers each client: does the processing a request needs and returns the result.
- Manages security and backups centrally.
Client
- Asks the server for a service (a request).
- Shows the user whatever the server sends back.
- Uses services but does not provide them.
Peer
- Every peer has equal status: none is in charge.
- Each peer both requests files and supplies them: a client and a server.
- Each peer secures its own files and resources.
Describe the roles in a scenario
For each service, say what the client sends and what the server does before it replies.
| Service | Client → request | Server → response |
|---|---|---|
| Library renewals | member’s phone app sends the loan to renew | holds loan records; checks and updates the loan, then returns the new due date |
| Route-planning website | browser sends the start and end points; draws the returned route | holds map data and route software; calculates and returns the route |
1 In the peer-to-peer figure, B sends a file to A while it asks D for another. What is B’s role for A, and for D?
2 A weather app on a phone shows tomorrow’s forecast. What does the client send, and what does the server do?
3 Four laptops share files with no server, and none is in charge. Which model is this?
- 1a server for A (it supplies the file) and a client of D (it requests one)
- 2the phone sends a request for the place and day; the server holds the forecast data, finds the forecast and returns it for the app to show
- 3peer-to-peer: every peer has equal status
Choosing a network model
Neither model wins everywhere: a school and a group of gamers need different things. To choose, weigh security, backup, consistency, cost and availability against what the situation needs.
Benefits and drawbacks
Compare the two models one feature at a time. Each drawback needs its consequence.
| Client-server | Peer-to-peer | |
|---|---|---|
| Security | managed centrally: access rights, anti-malware | no central security: only as secure as the weakest computer; malware can spread |
| Backup | the server’s data is backed up centrally | no central backup: if a peer loses unbacked-up files, there is no central copy to recover |
| Files and software | one central copy, so data stays consistent | spread across the peers; versions and software may differ |
| Cost and set-up | a server and a specialist to run it | no server to buy: cheap and simple for a few computers |
| Availability | the server is a single point of failure; many requests can congest it | files are available only while their peer is switched on; a peer slows while others use it |
Justify the model for the situation
Choose a model, then give reasons that come from the situation.
| Situation | Model | Linked reasons |
|---|---|---|
| A clinic’s appointment booking system | client-server | central access rights protect bookings; one shared record helps prevent conflicting appointments |
| A school of 900 students | client-server | central backups and access rights; log on anywhere and reach your files |
| Four friends sharing photos at home | peer-to-peer | no server to buy or manage; each friend shares their own files |
| Thousands of players fetching one big game update | peer-to-peer | each player who has a piece passes it on, so no single server carries the whole load |
Two points that catch people out when they choose: what a model does not describe, and that one network can use both.
Do not confuse
- The models describe the roles of the computers, not how they are cabled.
- Either model can run on a star or a bus network.
Mixing models
- A large network can use both.
- One office’s subnetwork can run peer-to-peer while the main services are client-server.
1 Three flatmates share one printer and their holiday photos. Which model, and why?
2 A dental practice stores every patient’s records. Which model, and why?
3 Develop this drawback of peer-to-peer: “no central backup”.
- 1peer-to-peer: no server to buy or manage for so few computers; each shares their own files
- 2client-server: central access rights protect the records, and the server is backed up centrally
- 3each peer must back up its own files, so if one peer’s disk fails, files it had not backed up are lost: there is no central copy to recover
Thin clients and thick clients
A client can do most of the work itself, or leave almost all of it to the server. Thin and thick clients are both client-server. They differ in where the processing, software and data are, not in the size of the computer.
Read each row across and find where Processing and Data storage sit: on the client, or on the server.
Compare the two
Where the processing happens decides what each client needs from the network and the server. Be able to say, for each characteristic, which way round it is for a thin and a thick client.
| Characteristic | Thin client | Thick client |
|---|---|---|
| Processing | minimal: sends input, displays results | does most of its own processing |
| Software and data | on the server; none stored on the client | installed and stored locally |
| Local resources | few: little memory, processing or storage | needs a more powerful device |
| Network and server | heavily reliant: stops if either fails | works on local files; shared data still needs the server |
| Load on the server | high: it does the work for every client | lower: the clients share the work |
| Updates | made once, centrally, on the server | made on every client |
Apply it to the scenario
Give a characteristic, then what it means for the people in the scenario.
| Thin-client characteristic | How it applies: doctors review X-ray scans on tablets |
|---|---|
| Data is not stored on the client | every scan stays on the hospital’s server; none is saved on a tablet |
| Reliant on the network and server | if the hospital link or the server goes down, no doctor can open a scan |
| Few local resources needed | a basic tablet is enough: the server does the heavy image work |
| Minimal processing on the client | the tablet sends each zoom or note; the server works it out and sends back the new view |
1 Which client has the application software installed on it?
2 A college’s server goes down for an hour. Which students can carry on with files saved on their own computers: those on thin clients or on thick clients?
3 Give one reason a library might choose thin clients for its 30 catalogue terminals.
- 1the thick client
- 2those on thick clients: they store and process their own files; a thin client can do nothing without the server
- 3for example: cheap devices with few resources are enough, or software is updated once on the server instead of on 30 terminals
Bus and star topologies
The same computers can be cabled together in more than one shape, and the shape changes what one broken cable does. A topology is the way the devices on a network are connected. It decides how a packet travels from one host to another.
Compare where the frame goes: on the bus it reaches every device, on the star only the device it is for.
Bus or star?
Compare the two feature by feature, then justify one for a situation with linked reasons.
| Bus | Star | |
|---|---|---|
| If a cable fails | a break in the main cable stops the whole network, or the part beyond the break | only the device on that cable is affected; but if the central switch fails, every device loses its connection |
| Collisions and speed | one transmission at a time on the shared cable, so collisions are likely and it slows down with many devices or heavy traffic | each device has its own full-duplex link to the switch: no collisions on those links, so better performance (a star built on a hub still has collisions) |
| Privacy | every transmission reaches every device | a switch sends data only to the intended recipient |
| Cost and growth | least cable and no central device, so cheap; does not scale: every device added shares the one cable | more cable plus a switch; a new device plugs into a free port; faults are easier to find |
A justification picks the rows that matter for the situation and links each one to what it means there.
Why a star suits 16 public library PCs
- 1Each of the 16 PCs has its own link to the switch.
- 2A fault in one PC’s cable cuts off only that PC, because no cable is shared, so other readers keep working.
- 3Each link is full-duplex, so frames do not collide on it and the network stays quick when the library is busy.
1 On the bus in the figure, B sends a frame to E. Which devices does the signal reach, and which one accepts it?
2 On the star, the cable to C breaks. Which devices lose their connection?
3 On the star, the switch fails. How many of the five devices can still send to each other?
- 1it reaches A, C, D, E; only E accepts it, because only E’s address matches
- 2only C: every other device has its own link
- 3none: every frame passes through the central switch
Mesh and hybrid topologies
In a bus or a star, one broken link can cut a device off. A mesh gives more than one route between two hosts, so data can go round a failure. A hybrid joins parts with different topologies.
Compare what each one does with a packet: the mesh routes round the broken B–D link; in the hybrid, each part moves the packet its own way.
Mesh
- Each device links to at least one other, most to more than one: multiple routes.
- Devices act as relays, each handing a packet on; if a link fails, it goes another way.
- Dedicated links, not one main line: fewer collisions.
- Drawback: many links and ports: costly, complex.
Hybrid
- Combines two or more different topologies, e.g. stars on a bus, or a mesh backbone linking stars.
- Each part moves a packet its own way: broadcast on a bus, forwarded by a star’s switch.
- Joins existing networks without rebuilding them.
- Drawback: more complex to design and manage.
For the networks shown: tick each that fits
| Statement | Bus | Star | Mesh |
|---|---|---|---|
| a break in the shared cable cuts off the devices beyond it | ✓ | ||
| each device has its own link to one switch | ✓ | ||
| a packet can reach its destination by two different routes | ✓ | ||
| whichever single cable breaks, everything else on the network still works | ✓ | ✓ | |
| two frames sent at the same moment can collide on the cable | ✓ |
For 1 to 5, say which topologies fit: bus, star or mesh. More than one can fit.
1 A break in the shared cable cuts off the devices beyond it.
2 Each device has its own link to one switch.
3 A packet can reach its destination by two different routes.
4 Whichever single cable breaks, everything else on the network still works.
5 Two frames sent at the same moment can collide on the cable.
6 A full mesh links every device to every other. How many links does a full mesh of 5 devices need?
- 1bus
- 2star
- 3mesh
- 4star and mesh
- 5bus
- 65 × 4 ÷ 2 = 10
Cloud computing
Files, programs and even processing power can live on a computer you never see. Cloud computing is the use of a remote server for a service, for files or for software, usually reached over the internet.
In both kinds the servers are somewhere the user never sees. What differs is who shares them: many customers, or Company A alone.
Public or private?
A hospital and a student backing up photos want very different things from a cloud. Be able to say who owns each kind, who can use it and when to choose it.
| Public cloud | Private cloud | |
|---|---|---|
| Owned and run by | a third-party provider, shared by many customers | the organisation or a third party, for it alone; own servers still need administration |
| Who can use it | anyone who signs up with the right credentials | only the organisation’s selected users |
| Reached over | the public internet | a private internal network or the internet |
| Choose it when | the content is for anyone who wants it, and sharing the provider’s servers with other customers lowers the cost | the organisation wants control of security, privacy and backup, and storage tailored to it |
Benefits and drawbacks depend on who hosts it
Almost every point follows from one fact: someone else runs the servers, for good and for bad.
Provider-managed benefits
- No own servers or expertise to run them.
- Use software without buying outright; staff can change laptops and retain remote files.
- Backups and recovery can be included: check the provider’s arrangements.
- Files open on any device online and are easy to share; add capacity as needed.
Hosted service: drawbacks
- Internet access is needed; an internal private cloud needs its internal network instead.
- Large uploads and downloads can be slow.
- Relies on the provider’s security and backup: remote files could be exposed or lost if these fail.
- Provider downtime stops access.
- Fees continue for as long as the service is used.
1 A photo-sharing service runs on a provider’s servers, and anyone can sign up. Public or private cloud?
2 A bank keeps customer accounts on cloud servers that only its own staff can reach. Which kind is this, and what does the bank gain?
3 A student keeps all their coursework in a public cloud. Give two drawbacks.
- 1public: a third-party service anyone can sign up to
- 2private: only the bank’s users can reach it, so the bank controls security, privacy and backup
- 3any two: no internet, no access; the provider’s downtime stops access; it relies on the provider’s security and backup; large files are slow to upload; fees continue
Wired and wireless networks
A cable ties a device to one spot; radio lets it move, at a price. Devices connect by cable (copper or fibre-optic) or wirelessly by radio waves, e.g. WiFi. The choice changes speed, reliability, security, mobility and cost.
Compare who can pick up the signal: to tap the cable someone must reach it, but the WiFi rings spread through a wall and out of the building.
Differences and their implications
Each difference has a consequence. Give both when you compare.
| Wired | Wireless | |
|---|---|---|
| Speed | higher bandwidth; consistent | usually lower; shared, and falls with distance |
| Reliability | stable: little interference | affected by walls, distance and other devices |
| Security | data must be tapped at the cable | anyone in range can intercept the signal: encrypt it |
| Mobility | devices stay where the cable is | devices move freely within range |
| Setting up | cables must be laid: costly and disruptive | no cabling: quicker, cheaper, easy to add devices |
| Devices | needs a port and a NIC | needs a WNIC; phones often have no port |
Justify the choice
One situation favours a cable; in the other, each kind of link does the job it suits.
Why a cable suits large video uploads
- A student at a library desk uploads big video files to the school server.
- A wired link has higher bandwidth, so each upload finishes sooner.
- A cable gives a steady link that walls, distance and other signals do not weaken.
Why a hospital uses both
- Wired at ward desks: fast, steady access to patient records that never travel by radio.
- Wireless on rounds: nurses carry tablets from bed to bed.
- Older monitors may have only a network port; phones may have only WiFi.
1 A gamer wants the steadiest connection to the router in the next room. Wired or wireless? Give a linked reason.
2 Why is data on a wireless network easier to intercept than data on a cable?
3 A café lets customers’ phones join its network. Wired or wireless? Give two reasons.
- 1wired: a cable is not weakened by walls, distance or other signals, so the link stays steady
- 2radio signals spread out in range of the access point, so anyone in range can receive them; to tap a cable someone must reach the cable
- 3wireless: phones often have no network port, and customers move around; no cables to lay to every table
Transmission media
One message from your phone can travel as radio waves, then as electricity in copper, then as light in glass. Copper carries electrical signals, fibre pulses of light, wireless media electromagnetic waves.
Copper carries electrical signals, fibre pulses of light, wireless media electromagnetic waves.
For each medium, find what carries the bits and how the signal travels from one end to the other.
Characteristics of each medium
Every medium trades something away. For each one, be able to say how it carries data, one strength and one limitation.
| Medium | How it carries data · strengths | Limitations |
|---|---|---|
| Copper cable | electrical signals along copper wires; cheap, flexible, easy to install | lower bandwidth; interference; repeaters needed sooner |
| Fibre-optic cable | pulses of light in glass fibres; higher bandwidth; the signal weakens less, so fewer repeaters; no electrical interference; hard to tap | more expensive; more easily damaged; specialist installation |
| Radio waves (incl. WiFi) | electromagnetic waves sent in all directions; pass through walls; used by WiFi | lower bandwidth; interference; anyone in range can receive it |
| Microwaves | electromagnetic waves in a narrow beam between dishes; higher bandwidth than radio | need line of sight; affected by rain; relay towers over long distances |
| Satellites | microwaves from a ground station to a satellite and back down; reach remote areas | high latency; needs a dish and extra equipment; weather weakens it |
Bandwidth and latency are easy to mix up: a satellite link has plenty of one and suffers from the other.
Worked example: why a satellite link lags
Over 2 000 km of glass fibre, where light travels at about 200 000 km/s: 2 000 ÷ 200 000 = 0.01 s.
Do not confuse
- Bandwidth: how much data a link can carry each second.
- Latency: the delay before data arrives. A satellite link can have high bandwidth and still lag, because the signal travels so far.
- Repeaters regenerate an attenuated (weakened) signal.
- The example uses an idealised path: real slant paths are longer, and processing and queuing are left out.
Do not confuse
Bandwidth is how much data a link can carry each second. Latency is the delay before data arrives. A satellite link can have high bandwidth and still lag, because the signal travels so far.
Repeaters regenerate an attenuated (weakened) signal.
Idealised two-altitude path: real slant paths are longer, and processing and queuing are excluded.
1 Which medium carries data as pulses of light?
2 A satellite orbits 36 000 km up. Signals travel at about 300 000 km/s. How long does one message take to go up and come down again?
3 Why do microwave dishes need line of sight, when WiFi radio waves pass through walls?
- 1fibre-optic cable
- 22 × 36 000 = 72 000 km; 72 000 ÷ 300 000 = 0.24 s
- 3microwaves are sent in a narrow beam from one dish to the next; radio waves spread in all directions
LAN hardware
A LAN needs devices that pass the data along, each with its own job. A switch joins the devices on one site, a router joins the LAN to other networks, and a WAP lets wireless devices join.
The switch sits at the centre. Find each device on its line out from the switch, then look up its job.
The job of each device
In a diagram these boxes can look alike, but each one moves data in its own way. Be able to name each device in the figure and say what it does.
| Device | What it does |
|---|---|
| Switch | the central device: stores the MAC addresses of connected devices and forwards each packet only to its intended recipient |
| Server | provides services to other devices: shared files, applications, printing, backups |
| NIC (network interface card) | connects a device to a wired network; its MAC address identifies the device |
| WNIC (wireless NIC) | joins a device to a wireless network, turning data into radio waves and back; its MAC address identifies the device there |
| WAP (wireless access point) | lets wireless devices join the wired LAN by radio |
| Cables | carry the data between devices: twisted-pair copper or fibre-optic |
| Bridge | links two LAN segments that use the same protocol |
| Repeater | regenerates a weakened signal so it can travel further |
Two slips to avoid: lines drawn between devices in a star, and devices with similar jobs mixed up.
Drawing a star topology
- Draw one line from each device to the switch, and none between devices.
- Name each device you draw.
Do not confuse
- “Data between two networks”: router.
- “Connects two LANs or segments”: bridge.
- A hub sends to every device; a switch only to the recipient.
1 Which device lets a laptop join the wired LAN by radio?
2 Which device regenerates a weakened signal on a long cable?
3 Which device links two LAN segments that use the same protocol?
4 Which device forwards each packet only to the device it is for, using MAC addresses?
- 1a WAP (wireless access point)
- 2a repeater
- 3a bridge
- 4a switch
The router
A packet leaving a LAN may cross many networks, and at every junction something must choose the way on. A router connects networks and sends each packet on using its destination IP address.
Follow the packet from the home LAN to the web server, and see how R1 uses its routing table to choose the next router.
Moving packets between networks
- Takes in packets from the LAN and from the internet.
- Looks at where each is going: its destination IP address.
- Finds that network in its routing table, which names the next hop.
- Sends the packet on along the best route: to the next router or into the LAN.
- Revises the table as routes change.
Extra jobs of a home or office router
- Holds the LAN’s public IP address, supplied by the ISP, and is its gateway.
- Allocates private IP addresses to devices.
- Keeps a table of IP and MAC addresses.
- Translates private/public addresses (NAT); may adapt packet format for the next network.
- Acts as a firewall; may include a WAP and modem.
Router or not?
| Task | Router | Not the router |
|---|---|---|
| chooses the next hop for a packet from a table | ✓ | |
| turns a domain name into an IP address | ✓ a DNS server does this | |
| regenerates a weak signal on a long cable | ✓ a repeater does this | |
| hands out private addresses to devices that join | ✓ |
1 Use R1’s routing table. A packet arrives for 198.51.100.77. Where does R1 send it?
2 A packet arrives for 192.0.2.5. Where does R1 send it, and why?
3 Router or not? Choosing the next hop for a packet from a table.
4 Router or not? Turning a domain name into an IP address.
5 Router or not? Regenerating a weak signal on a long cable.
6 Router or not? Handing out private addresses to devices that join.
- 1R2: 198.51.100.77 is in the network 198.51.100.0 to .255
- 2R3: it matches no listed network, so it takes the “any other address” row
- 3router
- 4not the router: a DNS server does this
- 5not the router: a repeater does this
- 6router
Ethernet
Devices that share a cable must agree how to take turns, or their signals crash into each other. Ethernet is the rule set (protocol) that most wired LANs follow. It packs data into frames, and on a shared cable it handles collisions with CSMA/CD.
The parts of an Ethernet frame
How a collision happens on a shared cable
Follow the numbers in order. Time runs down the page; each sloping line is a signal crossing the cable.
A switch takes away the shared cable, and with it the collisions. Compare the two kinds of Ethernet, then follow one file across a shared cable.
| Shared Ethernet (bus, or a hub) | Switched Ethernet (star with a switch) |
|---|---|
| all devices share one transmission medium | each device has its own full-duplex link to the switch |
| every frame reaches every device; only one can send at a time | the switch holds each frame briefly and passes it only to its addressee |
| two devices can start at once: collisions, so CSMA/CD is needed | frames cannot meet on a device’s own link, so CSMA/CD is not needed (a star built on a hub still has collisions) |
Sending a file from A to D on a shared cable
- The file goes out in frames; each carries D’s and A’s MAC addresses.
- A listens first and starts only when the cable is quiet (CSMA/CD).
- The frame spreads along the bus to every device; only D, whose address matches, keeps it.
- If A’s frame meets another, A waits a random time and sends it again.
1 Name the four parts of an Ethernet frame.
2 In the collision figure a signal takes 100 time units to cross the cable. If D had started sending at time 50 instead of 30, at what time would the two signals meet?
3 Why does a star built on a switch not need CSMA/CD?
- 1destination MAC address, source MAC address, data, error-checking data
- 275: A’s signal has travelled for 75 units and D’s for 25; 75 + 25 = 100, one whole crossing, so the two fronts meet
- 3each device has its own full-duplex link to the switch, so two frames never meet on one cable
CSMA/CD
On a shared cable, collisions cannot be prevented completely, so Ethernet needs a plan for them. Carrier Sense Multiple Access with Collision Detection (CSMA/CD) is the protocol it uses: it cuts down collisions, detects the ones that still happen, and recovers from them.
Start at Frame ready and follow the arrows. The amber boxes are what happens after a collision; after the wait, the device listens again.
What the name means
Each part of the name is one thing the device does. Be able to say all three.
Carrier sense
A device listens to the channel and sends only when no other data is being transmitted.
Multiple access
Many devices share one cable, so two of them can begin sending at the same moment.
Collision detection
While sending, the device keeps listening; if the signals overlap it detects the collision.
What each step is for
| Step | Why |
|---|---|
| Listen before sending | avoids interrupting a transmission already on the cable |
| Keep listening while sending | two devices can both sense an idle cable and start together |
| Send a jamming signal | warns every device that a collision has happened |
| Wait a random time | the two devices are unlikely to choose the same wait, so they do not collide again |
| Wait longer after each repeat | spreads out the retries when the network is busy |
Drawbacks of CSMA/CD
- Not scalable: more devices mean more collisions and longer waits.
- The wait grows after each repeated collision, so a frame can be held up for a long time on a busy cable.
- No priority: an urgent frame waits like any other.
1 Put these in order after a collision is detected: wait a random time; send a jamming signal; listen again; stop sending; resend the frame.
2 Why is the wait random and not the same for every device?
3 Two devices both sense an idle cable and start sending together. Which part of CSMA/CD deals with this?
- 1stop sending; send a jamming signal; wait a random time; listen again; resend the frame
- 2with equal waits the same two devices would start together again and collide again
- 3collision detection: each keeps listening while it sends, so both detect the collision
Bit streaming
Nobody wants to wait for a whole film to download. Bit streaming sends bits as a continuous, ordered stream along a communication path, so playback starts before the whole file has arrived.
Two sources feed one media server. Follow the bits through the internet into the buffer on the user’s device; the line back to the server carries the control data.
Real-time or on-demand?
The difference is when the content is made, and that decides what a viewer can do with it.
| Real-time (live) | On-demand | |
|---|---|---|
| Content | sent as it is produced, direct from the source | pre-recorded, stored on a media server and sent when the user chooses |
| Control | watched as it happens; cannot be re-watched later unless recorded | can be paused, rewound, re-watched or skipped |
| Delay | must stay small, so viewers see each goal as it is scored | a short wait while the buffer fills is acceptable |
| Examples | a live sports match, a radio phone-in | films, music and lessons from a streaming service |
How real-time bit streaming works
Four stages, in order. Be able to give the whole chain and say why the buffer is there.
1 A school concert is watched online as it happens. Real-time or on-demand?
2 Which can a viewer pause and rewind: a real-time stream or an on-demand one?
3 Why does the device put the bits in a buffer before playing them?
- 1real-time: sent as it is produced
- 2on-demand: it is pre-recorded and stored on the media server
- 3bits arrive at an uneven rate but must be played at a steady one; the buffer holds a short store so playback does not stop each time the arrival rate drops
Bit rate, broadband speed and buffering
When a video freezes, data is arriving too slowly. The bit rate of a stream is the number of bits that must be played each second; the broadband speed must keep up, or the buffer runs out.
A 4 Mbit/s stream when the connection slows down
Read the two charts on one time line: the top shows how fast data arrives against the bit rate, the bottom shows the buffer filling and draining.
Why bit rate and broadband speed matter
Compare the broadband speed with the bit rate to say what the buffer does.
| When… | What happens |
|---|---|
| broadband speed ≥ bit rate | data arrives at least as fast as it is played: the buffer stays full enough and playback is smooth |
| broadband speed < bit rate | the buffer drains; when it is empty, playback pauses while it refills |
| the bit rate is higher | can support better quality at comparable encoding settings (more pixels, frames or samples per second), but a faster connection is needed |
| stronger lossy compression | a lower bit rate is needed, so people with less bandwidth can still watch, at lower quality |
The data a stream uses grows with its bit rate and the time watched; the buffer is what lets the download and the player run at different speeds.
Worked example: data used
What a buffer is for
- A buffer is a temporary store between a part that sends data and a part that uses it.
- Each part can then run at its own speed: here, the download and the player.
- A print queue works the same way.
1 Read the chart. At what time does the buffer first run empty and playback pause?
2 A 4 Mbit/s stream is watched on a 6 Mbit/s connection. Does the buffer fill or drain, and by how much each second?
3 A 5 Mbit/s stream is played for 30 minutes. How much data is that, in GB?
- 1at about 31.6 s: from 20 s only 2 Mbit arrives each second but 4 is played, so the buffer drains
- 2it fills: 6 − 4 = 2 Mbit more each second
- 35 000 000 × 1800 = 9 000 000 000 bits; ÷ 8 = 1 125 000 000 bytes = 1.125 GB
The internet, the WWW and their hardware
Email works without a single web page. The internet is the network hardware and connections; the World Wide Web is the web pages stored on web servers and reached over the internet.
Two ways in: a home router and modem over a phone line, through the exchange and the ISP, or a phone through a cell tower. The leased line joins two offices privately.
The internet and the WWW are not the same
A library’s online catalogue uses both: the internet carries the data; the catalogue pages are a website.
| The internet | The World Wide Web (WWW) |
|---|---|
| a global network of networks: the infrastructure | a collection of web pages, linked by hyperlinks |
| cables, routers and servers; uses TCP/IP | stored on web servers; reached by URL over HTTP(S) |
| carries email, video calls, file transfer and the WWW | one service that runs on the internet |
Hardware that supports the internet
Data cannot reach the internet without equipment to carry it, from a phone line to a cell tower. Be able to say how each one helps data reach the internet.
| Hardware | How it supports the internet |
|---|---|
| Modem | turns a computer’s digital data into an analogue signal a phone line can carry, and the modem at the far end turns it back |
| PSTN | the public switched telephone network: the public phone system, carrying data between switching centres in both directions simultaneously (duplex); some lines need analogue conversion |
| Dedicated line | a private link leased between two sites: capacity is not shared with other customers; the contract specifies the service speed |
| Cell phone network | an area is divided into cells, each served by one tower; the tower exchanges radio signals with multiple devices simultaneously, using low-power transmitters |
1 Internet, WWW or both? Sending a message in a chat app.
2 Internet, WWW or both? Reading a news website in a browser.
3 What does a modem do, in both directions?
4 A company joins two offices with a dedicated line. Give one reason.
- 1the internet only: no web pages are fetched
- 2both: the pages are on the WWW, carried over the internet
- 3it turns digital data into an analogue signal for the phone line, and turns the analogue signal back into digital data
- 4for example: the line is private, so its capacity is not shared with other customers, and the speed is set in the contract
IP addresses: IPv4 and IPv6
A letter needs an address before it can be delivered, and so does a packet. An IP address identifies a device’s network connection so that packets can be routed to it. Two versions are in use: IPv4 and the much longer IPv6.
Count the bits under each group: IPv6 has twice as many groups as IPv4, and each is twice as wide.
IPv4 | IPv6 | |
|---|---|---|
| Size | 32 bits | 128 bits |
| Groups | 4 groups of 8 bits | 8 groups of 16 bits |
| Written in | denary, full stops | hexadecimal, colons |
| Range | 0 to 255 each | 0000 to FFFF each |
| Addresses | 2³² ≈ 4.3 billion: running out | 2¹²⁸ ≈ 3.4 × 10³⁸ |
Shortening an IPv6 address
Use :: only once, or nobody can tell how many groups each one replaces.
Valid or invalid?
Check the separators, the number of groups and the range of each group.
| Address | Type | Reason |
|---|---|---|
| 300.1.1.7 | invalid | not IPv4: 300 is over 255. Not IPv6: full stops, and only 4 groups |
| 10.2.2.9 | IPv4 | 4 denary groups, each 0 to 255: 32 bits. Not IPv6: no colons, not 8 groups |
| 2001:db8::c4:a1f:42 | IPv6 | shortened: :: stands for the three groups of zeros |
| 2001:db8::4::1 | invalid | :: used twice, so the missing zero groups cannot be counted |
1 Is 172.16.300.1 a valid IPv4 address? Give the reason.
2 Write 2001:0db8:0000:0000:0000:0000:0000:0001 in its shortest form.
3 How many groups does an IPv6 address have, and how many bits are in each?
- 1no: 300 is over 255, the largest value one group can hold
- 22001:db8::1: drop the leading zeros, then replace the one run of zero groups with ::
- 38 groups of 16 bits: 128 bits
Subnetting
A school’s network is easier to manage in parts: one for the offices, one for the science labs. Subnetting divides one network into smaller networks (subnets). An IP address then has two parts: the network ID, shared by every device in the subnet, and the host ID, which picks out one device in it.
Use the subnet mask: IP address AND mask = network address
Where a group of the mask is 255, copy that group into the network ID. Where it is 0, that group belongs to the host ID.
| IP address | Subnet mask | Network ID | Host ID |
|---|---|---|---|
| 10.4.7.9 | 255.0.0.0 | 10 | 4.7.9 |
| 192.168.20.77 | 255.255.255.0 | 192.168.20 | 77 |
Extension: a mask can also split a group of 8 bits, as below.
Four subnets of 64 addresses (62 for devices: the first and last are reserved)
The extension’s mask, 255.255.255.192, leaves 6 host bits, so the last group splits into four blocks of 64: one subnet for each department.
Why subnet a network?
Each benefit needs its reason.
| Benefit | Because… |
|---|---|
| Reduces traffic and congestion | packets between hosts in one subnet never enter the other subnets |
| Improves security | access controls between routed subnets can restrict a break-in’s reach |
| Easier maintenance | one subnet can be repaired or changed while the others carry on |
| Easier to expand | a new department gets a subnet of its own; the others keep their addresses |
1 An IP address is 192.168.5.200 with subnet mask 255.255.255.0. Give the network ID and the host ID.
2 An IP address is 10.1.1.70 with mask 255.255.255.192. AND the last group with the mask: what is the network address, and what is the host ID?
3 In the four-subnet figure, which subnet does 172.16.45.150 belong to?
- 1network ID 192.168.5, host ID 200
- 270 = 01000110 and 192 = 11000000; AND gives 01000000 = 64, so the network address is 10.1.1.64; the host bits 000110 = 6
- 3the Library subnet: .128 to .191
Public, private, static and dynamic IP addresses
Not every device faces the internet or keeps its address. An address is public (seen on the internet) or private (seen only inside its LAN) and, separately, static (does not change) or dynamic (can change).
Follow the request from the laptop: the router swaps its private source address for the public one, keeps the mapping, and swaps it back on the reply.
Public or private, static or dynamic
Each address is public or private, and also static or dynamic. Be able to place a device in one cell and say why.
| Static: does not change | Dynamic: can change | |
|---|---|---|
| Public: visible on the internet, unique worldwide | web server, email server: always found at the same address | a home router’s address, given by the ISP and changed from time to time |
| Private: used only inside the LAN | a printer or file server the LAN must always find | a phone or laptop given an address by the router each time it joins |
How an IP address is linked to a device
- 1The address belongs to the device’s network connection (its NIC or WNIC).
- 2When the device joins the LAN, the router allocates it a private address (dynamic), or the address is set by hand (static).
- 3The router keeps a table of each device’s IP and MAC addresses, so packets for that IP address reach that device.
How an IP address is linked to a device
The address belongs to the device’s network connection (its NIC or WNIC). When the device joins the LAN, the router allocates it a private address (dynamic) or the address is set by hand (static). The router keeps a table of each device’s IP and MAC addresses, so packets for that IP address reach that device.
Whether an address is public or private also decides who can reach the device.
Security: private addresses
- Not reachable directly from the internet: devices are hidden behind the router.
- NAT maps replies back to private devices. A firewall separately controls which traffic is allowed.
- Not a guarantee: malware or a user inside the LAN can still attack.
Security: public addresses
- Visible to every device on the internet, so they can be found and attacked.
- Protect them with a firewall.
1 Is 192.168.4.20 a public or a private address?
2 Is 203.0.113.8 public or private?
3 A school’s printer must always be found at the same address inside its LAN. Which two types of address should it have?
4 What does NAT do to a request that leaves the LAN?
- 1private: it is in the 192.168.x.x range used only inside LANs
- 2public: it is in none of the private ranges
- 3static and private: fixed, and used only inside the LAN
- 4it replaces the device’s private source address with the router’s public address, and keeps the mapping so the reply can be sent back to the right device
URLs and the DNS
You type a name such as www.example.org, but routers move packets by number. A URL (Uniform Resource Locator) is the text address people use for a resource on the WWW; the DNS (Domain Name System) finds the IP address that matches its domain name.
A URL (Uniform Resource Locator) is the text address people use for a resource on the WWW. Routers need numbers, so the DNS (Domain Name System) finds the IP address that matches its domain name.
Finding www.example.org
No single server knows every name, so the resolver asks in levels. Follow the numbers down the page, from the browser’s question to the web page.
The DNS in one idea
- People remember domain names; packets are routed by IP address.
- A DNS server returns the matching IP address (steps 1 and 5).
Extra detail
- Name servers hold parts of the domain-to-IP list in levels.
- The resolver follows referrals from root to domain servers (steps 2 to 4), then caches the answer.
From URL to web page
Four stages, in order. Be able to say what the DNS does and what happens after it.
1 In https://shop.example.net/bags/red.html, name the protocol, the domain name, the path and the file name.
2 What does a DNS server send back to the browser?
3 After the lookup, where does the browser send its request for the page?
- 1protocol https, domain name shop.example.net, path /bags/, file name red.html
- 2the IP address that matches the domain name, not the web page
- 3to the web server at that IP address