impera Open Impera

AP Computer Science Principles · Computer systems and networks

The internet

1Networks and the internet

  • A computing device is a physical machine that can run a program (computer, phone, router, smart sensor).
  • A computer network is a group of interconnected devices that can send and receive data.
  • A path is the sequence of directly connected devices that data passes through from sender to receiver.
  • Bandwidth is the maximum amount of data that can be sent in a fixed time, usually measured in bits per second.

The internet is a network of networks, connecting billions of devices worldwide. It is built on open protocols so that any device following them can join.

Check yourself

Bandwidth measures:

  • The maximum data that can be sent per second

  • The physical length of a cable

  • The number of devices on a network

  • The time to type a message

Show the answer

The maximum data that can be sent per second

Bits per second.

2Protocols

A protocol is an agreed set of rules for how data is sent and received. Key internet protocols:

  • IP (Internet Protocol): gives every device an IP address and routes packets toward their destination.
  • TCP (Transmission Control Protocol): splits data into packets, numbers them, checks they all arrive and requests missing ones again, then reassembles them in order. Reliable.
  • UDP (User Datagram Protocol): sends packets without checking that they arrive. Faster but less reliable; used for live video calls and games, where speed matters more than every packet.
  • HTTP/HTTPS: rules for requesting and sending web pages. HTTPS adds encryption.
  • DNS (Domain Name System): translates domain names (like example.com) into IP addresses.

Because the protocols are open (publicly available, not owned by one company), anyone can build compatible devices and software, which helped the internet grow.

Check yourself

Which protocol resends missing packets and puts them in order?

  • TCP

  • UDP

  • DNS

  • HTTP

Show the answer

TCP

Reliable delivery.

3Packets and routing

Data sent over the internet is split into small packets. Each packet contains part of the data plus metadata: source and destination addresses, and a sequence number.

  • Packets may take different paths and arrive out of order; TCP reassembles them.
  • Routers forward each packet toward its destination, choosing paths dynamically.
  • Routing is the process of finding a path from sender to receiver.

This packet switching design is efficient (links are shared) and robust (if one path fails, packets use another).

Packet switching: routers forward each packet along any available path

Check yourself

Why can packets of the same message arrive out of order?

  • Routers sort them into reverse order before forwarding them

  • They are sent in random order on purpose to confuse attackers

  • They can travel along different paths through the network

  • Each packet contains the whole message, so order does not matter

Show the answer

They can travel along different paths through the network

Different routes.

4The World Wide Web and scalability

The World Wide Web is a system of linked pages, programs and files that is accessed using the internet (with HTTP). The web is one service running on the internet; email and online games are others.

Scalability is the ability of a system to keep working well as it grows. The internet was designed to scale: its hierarchical addressing, open protocols and many independent networks let it grow from a few computers to billions of devices. IPv6 addresses replaced many uses of IPv4 because IPv4 (32-bit, about 4.3 billion addresses) was running out; IPv6 uses 128 bits.

Check yourself

Which statement about the internet and the World Wide Web is correct?

  • The web existed before the internet

  • The web is a service that uses the internet

  • They are exactly the same thing

  • The internet is part of the web

Show the answer

The web is a service that uses the internet

Internet = network; web = service.

5Going deeper: packets, protocols and how a web page reaches you

Definitions

  • A computing device can run a program: a computer, phone, tablet, router, smart sensor.
  • A computer network is a group of connected devices that can send and receive data.
  • The Internet is a network of interconnected networks, using open, standardized protocols.
  • A path is the sequence of directly connected devices between sender and receiver; routing is the process of finding one.
  • Bandwidth: the maximum amount of data that can be sent in a fixed time, in bits per second.

Protocols are agreed sets of rules for how data are formatted, sent and received. Because the Internet's protocols are open (published, not owned by one company), any manufacturer's device can join. That openness is why the Internet could grow so far, so fast.

