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?
-
2+1 despite it is obvious that MAC must be unique only for devices within one local network (connected to the same bus) whereas Internet layer consolidates all local networks into one global net whereby the fundamental design principle, divide an conquer, precisely prescribes that local networks be unaware of the local addresses within the other local networks to successfully communicate via global IP scheme, and furthermore, you can attach non-Ethernet based local networks to the Internet. So, I am interested to know what would be the answer if IP demanded Ethernet-only at the bottom level. – Val Jun 04 '13 at 17:24
-
1The transition from IPv4 to IPv6 was — and is — so slow and expensive that we don't want to face another transition ever again. 128 bits have reasonable chance to be enough "forever". http://tools.ietf.org/html/rfc1606 is a great humorous take on that ("As the IP **version 9** protocol comes to the end of its useful life, once again due to address space exhaustion, ...") – Beni Cherniavsky-Paskin Jun 04 '13 at 22:12
-
@BeniCherniavsky-Paskin, the transition is slow because NATs mitigate the need. Again, this shows us that we do not need the local address space to cover the global address space. – Val Jun 05 '13 at 10:48
5 Answers
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.

- 16,953
- 6
- 44
- 70
-
8Also because of aggregation. 48bits would be more than enough IP addresses (40k per person), but that would mean each router needs to look at flat table of over 2PB, that technology does not exist. – ytti Jun 04 '13 at 10:41
-
1@ytti: At least until we all have ip-enabled nanorobots in our bloodstreams – BlueRaja - Danny Pflughoeft Jun 04 '13 at 13:09
-
1They probably can use linklocal as only few of them would interface outside the local net. – ytti Jun 04 '13 at 13:09
-
Thanks for the explanation. I was under the assumption that MAC-addresses were globally unique, maybe I misunderstood the textbook, but then what happens when you get a MAC address collision in a local broadcast? Is it avoidable or is it just inconceivable? – Lorentz Vedeler Jun 04 '13 at 15:45
-
1On _paper_, they're supposed to be globally unique. However reality has been known to differ. – Ricky Jun 04 '13 at 19:23
-
4This would warrant another question. But MAC address is done from 24b or 36b OUI number you purchase from IEEE, which should be unique, but in practice to save 1300USD some people use other peoples OUI, or some people manufact NIC with non-unique MAC. While MAC address is 48b, it's actually just 46b, since 1 bit determines if it unicast/multicast and 1 bit if it is global/local, if local scope bit is on, then all bets are off for uniqueness. – ytti Jun 04 '13 at 19:25
-
It does seem odd that something that "usually isn't a problem" would be baked into a standard of such ubiquity. – jayjay Jan 10 '17 at 17:27
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.
-
1
-
I forgot about that part -- I edited my answer to reflect the information. Thanks for catching that :-) – WaxTrax Jun 04 '13 at 11:45
-
Silly script to do it automatically: ruby -e'EUI=(ARGV[1]);k=ARGV[0].delete(":.").scan(/.{6}/).join("fffe").scan(/../);k[0]="%02x"%(k[0].hex^0b10);p EUI+":"+k.join.scan(/..../).join(":")' 74:66:30:42:42:42 2001:67c:17a0:0 – ytti Jun 04 '13 at 11:52
-
The translation of MAC address to EUI-64 for use in IP allocation seems to be a later thing, the original IPv6 over Ethernet standard (RFC 2464) specified zero-prefixed MAC addresses. – Peter Green May 24 '18 at 15:48
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.

- 1,743
- 11
- 24
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)]

- 31,438
- 2
- 43
- 84
-
Afaict privacy extensions were an afterthought when people realised that MAC based autoconfig was a privacy nightmare. Not one of the driving forces in the design of IPv6 – Peter Green May 24 '18 at 14:50
-
Most of IPv6 is an afterthought... *Those who don't learn from history are doomed to repeat it.* – Ricky May 24 '18 at 19:11
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.

- 12,935
- 2
- 20
- 46