Creation and initialization of network.