Computer Science • The Internet and its Uses

How a Web Page Loads

0 ms

Waterfall

1×
1 / 1

—

index.html


    

How a Web Page Loads — Explanation

Follow one web page, https://www.example.co.nz/tours/index.html, from the moment its URL is typed to the moment the page is on the screen. Press Play, or Step from one moment to the next: each message travels along the lines as it's sent, and the panel on the right explains it. The waterfall under the picture builds up as it goes, a row for each file, as in a browser's developer tools.

The key ideas

In the TCP/IP model these are layers: HTTP is an application layer protocol; it uses TCP (the transport layer: connections, sequence numbers, acknowledgements), which uses IP (the internet layer: addressing and routing each packet); and the link layer carries the bits across each cable or Wi-Fi hop. DNS is an application-layer protocol too.

The names are made-up examples, and the IP addresses are from the ranges kept for documentation, so none of them is a real site. Simplified: real browsers start fetching before the HTML has finished arriving, open several connections to a server at once (or use HTTP/2 to send many requests down one), and a large file is many packets. The order of the steps is right.

Common exam mistakes

"The DNS stores the web page." DNS only turns the domain name into an IP address. The page comes from the web server.
"The browser asks the root server." The computer asks its resolver; the resolver asks the root, TLD and authoritative servers in turn, and only if it hasn't the answer cached.
"The order is SYN, ACK, SYN-ACK." It's SYN, then SYN-ACK, then ACK: the SYN-ACK both acknowledges the computer's SYN and sends the server's own.
"HTTPS means the website is safe." It means the connection is encrypted and the certificate matches the domain name. A scam site can have a valid certificate for its own domain.
"The internet and the World Wide Web are the same thing." The internet is the network of networks (the hardware and the connections); the web is the collection of web pages and other resources on it, reached with HTTP(S) through a browser.

Exam-style questions and answers

1. Identify the three parts of the URL https://www.example.co.nz/tours/index.html. [3]

Answer. Protocol: https. Domain name: www.example.co.nz. File name (path): /tours/index.html.

2. Explain how a web page is located and displayed when its URL is typed into a browser. [6]

