Teachers' Portal  /  A-Level Computer Science 9618  /  Communication  /  IP addressing and the domain name service
Lesson pack · A-Level Computer Science 9618 · 2.1 · AS Level

IP addressing and the domain name service

Every device needs an address. Packets can only be delivered if every device has an address.

Student lesson Lab, full screen
At a glance

The shape of the lesson

Topic
Communication
Syllabus reference
Cambridge International AS and A Level Computer Science 9618, 2.1
Level
AS Level
Duration
45 minutes, lab-led; stretches to a 60 minute block (see the contingency notes)
Position in topic
Lesson 6 of 6 in Communication; follows The internet and the world wide web
Central model
Fig. 1: ANDing an address with the subnet mask 255.255.255.192 gives the network address 192.168.20.64
Cooperative structure
Assessment
Stage 1 check and the exam-style plenary from the student lesson, plus the worksheet as the exit task
Learning objectives

By the end of the lesson, learners can

Section by section
  • IPv4 and IPv6: In the lab, click a device to see its MAC address and its IP address, switch between IPv4 and IPv6, and restart the router to see dynamic addresses change.
  • Subnets, public and private: Subnetting splits the address into a network part and a host part.
  • URLs and the DNS: In the lab, step through what happens when a URL is typed, then edit the URL and change https to http.
Key points to leave on the board
  • IPv4: 32 bits, four denary numbers 0 to 255. IPv6: 128 bits, eight groups of four hex digits.
  • Subnetting: address AND mask = network address; usable hosts = 2h − 2.
  • Private vs public: LAN only and hidden behind NAT, vs unique and reachable on the internet.
  • DNS: domain name to IP address, passed up the DNS hierarchy if not known locally.
The core visual model

One picture every idea returns to

An IP address identifies a device on a network so packets can be routed to it. IPv4 is 32 bits, written as four denary numbers 0 to 255 separated by dots; IPv6 is 128 bits, written as eight groups of four hex digits separated by colons. Subnetting uses a subnet mask to split an address into a network ID and a host ID, dividing one network into smaller ones. A private address is used only inside a LAN and is not reachable from the internet; a public address is unique on the internet. A static address never changes; a dynamic one is assigned by DHCP each time a device connects. A URL names a resource; the DNS translates its domain name into the IP address of the server.

IPv4 address AND subnet mask = network address IP addressmasknetwork 192.168.20.77 255.255.255.192 01001101 11000000 01000000 (77)(192)(64) 192.168.20.64 network ID: 26 bits host ID: 6 bits this host is host 13 on subnet 192.168.20.64 (64 addresses: .64 to .127)
Fig. 1: ANDing an address with the subnet mask 255.255.255.192 gives the network address 192.168.20.64
Lesson sequence

Forty-five minutes, phase by phase

TimePhaseWhat happens in the roomGrouping
0 to 5 minHook: predictOpen with the question in the title, Every device needs an address.. Packets can only be delivered if every device has an address. Put the figure on the board: it is the one picture every idea in the lesson returns to.Whole class, then pairs
5 to 13 minTeach and check: IPv4 and IPv6In the lab, click a device to see its MAC address and its IP address, switch between IPv4 and IPv6, and restart the router to see dynamic addresses change. Project tab 3 of the lab (MAC and IP addresses) and let a student drive it while the class predicts.Whole class, then pairs
13 to 21 minTeach and check: Subnets, public and privateSubnetting splits the address into a network part and a host part. Model the worked example Find the network address on the board, one line at a time. Your turn: A host is 10.0.5.200 with mask 255.255.255.128. What is its network address?Pairs
21 to 30 minTeach and check: URLs and the DNSIn the lab, step through what happens when a URL is typed, then edit the URL and change https to http. Project tab 1 of the lab (From URL to web page) and let a student drive it while the class predicts. Model the worked example Locating a resource on the board, one line at a time.Cooperative Concept Mapping
30 to 36 minCheckThe four Stage 1 questions from the student lesson, answered on mini whiteboards or by show of fingers. Re-teach the one most get wrong.Individual, then whole class
36 to 43 minPlenaryThe exam-style questions from Stage 2, one at a time: thirty seconds alone, then a random call. The feedback lines in the key give the examiner's wording.Individual, random call
43 to 45 minExit and homeworkSet the worksheet below (6 questions, 22 marks). Learners self-assess against the objectives before they leave.Individual
Timing and contingency

Protect the parts that carry the learning

