Kinnu

Networking and Web Basics

Networking concepts

In today’s interconnected world, the importance of networks grows daily. Nowadays, networking is the backbone of modern computing, enabling devices to communicate and share resources. Whether you’re streaming videos, sending emails, or accessing cloud services, networking makes it all possible.

Networking means any way in which two or more computers can be joined up to share data. A network could be anything from two PCs joined together by a USB, to the entirety of the internet.

Global networks. Image: Public domain via Freepik

The internet is the biggest network of all, and unless you’ve been living under a rock, you already know what it is and how important it is. The internet allows billions of devices all over the world to communicate with each other, massively augmenting the power of computers around the world.

The concept of networking extends far beyond the simple connection of two computers. It encompasses a vast array of technologies, protocols, and systems that work together to enable seamless communication between devices across the globe.

One of the fundamental aspects of networking is how information is actually transmitted. In most networks, data is broken down into smaller units called packets. These packets contain not only the data being sent but also information about where the packet came from, where it's going, and how it fits into the larger message. These packets are sent and interpreted according to rulebooks called protocols, which are the subject of the next orb.

The transmission of these data packets can occur through various media. In wired networks, this might involve electrical signals sent through copper cables, or light pulses sent through fiber optic lines.

Wireless networks, on the other hand, use radio waves to transmit data through the air. Each of these methods has its own advantages and challenges, and the choice often depends on factors like distance, required bandwidth, and environmental conditions. The most common wireless networks are Wi-Fi and cellular networks such as 5G.

When we talk about networks, we often distinguish between Local Area Networks (LANs) and Wide Area Networks (WANs). LANs typically cover a small geographic area, like a home, office, or campus. They're characterized by high-speed connections and are often under the control of a single organization.

WANs vs. LANs. Image: Gateway_firewall.svg: Harald Mühlböckderivative work: Ggia, CC BY-SA 3.0 <http://creativecommons.org/licenses/by-sa/3.0/>, via Wikimedia Commons

WANs, in contrast, span much larger areas, potentially connecting LANs across cities, countries, or even continents. The internet itself can be thought of as the ultimate WAN, connecting countless smaller networks worldwide.

To manage the complexity of network communication, networking is often conceptualized in terms of layers. The most well-known model for this is the OSI (Open Systems Interconnection) model, which defines seven layers of network functionality.

The OSI model. Image: Public domain via Cloudflare

At the bottom is the Physical layer, which deals with the actual transmission of bits over a physical medium. Above that is the Data Link layer, which handles direct node-to-node communication.

The Network layer comes next, managing addressing and routing across multiple networks. The Transport layer ensures reliable delivery of data between applications. The Session layer manages connections between applications, while the Presentation layer handles data formatting and encryption.

Finally, at the top is the Application layer, which provides network services directly to end-user applications.

While the OSI model is primarily theoretical, it provides a useful framework for understanding how networks operate. In practice, most networks use the TCP/IP model, which combines some of the OSI layers but follows similar principles.

Network performance is crucial in evaluating how well a network operates. Two key metrics for measuring performance are bandwidth and latency. Bandwidth refers to the maximum amount of data that can be transmitted over a network in a given period, usually measured in megabits per second (Mbps). A higher bandwidth enables faster data transfers, allowing for smoother streaming and quicker downloads.

On the other hand, latency measures the time it takes for data to travel from its source to its destination. Lower latency results in quicker response times, which is particularly important for real-time applications such as video conferencing and online gaming, where delays can disrupt communication or gameplay.

IPs and protocols

The internet is a vast network of interconnected computers that communicate with each other using protocols. Protocols are sets of rules that govern how data is transmitted and received. When a device receives raw data over an internet connection, it needs to have a rulebook for how to decode that data into something meaningful. That’s what protocols are there for.

One of the most fundamental protocols enabling this communication is the Internet Protocol (IP). Every device connected to the Internet is assigned a unique IP address, much like a postal address, ensuring that data sent from one device is decoded by the other device correctly.

IP address. Image: Public domain via IPXO.com

Initially, the Internet relied on IPv4 addresses, which offered around 4.3 billion unique addresses. However, with the rapid expansion of the Internet and the surge in devices like smartphones, tablets, and IoT (Internet of Things) devices, these 32-bit addresses are now in short supply.

To address this challenge, IPv6 was introduced. IPv6 uses 128-bit addresses, providing an almost limitless supply — approximately 340 undecillion or 3.4028*10³⁸ unique addresses. This represents 340 followed by 36 zeros. This ensures every device can have its own unique identifier on the Internet, supporting continued growth without the risk of running out of addresses.

When you type a web address into your browser, a series of events is set into motion to retrieve the desired webpage. This process begins with the Domain Name System (DNS), which functions like the Internet's phonebook. DNS translates human-readable domain names like “www.example.com" into numeric IP addresses that computers understand.

Once your computer knows the IP address, it uses the Hypertext Transfer Protocol (HTTP) to request the webpage from the server where the website is hosted. HTTP is the protocol that defines how messages are structured, transmitted, and how servers and browsers communicate to deliver the requested content.

The HTTP logo. Image: Public domain via Wikimedia

Once the server receives the request, it processes it and sends back a response. This response typically includes the requested webpage, like an HTML Hypertext Markup Language (HTML) with all its content. Alongside the webpage, the server sends status information that tells your browser if the request went smoothly or if there was a problem.

An example of a webpage written in HTML

For example, a "404 error" indicates that the specific webpage requested couldn’t be found, while a "200 OK" status means the request was successful and the webpage is being delivered as expected. Additionally, the server includes extra headers in the response. These headers provide more details about the response, like the type of content being sent or instructions on how long the browser should cache the webpage.