Packets: data are not sent as one continuous stream.

  1. A message is split into packets.
  2. Each packet carries a chunk of the data plus metadata (a header): the sender's and receiver's addresses and a sequence number.
  3. Packets travel independently, and may take different paths.
  4. They may arrive out of order, or not at all.
  5. The receiver reassembles them using the sequence numbers.

IP (Internet Protocol): handles addressing and routing. Every device on the Internet has an IP address.

  • IPv4 addresses are 32 bits: about 4.3 billion addresses, no longer enough.
  • IPv6 addresses are 128 bits: about 3.4 × 10³⁸ addresses.

Routers forward each packet toward its destination; routing is dynamic, not fixed in advance.

TCP (Transmission Control Protocol): provides reliability on top of IP.

  • Numbers the packets.
  • The receiver acknowledges what arrives.
  • Lost packets are re-sent; packets are put back in order.
  • Used when accuracy matters: web pages, email, file transfers.

UDP (User Datagram Protocol): no acknowledgements or re-sending. Faster, with less overhead, but packets may be lost. Used where speed matters more than perfection: live video, voice calls, online games.

DNS (Domain Name System): the Internet's directory. It translates a human-readable domain name (example.org) into an IP address. It is hierarchical and distributed among many servers.

The World Wide Web is not the Internet.

  • The Internet is the physical network and its protocols.
  • The Web is a system of linked pages and files that uses the Internet, with the protocol HTTP (or HTTPS, which is encrypted).
  • Email, video calls and file sharing also use the Internet without being part of the Web.

Worked example (what happens when you open a web page)

  1. You type a web address into the browser.
  2. The browser asks a DNS server for the IP address of that domain.
  3. The browser sends an HTTP request to that address; the request is split into packets (TCP), each addressed (IP).
  4. Routers pass the packets from network to network, possibly by different paths.
  5. The web server receives and reassembles the request, and sends the page back, again as packets.
  6. Your device reassembles them, asks again for any that were lost, and the browser displays the page.

Scalability: the capacity of a system to change in size and scale to meet new demands. The Internet was designed to scale: networks and devices can be added without redesigning the whole, because of open protocols, hierarchical addressing and routing that adapts.

Fault tolerance through redundancy: there are usually many paths between two points, so if one connection or router fails, packets are routed another way.

Worked example (bandwidth): a 40-megabyte file is downloaded over a connection of 16 megabits per second.

  1. 40 megabytes = 320 megabits (8 bits per byte).
  2. 320 ÷ 16 = 20 seconds, at best.

Latency is the delay before data begin to arrive; a connection can have high bandwidth and still feel slow if latency is high.

Common mistakes

  • Using "Internet" and "World Wide Web" interchangeably.
  • Saying all packets of a message follow the same path, or arrive in order.
  • Giving DNS the job of routing, or IP the job of reliability.
  • Confusing bits with bytes in bandwidth calculations.
  • Saying the Internet is owned or controlled by a single organization.
Check yourself

What does the Domain Name System (DNS) do?

  • Translates domain names into IP addresses

  • Encrypts web pages

  • Re-sends packets that are lost

  • Splits messages into packets

Show the answer

Translates domain names into IP addresses

It is the directory that lets people use names in place of numeric addresses.

6For top marks

  • Distinguish internet (the network infrastructure) from the web (pages accessed with HTTP).
  • Explain packet switching: splitting, independent routing, reassembly.
  • Compare TCP and UDP with a reason for choosing each.
  • Link open protocols to growth and interoperability; link IPv6 to scalability.
Example

"A live sports stream uses UDP: a few lost packets cause a brief glitch, which is better than the delay of waiting for resends."

Check yourself

Why did the change from IPv4 to IPv6 support scalability?

  • It provides vastly more unique addresses

  • It made packets smaller

  • It removed the need for routers

  • It encrypts all data

Show the answer

It provides vastly more unique addresses

2¹²⁸ addresses.

Now test yourself

This lesson has a 8-question quiz and 5 exam-style questions with mark schemes in Impera. Free, with your progress saved.

Practise in Impera