How does blockchain ensure that a closed loop in network is not formed? Suppose there are 9 nodes and each node can connect to 8 other nodes. All these 9 nodes connect to the 8 others. Then when a new node comes where does it connect to in this case? All the current nodes are full (connected to 8 other nodes).
Nodes have more than 8 connection slots, by default they have 125 maximum connections. There are 8 outbound connections, but can still have incoming connections from other nodes when all 8 outbound connection slots are full. So in your example, the new node can open a connection to any of the other nodes in the network because they all have available incoming connection slots.

Furthermore, because connections are classified as incoming or outgoing (but data is still bidirectional), at least 8 of the 9 nodes will have at least one more outgoing connection slot.



Also, your question has nothing to do with blockchains and is solely related to networking.