IP addresses are allocated by the network

Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.

IP addresses are allocated by the network

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. Who gives a device its IP address?
A The manufacturer of the device
B The network the device joins
2. A laptop moves from a school network to a home network. What happens to its IP address?
A It is likely to change to a new one
B It stays exactly the same
3. Which address is built into the NIC when it is made?
A MAC address
B IP address
4. True or false: an IP address is set by the manufacturer at the factory.
A True
B False
5. Which statement about IP addresses is correct?
A It depends on the network the device is connected to
B It is permanently fixed to the device's hardware

Match the Pairs

Draw a line connecting each item on the left to its match on the right.

Left columnRight column
1Laptop at home: 192.168.1.20 -> Laptop at school: 10.0.5.47 AThe same device gets a different IP address on a new network, because the network allocates the address.
2MAC address: 00:1A:2B:3C:4D:5E (stays the same on every network) BWrong: the manufacturer gives the MAC address, not the IP address. The network the device joins allocates the IP address.
3An IP address is given to a device by the network it joins, not by the manufacturer. CPhone joins Wi-Fi -> Router gives IP 192.168.0.12
4An IP address is not built into the NIC, so it can change when the device moves to another network. DTablet on café Wi-Fi: 172.16.4.9 / Tablet on home Wi-Fi: 192.168.1.8
5The manufacturer sets the IP address of a device when it is made. EWrong: the IP address is not built into the NIC. It depends on the network and changes when the device joins a new network.
6A device keeps the same IP address on every network because it is built into the NIC. FAn address built into the NIC at manufacture, so unlike an IP address it does not change when the device joins a new network.

Definitions

IP address allocation

Fill in the Blanks

Complete each line of code by filling in the missing parts.

1.
nic.macAddress ← manufacturer.assign() device.ipAddress ← _______.allocate()
2.
IF newNetwork __ oldNetwork THEN device.ipAddress ← newNetwork.allocate() ENDIF
3.
joinNetwork(device, network) device.ipAddress ← network.________() OUTPUT device.ipAddress
4.
IF device.joinsNewNetwork ____ device.ipAddress ← network.allocate() ENDIF
5.
nic.macAddress ← manufacturer.assign() device._________ ← network.allocate()

Spot the Error

Shade in the letter of the line that contains an error.

Question 1
A laptop.mac ← nic.mac
B network ← join("SchoolWiFi")
C laptop.ip ← nic.factoryIP()
Question 2
A phone.ip ← maker.assign()
B OUTPUT phone.ip
C phone.mac ← nic.mac
Question 3
A IF sameNetwork THEN
B device.ip ← network.assign()
C ENDIF
Question 4
A home.ip ← homeNet.assign()
B cafe.ip ← home.ip
C OUTPUT home.ip, cafe.ip
Question 5
A nic.mac ← "A4:5E:60:C1:09:7B"
B ip ← network.assign()
C OUTPUT "IP never changes"

Answer Key

IP addresses are allocated by the network
Section A: Quick Questions
Q1
B — The network the device joins
Q2
A — It is likely to change to a new one
Q3
A — MAC address
Q4
B — False
Q5
A — It depends on the network the device is connected to
Section B: Match the Pairs
Q1
Laptop at home: 192.168.1.20 -> Laptop at school: 10.0.5.47 → The same device gets a different IP address on a new network, because the network allocates the address.
Q2
MAC address: 00:1A:2B:3C:4D:5E (stays the same on every network) → An address built into the NIC at manufacture, so unlike an IP address it does not change when the device joins a new network.
Q3
An IP address is given to a device by the network it joins, not by the manufacturer. → Phone joins Wi-Fi -> Router gives IP 192.168.0.12
Q4
An IP address is not built into the NIC, so it can change when the device moves to another network. → Tablet on café Wi-Fi: 172.16.4.9 / Tablet on home Wi-Fi: 192.168.1.8
Q5
The manufacturer sets the IP address of a device when it is made. → Wrong: the manufacturer gives the MAC address, not the IP address. The network the device joins allocates the IP address.
Q6
A device keeps the same IP address on every network because it is built into the NIC. → Wrong: the IP address is not built into the NIC. It depends on the network and changes when the device joins a new network.
Section C: Definitions
Q1
IP address allocation — A device is given its IP address by the network it joins, not by the manufacturer, so it can change on a new network. Unlike a MAC address, it is not built into the NIC.
Section D: Fill in the Blanks
Q1
nic.macAddress ← manufacturer.assign() device.ipAddress ← network.allocate()
Q2
IF newNetwork <> oldNetwork THEN device.ipAddress ← newNetwork.allocate() ENDIF
Q3
joinNetwork(device, network) device.ipAddress ← network.allocate() OUTPUT device.ipAddress
Q4
IF device.joinsNewNetwork THEN device.ipAddress ← network.allocate() ENDIF
Q5
nic.macAddress ← manufacturer.assign() device.ipAddress ← network.allocate()
Section E: Spot the Error
Q1
C — An IP address is not built into the NIC. The network the laptop joins assigns it, so it should be network.assign().
Q2
A — The manufacturer does not give out IP addresses. The network the phone joins allocates its IP, so it should be network.assign().
Q3
A — A new IP address is allocated when the device joins a new network. The condition should be joinsNewNetwork, not sameNetwork.
Q4
B — The cafe network gives the device its own IP address. It does not reuse the home one. It should be cafe.ip ← cafeNet.assign().
Q5
C — The MAC address is built into the NIC and stays the same. The IP address depends on the network and can change. The output should say MAC never changes.