So, I'm reading for a networking exam, and I'm just wondering if I have missed something basic. Is there a need for more ip addresses than MAC addresses, and how would a node with one network adapter be assigned many ip addresses in that case?
MAC addresses only need to be unique in a local broadcast domain, not globally, so re-use of MAC addresses in different networks usually isn't a problem.
The internet isn't one global broadcast domain and thus needs to be divided into many blocks of addresses assigned to different ISP's and each ISP divides his blocks into smaller blocks for different customers/services. To allow each of these smaller blocks to contain many MAC addresses you need to have the IP-space much bigger than the MAC address space.
Not all types of network interfaces use MAC addresses. MAC addresses are mostly associated with Ethernet, though quite a few other networking standards do use it. However, an IPv6 address can still be assigned to a network interface that doesn't use MAC addresses for Layer 2.
Also of note, a MAC address can be converted to an IPv6 host portion through EUI-64 conversion (mostly used for stateless autoconfiguration), by inserting the hexadecimal values FFFE between the leftmost and rightmost 24-bits of the 48-bit MAC address, and the seventh bit gets inverted.
So, for example, 0c:3a:bb:2a:cd:23 can be converted to the host portion of a stateless autoconfiguration IPv6 address. 0c in the above MAC addresses, represented as 0000 1100 in binary, would become 0000 1110 in binary or 0e in hexadecimal. Therefore the final EUI-64 host portion of the IPv6 address, converted from the MAC address, would be 0e:3a:bb:ff:fe:2a:cd:23.
Also, there's some layer 2 protocols with more than 48 bits in their MAC, for example Fibre Channel has 64-bit (or 128-bit apparently according to Wikipedia) as does FireWire (well, kinda), so they can fit in a /64 without the potential of overlap.
IPv6 SLAAC can only generate one address per prefix as it's using the MAC to generate a reasonably unique address. Privacy extensions can generate one or more pseudo-random addresses which are then checked for any overlaps on the local segment. Of course, local administrators can assign as many static addresses as they wish -- it's their job to ensure no overlaps.
[By reasonably unique I mean the likelihood of a collision is nil. And if it does, you'll have a layer-2 problem first! (two machines on the same segment with the same MAC)]
I think fundamentally it comes down to two key points.
- Internet addresses don't just need to be globally unique, they need to be globally routeable. Routing every machine's address individually would result in prohibitively large routing tables. The IPv6 designers had a dream of a hierarchical routing system* to keep routing tables small.
- The designers of IPv6 wanted stateless auto-configuration. Stateless auto-configuration requires the "host" part of the address to be large, to either accommodate an existing link address or to accommodate a random number large enough that collisions are very unlikely.
Put these points together and you need both the "host" and the "network" parts of an address to be large. Certainly more than 32 bits each. 64-bits each was probably overkill but better overkill than running out.
* The dream didn't really work out because the Internet is not a fixed hierarchy but this isn't about what actually happened in the 20 years or so since IPv6 was introduced, it's about what drove the design.