Short answer
Use an IP address to route a packet across networks, and a MAC address to identify an interface on a local link. RFC 791 fixes an IPv4 address at 32 bits. RFC 4291 fixes an IPv6 address at 128 bits. The IEEE Registration Authority describes 48-bit Universal LAN MAC addresses built from an assigned prefix plus bits the organization supplies.
Last verified against the sources listed below.
Key takeaways
- Cloudflare places IP at layer 3, where routers forward packets, and MAC at layer 2, where many switches forward frames.
- RFC 791 says an IPv4 address is four octets, 32 bits, with a network number and a local part.
- RFC 4291 says an IPv6 address is a 128-bit identifier for one interface or a set of interfaces.
- IEEE assigns an OUI in an MA-L. The holder adds 24 bits to make an EUI-48.
- IANA's IPv4 registry says the space was originally managed by IANA and later allocated to other registries.
IP address vs MAC address comes down to scope: use the IP address to route a packet across networks, and use the MAC address to name an interface on the local link.
The lengths come from the specifications, not from a vendor brochure. RFC 791, dated September 1981, sets an IPv4 address at four octets, 32 bits. RFC 4291 sets an IPv6 address at 128 bits.
The IEEE MA-L page says the OUI defined in IEEE 802 can generate 48-bit Universal LAN MAC addresses. How those packets move between networks is part of how the internet works.
Which layer each address uses
An IP address is a network-layer identifier for routing. A MAC address is a local-link identifier that switches use.
Cloudflare’s IP guide says IP is the set of rules for routing and addressing packets so they reach the right destination. Data is split into packets, an IP header is attached, and routers use that header.
The same page says most switches operate at layer 2, the data link layer, not layer 3, the network layer, and that they forward with MAC addresses rather than IP addresses.
Cloudflare also says the fourth version of IP was introduced in 1983, and that IPv6 addresses have many more characters because the supply of IPv4 addresses has been depleted. It does not restate the bit lengths. Those stay with the RFCs above. An address on that page is shown as a series of characters, with 192.168.1.1 as the example of the form, not as a special class of its own.
How long each address is
IPv4 is 32 bits, IPv6 is 128 bits, and a Universal LAN MAC address in IEEE 802 is 48 bits.
RFC 791 says an address begins with a network number and continues with a local address, called the rest field. The 1981 text splits that into classes: class A uses 7 network bits and 24 local bits, class B uses 14 and 16, and class C uses 21 and 8.
Later allocation practice is a registry question, not a change to the 32-bit width.
RFC 4291 says IPv6 addresses are 128-bit identifiers for interfaces and for sets of interfaces. It defines unicast, anycast, and multicast.
Unicast names one interface. Anycast names a set and delivers to one member, and multicast names a set that should receive the packet.
The IEEE page says an MA-L includes an OUI, previously called an Organizationally Unique Identifier, plus the right to build extended identifiers. Append 24 organization-supplied bits to form an EUI-48, or 40 bits to form an EUI-64. The page calls MAC-48 an obsolete term. The 48-bit form is what it describes for uniquely identifying stations on a local or municipal area network.
| Question | IP address | MAC address |
|---|---|---|
| Layer | Layer 3, the network layer, in Cloudflare’s account of routers | Layer 2, the data link layer, where many switches forward |
| Length | IPv4: 32 bits, four octets. IPv6: 128 bits | 48-bit Universal LAN MAC. EUI-64 uses a longer extension |
| Scope | Across networks, so a packet can be routed to a destination | A station on a LAN or MAN, per the IEEE 802 description |
| Who assigns the block | IANA’s registry, later allocated onward to other registries | IEEE Registration Authority assigns the OUI. The organization assigns the rest |
| Written form | Cloudflare’s example is 192.168.1.1 for IPv4 | Built as an EUI-48 or EUI-64 from an IEEE prefix |
Who assigns each one
IANA records IPv4 allocations. The IEEE Registration Authority assigns the MAC prefix, and the organization fills in the rest.
IANA’s IPv4 address space registry says allocations to regional internet registries follow a published global policy, and that other assignments require IETF Review. It says IANA originally managed the whole IPv4 space, and that parts were later allocated to other registries.
Rows in that table name ARIN, RIPE NCC, and APNIC, among other holders. One reserved row, prefix 010/8, is designated “IANA - Private Use”.
The IEEE page says the Registration Authority assigns an MA-L, which includes an OUI. That OUI is the prefix, and the organization that holds it supplies 24 bits for an EUI-48.
The page also says the OUI from IEEE 802-2001 can generate 48-bit Universal LAN MAC addresses for LAN and MAN stations, and it lists Ethernet (IEEE 802.3) and Wi-Fi (IEEE 802.11) among the related standards. A second OUI is not automatic: the assignee must ask and state that the earlier block is nearly fully shipped.
Cloudflare’s sentence on assignment is broader: every device or domain that connects to the Internet is assigned an IP address, and DNS resolvers turn names into those addresses. It does not name IANA. Use the registry for who holds a block, and use Cloudflare for the idea that the address is what routers deliver to.
Which to choose when
Choose the IP address when the problem is reaching a host on another network. Choose the MAC address when the problem is a station on the local link.
Choose an IP address when you are writing a destination that routers should follow, when you are talking about the address DNS returns, or when you are comparing IPv4 with IPv6. RFC 791’s job for the internet module is addressing and fragmentation, and it says the module maps an internet address to a local network address. That mapping is why both numbers exist on one hop.
Choose a MAC address when you are identifying a network interface for a LAN or MAN standard, when a switch is forwarding at layer 2, or when a manufacturer needs a block of EUI-48 values. The IEEE page is about that block assignment. It is not a routing protocol.
You normally keep both. The packet’s IP header carries the network destination Cloudflare describes, and the local delivery of that packet uses the MAC address the switch already understands.
Spoofing either identifier is an impersonation problem, which is why both show up in discussions of website security.
A site icon is unrelated. The favicon generator builds an icon file in the browser and does not assign either address.
Common mix-ups
The mix-ups are treating the two lengths as interchangeable, assuming a switch routes on IP, and assuming IANA stamps every MAC address.
- Quoting a 48-bit length for IPv4. RFC 791 says 32 bits. The 48-bit figure on the IEEE page is for a Universal LAN MAC address.
- Quoting 128 bits for a MAC address. RFC 4291’s 128-bit figure is for IPv6. An EUI-64 is an OUI plus 40 organization bits, which is a different construction.
- Expecting a typical switch to forward on the IP address. Cloudflare says most switches use the MAC address because they sit at layer 2.
- Treating
192.168.1.1as the definition of a private block. On the Cloudflare page it is only an example of how an address looks. The IANA row that says “Private Use” in the portion read here is 010/8. - Assuming the IEEE assigns every bit of the MAC address. It assigns the OUI. The organization assigns the remaining bits of the EUI-48.
Frequently asked questions
How many fields are in an IPv4 header?
Cloudflare's IP guide says an IPv4 header has 14 fields, and one of them is optional. The header includes the sending address, the receiving address, a time to live counted in hops, and the transport protocol, such as TCP or UDP. That field count is about the header, not about how many addresses a host may hold. RFC 791 separately fixes the address itself at four octets. A longer header does not make the address longer than 32 bits.
What is an EUI-64, and is MAC-48 still the name?
The IEEE MA-L page says an OUI can be extended with 24 organization-supplied bits to form an EUI-48, or with 40 organization-supplied bits to form an EUI-64. The same page calls MAC-48 an obsolete term. An MA-L is most often used to create IEEE 802 MAC addresses in both forms. EUI-64 is a longer identifier from the same kind of prefix, not a second IPv4.
Which IPv6 address kinds does RFC 4291 define?
RFC 4291 defines three kinds. Unicast identifies a single interface, and a packet sent there is delivered to that interface. Anycast identifies a set of interfaces, usually on different nodes, and the packet is delivered to one of them, the nearest by the routing protocol's distance. Multicast also identifies a set of interfaces, and the packet is meant for that set rather than for a single nearest member. Those three kinds are all 128-bit identifiers.
Who hands out blocks of IPv4 space?
IANA's IPv4 address space registry says allocations to regional registries follow a global policy, and that other assignments require IETF Review. The description says IANA originally managed all of the IPv4 space, and that parts were later allocated to other registries for particular purposes or regions. The table includes allocations and legacy entries for ARIN, RIPE NCC, and APNIC, among others. The registry lists blocks. It does not, by itself, name the DHCP server on a single home network.
Does a switch forward on the IP address?
Usually not. Cloudflare's IP guide says most network switches operate at layer 2, the data link layer, rather than layer 3, the network layer, and therefore forward using MAC addresses rather than IP addresses. Routers are the devices that use the destination IP to move a packet toward another network. A host still has both addresses in normal use: the IP is the network destination, and the MAC is what the local link uses for that hop.
Sources
- RFC 791: Internet Protocol · RFC Editor, 1981
- RFC 4291: IP Version 6 Addressing Architecture · RFC Editor, 2006
- MAC Address Block Large (MA-L) · IEEE SA, 2026
- What is the Internet Protocol? · Cloudflare, 2026
- IPv4 Address Space · IANA, 2026