The sequence carries about fifty minutes of material, so the lab is driven by one student while the class predicts rather than explored freely. Times are a guide.

Protected: the check at 30 minutes. It is the only individual read on whether the key idea landed, and it is not cut.

Cut first if the build overruns: the last check in URLs and the DNS, never the check or the plenary.

In a 60 minute block: run worksheet questions 1 to 3 in class as a Rally Coach set and model both the hardest worked example and its check live.

Running the cooperative task

Cooperative Concept Mapping

Teams receive the key terms on cards and arrange them on a large sheet, drawing and labelling the links. Compare maps between teams before showing the model map.

The full structure, with its variations and the other twelve, is on the cooperative-learning page.

Examiner traps to pre-empt

What to head off, and how

Trap learners fall intoTeaching move that pre-empts it
An IPv4 number cannot exceed 255, because each part is one byte.An address such as 192.168.1.300 is invalid, and is a favourite in "identify the invalid address" questions.
The number of usable hosts is 2 h − 2, not 2 h: the network address and the broadcast address cannot be given to a device.Return to Subnets, public and private: ask a pair to state the correct version and show it on the lab before moving on.
The DNS does not send the web page.It only returns the IP address; the browser then requests the page from the web server itself.
Worksheet

IP addressing and the domain name service: worksheet

6 questions, 22 marks. Written in the style of the papers; no past paper question is reproduced.

NameClassDate
Q1 · recall[3 marks]

Describe the format of an IPv4 address and of an IPv6 address.

Q2 · calculate[3 marks]

A host has IP address 172.16.9.150 and subnet mask 255.255.255.224. (a) Find the network address. (b) State how many usable host addresses the subnet has.

Q3 · explain[4 marks]

Explain the difference between a public IP address and a private IP address, and the implications for security.

Q4 · explain[4 marks]

Compare static and dynamic IP addresses, giving a suitable use for each.

Q5 · explain[5 marks]

A user types https://www.example.org/shop/basket.html into a browser. Explain how the URL is used to locate the resource, including the role of the DNS.

Q6 · analysis[3 marks]

A company has the network 192.168.50.0 with subnet mask 255.255.255.0. It wants four separate subnets, one per department, each with up to 50 devices. Suggest a new subnet mask and justify it.

Answer key and marking notes
Q1 · 3 marks
  • IPv4: 32 bits, written as four denary numbers (each 0 to 255, one byte) separated by dots.
  • IPv6: 128 bits, written as eight groups of four hexadecimal digits separated by colons.
  • IPv6 can be shortened by removing leading zeros and replacing one run of zero groups with ::.
Q2 · 3 marks
  • 150 = 10010110 and 224 = 11100000; AND gives 10000000 = 128.
  • (a) Network address 172.16.9.128.
  • (b) 5 host bits: 25 − 2 = 30 usable host addresses.
Q3 · 4 marks
  • A private IP address is used only within a LAN and is not unique on the internet / not routable on the internet.
  • A public IP address is unique on the internet and allocated by an ISP.
  • Devices with private addresses cannot be contacted directly from outside; the router uses NAT so only its public address is seen.
  • A device with a public address is directly reachable and so more exposed to attack; it needs a firewall.
Q4 · 4 marks
  • A static address is set manually and does not change.
  • Use: a web server or network printer, which must always be found at the same address.
  • A dynamic address is allocated by a DHCP server each time the device connects and can change.
  • Use: laptops and phones joining a network; addresses are reused, so fewer are needed.
Q5 · 5 marks
  • The browser identifies the protocol (https), the domain name (www.example.org) and the path/file (/shop/basket.html).
  • The domain name is sent to a DNS server to find the matching IP address (if it is not already cached).
  • If that DNS server does not have it, the request is passed to other DNS servers in the hierarchy until it is resolved.
  • The IP address is returned to the browser.
  • The browser sends an HTTPS request for /shop/basket.html to the web server at that IP address, and the server returns the page.
Q6 · 3 marks
  • 255.255.255.192: borrows 2 bits from the host part, giving 22 = 4 subnets.
  • This leaves 6 host bits: 26 − 2 = 62 usable addresses per subnet, enough for 50 devices.
  • Subnets: 192.168.50.0, .64, .128 and .192.
Quiz

6 multiple-choice questions on this lesson

From the topic question bank. Assign them in the app for a marked score in your gradebook, or run the topic as a class game.

Q11 mark

