I'm networking a bunch of Raspberry Pis together on a subnet as shown in my highly technical diagram below: enter image description here

I'm wondering if the red cables are supposed to be crossover cables or straight through? The blue cables I'm quite sure are supposed to be straight through cables (but please correct if I'm wrong).

Also what if I were to swap out any of the hubs for switches, would that change whether I should be using crossover vs. straight through cabling anywhere?

Thank you

  • Is it a semi-permanent setup with cables in walls etc? Or just a bunch of devices on a table? If latter, I would use any good cables and count on Auto MDI-X. Or do you deliberately want/need to allow hubs without this feature? Sep 12 '18 at 4:33
  • I bought super cheap hubs from China so I'm honestly not even sure whether they have that feature. Is there a way to check? The setup does not have cabling in walls but it still needs to be permanent and reliable as it won't be me operating it and so I won't be on hand to fix any issues with cabling
    – Matt
    Sep 12 '18 at 4:35
  • @Matt Can you link us to the product page? I'd hope they're not actual hubs - the distinction is very important.
    – Bob
    Sep 12 '18 at 5:00
  • @Bob I went to go double check the page here ... I missed the part that said switch
    – Matt
    Sep 12 '18 at 5:04
  • 4
    It's definitely a switch, and the description below in that page actually explicitly mentions Auto-MDI/MDIX support, among various other switch-only features. (Slightly odd that the same page also says "Communication mode: Half-duplex" as opposed to full-duplex, but I guess they just copy-pasted whatever.)
    – user1686
    Sep 12 '18 at 5:06

Most modern hardware – Ethernet switches and computer Ethernet interfaces – implements Auto-MDIX, automatically choosing the correct mode for each physical connection. (This is now a required part of Gigabit Ethernet, but also very common among 100 Mbps ports as well.) In other words, you can use the same type – regular straight-through cables – practically everywhere.

Ethernet hubs, however, do not have this feature. They do not participate in link negotiation and only electrically connect all the devices. (Although your devices are probably switches mislabelled as hubs, not actual hubs.)

Without this feature, two hubs or switches (just like two computers) would have needed a cross-over cable. That is, unless one switch had a dedicated 'Uplink' port, which would accept a straight-through cable instead. (Sometimes the last port had a physical toggle button for this.)

I bought super cheap hubs from China so I'm honestly not even sure whether they have that feature. Is there a way to check?

The easiest way to find out whether it works is to connect all the devices together and see whether the 'link' indicator lights turn on on both ends, and whether you can actually send/receive packets between them. If it works, that means it works. (Ethernet ports are transformer-isolated, which I think means that you won't physically damage anything by just using the wrong kind of cable.)

Other indications:

  • If they are 1 Gbps switches, then at least the 1G ports will always have Auto-MDIX.
  • If the specs mention "Auto-Uplink", that's just another name for Auto-MDIX, so you're good.
  • If the specs mention "store and forward", that at least means you have a switch.

Note: do not buy actual hubs. You won't get any reasonable performance out of a hub (getting worse the more devices you have), and you will never have 1 Gbps support in a hub. (And they're not any cheaper than switches anymore.)

That said, what you bought is quite likely to be switches mislabeled as hubs, but be careful regardless. I mean, "super cheap" usually contradicts "permanent and reliable".

  • 1
    Very well explained, thank you. One follow up question - so because my so called 'hubs' do not have a dedicated 'uplink' port and I have successfully connected two computers to one another through that hub using straight through cabling only, that should confirm that the hub is actually a switch, correct?
    – Matt
    Sep 12 '18 at 4:58
  • 3
    @Matt: I'm not sure if it's a guarantee (try connecting at least 3 devices). But it's very likely to be a switch – because switches are so widespread that they almost became cheaper to make than hubs, while at the same time offering much better performance than hubs.
    – user1686
    Sep 12 '18 at 5:01
  • 7
    @matt You can test if its a hub vs switch by connecting at least 3 devices, and then sending a large file from PC 1 to PC 2, if the activity light on all pc's blink at the same rate, its a hub, if the activity on only 2 of the pc's blink in sync, it's a switch
    – Ferrybig
    Sep 12 '18 at 6:50
  • 2
    "hubs" do not "electrically connect all the devices together" (they decode and re-generate the signal, but do so in real time without buffering). There is no technical reason a hub could not support auto-MDIx through in practice they generally don't..
    – plugwash
    Sep 12 '18 at 14:37
  • 2
    @Matt Just to echo what others have said, basically brainless Ethernet hubs are relics of like 15 to 25 years ago. You might run into a situation where you need to be aware of a device being a hub or a switch if you are doing consulting in some godawful environment that has ancient hardware like that. But if you walk into most any store anywhere and just buy a cheap “hub” off of the shelf for like $15, chances are it’s a switch. The big difference nowadays is whether the switch is manageable like a router or unmanaged. Cheap “hubs” are just unmanaged switches. Sep 13 '18 at 11:30

Technically speaking, cross over cables are supposed to be used when connecting devices of the same “type” together. Like connecting 2 PCs together, or 2 switches together.

When connecting devices of different types together you use a straight through cable. Like when plugging a PC into a switch.

There are really only two different “types” of devices. A NIC in PC configuration and a NIC in router/switch/hub configuration.

For network communications to occur the transmit line on one end needs to connect to the receive line on the other end and vice-versa. The two types of devices use opposite transmit/receive pinout configurations and a straight-through cable is used to connect them. But when connecting the same interface type together a cross-over cable is necessary.

However, that is all technically speaking. In reality, Auto MDI-X has existed for 20 years and is included pretty much on every network interface that exists nowadays. The need for a cross-over cable is very rare, and is not likely necessary in your situation. This feature may also be called Auto uplink and trade, Universal Cable Recognition and Auto Sensing.

  • 2
    Part of why Auto-MDIX is practically everywhere is because 1000BASE-T no longer has separate transmit and receive lines. (All four pairs are bidirectional.)
    – user1686
    Sep 12 '18 at 9:01
  • 2
    Nit-pick - default router ports typically are in "PC configuration". I would change your 3rd paragraph to There are really only two different “modes” of ports. A port in host mode (e.g. PC, router) and a port in switch/hub mode. Sep 12 '18 at 23:20
  • @digitaltrauma ok. I’m not disagreeing, but do you have a reference on that regarding the default port mode? Sep 13 '18 at 1:49
  • @Appleoddity I'll try to look something official up, but my background is 17 years of working on just about every one of Cisco's router and switch product lines. Sep 13 '18 at 15:41
  • @Appleoddity: Consider that many dedicated routers do not have a built-in switch the way home combined routers do. They have some number of individual ports, which are often meant to be connected to a switch.
    – user1686
    Sep 14 '18 at 16:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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