A router assigns IP addresses

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

A router assigns IP addresses

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. A new phone joins the school Wi-Fi. What happens to its IP address?
A The router gives it an IP address automatically
B The student must type in an IP address by hand
2. Which device on a home network gives out IP addresses to the other devices?
A The monitor
B The router
3. A router gives out dynamic IP addresses. What does this mean?
A The address is given automatically when a device joins
B The address is permanently fixed to the device by hand
4. A laptop and a tablet are both connected to the same router. Which statement is true?
A Both devices share the same IP address
B Each device is given a different IP address
5. Why does the router assign IP addresses automatically?
A So users do not have to set up each device by hand
B So that every device has the same MAC address

Match the Pairs

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

Left columnRight column
1Phone joins Wi-Fi -> router gives 192.168.1.23 AOn a local network the router assigns addresses automatically, so nobody needs to type them in by hand.
2Laptop = 192.168.1.24, Phone = 192.168.1.23 BA new device joins the network and the router automatically gives it an IP address
3The router gives out dynamic IP addresses, so a device does not need to be set up by hand Cnext_address = last_address + 1
4Every device that joins receives a different address from the router Dip_address = router.assign()
5Technician types 192.168.1.50 into every new tablet by hand EEach device on the network is given a different IP address by the router
6Router gives 192.168.1.30 to both the printer and the laptop FTwo devices must never have the same IP address. The router gives each device a different address.

Definitions

router assigns IP

Fill in the Blanks

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

1.
______.assignIP(newLaptop)
2.
IF device.joined ____ router.assignIP(device) ENDIF
3.
ipPhone = router.assignIP(phone) ipLaptop = router.assignIP(laptop) OUTPUT ipPhone __ ipLaptop
4.
tabletIP = router.________(tablet) OUTPUT tabletIP
5.
FOR ____ device IN network router.assignIP(device) NEXT device

Spot the Error

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

Question 1
A laptop <- NewDevice()
B laptop.joinNetwork()
C ip <- router.assignIP(laptop)
D laptop.ip = ip
Question 2
A IF newDevice.joined = TRUE
B ip <- router.assignIP()
C newDevice.ip <- ip
D ENDIF
Question 3
A router.mode <- "static"
B pc <- NewDevice("PC")
C ip <- router.assignIP(pc)
Question 4
A FOR EACH device IN newDevices
B ip <- user.typeIP(device)
C device.ip <- ip
D NEXT device
Question 5
A tablet <- NewDevice("Tablet")
B tablet.ip <- tablet.assignIP()
C OUTPUT tablet.ip

Answer Key

A router assigns IP addresses
Section A: Quick Questions
Q1
A — The router gives it an IP address automatically
Q2
B — The router
Q3
A — The address is given automatically when a device joins
Q4
B — Each device is given a different IP address
Q5
A — So users do not have to set up each device by hand
Section B: Match the Pairs
Q1
Phone joins Wi-Fi -> router gives 192.168.1.23 → A new device joins the network and the router automatically gives it an IP address
Q2
Laptop = 192.168.1.24, Phone = 192.168.1.23 → Each device on the network is given a different IP address by the router
Q3
The router gives out dynamic IP addresses, so a device does not need to be set up by hand → ip_address = router.assign()
Q4
Every device that joins receives a different address from the router → next_address = last_address + 1
Q5
Technician types 192.168.1.50 into every new tablet by hand → On a local network the router assigns addresses automatically, so nobody needs to type them in by hand.
Q6
Router gives 192.168.1.30 to both the printer and the laptop → Two devices must never have the same IP address. The router gives each device a different address.
Section C: Definitions
Q1
router assigns IP — A router on a local network gives each device that joins its own IP address automatically, so nobody sets it up by hand. Every device gets a different address.
Section D: Fill in the Blanks
Q1
router.assignIP(newLaptop)
Q2
IF device.joined THEN router.assignIP(device) ENDIF
Q3
ipPhone = router.assignIP(phone) ipLaptop = router.assignIP(laptop) OUTPUT ipPhone != ipLaptop
Q4
tabletIP = router.assignIP(tablet) OUTPUT tabletIP
Q5
FOR EACH device IN network router.assignIP(device) NEXT device
Section E: Spot the Error
Q1
D — Assignment in this pseudocode uses the arrow <-, not =. The line should be laptop.ip <- ip, which stores the address the router gave the laptop.
Q2
A — An IF statement needs THEN at the end of its first line. It should be IF newDevice.joined = TRUE THEN, so the router assigns an address when a new device joins.
Q3
A — With static addressing, a person sets each address by hand. The router assigns addresses automatically in dynamic mode, so the line should be router.mode <- "dynamic".
Q4
B — The router gives each device its address automatically, so a user does not type it in by hand. The line should be ip <- router.assignIP(device).
Q5
B — The device does not give itself an address. The router on the network assigns it, so the line should be tablet.ip <- router.assignIP().