Image: Public domain via Unsplash

In addition to HTTP, several other protocols are essential for the Internet's operation. For example, the Internet Protocol (IP) handles the addressing and routing of data packets across networks, ensuring they reach their intended destinations. Working in conjunction with IP, the Transmission Control Protocol (TCP) ensures reliable, ordered, and error-free delivery of data between applications using IP networks. TCP is often paired with IP, forming the TCP/IP suite, which is the foundation of Internet communication.

Another important protocol is the User Datagram Protocol (UDP), which, unlike TCP, does not guarantee delivery or order, but prioritizes speed over reliability, making it faster and more suitable for applications like video streaming and online gaming, where speed is more critical than reliability.

The landscape of internet protocols is vast and constantly evolving. While we've explored some essential protocols, the realm of protocols extends far beyond. For instance, there exist next-generation HTTP protocols aimed at enhancing web page load times and efficiency.

They are also very important for the Internet of Things, which refers to physical devices, such as sensors, actuators, and other connected objects, that collect and exchange data over the internet, such as smart home devices (thermostats, lights, appliances), or wearable health monitors (fitness tracker, health monitoring devices).

A smart light switch. Image: Public domain via Pexels.

Emerging trends such as 5G networks are reshaping internet protocols with faster speeds, lower latency, and enhanced IoT device connectivity. As technology advances, so too do the protocols that underpin the foundation of our digital connectivity.

HTTP, URLs, and browsers

At the heart of the web experience are three key components: HTTP, URLs, and web browsers. These elements collaborate seamlessly to deliver the content we access, whether it’s news articles, videos, or online shopping platforms.

HTTP, or Hypertext Transfer Protocol, is essential to all data communication on the web. This protocol is used for transmitting hypertext requests and information between web servers and browsers. When you type down a web address into your web browser or click on a link, your browser sends an HTTP request to the server where the website is hosted. The server then processes this request and sends back the requested web page, which your browser displays.

When you send an HTTP request to a server, it includes a bunch of data such as the type of action you want to perform, the specific webpage’s URL you’re requesting, and additional information called headers that provide context about your request.

There are two primary types of requests your browser can make, a GET or a POST request. A GET request is used when you want to retrieve data from a server. For example, when you click on a link or enter a web address into your browser, it sends a GET request to fetch the webpage's content from the server. A POST request is used when you want to submit data to the server, such as when filling out a form or uploading a file. POST requests include the data being sent to the server along with the request.

One of the key features of HTTP is its stateless nature, which means that each request from a client to a server is treated independently, without any memory of previous interactions. This simplicity allows HTTP to scale efficiently across the web, but it also means that additional mechanisms such as cookies, which are data about previous interactions with a domain, are needed to maintain stateful interactions that enhance user experience, such as keeping a user logged in as they navigate a website.

An example of a cookies warning. Image: User centrics

In simple terms, HTTP requests are the way your browser talks to web servers to get or send information seamlessly. This process is what allows you to browse websites, fill out forms, and use web apps without any hassle. It's like a conversation between your browser and the server, where requests are made and responses come back with the information you need.

Hypertext Transfer Protocol Secure (HTTPS), is a protocol for secure communication over a computer network, particularly the internet. It ensures that data transmitted between your browser and the server is encrypted, providing a layer of security. This encryption, facilitated by SSL/TLS certificates, protects sensitive information such as passwords and credit card numbers from interception by malicious entities.

By authenticating the server and establishing a secure connection, HTTPS ensures that user data remains private and secure during transmission over the internet. The shift from HTTP to HTTPS has become increasingly important due to the enhanced security it provides. By adopting HTTPS, websites ensure that user data remains private and secure during transmission over the internet, maintaining trust and safeguarding online interactions against potential threats.

HTTPS. Image: Public domain via Pixabay

URLs, or Uniform Resource Locators, are the addresses you type into your web browser to access specific resources on the internet. A URL is composed of several parts: the protocol (e.g. HTTP or HTTPS), which dictates how the data should be transferred, the domain name (e.g. “www.example.com”), which identifies the server's location; and the path (e.g. /page1.html), which specifies the resource's precise location on the server.

URL structure by Noémie2602 (CC BY-SA 4.0) <https://creativecommons.org/licenses/by-sa/4.0>, via Wikimedia Commons

Additionally, URLs may include query parameters and fragments. Query parameters provide extra information to the server about the search, such as specifying filters or sorting criteria when shopping on e-commerce sites. For example, in the URL “www.example.com/products?category=electronics&sort=price” , “category=electronics” and “sort=price” are query parameters that refine the search.

Fragments, on the other hand, specify a specific section of the webpage to display after it loads, it automatically scrolls to or highlights a particular part of the page. This feature is particularly useful for navigating lengthy web pages efficiently. For example, the URL “www.example.com/about#team” directs the browser to automatically scroll to the section of the page that highlights information about the team.

Web browsers are the software applications that enable users to interact with web content. Popular browsers include Google Chrome, Mozilla Firefox, Microsoft Edge, and Safari. When you enter a URL, the browser interprets it to determine the protocol, domain, and path, then sends an HTTP request to the appropriate server. Upon receiving the data, the browser interprets HTML, CSS, and JavaScript to render the webpage.

Modern browsers offer features like tabbed browsing, bookmarks, and extensions to enhance the browsing experience.

A mobile browser. Image: Public domain via Pexels.

Understanding these components can help you troubleshoot common issues you might encounter while browsing the web. For example, if a web page fails to load, it could be due to a problem with the URL, such as a typo in the domain name or an incorrect path. Alternatively, the server might be down or experiencing high traffic, preventing it from responding to your HTTP request. In some cases, browser settings or extensions might interfere with the proper rendering of a web page.