If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

## AP®︎/College Computer Science Principles

### Course: AP®︎/College Computer Science Principles>Unit 2

Lesson 2: Connecting networks

# Computer networks

The Internet is the world's largest computer network. Let's break that down:
A computer network is any group of interconnected computing devices capable of sending or receiving data. A computing device isn't just a computer—it's any device that can run a program, such as a tablet, phone, or smart sensor.

## Building a network

The simplest computer network is two devices:
A diagram of the simplest computer network. Two computers are shown with a line connecting them.
A network like that only has to worry about a few things, like how to physically connect the two devices and how to send data over the physical connection in a format they both understand.
A diagram of a simple computer network. Three computers are shown with a line from one computer to the next.
Now there's additional complexity. How can each device know whether incoming data is meant for them or for their neighbor? This simple network will need an addressing scheme.
Let's jump to six devices. There are actually many ways we can connect six devices together in a computer network:
A diagram of 5 different network topologies for networks that each have 6 computing devices.
• The ring topology looks like a circle of connected devices, where each device is connected to two neighbors (one on either side).
• The mesh topology looks like a circle with lines inside it, showing that every device is connected to every other device.
• The star topology has a device at the center and then a connection between that center device and the other five devices.
• The bus topology shows a center line with connections coming off the line for each device. No device is directly connected to another device, but they are all connected via the central line.
• The tree topology starts with a single device at the top which branches to connect with two more devices. The left child device branches to connect with two more devices, while the right child only has one branch connecting it to a child device. There are three layers to the tree.
The top row shows the ring, mesh, and star topologies. The bottom row shows the bus and tree topologies.
Each of those arrangements is a different network topology, and each topology has its advantages and disadvantages.
Imagine the journey of a piece of data through one of those larger networks. What path will it take? When there are multiple paths, how does it know which path is best?
Once networks become larger, routing strategies become more important. There isn't a big difference between two stops and three stops in a path, but there is a big difference between 20 stops and 300 stops.

## Types of networks

We use different terms to refer to networks based on their size and characteristics. Let's touch on a few of them here.
The most common type of network is the Local area network (LAN), a network that covers a limited area like a house or school.
A diagram of a LAN. Five different computers are connected in a bus topology.
A LAN connected using a bus topology. The devices are connected with an Ethernet cable.
The largest type of network is a Wide Area Network (WAN), a network that extends over a large geographic area and is composed of many, many LANs. Oftentimes, the networks in a WAN can only be connected by leasing telecommunications lines from different companies, since no single company owns all the infrastructure across the wide geographic area.
A diagram of a WAN. Three LANs in different parts of Australia are connected in a ring topology.
A WAN covering the country of Australia and connecting three LANs with long-distance connections.
Another type of network is the Data Center Network (DCN), a network used in data centers where data must be exchanged with very little delay.
Based on those descriptions, what type of network is the Internet?

## Networking protocols

Whenever computing devices are connected together in a network, they need protocols to communicate with each other.
If the devices want to communicate over the Internet, they must use the Internet networking protocols. There are many networks that aren't connected to the Internet that also use the Internet protocols, due to how well designed they are for networking.
However, there are networks that use other protocols that are more suited for their task. Data center networks often opt to use networking protocols that take advantage of the incredibly closely knit architecture of the data center. That enables data centers to more efficiently run intensive algorithms, such as training a deep learning network.
As we go forward in this unit, we will focus specifically on the Internet protocols that power the majority of computer networks. In the future, networks might be using protocols that haven't even been invented yet. Fortunately, the concepts underlying the Internet protocols are relevant to all networked systems.

## Want to join the conversation?

• new lessons...where are the vidios?
• From the author:Hi Mohamed, I didn't make videos for most of the new topics, but I've gotten feedback that lots of folks would like videos, so I'll be working on video versions of the articles.
• gl on the ap test everyone...
• what does a network mean
• From above: "A computer network is any group of interconnected computing devices capable of sending or receiving data."
• Are the Internet and Network same?
• the internet is a group of connected networks (WAN). a network is a group of interconnected devices(LAN,PAN,MAN), as shown in the article above, so, no. they are not the same.
• I don't understand this statement:"Data center networks often opt to use networking protocols that take advantage of the incredibly closely knit architecture of the data center."
• I'm assuming that this means that the internet uses protocols that might not be as efficient as possible, but that better allow machines that might be far away from each other to connect. In data centers, they can use the most efficent protocols possible, because all of the connecting machines are squahed together, so distance between machines isn't a limiting factor. Hope this helps!
• how does the internet workkkk