Crossover cable or straight through between multiple hubs/switches

9,376

Solution 1

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

Solution 2

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.

Share:
9,376
Matt
Author by

Matt

Updated on September 18, 2022

Comments

  • Matt
    Matt almost 2 years

    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
    Matt almost 6 years
    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?
  • user1686
    user1686 almost 6 years
    @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.
  • Ferrybig
    Ferrybig almost 6 years
    @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
  • Matt
    Matt almost 6 years
    @Ferrybig great point. Thanks for adding that!
  • Attie
    Attie almost 6 years
    Connect: PC - Switch - Switch - PC... if the PCs communicate, then great!... if not, you'll probably require a crossover cable (or try different ports)
  • user1686
    user1686 almost 6 years
    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.)
  • plugwash
    plugwash almost 6 years
    "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..
  • grahamj42
    grahamj42 almost 6 years
    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.
  • Digital Trauma
    Digital Trauma almost 6 years
    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.
  • Appleoddity
    Appleoddity almost 6 years
    @digitaltrauma ok. I’m not disagreeing, but do you have a reference on that regarding the default port mode?
  • Giacomo1968
    Giacomo1968 almost 6 years
    @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.
  • Digital Trauma
    Digital Trauma almost 6 years
    @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.
  • user1686
    user1686 almost 6 years
    @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.
  • Admin
    Admin about 2 years
    is there any way that switch work for first time and after a while make some interferences on connections ?
  • Admin
    Admin about 2 years
    another questions is in Cisco switches(like 2960g or 3560s or other models) that port not configured for trunk usage or not use crossover cable and use straight cable make network unstable ?