Why a device needs both a MAC address and an IP address

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

Why a device needs both a MAC address and an IP address

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. Which address do routers mainly use to send data towards a device on another network?
A The MAC address
B The IP address
2. Which address identifies the physical network interface card (NIC) of a device?
A The MAC address
B The IP address
3. Which statement is correct?
A Both addresses are used to deliver data
B Only the IP address is needed to deliver data
4. A message is sent from a laptop to a server on a different network. What does the IP address tell the routers?
A Which company made the NIC
B Where the device is on the network
5. In the last step of delivery on the local network, which address points to the exact NIC that receives the data?
A The MAC address
B The IP address

Match the Pairs

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

Left columnRight column
1IP address: 192.168.1.20 ADestination IP: 82.14.7.9
2MAC address: 3C:52:82:1A:B4:F0 BShows where the device is on the network, so routers can work out the route to it across networks
3The IP address is used for routing data across different networks until it reaches the right network CThis mixes up the two addresses. The IP address shows where the device is on the network for routing. The MAC address only identifies the physical NIC.
4The MAC address is used for the final local delivery to the NIC of the receiving device DBoth addresses are used. The IP address shows where the device is on the network, and the MAC address identifies its physical NIC for local delivery.
5A device only needs an IP address, so the MAC address is not used to deliver data. EDestination MAC: 5E:A1:09:7C:22:D8
6The MAC address tells routers where a device is on the network, so it is used to route data across networks. FIdentifies the physical NIC of the device, so data can be delivered to the right device on the local network

Definitions

IP address and MAC address

Fill in the Blanks

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

1.
route ← FindRoute(packet.______)
2.
DeliverLocally(packet._______)
3.
packet.destIP ← "192.168.1.20" packet.destMAC ← "3C-52-82-1A-9F-D4" ____(packet)
4.
IF packet.destIP <> myIP ____ FORWARD(packet) ENDIF
5.
delivered ← routedByIP ___ matchedByMAC

Spot the Error

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

Question 1
A message ← 'Hello'
B routeAcross(destinationMAC)
C deliverLocal(destinationMAC)
Question 2
A IP ← network gives address
B MAC ← set at manufacture
C IP can change on new network
D MAC changes on a new network
Question 3
A mac ← '3C:52:82:1A:9F:04'
B PRINT mac
C ip ← '192.168.1.320'
D PRINT ip
Question 4
A // Ava sends a message to Ben
B src IP: 192.168.1.5
C dest IP: 192.168.1.9
D dest MAC: 192.168.1.9
Question 5
A packet arrives at router
B router reads destination IP
C router picks route by MAC
D NIC checks destination MAC

Answer Key

Why a device needs both a MAC address and an IP address
Section A: Quick Questions
Q1
B — The IP address
Q2
A — The MAC address
Q3
A — Both addresses are used to deliver data
Q4
B — Where the device is on the network
Q5
A — The MAC address
Section B: Match the Pairs
Q1
IP address: 192.168.1.20 → Shows where the device is on the network, so routers can work out the route to it across networks
Q2
MAC address: 3C:52:82:1A:B4:F0 → Identifies the physical NIC of the device, so data can be delivered to the right device on the local network
Q3
The IP address is used for routing data across different networks until it reaches the right network → Destination IP: 82.14.7.9
Q4
The MAC address is used for the final local delivery to the NIC of the receiving device → Destination MAC: 5E:A1:09:7C:22:D8
Q5
A device only needs an IP address, so the MAC address is not used to deliver data. → Both addresses are used. The IP address shows where the device is on the network, and the MAC address identifies its physical NIC for local delivery.
Q6
The MAC address tells routers where a device is on the network, so it is used to route data across networks. → This mixes up the two addresses. The IP address shows where the device is on the network for routing. The MAC address only identifies the physical NIC.
Section C: Definitions
Q1
IP address and MAC address — The IP address shows where a device is on the network so routers can route data to it. The MAC address identifies its physical NIC for local delivery. Both are used to deliver data.
Section D: Fill in the Blanks
Q1
route ← FindRoute(packet.destIP)
Q2
DeliverLocally(packet.destMAC)
Q3
packet.destIP ← "192.168.1.20" packet.destMAC ← "3C-52-82-1A-9F-D4" SEND(packet)
Q4
IF packet.destIP <> myIP THEN FORWARD(packet) ENDIF
Q5
delivered ← routedByIP AND matchedByMAC
Section E: Spot the Error
Q1
B — Routers route data across networks using the IP address, which shows where the device is. The MAC address is only used for local delivery. Line 2 should be routeAcross(destinationIP).
Q2
D — A MAC address is given to the NIC at manufacture and stays the same on any network. Only the IP address changes when a device joins a new network. Line 4 should say the MAC stays the same.
Q3
C — Each part of an IPv4 address is an 8-bit number from 0 to 255, so 320 is invalid. The line should be ip ← '192.168.1.20' or another valid value.
Q4
D — A MAC address is written as hexadecimal pairs such as 5E:11:A0:7B:22:C9. 192.168.1.9 is an IPv4 address, so it was put in the wrong field.
Q5
C — The router chooses the route using the destination IP address, which shows where the device is on the network. The MAC address is only used for the local delivery. Line 3 should say the route is picked using the IP.