Network devices like hubs, switches, routers, and firewalls are used to connect and secure computer networks. Hubs broadcast data to all ports but operate in half duplex mode, limiting network size. Switches can connect different network types but routers are needed to connect different network architectures using routing tables. Firewalls use rules and packet inspection to control incoming and outgoing network traffic for security. Intrusion detection and prevention systems monitor networks for threats but IPS can also block intrusions.