According to Data Communications and Networking by Behrouz Forouzan, a packet switch has four components: input ports, output ports, routing processor, and switching fabric. The basic architecture looks like below
The switching fabric connects input port to output port, while the routing processor determines which connection should be made. But this assumes that there is a set of input ports and a set of output ports.
What if you want to connect an input port to another input port, or an output port to another output port? Because in reality, routers/switches don't have a set of input ports and set of output ports. Any port can connect to any other port. If a switch has eight ports, port 1 can connect to any of port 2 to port 8, and same with other ports. What am I missing here?