Network interface cards, MAC and IP addresses, and routers
To join a network a computer needs a network interface card, which has a MAC address. On the network it is also given an IP address, and a router sends data to it. This lesson explains each part, the structure of a MAC address, the two versions of IP address, and the jobs of a router.
about 25 min1 simulation1 practice question
Lesson 3 of 3Show all lessonsHide
Try the code and the simulations beside the lesson.
Joining a network
A letter needs an address before it can be delivered. Data on a network is the same: every device needs addresses so that data can find it.
A home network. A laptop, a phone and a printer each have a network interface card with its own MAC address. Each is joined to a router, which gives each device an IP address and connects the home network to the internet, drawn as a cloud.
The picture shows a home network. A laptop, a phone and a printer each have a network interface card. They are joined to a router, and the router joins the home network to the internet.
The network interface card
A computer needs a network interface card (NIC) to access a network. The NIC is the part that sends data onto the network and receives it. It may connect with a cable or without wires. Today it is often built into the main circuit board, but it is still called a card.
The MAC address
MAC stands for media access control. A NIC is given a MAC address at the point of manufacture. It identifies that card on a network.
Structure. A MAC address is created from two parts: the manufacturer code, which identifies the company that made the card, and the serial code, which the company gives to each card it makes.
How it is written. MAC addresses are usually written in hexadecimal. A MAC address is 48 bits long. That is 12 hexadecimal digits, because each hex digit stands for 4 bits. The digits are written in six pairs, with a colon or a hyphen between the pairs.
The MAC address 3C:5A:B4:01:9F:E2 drawn as six pairs of hexadecimal digits. A bracket under the first three pairs, 3C:5A:B4, says manufacturer code. A bracket under the last three pairs, 01:9F:E2, says serial code. Under the first pair, 3C is shown as the 8 binary digits 0011 1100.
In the address 3C:5A:B4:01:9F:E2, the first half, 3C:5A:B4, is the manufacturer code. The second half, 01:9F:E2, is the serial code. Why hexadecimal? It is much shorter and easier for people to read than 48 binary digits. You learnt to convert hex to binary in the chapter on data representation.
The IP address
IP stands for internet protocol. An IP address is allocated to a device by the network it joins. Data sent across networks and the internet uses IP addresses to find the right device.
Static or dynamic. A static IP address stays the same every time the device connects. A dynamic IP address is given out each time the device connects, so it can change. A web server needs a static address, so that it can always be found at the same place. A phone usually gets a dynamic one.
IPv4. An IPv4 address is 32 bits long. It is written as four denary numbers from 0 to 255, separated by dots, for example 198.51.100.7. Each number stands for 8 bits.
IPv6. An IPv6 address is 128 bits long. It is written as eight groups of four hexadecimal digits, separated by colons. For example, the groups 2001, 0db8, 0000, 0000, 0000, ff00, 0042 and 8329 are written one after another with a colon between each pair.
Why was IPv6 needed? The 32 bits of IPv4 give 232, about 4.3 billion, different addresses. That is not enough for every device in the world. The 128 bits of IPv6 give 2128 addresses, far more than will ever be needed.
MAC address or IP address?
The MAC address belongs to the network card. It is set when the card is made.
The IP address is given by the network. It can change when the device joins a different network.
The router
A router joins networks together. In a home or a school it has three jobs.
It sends data to a specific destination on a network. It reads the destination IP address of the data and sends the data the right way.
It can assign IP addresses to the devices that join the local network.
It can connect a local network to the internet. All the devices at home share the internet through it.
Practise with new numbers
Try it in Python
The program splits a MAC address into its two codes and writes it in binary. It then writes an IPv4 address in binary and compares the number of IPv4 and IPv6 addresses.
Common mistakes
Mixing up MAC and IP. The MAC address is set at manufacture. The IP address is given by the network.
Writing an IPv4 number above 255. Each of the four numbers is 8 bits, so it goes from 0 to 255.
Saying IPv6 is written in denary. IPv6 uses hexadecimal groups separated by colons.
Saying a router makes MAC addresses. A router can assign IP addresses. MAC addresses come from the manufacturer.
Remember these
A computer needs a NIC to access a network.
A MAC address is given at manufacture, written in hexadecimal: a manufacturer code and a serial code.
An IP address is allocated by the network. It can be static or dynamic.
IPv4: 32 bits, four denary numbers with dots. IPv6: 128 bits, hexadecimal groups with colons.
A router sends data to a specific destination, can assign IP addresses and can connect a local network to the internet.
Check yourself
Try each one on your own first. If you are stuck, open a hint. Then check with Show the answer.
What does a computer need in order to access a network?
Which two codes make up a MAC address?
Is 12.300.4.8 a correct IPv4 address? Explain.
A laptop gets a different IP address each time it joins the school network. What type of IP address is this?
Give two jobs of a router in a home network.
References
Cambridge International, IGCSE Computer Science 0478 syllabus (2026, 2027 and 2028), section 3.4 Network hardware: the NIC, the MAC address, IPv4 and IPv6 addresses and the router.
Enroll free in Storage, the Cloud and Network Hardware
Every lesson is open to read. Enrolling also lets you:
Mark lessons done and carry on where you stopped.
Take the tests of this lesson and its course.
Count the course towards the certificate for its chapter.