Computer networks in 3D

A standing 3D poster of a star network: a central switch links to a server, printer, router and two hosts.Drag to turn

A computer network is a set of devices linked by cables or radio so they can exchange data. The data is split into packets and moved according to shared rules called protocols.

Devices, links and the basic parts of a network

A network connects hosts, which are devices that send or receive data, such as laptops, phones and servers. The links between them are usually copper cables, optical fibre or radio signals such as Wi-Fi. Copper carries electrical signals, and fibre carries pulses of light.

Two devices do the joining work. A switch connects hosts inside one local network and forwards data to the correct port. A router connects separate networks to each other and chooses where to send data next.

Packets, addresses and protocols

Data does not travel as one long stream. It is cut into packets, which are small chunks that each carry a header with the sender and destination addresses. Packets from one message may take different routes and are put back in order at the destination.

A protocol is an agreed set of rules for formatting and exchanging data. In the common internet model, IP handles addressing and routing. TCP sits above it and gives each byte of data a sequence number. The receiver acknowledges what has arrived, and the sender retransmits any data that is not acknowledged in time. Local networks usually use Ethernet or Wi-Fi to move packets between neighbouring devices.

Worked example: sending a file in packets

Suppose a file of 6,000 bytes is sent, and each packet can carry at most 1,500 bytes of data. The number of packets is 6,000 divided by 1,500, which is 4. If each packet also has a 40 byte header, each one is 1,500 plus 40, or 1,540 bytes long.

The total sent is 4 times 1,540, which is 6,160 bytes. The extra 160 bytes are the cost of addressing and control. If packet 3 is lost, its bytes are never acknowledged, so the sender retransmits that data after a timeout.

Common misconceptions

Wi-Fi is not the internet. Wi-Fi is a way to reach a local network by radio, and that network then connects onward to the internet through a router.

A packet does not follow a fixed path reserved for it, as a phone call on an old circuit network did. Each router usually decides the next step for each packet separately. Also, a higher link speed does not always mean faster page loads, because delay, called latency, matters as well.

Where networks appear

Networks run home Wi-Fi, school and office systems, and the internet itself, which is a very large collection of linked networks. Web browsing, email and video calls all depend on them. Many programs use the client-server pattern, in which one machine requests a service and another supplies it over the network.

Key terms

Host
A device that sends or receives data on a network.
Packet
A small chunk of data with a header holding addresses and control information.
Protocol
An agreed set of rules for how devices format and exchange data.
Router
A device that connects networks and forwards packets toward their destination.
Switch
A device that forwards data between hosts within one local network.
IP address
A number that identifies a host on a network for routing purposes.
Latency
The time a packet takes to travel from sender to receiver.

Common questions

What is the difference between a router and a switch?

A switch links devices inside one network and forwards data by device address. A router links different networks and chooses the route between them using IP addresses.

Why are messages split into packets?

Small packets let many users share the same links, and lost data can be resent without resending everything. Packets can also take different routes if one path is busy.

What does TCP add to IP?

IP delivers packets on a best-effort basis and may lose or reorder them. TCP numbers the bytes it sends and uses acknowledgements to detect losses. The sender retransmits missing data, so it arrives complete and in order.

Learn this with a tutor

Sidechair's AI tutor will teach this topic in 3D. Join the waitlist for early access.

We'll only email you about Sidechair. Read our privacy policy.