#100DaysOfCode: Days 20-22 - Networking Fundamentals
Welcome to my #100DaysOfCode blog series! Over the past three days (Day 20-22), I have been delving deep into the fundamentals of networking. Networking is the backbone of modern computing, allowing devices to communicate and share information efficiently. In this post, I'll walk you through key concepts I learned, including the OSI model, TCP/IP model, packet transmission, and various network protocols.
1. The Structure of a Network
A computer network is a group of devices (computers, servers, etc.) that are connected to share resources and data. These networks are classified based on their size and scope, such as LAN (Local Area Network), WAN (Wide Area Network), and MAN (Metropolitan Area Network).
The structure of a network involves:
Devices such as routers, switches, modems, and firewalls
Communication protocols like TCP/IP, UDP, and HTTP
Physical media, such as ethernet cables, fiber optics, or wireless signals
2. OSI Model: Understanding the 7 Layers
The OSI (Open Systems Interconnection) model is a conceptual framework that standardizes the functions of a telecommunication or computing system into seven distinct layers. Each layer serves a specific function and communicates with the layers directly above and below it. Here's a breakdown of the seven layers:
| OSI Layer | Function |
| 1. Physical | Deals with the transmission of raw data (bits) over the physical medium. |
| 2. Data Link | Ensures data transfer between two directly connected nodes, error detection, and MAC addressing. |
| 3. Network | Manages packet forwarding and routing through logical addressing (IP addresses). |
| 4. Transport | Ensures reliable data transmission, flow control, and error correction. Protocols include TCP and UDP. |
| 5. Session | Manages and controls sessions between applications. Establishes, maintains, and terminates connections. |
| 6. Presentation | Ensures data is in a readable format by translating, encrypting, or compressing data. |
| 7. Application | Closest to the user, providing services such as email, file transfer, and web browsing. |
How a Packet Travels Through the Layers:
When a data packet is transmitted, it moves down through the OSI layers of the sender's device, each layer adding its own header. At the receiving end, the packet moves up the layers, and each layer processes and removes the header to access the original data.
3. TCP/IP Model: The Foundation of Modern Networking
The TCP/IP (Transmission Control Protocol/Internet Protocol) model is a simplified version of the OSI model. It's the protocol suite used by the internet. Unlike the OSI model's seven layers, the TCP/IP model has four layers:
| TCP/IP Layer | Corresponding OSI Layers | Function |
| 1. Network Interface | Physical, Data Link | Manages data transmission between a device and its network. |
| 2. Internet | Network | Routes data across the internet using IP addresses (e.g., IPv4, IPv6). |
| 3. Transport | Transport | Manages end-to-end communication, ensuring reliable data delivery (TCP, UDP). |
| 4. Application | Session, Presentation, Application | Provides services like web browsing, file transfer, and email (HTTP, FTP, SMTP). |
4. The Application Layer: Client-Server and Peer-to-Peer Architecture
At the top of the TCP/IP model is the Application Layer, which interacts directly with software applications. It provides the necessary services to enable users to interact with the network, such as accessing web pages or sending emails. The application layer supports two main architectures:
Client-Server Architecture: A central server provides services or resources to multiple clients (e.g., web browsers accessing a website hosted on a server).
Peer-to-Peer (P2P) Architecture: In a peer-to-peer setup, devices (peers) share resources and data directly without relying on a centralized server (e.g., file-sharing applications like BitTorrent).
5. Key Network Protocols
Understanding network protocols is critical for configuring and managing network resources. Here’s a breakdown of some of the most important protocols:
| Protocol | Purpose |
| TCP/IP | Foundation of the internet, managing the connection between devices. |
| HTTP | Handles the transfer of web pages between a server and client. |
| DHCP | Automatically assigns IP addresses to devices on a network. |
| FTP | Facilitates file transfers between a client and server. |
| SMTP | Used for sending emails. |
| POP3/IMAP | Retrieves emails from a server. |
| SSH | Provides secure remote access to another computer. |
| Telnet | Enables remote access to a device (though less secure than SSH). |
| UDP | Offers faster, but less reliable, data transmission for real-time services like video streaming. |
6. Processes, Threads, Sockets, and Ports
Processes and threads are essential elements of computer programs. A process is an instance of a program, and a thread is a unit within a process that can be executed independently.
Sockets are the endpoints of a communication link between two devices in a network. They allow programs to exchange data over the network.
Ports are the virtual points through which data enters or leaves a computer. Ports are numbered (e.g., port 80 for HTTP, port 443 for HTTPS).
Conclusion
Understanding these networking concepts, from how data packets move through the OSI layers to how different protocols work, has been an eye-opening experience. These concepts form the foundation of cloud architecture, DevOps, and many areas of software development.
As I continue my #100DaysOfCode journey, I look forward to diving deeper into networking and cloud computing!
Feel free to follow my progress and read more on my blog.
Let’s connect!
🌐 LinkedIn