A Complete Guide to Computer Networking: Practical Guide with OSI Model

A Complete Guide to Computer Networking: Practical Guide with OSI Model

Context and Building Up

Welcome to the ultimate guide to computer networking. Get ready to dive deep into the realm of routers, protocols, and data packets, as we unravel the mysteries behind how computers communicate and collaborate. Whether you're a tech enthusiast, a curious learner, or simply someone who wants to understand the magic that powers our interconnected world, this comprehensive guide will equip you with the knowledge you need to navigate the vast landscape of computer networking.

Let's embark on this epic quest to unravel the origins and evolution of computer networking, where the clash of nations and the thirst for being number one set the stage for an internet revolution like no other.

Introduction

The Birth of ARPANET: A Battle of Satellites and Egos: Picture this: It's the 1950s, and the United States and the Soviet Union are locked in a fierce competition to outdo each other. The Soviets launch the first satellite, Sputnik, into space, leaving the Americans feeling a tad bit salty. In response, the USA decides to create something equally mind-blowing – ARPA (Advanced Research Projects Agency). It's like they said, "Oh, you launched a satellite? Hold my coffee!"

ARPA's mission? Connect computers across different locations and show the world who's boss. They picked four prestigious institutions – MIT, Stanford, UCLA, and the University of Utah – to be the chosen ones. These places became the birthplaces of ARPANET, a network that would make the Internet what it is today.

While ARPANET laid the foundation for computer networking, it lacked a crucial element – the ability to navigate through interconnected documents effortlessly. Imagine sending a document without the convenience of a hyperlink that redirects you to another document. This limitation was overcome by the ingenious mind of Tim Berners-Lee, who introduced the World Wide Web (WWW).

The World Wide Web, a vast repository of interconnected documents, granted each document a unique identity under the prefix "www," making them universally accessible on the internet. These documents found their home on web servers scattered across the globe, forming the backbone of the digital landscape we know today.

However, in the early days of the internet, a significant challenge persisted – the absence of a search engine. Imagine a world where you couldn't search for specific information but had to navigate from hyperlink to hyperlink, exploring the vast expanse of the web. It was during this time that the first search engine, Yahoo, emerged, revolutionizing the way we seek knowledge and navigate the digital realm.

The Internet Society: Behind the scenes, governing and shaping the Internet's growth, lies the Internet Society. This organization plays a vital role in establishing rules, regulations, and standards that ensure the smooth functioning and security of the Internet. With their guidance, the internet continues to evolve, adapting to the ever-changing needs of our interconnected world.

Client-Server Architecture

Client-server architecture is a common model used in computer networking, and Google's example can help illustrate how it works.

In client-server architecture, the client and server are two separate entities that communicate with each other over a network. The client, in this case, is your computer or device, and the server is Google's web server.