Which describes an IPv6 address?

  • A128 bits, written as eight groups of four hexadecimal digits separated by colons
  • B32 bits, written as four denary numbers from 0 to 255 separated by dots
  • C48 bits, written as six pairs of hexadecimal digits, fixed by the manufacturer
  • D64 bits, written as eight denary numbers separated by colons
Q21 mark

Which of these is not a valid IPv4 address?

  • A172.16.300.4
  • B10.255.0.1
  • C192.168.0.0
  • D8.8.4.4
Q31 mark

A host has IP address 172.16.45.150 and subnet mask 255.255.255.224. What is the network address, and how many usable host addresses does the subnet have?

  • A172.16.45.128, with 30 usable host addresses
  • B172.16.45.128, with 32 usable host addresses
  • C172.16.45.0, with 254 usable host addresses
  • D172.16.45.160, with 30 usable host addresses
Q41 mark

A laptop is given a different IP address each time it joins the school network. Which statement explains this?

  • AIt has a dynamic IP address, allocated from a pool by a DHCP server when it connects
  • BIt has a static IP address, set manually by the network manager each morning
  • CIts MAC address changes each time it connects, so its IP address changes too
  • DThe DNS server gives it a new IP address whenever it visits a website
Q51 mark

Which is the correct shortened form of the IPv6 address 2001:0db8:0000:0000:0abc:0000:0000:0001?

  • A2001:db8::abc:0:0:1
  • B2001:db8::abc::1
  • C2001:db8:abc::1
  • D21:db8::abc:0:0:1
Q61 mark

A user types https://www.example.org/science/index.html into a browser whose cache does not hold that domain. Which statement about what happens is correct?

  • AA DNS server returns the IP address for www.example.org, then the browser requests /science/index.html from the web server at that address
  • BThe DNS server finds the page /science/index.html and sends it straight back to the browser
  • CThe DHCP server converts the domain name into an IP address and the router fetches the page
  • DThe router looks up www.example.org in its routing table, which lists every domain name on the internet
Quiz key
Q1: A

IPv6 addresses are 128 bits (about 3.4 × 1038 addresses), written as eight groups of four hex digits with colons. 32 bits in dotted decimal is IPv4. 48 bits fixed at manufacture is a MAC address. The 64-bit option mixes up the size and uses denary instead of hexadecimal.

Q2: A

Each part of an IPv4 address is one byte, so it must be from 0 to 255; 300 is too large, so 172.16.300.4 is invalid. 10.255.0.1 and 8.8.4.4 have four numbers all in range. 192.168.0.0 is also correctly formed (it is a network address, but it is still a valid IPv4 address).

Q3: A

150 = 10010110 and 224 = 11100000; ANDing gives 10000000 = 128, so the network address is 172.16.45.128. The mask has 5 zero bits, giving 25 = 32 addresses, minus the network and broadcast addresses = 30 usable. 32 forgets to subtract those two. 172.16.45.0 with 254 hosts treats the mask as 255.255.255.0. 160 (10100000) is not a possible AND result, because it has a 1 in the 32s place where 150 has a 0.

Q4: A

A dynamic address is allocated by DHCP from a pool each time a device connects, so it can change. A static address never changes. The MAC address is fixed in the NIC and does not change. The DNS translates domain names into IP addresses; it does not give devices their addresses.

Q5: A

Dropping leading zeros gives 2001:db8:0:0:abc:0:0:1; one run of zero groups is replaced by ::, giving 2001:db8::abc:0:0:1. Using :: twice is not allowed, because the reader could not tell how many groups each one stands for. 2001:db8:abc::1 loses the two zero groups before abc, which changes the address. 21:db8 wrongly removes zeros from inside the group 2001; only leading zeros may go.

Q6: A

The domain name is sent to a DNS server (and up the DNS hierarchy if needed); the IP address comes back, and the browser then sends an HTTPS request for the path to that web server, which returns the page. A DNS server never sends web pages. DHCP allocates addresses to devices; it does not resolve names. Routing tables hold routes to networks by IP address, not domain names.

Lab and demo

What to project

The student lesson embeds these tabs. Open them full screen on the projector; every slider has a drag handle on the stage.

Slides

Slides for this lesson

A projectable deck for every pack is on the way. Until then, present the student lesson full screen: its sections, figure and lab tabs follow the same order as the plan above.

Also for this topic

Everything else you can use

Original work by the TheLucidSTEM team. The worksheet items are written in the style of the papers; no past paper question is reproduced.
Previous lessonThe internet and the world wide web