Networking 101: the basics of computer networks and the internet
What is a computer network?
A computer network is multiple computers that are connected so that they can communicate data electronically. They are built from hardware (e.g., routers, switches, hubs) and software. Connections are made using cables, fibre optics, or WiFi.
Networks follow protocols which define how data packets are communicated between devices. Routers allow data to be communicated across different networks, while switches manage communication within a network. Devices each have a unique address which ensures data reaches the correct recipient.
The internet is a network of networks that connects devices worldwide. Communication is achieved using standard protocols.
Types of computer networks
There are different types of networks, some of which are defined by their geography. Some of the most common are:
- LAN (local area network). Connects computers across a single location (e.g., an office). They are usually privately owned.
- WAN (wide area network). Connects computers across different locations or worldwide (e.g., the internet).
- VPN (virtual provide network). A secure, encrypted channel which connects two endpoints.
Network infrastructure
There are several devices that can be used to build a network. These rely upon unique identifiers (MAC addresses or IP addresses) to determine the where to deliver data on the network. Some of these devices are:
- Nodes. Physical devices within networks which can create, receive, or send data (e.g., computers, printers, switches, etc).
- Routers. Link different networks together, forwarding data packets on to the correct network. They use IP addresses to determine the data’s destination.
- Switches. Forward data packets to network devices within the same network. They use MAC addresses to determine the data’s destination.
Network topology
Networks have a topology. This describes the physical arrangement of the elements of a network. Examples of different types of topologies are:
- Bus. Each device is connected to a single cable. All devices need to be geographical close together (e.g., in the same room) as the strength of the signal weakens along the cable.
- Ring. Each device is connected to its neighbour in a ring.
- Mesh. Each device connects to all other devices. While this is robust it has a lot of overhead and is, therefore, not common.
- Star. Each device connects to a centralised switch, which can be linked together. It is the most robust and scalable design and, therefore, the most used.
Network protocols
A network protocol is a set of rules for how data is communicated between devices on a network.
Data is sent between devices in data packets (also known as datagrams). These consist of raw data and a header; the header includes addresses of the sender and recipient. The arrival, content, and order of a data packet is not ensured.
Each network device (or host) has a unique identifier (or address). These are used to ensure data is sent to the correct destination. Examples are:
- MAC (Media Access Control) addresses. Unique identifiers assigned to every device during manufacturing.
- IP (Internet Protocol) addresses. Unique identifiers which define a device’s host network and location. They are assigned to every device using the Internet Protocol to communicate.
Ports are logical channels which allow data to be routed to a specific application or service within a host. They are identified by unique numbers. A combination of an IP address and port number specifies a particular service on a particular host.
Network communication protocols
Network communication protocols provide standards for creating and keeping connections between network devices. The following protocols are key to the functioning of the internet:
- TCP (transmission control protocol). Chunks data into packets which can be sent across an IP-based network.
- IP (internet protocol). Responsible for assigning sender and destination addresses to the header of a data packet.
- UDP (user data protocol). Used for establishing low-latency and loss-toleration in communications between applications.
- HTTP (hypertext transfer protocol). Uses TCP/IP to deliver webpage content from a server to a browser.
- FTP (file transfer protocol). Used to deliver files between computers on a network.
Network security protocols
There are also various protocols which increase network security and prevent cyberattacks like eavesdropping. Common examples include:
- SSL (secure socket layer). Creates an encrypted connection between a computer and the server over the internet.
- TLS (transfer layer security). The more robust successor to SSL.
- HTTPS (hypertext transfer protocol secure). Modifies HTTP to use TSL and encrypt the connection between the web browser and a server.
- SSH (secure shell). Provides an encrypted connection between computer and a server. It supports a variety of authentication methods.
Internet Protocol suite
The Internet Protocol suite (also known as TCP/IP) outlines how protocols can be combined to enable end-to-end communication between devices over an IP network. It has 4 layers:
- Application layer. Defines how network devices create and share data with other applications. It is concerned with using the appropriate protocol for the type of data being sent.
- Transport layer. Performs host to host communication.
- Network layer (or Internet layer). Responsible for exchanging datagrams across networks.
- Link layer. The networking methods which hosts use to communicate. It is the physical mechanism for sending digital data.
The internet protocol suite is the ‘Network Layer’ of the comprehensive OSI (open systems interconnection) model. This has 7 abstract layers which provide a standard for devices and systems to communicate with each other. In comparison to the Internet Protocol suite, it is more general; the modern internet more closely follows the Internet Protocol suite.
Useful resources
The information from this article was mostly gathered from the following resources:
- https://www.ibm.com/cloud/learn/networking-a-complete-guide
- https://medium.com/@computerscienceengineering/basics-of-computer-networking-6c7b961f4e14
- https://docs.microsoft.com/en-us/learn/modules/network-fundamentals/
- https://www.cloudflare.com/en-gb/learning/ddos/glossary/open-systems-interconnection-model-osi/
By Megan Slattery, Software Engineer