Answer. The browser sends the domain name to a DNS (domain name server); the DNS looks up the matching IP address (asking other DNS servers in turn if it doesn't have it) and returns it to the browser. The browser sends a request to the web server at that IP address, using HTTP or HTTPS. The web server sends back the HTML for the page. The browser interprets (renders) the HTML, requesting any other files it refers to (images, stylesheets, scripts), and displays the page.

3. Describe the three-way handshake used to open a TCP connection. [3]

Answer. The client sends a SYN with its initial sequence number. The server replies with a SYN-ACK, acknowledging the client's number and giving its own. The client replies with an ACK acknowledging the server's number, and the connection is open.

4. The second time the page is loaded it appears faster. Explain why, with reference to DNS. [2]

Answer. The IP address was cached (by the browser, the operating system or the resolver) the first time, for its time to live, so no DNS lookup across the internet is needed, saving several round trips.

5. State two differences between HTTP and HTTPS. [2]

Answer. HTTPS encrypts the data sent (using TLS); HTTP sends it as plain text. HTTPS uses a digital certificate so the browser can check the server is genuine; HTTP doesn't. (HTTPS normally uses port 443, HTTP port 80.)

Objective: explain how a web page is located, retrieved and displayed when a URL is entered: the URL's parts, the DNS (domain name server / service) and IP addresses, HTTP and HTTPS, and the web browser (Cambridge IGCSE Computer Science 0478, 5.1 The internet and the World Wide Web, with 2.1 packets and protocols); the role of DNS, client-server, and the TCP/IP protocols with the three-way handshake (Cambridge AS & A Level Computer Science 9618, AS 2.1 Networks including the internet, and A Level 14.1 Protocols).

Where this fits

  • AP: AP Computer Science Principles Goes beyond AP Computer Science Principles: TLS handshakes and the DNS server hierarchy go beyond AP CSP.
  • AQA: AQA A Level Computer Science (7517)
  • Cambridge: Cambridge IGCSE Computer Science (0478); Cambridge A Level Computer Science (9618); Cambridge AS Level Computer Science (9618); Cambridge A Level Information Technology (9626) Goes beyond Cambridge IGCSE Computer Science (0478): The TCP handshake, DNS root/TLD hierarchy and request waterfall go beyond 0478. Goes beyond Cambridge AS Level Computer Science (9618): TCP, HTTP and the TCP/IP layers are A Level (14.1) and TLS is 17.1; AS has URLs and DNS.
  • IB: IB Computer Science HL; IB Computer Science SL
  • NCEA Level 2 Digital Technologies: 91895 Use advanced techniques to develop a network; 91895 Use advanced techniques to develop a network
  • NCEA Level 3 Digital Technologies: 91905 Use complex techniques to develop a network; 91905 Use complex techniques to develop a network
  • Pearson Edexcel International: Edexcel International GCSE Computer Science (4CP0); Edexcel International A Level Information Technology
  • USDP: USDP Computer Science

How a Web Page Loads — Key Terms

Key concepts in English, with te reo Māori, Chinese (Simplified) and Korean.

EnglishTe reo Māori中文(简体)한국어What it means on this page
URLno attested term网址 (wǎngzhǐ)웹 주소 (wep juso)Uniform Resource Locator: the address of a web page or file, made of the protocol (https://), the domain name (www.example.co.nz) and the path to the file (/tours/index.html).
Domain Nameno attested term域名 (yùmíng)도메인 이름 (domein ireum)The name of a server, such as www.example.co.nz, read from the right: the top-level domain (.nz), the second-level domain (.co), the registered name (example) and a subdomain (www).
Top-Level Domain (TLD)no attested term顶级域名 (dǐngjí yùmíng)최상위 도메인 (choesangwi domein)The last part of a domain name, such as .nz, .com or .org; the TLD's name servers know which name server is in charge of each domain under it.
DNS (Domain Name System)no attested term域名系统 (yùmíng xìtǒng)도메인 네임 시스템 (domein neim siseutem)Turns a domain name into its server's IP address. Cambridge IGCSE calls the servers that do it domain name servers: the resolver asks a root server, then a top-level domain server, then the domain's authoritative name server.
DNS Cacheno attested termDNS缓存 (DNS huǎncún)DNS 캐시 (DNS kaesi)A store of recently looked-up domain names and their IP addresses, kept by the browser, the operating system and the resolver for each answer's time to live, so the lookup isn't repeated.
Hosts Fileno attested term——A text file on a computer that pairs domain names with IP addresses, typed in by hand. The computer checks it before asking DNS, and uses its address for any name it lists.
IP Addressno attested termIP地址 (IP dìzhǐ)IP 주소 (IP juso)An address given to a device by the network it joins, used to send data to it across networks; it changes if the device moves to another network.
Web Browserno attested term网页浏览器 (wǎngyè liúlǎnqì)웹 브라우저 (wep beuraujeo)Software that requests web pages using HTTP or HTTPS, interprets (renders) the HTML, CSS and scripts, and displays the page.
Web Serverno attested term网页服务器 (wǎngyè fúwùqì)웹 서버 (wep seobeo)A computer that stores web pages and their files and sends them to browsers that request them.
Protocolno attested term协议 (xiéyì)프로토콜 (peurotokol)An agreed set of rules for how devices communicate, such as how data is formatted, addressed, sent and checked.
HTTPno attested term超文本传输协议 (chāowénběn chuánshū xiéyì)하이퍼텍스트 전송 프로토콜 (haipeotekseuteu jeonsong peurotokol)Hypertext Transfer Protocol: the rules for a browser requesting a web page or file (GET) and a web server replying with a status code (200 OK, 404 Not Found) and the file.
HTTPSno attested term超文本传输安全协议 (chāowénběn chuánshū ānquán xiéyì)보안 하이퍼텍스트 전송 프로토콜 (boan haipeotekseuteu jeonsong peurotokol)Hypertext Transfer Protocol Secure: web pages sent over an encrypted connection, shown by https:// and a padlock in the address bar.
TCP/IPno attested termTCP/IP协议 (TCP/IP xiéyì)TCP/IP 프로토콜 (TCP/IP peurotokol)The protocols the internet is built on: TCP splits data into numbered packets, checks they all arrive and puts them in order; IP addresses and routes each packet.
Three-Way Handshakeno attested term三次握手 (sān cì wòshǒu)3방향 핸드셰이크 (sambanghyang haendeusyeikeu)How TCP opens a connection: the client sends SYN, the server replies SYN-ACK, and the client replies ACK, each side giving its starting sequence number and acknowledging the other's.
Digital Certificateno attested term数字证书 (shùzì zhèngshū)디지털 인증서 (dijiteol injeungseo)An electronic document, signed by a certificate authority the browser trusts, that proves the server is the one for that domain name; HTTPS checks it before the session key is agreed.

On the te reo Māori column. Terms marked as gaps have no attested equivalent in the sources checked — Karaitiana Taiuru's Dictionary of Māori Computer and Social Media Terms, Paekupu, the Reserve Bank's te reo financial glossary, NZQA and Te Aka. No coinage is printed as though it were established; where a class needs one, commission it from Te Taura Whiri i te Reo Māori and credit the translator. Te reo Māori is not italicised and takes no plural "s".