Skip to content

Instantly share code, notes, and snippets.

@zeroFruit
Created October 31, 2020 12:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zeroFruit/10878b3a9f6d9ef8371190448b68e645 to your computer and use it in GitHub Desktop.
Save zeroFruit/10878b3a9f6d9ef8371190448b68e645 to your computer and use it in GitHub Desktop.
Modeling the Internet from the scratch: Link-layer, LAN, Switch - Code snippet: Build network-1
func Build() (host1 *link.Host, host2 *link.Host, host3 *link.Host,
swch1 *link.Switch, swch2 *link.Switch) {
// setup node
host1 = link.NewHost()
host2 = link.NewHost()
host3 = link.NewHost()
swch1 = link.NewSwitch()
swch2 = link.NewSwitch()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment