Why the near uniformity in the number of router/switch ports?

Clearly there are exceptions, but almost every router I’ve seen has four Ethernet ports. Most switches have either five, eight, twelve, and up (haven’t really explored larger switches). Is there a reason for this? Is it confirmation bias on my part? Marketing reasons? Some esoteric networking reason that is beyond my comprehension? That is, is it akin to why you see memory increments of 128, 256, 512?

  • and so computer hardware engineers as well as network engineers tend to look at 8, 16, 32 etc. as nice, round numbers. I can confirm that the trend continues into the larger chassis-based switches - your typical Cisco wiring closet switch will come with 48-port modules.

In the olden days (we’re talking hubs, here), you could conceivably design (for instance) Ethernet collision detection circuitry by gating together the right port leads. That sort of design lends itself very well to port numbers that fit with base 2.

Nowadays, I don’t think there’s any strict technical reason for it, beyond the fact that it’s the industry standard.

To my knowledge, and I might be wrong…

The size of the board used in the router is about seven inches long. When you put in the power supply, the casing, etc., you are left with enough room for 4 ports. Its just a size thing.

I’d suggest you’ve got cause and effect backwards here.

I’ll bet that devices with 8 ports have boards that are just big enough for all the components, too.

Yep, like Spiny Norman says, it’s a base-2 thing. Absent some compelling reason to use a different number, arrays of things in hardware design will tend towards powers of two for the simple reason that it makes designing the hardware (and firmware and software) easier. If you have four ports, you can address them with just two bits, or two dedicated wires on a bus, or what have you. (Two bits of data allows for four unique combinations (2^2 = 4), enough to assign a different number to each port.) If you wanted 5 ports, you would need 3 bits to uniquely identify them, but 8 ports would only require 3 bits as well; it’s inefficient to use numbers that aren’t powers of two, because you either have to waste bits or complicate your digital logic.

Granted, this isn’t so critical as it was in the past, but it’s still enough of a factor that things in general tend to be simplified if you stick with powers of two (or multiples of powers of two, like the 48-port switches Spiny Norman referred to).

I don’t think it’s a power of two thing at all. Any router is going to be using at least an 8 bit addressing system, one because everything talks in 8 bit increments and translating it down to 2 bits just isn’t worth the effort and two because you want to leave room for future expandability so you don’t have to rewrite the firmware when you come out with a 5 port model.

Because if you take two 4-port banks and put them next to each other, you get 8-ports. If you put two 8-port sets above each other, you get 16.

There’s no basis in base-2 numbering that governs the number of physical jacks. The relevant factors limiting how many things you an plug in are the class of your network and the subnet mask.

Beyond that, the people who make jacks as electrical components have RJ45 jacks pre-fab in one module and ready to go in blocks of four or eight. If you want to be a rebel and build a nine-port switch, I won’t stop you, but the cost of having jacks custom-made might.

What are you talking about? These things have no relevance whatsoever to the number of physical ports on network hardware.

Well wouldn’t exceeding 255 on one device get kinda messy.

Yes, but if you think that has anything to do with the class of network or the subnet mask, you’re mistaken.

It’s obviously not a power-of-two thing, since there are plenty of 12- and 24-port network devices on the market. It is more likely a “that’s how blocks of RJ45s come” thing, as gotpasswords suggests. The ports are likely to be arranged in a rectangle, so that rules out prime numbers. They are, further, likely to be composed of smaller rectangles, and small rectangles tend to be even in nature - 4, 6, 8.

I’m still baffled. This question actually arose as I was looking for a Gigabit switch – my current hub has five ports, and the baseline number of ports seems to be five. (Sounds much better if you read that in a Pythonesque voice.)

The next jump is eight. Not six. Not seven. (Nine is right out.) Eight. All of them, all manufacturers. I still don’t get it.

I’m sorry if I sound rude but that’s completely wrong. The ports are generally identified by their MAC address which is (IIRC) 48 bits. Besides masking 8 bits down to 2 is a simple microprocessor instruction. A couple of nanoseconds max.

The likely reason has already been mentioned - powers of two. When building early devices it was necessary to use discrete logic (as opposed to large scale ICs or CPUs) and most relevant ICs had gates as a power of two e.g. Octal AND or hex buffer.

It was down to cost and technology, as with most things.

Tim

I think it’s a conspiracy that intentionally mismatches the number of ports and hot dog buns, so we end up buying more buns.
In all seriousness, this is a bit of a “why ask why” question. Ports definitely sometimes come in blocks of 4 or 8, which will influence the design of your router. But why the ports come in blocks of 4 or 8 most likely has to do with the design of a specialized chip that can control a power-of-two number of ports, and that design decision was made partially because it is most efficient to build things in powers of 2 in computers, and whether or not that is even remotely important, that’s just how computer engineers do things.

As for 24 or 48 port switches, the obvious explanation is that it’s 3 seperate units of 8 or 16 packaged together in one box because that’s how much they had room for. If you google around for an image of a Cisco 2924 catalyst switch, for example, you’ll see that it’s got 24 ports, but they’re arranged in 3 groups of 8.

I said it was at least 8 bits, not exactly 8 bits. And while masking down to 2 bits would be trivial performancewise, it’s completely unnecessary and adds scope for bugs and future incompatibilities. I would be almost certain there’s nothing inside the router which knows it’s an inherently 4 port router. If you asked tomorrow for a 31 port router to be built, it would simply be a matter of taking the same firmware and flipping a single variable.

The individual ports on a switch or router do not tend to have their own MAC addresses. The device would have an address, not the ports.

They certainly do have MAC addresses on each switch port. It’s the mechanism by which the switch core transmits data. I’m on an iPhone atm so can’t paste a cite but google has plenty.

Tim