Crossover cable or straight through between multiple hubs/switches

17

5

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

Matt

Posted 2018-09-12T04:14:49.000

Reputation: 507

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?

– Kamil Maciorowski – 2018-09-12T04:33:21.970

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 – 2018-09-12T04:35:15.643

@Matt Can you link us to the product page? I'd hope they're not actual hubs - the distinction is very important. – Bob – 2018-09-12T05:00:29.887

@Bob I went to go double check the page here ... I missed the part that said switch

– Matt – 2018-09-12T05:04:00.760

4It'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 – 2018-09-12T05:06:39.810

Answers

43

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".

user1686

Posted 2018-09-12T04:14:49.000

Reputation: 283 655

1Very 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 – 2018-09-12T04:58:39.293

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 – 2018-09-12T05:01:31.463

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 – 2018-09-12T06:50:49.523

@Ferrybig great point. Thanks for adding that! – Matt – 2018-09-12T07:26:40.577

Connect: PC - Switch - Switch - PC... if the PCs communicate, then great!... if not, you'll probably require a crossover cable (or try different ports) – Attie – 2018-09-12T08:03:45.623

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 – 2018-09-12T14:37:58.047

Hubs only work in half-duplex, so if your hosts work in full duplex, it's a switch (managed to crash the last 100 Mb hub in the company when I forgot this about 12 years ago). FWIW, the gigabit Ethernet spec. does not allow half-duplex. – grahamj42 – 2018-09-12T19:13:15.733

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. – JakeGould – 2018-09-13T11:30:22.153

7

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.

Appleoddity

Posted 2018-09-12T04:14:49.000

Reputation: 9 360

2Part 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 – 2018-09-12T09:01:03.640

2Nit-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. – Digital Trauma – 2018-09-12T23:20:45.510

@digitaltrauma ok. I’m not disagreeing, but do you have a reference on that regarding the default port mode? – Appleoddity – 2018-09-13T01:49:42.510

@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. – Digital Trauma – 2018-09-13T15:41:39.100

@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 – 2018-09-14T16:39:35.213