Difference between Swarm and Switch

On the doc’s glossary page it says that a Swarm is responsible for managing connections with peers and was later renamed to a Switch. However based on the source code, it looks like Swarm and Switch are used differently, where Swarm is kind of protocol-agnostic (and implements the network.Network interface) and Switch handles the routing of stream with certain protocol ID to its corresponding handler (and implements the protocol.Switch) interface. So I wonder why is it mentioned in the doc that they are the same but just different names? or did I misunderstand their functionality?

They’re synonymous, the decisions was made to change Swarm to Switch but the go code never made the transition. Since Go is the reference implementation, several of the other implementations also follow this model.

The docs site should be updated to clarify this, and should really just refer Swarm as the primary term, because we rarely use the term Switch when referring to the code. While the intent was to rename Swarm to Switch this hasn’t happened (aside from the original change in JS) and I don’t see it happening. In the Go implementation both Swarm and Switch act like switches, just at difference levels (a switch for routing all connections, and a switch for routing streams). I think it would be more helpful for the docs to talk about switch as a concept and then speak to its various usages in code (Swarm / Switch).

Thanks a lot for the clarification! Yea it definitely would’ve made more sense if the doc mentioned switch as a concept instead of an implementation.