Take the 2-minute tour ×
Network Engineering Stack Exchange is a question and answer site for network engineers. It's 100% free, no registration required.

Many moons ago, when I was just a wee bairn commencing my career, I had a job interview for a low-level developer role. Having at that time just learnt how CIDR was implemented, I was keen to show off my knowledge.

Sadly, that tactic didn't work out too well for me. I recall being completely floored by the very first question that was asked (and, then ruffled, it all went downhill). The question was:

Why are IPv4 addresses 32-bit?

I readily admitted that I didn't know the answer, but I did know that the original protocol design divided the address space into an 8-bit network number and a 24-bit host identifier—so I tried to rationalise it on the grounds that the protocol designers imagined an Internet of a few networks (after all, it was originally intended to link together a specific few) each comprising many hosts and, for simplicity of programming, kept everything aligned to byte boundaries.

I recall the interviewer being unsatisfied with my answer and suggesting to me that the real reason is because it's guaranteed to fit inside a long int in C, so simplifies implementation details. Being young and green at the time, I accepted that as a reasonable answer and (before today) hadn't thought any more of it.

For some reason that conversation has just returned to me and, now that I reflect upon it, it doesn't seem entirely plausible:

  1. Under the original addressing scheme comprising fixed-size network and host fields, it's unlikely that a developer would have wanted to assign the concatenation of the two fields to a single variable (I don't have access to any early IP implementations to verify what they actually did in practice); and

  2. At the time that work on TCP/IP began, C was neither standardised nor the de facto "lingua franca" of low-level software development that it has become today.

Was the interviewer's suggestion actually founded in fact? If not, what were the real reasons that the protocol designers chose 32-bit addressing?

share|improve this question
3  
Same reason why 640 kB ought to be enough for anybody. Nobody expected toasters and fridges to have internet access. –  afwe May 15 at 17:32
1  
@afwe: Hm. The question wasn't why didn't they choose a bigger number to begin with? aka why only 32-bits? (which is really the point that \@Jens' excellent answer addresses), but more what was so special about 32-bits (rather than, say, 16-bits or 24-bits or 48-bits)? –  eggyal May 15 at 18:01
    
@Downvoter: Care to comment? –  eggyal May 23 at 21:51
add comment

2 Answers 2

up vote 7 down vote accepted

Here's a link to a Hangout with Vint Cerf (Apr. 2014) where he explains how he thought that this internet was supposed to be an experiment only:

As we were thinking about the Internet (thinking well, this is going to be some arbitrary number of networks all interconnected—we don't know how many and we don't know how they'll be connected), but national scale networks we thought "well, maybe there'll be two per country" (because it was expensive: at this point Ethernet had been invented but it wasn't proliferating everywhere, as it did do a few years later).

Then we said "how many countries are there?" (two networks per country, how many networks?) and we didn't have Google to ask, so we guessed at 128 and that would be 2 times 128 is 256 networks (that's 8 bits) and then we said "how many computers will there be on each network?" and we said "how about 16 million?" (that's another 24 bits) so we had a 32-bit address which allowed 4.3 billion terminations—which I thought in 1974/3 was enough do to the experiment!

I had already posted this as a comment to Jens Link's answer, but I felt it shoud surface a bit more.

share|improve this answer
    
More than "surface a bit more", I think that this answers the actual question more directly than Jens's answer. –  eggyal May 19 at 8:21
add comment

Easy answer: because Vint Cerf decided so. He thought that he was designing an experimental protocol and considered 32-bits to be more than sufficient for that purpose; he did not expect IPv4 to be used in production systems and so no greater thought was given to the size of the address space.

At the Google IPv6 Conference 2008, he hosted a panel discussion titled What will the IPv6 Internet look like? during which he recounted:

The decision to put a 32-bit address space on there was the result of a year’s battle among a bunch of engineers who couldn’t make up their minds about 32, 128 or variable length. And after a year of fighting I said — I’m now at ARPA, I’m running the program, I’m paying for this stuff and using American tax dollars — and I wanted some progress because we didn’t know if this is going to work. So I said 32 bits, it is enough for an experiment, it is 4.3 billion terminations — even the defense department doesn’t need 4.3 billion of anything and it couldn’t afford to buy 4.3 billion edge devices to do a test anyway. So at the time I thought we were doing a experiment to prove the technology and that if it worked we’d have an opportunity to do a production version of it. Well — [laughter] — it just escaped! — it got out and people started to use it and then it became a commercial thing.

Transcript by Peter E. Murray.

share|improve this answer
6  
Agh, how foolish of me! Occam's razor strikes again. At least you have given me the smug satisfaction of knowing that the interviewer was wrong. –  eggyal May 15 at 15:43
2  
@user5025: Yes, it is possible (in the general case). But if Vint says those were his reasons for choosing 32-bits for IPv4, then it's hard to argue that he also had others. –  eggyal May 15 at 15:56
5  
@user5025: Okay, that's a fair point. Indeed, he mentions that the engineers were squabbling over what the length should be, with some advocating 32-bit. So I suppose the question is what were their motivations for advocating 32-bit (i.e. what made it acceptable to Vint)? –  eggyal May 15 at 16:15
2  
@eggyal: My point is not that 32 bit integers were "definitely" a motivating factor, but rather to suggest that I would consider it highly plausible that enough of the engineers suggesting that size might have considered that a factor that, absent evidence to the contrary, I don't think it could be ruled out as a factor in the eventual choice. –  supercat May 15 at 23:20
2  
@eggyal: You asked what might have motivated engineers to pick 32 bits. My intention was to answer that particular question. I've written a TCP/IP stack on "bare metal" and had to deal with addresses on various occasions but was never interested in parsing them--only in determining whether they matched [this particular stack only handled incoming TCP/IP connections, so it had to deal with ARP, but not gateways]. –  supercat May 15 at 23:32
show 11 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.