A computer network connects computers together to share resources and exchange information. The main types of computer networks are personal area networks (PANs), local area networks (LANs), metropolitan area networks (MANs), and wide area networks (WANs). LANs are commonly used within offices and buildings to share printers and files between connected computers. WANs extend across broader areas like cities or countries using transmission lines and routers to connect distant LANs and allow communication between nonlocal computers. Common network hardware includes network interface cards, switches, routers, hubs, and gateways.