The limited number of IPv4 addresses

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

The limited number of IPv4 addresses

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. How many bits does an IPv4 address use?
A 32 bits
B 128 bits
2. How many different IPv4 addresses are possible in total?
A 2^32, about 4.3 billion
B 32^2, which is 1,024
3. Which statement is true about the number of IPv4 addresses?
A There are more than enough for every device, forever
B There are not enough for every internet-connected device
4. Which change has made IPv4 addresses run short?
A Growth of phones, tablets and smart devices online
B Computers switching to faster processors
5. Why was a new version of IP needed?
A To give every device a manufacturer code
B To provide many more addresses than IPv4

Match the Pairs

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

Left columnRight column
12^32 AThe number of possible IPv4 addresses, about 4.3 billion
2IPv6 BThe newer version of IP created because IPv4 addresses were running out
3IPv4 has 32 bits, and each bit can be 0 or 1, so the total number of addresses is found like this CIPv4 does not have unlimited addresses. It has only about 4.3 billion, which is not enough for all the phones and smart devices now online.
4The number of IPv4 addresses is about 4.3 billion, which is smaller than the number of phones and smart devices wanting to be online DIPv4 addresses use 32 bits, not 8 bits. The total is 2^32. 2^8 is only 256, the range of a single number in one part of the address.
5IPv4 addresses = 2^8 E2^32
6IPv4 has unlimited addresses F4300000000 < devices

Definitions

2^32

Fill in the Blanks

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

1.
total = 2 ** __ print(total)
2.
addresses = 2 __ 32 print(addresses)
3.
addresses = 2 ** 32 devices = 5000000000 if devices _ addresses:
4.
bits = 32 total = 2 ** ____ print(total)
5.
IF devices > addresses ____ OUTPUT "Use IPv6" ENDIF

Spot the Error

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

Question 1
A bits = 8
B total = 2 ** bits
C print(total)
Question 2
A total = 2 ** 32
B devices = 15000000000
C shortfall = total - devices
D print(shortfall)
Question 3
A total = 32 ** 2
B if devices > total:
C print("Not enough")
Question 4
A devices = 9000000000
B total = 2 ^ 32
C if devices > total:
D print("Use IPv6")
Question 5
A phones = 7000000000
B tvs = "2000000000"
C devices = phones + tvs
D print(devices)

Answer Key

The limited number of IPv4 addresses
Section A: Quick Questions
Q1
A — 32 bits
Q2
A — 2^32, about 4.3 billion
Q3
B — There are not enough for every internet-connected device
Q4
A — Growth of phones, tablets and smart devices online
Q5
B — To provide many more addresses than IPv4
Section B: Match the Pairs
Q1
2^32 → The number of possible IPv4 addresses, about 4.3 billion
Q2
IPv6 → The newer version of IP created because IPv4 addresses were running out
Q3
IPv4 has 32 bits, and each bit can be 0 or 1, so the total number of addresses is found like this → 2^32
Q4
The number of IPv4 addresses is about 4.3 billion, which is smaller than the number of phones and smart devices wanting to be online → 4300000000 < devices
Q5
IPv4 addresses = 2^8 → IPv4 addresses use 32 bits, not 8 bits. The total is 2^32. 2^8 is only 256, the range of a single number in one part of the address.
Q6
IPv4 has unlimited addresses → IPv4 does not have unlimited addresses. It has only about 4.3 billion, which is not enough for all the phones and smart devices now online.
Section C: Definitions
Q1
2^32 — The number of possible IPv4 addresses (about 4.3 billion). It is too few for every phone and smart device online, so a new version, IPv6, was needed.
Section D: Fill in the Blanks
Q1
total = 2 ** 32 print(total)
Q2
addresses = 2 ** 32 print(addresses)
Q3
addresses = 2 ** 32 devices = 5000000000 if devices > addresses:
Q4
bits = 32 total = 2 ** bits print(total)
Q5
IF devices > addresses THEN OUTPUT "Use IPv6" ENDIF
Section E: Spot the Error
Q1
A — An IPv4 address has 32 bits, not 8. With 8 bits, 2 ** bits would only give 256. The line should be bits = 32, which gives about 4.3 billion addresses.
Q2
C — The shortfall is how many more devices there are than addresses, so it is devices - total. total - devices gives a negative number and hides the problem.
Q3
A — 32 bits give 2 to the power 32 addresses, written 2 ** 32. 32 ** 2 is only 1024. The line should be total = 2 ** 32.
Q4
B — In Python, ^ is the XOR operator, not power. It would give 34, not about 4.3 billion. Use ** for powers: total = 2 ** 32.
Q5
B — Putting the number in quotes makes it a string, so phones + tvs causes an error. The count of smart TVs should be a number: tvs = 2000000000.