# 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 ![](https://i.imgur.com/F9GT5kf.jpg) 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 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**: ![](https://i.imgur.com/DBugNJp.jpg) * **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.