There are three main network topologies used to connect computers: bus, ring, and star. A bus topology has all computers connected to a single cable in a line. A ring topology connects each computer to the two nearest nodes in a circular configuration. A star topology connects each computer to a central device like a hub or switch. Hubs and switches are used to connect computers in a star topology network and operate at the physical and data link layers, while routers connect multiple networks and operate at the network layer.