A computer network connects two or more devices together to share data. There are different types of networks including personal area networks (PANs) within a single building, local area networks (LANs) within an office or campus, metropolitan area networks (MANs) across a city, and wide area networks (WANs) across large areas like countries. Computer networks are built using both hardware like routers and switches, and software.