Today we had some network problems and after some nested-interval trial and error we tracked down a small 4-port hub where someone had connected both ends of a patch cable to the same hub.
After removing that, everything went ok again.
My question: What happens from a hardware point of view?
Obviously there's nothing fried, and there were no error indicators lit on the main switch or the hub. But it seems there were packets broadcasted over the whole network.
You create a "L2 Loop". Basically what happens is that broadcasts go out of one end of the cable and in the other looping back into the network. You therefore create a broadcast storm that will most likely render your network either really slow or unusable.
Nothing happens hardware-wise I reassure you. You can protect yourself of such problems with Spanning Tree or Etherchannel.
Probably the hub automatically worked out the correct wires to send over - most are auto-detecting these days, to handle cross-over cables, and being connected to computers or other hubs.
If this happens then each port of the cross connected ports sees that it's connected to (another) hub, and resends all the traffic it receives from that port to all the other ports.
This causes a storm of traffic which kills the network.
Any network where you don't control all the ports on the network has 3 different but related problems potentially caused by your non-technical end users.
an end user connects 2 of your ports together.
An end user can put a switch on your network and loop two of those ports.
An end user can put a switch on your network and connect 2 ports of that switch to 2 ports on your network
If you've got managed switches, you may be able to use a loop prevention protocols like spanning tree to prevent 1 and 3, though that introduces other problems that you have prevent, such as an end user injecting spanning tree control packets into your network, but that's a slightly more esoteric problem.
Limiting broadcasts on a per-port basis is the only way of preventing case 2. This article describes configuring broadcast storm control on a cisco 2950. It limits the broadcasts and sends an SNMP trap to notify you of the problem.
If your network is made up of dumb L2 devices, your in quite a bit more trouble. The only way you can do fault isolation is to keep partitioning the network until you isolate the problem. Chop it in half -- which half has the problem? Okay, the offending port is on one of those 3 devices... Disconnect the uplinks on each of those until you find the device with the bad port, and so on.
I've seen this also on a non-managed switch. There were 2 network jacks on the wall, and someone had seen a network cable hanging out of one, and thinking it belonged in both, plugged it in. This happened late in the day, so we spent the entire night troubleshooting the issue with the network being completely unusable.