The military's approach to that problem is to use color-coded cables and ports, and we already use things like 802.1x to prevent unauthorized devices from being attached to corporate networks. This is not a novel or unsolvable problem.