Port management for networks