If you are willing to sacrifice one of the hub ports, FTDI has devices that talk UART over USB and have a bunch of IO-lines on them that support bit banging, ready to use. Advantage is that is only a single chip and most operating systems have drivers available.
I believe it is this one: http://www.ftdichip.com/Products/ICs/FT232H.htm
That way you can use one of the hub's USB ports to connect to the chip that can be programmed to control the outputs.
From the datasheet:
Bit Bang Mode.
The 2 nd generation device has a new option referred to as “Bit Bang”
mode. In Bit Bang mode, the eight UART interface control lines can be
switched between UART interface mode and an 8
- bit Parallel IO port.
Would be a nice fit with your option #2
You can have more than one root hub, so no, it is not the point where all hubs come together. It might be more convenient to think of root hub as one of the several starting points for enumeration.
Root hub is a piece of hardware. More specifically, it is a part of host controller (which itself can be either separate chip or a part of chipset).
The interfaces that you mention are Host Controller Interfaces (HCI), i.e. interfaces of host controller, not root hub. Basically they are registers that software can access in order to communicate with host controller.
From the above I don't think term "middleman" is applicable as you pictured it.
UPDATE:
Here is a simple analogue to illustrate to relationships:
A vehicle is a controller. It has an interface (pedals) that software (driver) can use to operate the controller. It also has an engine (root hub) that performs essential part of the car functionality.
You can say that driver operates an engine using pedals, and that would be correct but not precise, because there are quite a few parts between the pedals and an engine. These parts correspond to internal logic circuitry of the controller.
So, more precise statement would be "driver controls the car using pedals, steering wheel and a stick, and since engine is part of the car it does its job share in the whole driving process". In a computer terms that would translate into "software controls the host controller using HCI, and since root hub is part of the host controller it does its job share in supporting USB communication".
Best Answer
The hub to upstream computer will be capped at 5 Gbps. You can do 5 Gbps to one of the two devices at a time, or 2.5 Gbps to both devices simultaneously.
If you want to move data from one downstream hard drive (A) to another downstream hard drive (B), what you're really doing behind the scenes is reading data from hard drive A into host computer RAM, then writing from RAM to hard drive B. I don't think you can write directly from Hard Drive A to Hard Drive B with just a USB hub; you need some processor in the chain to tell the data where to go.
This will limit you to 2.5G Gbps reads from Hard Drive A and 2.5 Gbps writes to Hard Drive B, because the hub's max data rate is 5 Gbps total.
I don't think you can speed this up without using a second USB host controller on your upstream host computer. If Hard Drive A and Hard Drive B are both connected to a laptop directly, over two separate USB 3.1 hosts, then you could hit 5 Gbps reads from A and writes to B at the same time. The USB hub does create a bottleneck in your data rate.