When you visit a website like Google, your computer acts as the client. You enter the URL (e.g., http://google.com) in your web browser, and your browser sends a request to Google's server, asking for the webpages you want to access.

The request from the client includes information such as the type of request (e.g., GET request for retrieving webpages), the URL, and any additional parameters. This request is sent over the internet to Google's server.

Google's server receives the request and processes it. It searches for the requested webpages or performs any necessary computations or data retrieval. In this case, the server searches for the Google homepage and related webpages.

Once the server has processed the request, it sends back the requested webpages as a response to the client. The response typically includes the HTML, CSS, and JavaScript files that make up the webpage. The server may also include additional data or resources, such as images or scripts, if required by the webpage.

Upon receiving the response, the client (your computer) renders the webpage using the received HTML, CSS, and JavaScript files. Your web browser interprets the code and displays the webpage on your screen.

It's important to note that client-server architecture is not limited to web browsing. It is a fundamental concept in networking and can be applied to various scenarios. For example, your computer can act as a server when you share files or resources with other devices on a local network. In this case, other devices act as clients and request data or resources from your computer's server.

In summary, client-server architecture involves the client (your computer) sending a request to the server (Google's web server) for specific webpages. The server processes the request and sends back the requested webpages as a response. Your computer acts as both a client and a server, depending on the context and the services you provide or consume.

Wired or Wireless: Understanding Network Types

Let's delve into the key characteristics of these network types.

Wired Networks: The Power of Physical Connections

Wired networks rely on physical connections, such as Ethernet cables, to establish communication between devices. Think of them as interconnected highways, with data flowing through the cables like vehicles on a well-organized road system.

One essential concept in wired networks is the IP address. Each device connected to the network is assigned a unique IP address, acting as its digital identity. When you send a request for information, it travels through the network, reaching the destination device based on its IP address.

To ensure the response reaches the correct device, we have the Network Address Translator (NAT). This clever mechanism resides in your modem and acts as a translator, keeping track of which device made the request. It ensures that the response finds its way back to the right recipient, like a diligent postal service delivering mail to the correct address.

Efficient communication in wired networks is facilitated by port numbers. These 16-bit numbers act as gateways for specific types of data. For example, HTTP traffic, which powers web browsing, flows through port 80. Similarly, MongoDB, a popular database system, operates on port 27017.

While some ports are reserved for specific applications, there is a vast range of unregistered ports available for general use. Developers can assign these ports to their custom applications and services, fostering innovation and experimentation.

Wireless Networks: Embracing the Freedom of Connectivity

Wireless networks have revolutionized connectivity, offering flexibility and mobility. They eliminate the need for physical cables, allowing devices to communicate without constraints.

Bluetooth, Wi-Fi, 3G, 4G, LTE, and the latest addition, 5G, employ radio waves to transmit data over the airwaves. Bluetooth enables short-range connections, ideal for devices like headphones and keyboards. Wi-Fi provides broader coverage, allowing multiple devices to connect to a network within a specific range.

Mobile networks like 3G, 4G, LTE, and 5G enable wireless connectivity on the go, providing internet access and communication capabilities to smartphones and other mobile devices. These technologies have transformed the way we stay connected, enabling us to access information and communicate virtually anywhere.

Types of Topologies

LAN to WAN Connectivity: LAN (Local Area Network) refers to a network that covers a small geographical area, typically within a building or a campus. WAN (Wide Area Network), on the other hand, covers a larger geographical area and connects multiple LANs together, often spanning across cities or even countries.

To connect a LAN to a WAN, you typically need a modem and a router. The modem converts the digital signals from the LAN into analog electrical signals that can be transmitted over a wide area network. The router then routes the packets based on their IP addresses, allowing the LAN devices to communicate with devices on the WAN.

Network Topologies: Network topologies define the physical or logical layout of a network. Here are some commonly used network topologies:

  1. Bus Topology: In a bus topology, all devices are connected to a single communication line, known as a bus. Each device can transmit data onto the bus, and all devices on the network receive the data simultaneously. However, if the bus fails, the entire network can be affected.

  2. Ring Topology: In a ring topology, devices are connected in a circular manner, forming a closed loop. Each device is connected to two neighboring devices, and data travels in one direction around the ring. If one device or connection fails, it can disrupt the entire network.

  3. Star Topology: In a star topology, all devices are connected to a central device, such as a switch or hub. Each device has a dedicated connection to the central device, allowing for easy management and troubleshooting. If one device or connection fails, it does not affect the rest of the network.

  4. Tree Topology: A tree topology is a combination of bus and star topologies. It consists of multiple star topologies connected together in a hierarchical structure. This allows for scalability and flexibility in network design.

  5. Mesh Topology: In a mesh topology, every device is connected to every other device in the network. This provides redundancy and multiple paths for data to travel, increasing reliability. However, it can be costly and complex to implement, especially in large networks.

These are just a few examples of network topologies, and there are other variations and hybrid topologies as well. The choice of topology depends on factors such as network size, scalability, fault tolerance, and cost considerations.

The OSI Model

The OSI (Open Systems Interconnection) model is a conceptual framework that standardizes the functions of a communication system into seven different layers. Here is a breakdown of each layer:

  1. Application Layer: This layer is implemented in software and includes applications such as web browsers, messaging apps, and email clients. It interacts directly with the end-user and provides services for network applications. It sends data to the presentation layer.

  2. Presentation Layer: The presentation layer takes the data received from the application layer and converts it into a machine-readable format. It may involve tasks such as data encryption, data compression, and data formatting. The encryption ensures that only the intended recipient can interpret the data. The SSL (Secure Sockets Layer) protocol is often used for secure communication.

  3. Session Layer: The session layer establishes, manages, and terminates communication sessions between applications. For example, in online shopping, a session is created when a transaction begins and ends when the transaction is completed.

  4. Transport Layer: The transport layer defines the protocols and mechanisms for data transfer between network devices. It ensures reliable and efficient data delivery by segmenting the data into smaller units, assigning sequence numbers to the segments, and reassembling them at the receiving end. Error control mechanisms, such as checksums, are also implemented at this layer for error detection.

  5. Network Layer: The network layer is responsible for routing and forwarding data packets between different networks. It uses logical addressing (such as IP addresses) to identify the source and destination of the data. Routers operate at this layer to direct the data to its intended destination.

  6. Data Link Layer: The data link layer provides reliable data transfer between two directly connected nodes over a physical link. It is divided into two sublayers: the Logical Link Control (LLC) sublayer and the Media Access Control (MAC) sublayer. The LLC sublayer allows the upper layers of the OSI model to access the data link layer services, while the MAC sublayer handles the physical addressing (MAC addresses) and controls access to the physical medium.

Physical Layer: The physical layer is responsible for the actual transmission of raw bit streams over a physical medium, such as copper wires, fiber optic cables, or wireless signals. It deals with the electrical, mechanical, and functional aspects of the physical connection.

Understanding Application Layer in TCP/IP Protocols

The Application Layer is the topmost layer in the TCP/IP model. It is responsible for providing services directly to the end-users and enabling them to interact with various applications. Examples of applications that operate at this layer include web browsers, email clients, instant messaging apps like WhatsApp, and file transfer protocols.

The Application Layer is where users directly interact with the network through their devices. It provides a platform for applications to communicate with the underlying network layers. This layer defines the protocols and standards that applications use to exchange data. Some commonly used protocols at this layer include HTTP (Hypertext Transfer Protocol) for web browsing, SMTP (Simple Mail Transfer Protocol) for email communication, and FTP (File Transfer Protocol) for file transfers.

The Application Layer supports both client-server and peer-to-peer (P2P) architectures. In a client-server architecture, applications on user devices (clients) request services or resources from dedicated servers. Examples of client-server applications include web browsing and email. On the other hand, P2P architecture allows applications to connect directly to each other without the need for dedicated servers. This decentralized network model enables rapid scaling and is commonly used in applications like BitTorrent, where users share files directly with each other.

Overall, the Application Layer plays a crucial role in enabling user interactions with various applications and facilitating the exchange of data between devices in a network.

Network Devices

Network devices are essential components that enable communication and data transfer within a computer network. Here is a brief description of each device:

  1. Repeater: A repeater is a network device used to amplify or regenerate signals to extend the reach of a network. It receives a weak signal, cleans it up, and retransmits it, effectively increasing the network's coverage area.

  2. Hub: A hub is a simple network device that connects multiple devices in a network. It operates at the physical layer of the network and broadcasts incoming data to all connected devices. However, it does not perform any intelligent routing or filtering of data.

  3. Bridge: A bridge is a device that connects two or more network segments or LANs (Local Area Networks). It operates at the data link layer and uses MAC addresses to forward data packets between different network segments.

  4. Switch: A switch is a more advanced version of a bridge. It connects multiple devices in a network and uses MAC addresses to forward data packets to their intended destinations. Unlike a hub, a switch can intelligently route data to specific devices, improving network performance.

  5. Router: A router is a network device that connects multiple networks together, such as LANs or the Internet. It operates at the network layer and uses IP addresses to forward data packets between different networks. Routers can determine the best path for data transmission and perform functions like network address translation (NAT) and firewalling.

  6. Gateway: A gateway is a device that acts as an entry or exit point between two different networks. It can translate protocols, perform data conversions, and provide access to external networks, such as the Internet.

  7. Brouter (Bridging Router): A brouter is a hybrid device that combines the functionality of a bridge and a router. It can connect different network segments using bridging techniques and also route data between networks using routing techniques.

These network devices play crucial roles in establishing and maintaining efficient communication within computer networks.

Relevant Terminology about Web Protocol

  1. TCP/IP (Transmission Control Protocol/Internet Protocol): TCP/IP is the foundational protocol suite for the internet. It provides reliable, connection-oriented communication between devices on a network.

  2. HTTP (Hypertext Transfer Protocol): HTTP is the protocol used for transmitting hypertext over the internet. It is the foundation of data communication for the World Wide Web.

  3. HTTPS (Hypertext Transfer Protocol Secure): HTTPS is the secure version of HTTP. It adds an extra layer of security by encrypting the data transmitted between a web server and a client.

  4. DHCP (Dynamic Host Configuration Protocol): DHCP is a network protocol that automatically assigns IP addresses and other network configuration parameters to devices on a network.

  5. FTP (File Transfer Protocol): FTP is a standard network protocol used for transferring files between a client and a server on a computer network.

  6. SMTP (Simple Mail Transfer Protocol): SMTP is an internet standard protocol for sending email messages between servers. It is used for outgoing mail delivery.

  7. POP3 (Post Office Protocol version 3) & IMAP (Internet Message Access Protocol): POP3 and IMAP are email retrieval protocols. POP3 allows users to download emails from a mail server to their local device, while IMAP allows users to access and manage their emails directly on the mail server.

  8. SSH (Secure Shell): SSH is a cryptographic network protocol that provides secure remote access to a computer or server. It allows users to securely log in and execute commands on a remote machine.

  9. VNC (Virtual Network Computing): VNC is a graphical desktop-sharing system that allows remote control of another computer over a network. It enables users to view and interact with the desktop of a remote computer.

  10. Telnet: Telnet is a network protocol used to establish a remote terminal connection to a device or server. It allows users to access and manage a remote device or account through a command-line interface.

  11. UDP (User Datagram Protocol): UDP is a connectionless protocol that provides a lightweight and fast method of communication between devices on a network. Unlike TCP, UDP does not guarantee reliable delivery of data.

Ports and Protocol

Ports: In simple terms, ports are like doorways that allow different applications on a computer to communicate with each other. Each application uses a specific port to send and receive data. When an application is not using a port, it becomes free and available for other applications to use.

Ephemeral ports: Ephemeral ports are a range of temporary ports that are dynamically assigned by the operating system to client applications when they initiate a connection with a server. These ports are used for the duration of the communication and are released once the connection is closed. Ephemeral ports are typically used to establish outgoing connections from a client to a server.

HTTP Protocol: The HTTP (Hypertext Transfer Protocol) is a client-server protocol that defines how information is requested and exchanged on the World Wide Web. It specifies the format of the requests made by a client (such as a web browser) to a server, and how the server responds to those requests. The HTTP protocol supports various methods, including GET (retrieve data), POST (send data), and more, which allow clients to interact with servers and retrieve or send information.

HTTP and Statelessness: HTTP is considered a stateless protocol, which means it does not store any information about the client or the previous interactions between the client and the server. Each request made by the client is treated independently, without any knowledge of previous requests. This is why web applications often use techniques like cookies or session management to maintain stateful behavior and remember information about the client across multiple requests.

HTTP Methods and Error Codes

The four commonly used HTTP methods are:

  1. GET: This method is used to retrieve data from a specified resource. It is a safe and idempotent method, meaning it should not have any side effects on the server and can be repeated multiple times without changing the result.

  2. POST: This method is used to submit data to be processed to a specified resource. It is not idempotent, meaning multiple identical requests may have different effects on the server. POST requests are commonly used for creating new resources or submitting form data.

  3. PUT: This method is used to update a specified resource with new data. It is idempotent, meaning multiple identical requests should have the same effect as a single request. PUT requests are commonly used for updating existing resources.

  4. DELETE: This method is used to delete a specified resource. It is idempotent, meaning multiple identical requests should have the same effect as a single request. DELETE requests are commonly used for removing existing resources.

Regarding error status codes, HTTP uses a range of status codes to indicate the outcome of a request. Some common error status codes include:

  1. 404 Not Found: This status code indicates that the requested resource could not be found on the server.

  2. 400 Bad Request: This status code indicates that the server cannot process the request due to a client error, such as malformed syntax or invalid parameters.

  3. 500 Internal Server Error: This status code indicates that an unexpected condition occurred on the server, preventing it from fulfilling the request.

Cookies

Cookies are small text files that are stored on the client-side (in your browser) and are sent back to the server with each subsequent request. They can store information such as user preferences, session IDs, and authentication tokens.

Third-party cookies are cookies that are set by a domain other than the one you are currently visiting. For example, when you open a shopping website like Flipkart, it may include advertisements from other websites. These advertisements can set third-party cookies on your browser. These cookies allow advertisers to track your browsing behavior across multiple websites and show you targeted ads based on your interests.

Imagine you are browsing Flipkart and you see an ad for a product from another website. When you click on that ad, it takes you to the advertiser's website. In this scenario, the advertiser's website can set a third-party cookie on your browser. This cookie allows the advertiser to track your activity on their website and potentially show you personalized ads even when you are not on Flipkart.

How does Email Work?

Email operates using various protocols, including SMTP (Simple Mail Transfer Protocol) and POP3 (Post Office Protocol version 3).

SMTP is responsible for sending emails from the sender's email client to the sender's SMTP server. The email remains on the SMTP server until a connection is established with the recipient's SMTP server. If both the sender and recipient are using the same email provider, such as Gmail, the connection establishment is not required.

Once the email reaches the recipient's SMTP server, it is stored temporarily until the recipient's email client retrieves it. This retrieval is typically done using POP3 or IMAP (Internet Message Access Protocol). POP3 allows the recipient's email client to download the email from the server, and the email is usually deleted from the server after retrieval. On the other hand, IMAP allows the recipient's email client to access and manage emails directly on the server, providing synchronization across multiple devices.

In case of errors or server unavailability, the sending server will attempt to deliver the email for a certain period before giving up. This ensures that emails are not lost if the recipient's server is temporarily offline.

To check server details, the nslookup command can be used.

DNS

The Domain Name System (DNS) is a crucial component of the internet infrastructure that translates human-readable domain names into IP addresses, allowing users to access websites and other online resources. When we consider a domain like "mail.google.com," we can break it down into its subdomains, second-level domain, and top-level domain.

In this example, "mail" is the subdomain, "google" is the second-level domain, and "com" is the top-level domain.

The Internet Corporation for Assigned Names and Numbers (ICANN) is the organization responsible for managing and storing all the top-level domains. ICANN ensures that domain names are unique and properly registered.

Local DNS servers, which are typically provided by your Internet Service Provider (ISP), play a crucial role in the DNS process. These servers store information about the websites you visit, regardless of whether you are using incognito mode or taking other privacy measures. In case of any suspicious activities, ISPs are obligated to cooperate with law enforcement agencies.

It's important to note that when you purchase a domain, you are essentially renting it rather than owning it outright. Domain registrations typically have a limited duration, and you need to renew them periodically to maintain ownership. This system allows for the efficient management and allocation of domain names across the internet.

Congestion Control

Congestion control refers to the techniques and mechanisms used to manage and prevent network congestion, which occurs when there is more traffic in a network than it can handle efficiently. It aims to ensure that the network operates optimally and that all users receive fair and reliable service.

The transport layer, particularly TCP, plays a significant role in implementing congestion control mechanisms.

  1. The transport layer, specifically the Transmission Control Protocol (TCP), is responsible for implementing congestion control. TCP is a widely used transport protocol that provides reliable, connection-oriented communication between devices over an IP network. It includes congestion control mechanisms to regulate the flow of data and prevent network congestion.

TCP incorporates various congestion control algorithms to manage network congestion. These algorithms monitor network conditions, such as packet loss and delay, and adjust the transmission rate accordingly. Some well-known congestion control algorithms used in TCP include Slow Start, Congestion Avoidance, and Fast Recovery. These algorithms dynamically adapt the sending rate of data to avoid overwhelming the network and ensure efficient data transfer.

Timers

Timers play a crucial role in data transmission and ensuring reliable communication. When sending a data packet, a timer is started to track the elapsed time. If a confirmation is received from the recipient before the timer expires, it indicates successful transmission. However, if the packet gets lost during transmission, no confirmation is received, and the timer eventually expires, indicating that the packet did not reach its destination.

To address the possibility of a delayed confirmation, sequence numbers are used. In case a duplicate packet is received due to a lack of confirmation, the sequence number helps identify and discard the duplicate.

Moving on to the second transport layer protocol, UDP (User Datagram Protocol), it operates as a connectionless protocol. This means that no connection is established before data transfer occurs. With UDP, there is no guarantee of data delivery, and the data may change or arrive out of order. Additionally, important files may become corrupted during transmission.

UDP packets contain port numbers for both the sender and receiver, along with the length of the datagram and a checksum. The data itself is also included in the packet.

In contrast, TCP (Transmission Control Protocol) performs similar functions to UDP but in a different manner. TCP segments the raw data received from the application layer into smaller chunks and adds headers, checksums, and other necessary information. It may also collect data from the network layer.

TCP takes care of ensuring data arrives successfully and maintains the order of data transmission. If data does not arrive, TCP handles retransmission to ensure reliable communication.

The 3-Way Handshake

The 3-way handshake is a method used by the Transmission Control Protocol (TCP) to establish a connection between a client and a server. It ensures that both parties are ready to send and receive data before the actual data transmission begins.

Here's how the 3-way handshake works:

  1. The client initiates the connection by sending a SYN (synchronize) packet to the server. This packet contains a randomly generated sequence number to identify the data being sent. The SYN flag is set to indicate that a new connection is being requested.

  2. Upon receiving the SYN packet, the server responds with a SYN-ACK (synchronize-acknowledge) packet. This packet acknowledges the client's request by setting the ACK flag and also includes its own randomly generated sequence number. The acknowledgment number is set to the client's sequence number + 1, indicating that the server is ready to receive data starting from the next sequence number.

  3. Finally, the client acknowledges the server's response by sending an ACK packet. This packet has the ACK flag set and includes the server's sequence number + 1 as the acknowledgment number. At this point, both the client and server have exchanged their sequence numbers and acknowledgment numbers, confirming the successful establishment of the connection.

The 3-way handshake ensures that both the client and server agree on initial sequence numbers and are ready to exchange data. It helps prevent unauthorized connections and ensures reliable communication between the two parties.

IP Addresses and their Classes

IP addresses are unique numerical identifiers assigned to devices connected to a network. The Internet Engineering Task Force (IETF) is responsible for assigning IP addresses to organizations.

IP addresses are divided into classes based on their range. The classes are as follows:

  • Class A: Ranges from 0.0.0.0 to 127.255.255.255. The first octet represents the network address, and the remaining three octets represent the host address.

  • Class B: Ranges from 128.0.0.0 to 191.255.255.255. The first two octets represent the network address, and the remaining two octets represent the host address.

  • Class C: Ranges from 192.0.0.0 to 223.255.255.255. The first three octets represent the network address, and the last octet represents the host address.

  • Class D: Ranges from 224.0.0.0 to 239.255.255.255. These addresses are used for multicast purposes.

  • Class E: Ranges from 240.0.0.0 to 255.255.255.255. These addresses are reserved for future use.

IPv4 v/s IPv6

IPv4 and IPv6 are both protocols used for identifying and addressing devices on a network, but they differ in several key aspects.

IPv4 (Internet Protocol version 4) is the fourth version of the Internet Protocol and has been widely used since the early days of the internet. It uses a 32-bit address format, allowing for approximately 4.3 billion unique addresses. However, due to the rapid growth of the internet, the available IPv4 addresses have been exhausted, leading to the need for a new protocol.

IPv6 (Internet Protocol version 6) is the latest version of the Internet Protocol and was developed to address the limitations of IPv4. It uses a 128-bit address format, providing an enormous number of unique addresses, approximately 3.4 x 10^38. This vast address space ensures that there are enough addresses to accommodate the growing number of devices connected to the internet.

One of the main advantages of IPv6 over IPv4 is its improved address space, which allows for the allocation of unique addresses to a much larger number of devices. Additionally, IPv6 includes built-in features for security, auto-configuration, and mobility support, which were added as separate extensions in IPv4.

Another significant difference is the format of the addresses themselves. IPv4 addresses are written in decimal format, separated by periods (e.g., 192.168.0.1), while IPv6 addresses are written in hexadecimal format, separated by colons (e.g., 2001:0db8:85a3:0000:0000:8a2e:0370:7334). IPv6 addresses also allow for the use of double colons (::) to represent consecutive blocks of zeros, simplifying the notation.

In terms of adoption, IPv6 is gradually being implemented to replace IPv4. Many internet service providers, network operators, and organizations are transitioning to IPv6 to ensure the continued growth and connectivity of the internet. However, due to the vast number of existing IPv4 devices and infrastructure, IPv4 will likely coexist with IPv6 for the foreseeable future through mechanisms such as dual-stack deployment and network address translation (NAT).

Middleboxes

Middleboxes are additional devices that interact with IP packets in both the network layer and the transport layer. One type of middlebox is a firewall, which can be connected to both the global internet and your own network. Firewalls filter out IP packets based on various rules, such as addresses, modified packets, port numbers, flags, and protocols.

There are two types of firewalls: stateless and stateful. A stateless firewall examines each packet individually without considering the context of previous packets. On the other hand, a stateful firewall keeps track of the state of network connections and can make more efficient decisions based on the entire conversation.

Another middlebox is the Network Address Translator (NAT), which modifies network address information. The data link layer is responsible for transferring packets over the physical layer, and routers are devices that connect multiple devices with different IP addresses. When a new device is connected to a network, it can obtain an IP address automatically through the Dynamic Host Configuration Protocol (DHCP), which uses a client-server architecture.

In a local area network (LAN), devices communicate through the data link layer using data link layer addresses. If a device wants to send data to another device, it checks its cache memory for the destination's address. If the address is not found, the device broadcasts a message to all connected devices, which includes a packet containing a frame with the Data Link Layer Address (DLLA) of the sender and the IP address of the destination. This process is known as Address Resolution Protocol (ARP) and helps resolve the MAC address (also known as the physical address) of devices. Each device, such as Wi-Fi and Bluetooth, may have a different MAC address.

As we bring this chapter to a close, I want to express my gratitude to each and every one of you, my dedicated readers, for embarking on this journey with me. Your curiosity and passion for technology inspire me to continue exploring, learning, and sharing. Until we meet again in the next blog,

Take Care, and Thank You for existing,

Amazing people

Yours,

Pratham Sikka👨‍💻

Twitter

LinkedIn