Implemented network modes
Added a unit test for network modes