Introduction to Networking for Newbies


Networking
The process of connecting devices to exchange data and share resources. These devices use a system of rules, called protocols, to transmit information
Types of computer networks
Local Area Network (LAN): A private network that connects devices in a limited area, like a home, school, or office. LANs are often based on Ethernet technology.
Wide Area Network (WAN): A network that connects devices over a large geographical area, such as a city, state, or country. The Internet is an example of a WAN.
Metropolitan Area Network (MAN): A network that connects devices within a metropolitan area, such as a city or town. MANs use technologies such as FDDI, CDDI, and ATM.
IP ADDRESS
It is used to generate or provide a unique address to the device connected to our network.
SUBNET
A subnet or subnetwork is a smaller network inside a large network. Subnetting makes network routing much more efficient.
OSI Model
The open systems interconnection (OSI) model is a conceptual model created by the International Organization for Standardization that enables diverse communication systems to communicate using standard protocols. The open systems interconnection (OSI) model is a conceptual model created by the International Organization for Standardization that enables diverse communication systems to communicate using standard protocols.
TCP/IP Model
The TCP/IP model is a fundamental framework for computer networking. It stands for Transmission Control Protocol/Internet Protocol, which are the core protocols of the Internet. This model defines how data is transmitted over networks, ensuring reliable communication between devices.
FOR EXAMPLE
Let's suppose you're using What's app on a laptop. You're messaging your friend, who's using What's app on their phone from a different network.
What's App, as a network-connected application, uses Layer 7 (Application) protocols like XMPP. If you send your friend a picture of your cat, What's App would be using the File Transfer Protocol (FTP).
Layer 6 (Presentation) receives application data from Layer 7, translates it into binary, and compresses it. When you send a message, Layer 6 encrypts that data as it leaves your network. Then it decrypts the data when your friend receives it.
Applications like What's App consist of text files and image files. When you download these files, Layer 5 (Session) determines which data packets belong to which files, as well as where these packets go. Layer 5 also establishes, maintains, and ends communication between devices
.
Transport and Network Layers
Layer 4 (Transport) receives data from Layer 5 and segments it. Each segment, or data unit, has a source and destination port number, as well as a sequence number. The port number ensures that the segment reaches the correct application. The sequence number ensures that the segments arrive in the correct order.
This layer also controls the amount of data transmitted. For example, your laptop may be able to handle 100 Mbps, whereas your friend's phone can only process 10 Mbps. Layer 4 can dictate that the server slow down the data transmission, so nothing is lost by the time your friend receives it. But when your friend sends a message back, the server can increase the transmission rate to improve performance.
Lastly, Layer 4 performs error-checking. If a segment of data is missing, Layer 4 will re-transmit that segment.
TCP and UDP are both very well-known protocols, and they exist at Layer 4. TCP favors data quality over speed, whereas UDP favors speed over data quality.
Layer 3 (Network) transmits data segments between networks in the form of packets. When you message your friend, this layer assigns source and destination IP addresses to the data segments. Your IP address is the source, and your friend's is the destination. Layer 3 also determines the best paths for data delivery.
Data Link and Physical Layers
Layer 2 (Data Link) receives packets from Layer 3. Whereas Layer 4 performs logical addressing (IPv4, IPv6), Layer 2 performs physical addressing. It adds sender and receiver MAC addresses to the data packet to form a data unit called a frame. Layer 2 enables frames to be transported via local media (e.g. copper wire, optical fiber, or air). This layer is embedded as software in your computer's Network Interface Card (NIC).
In short, Layer 2 allows the upper network layers to access media and controls how data is placed and received from media.
Hardware - the things you can actually physically touch - exists at Layer 1 (Physical).
This layer converts the binary from the upper layers into signals and transmits them over local media. These can be electrical, light, or radio signals; it depends on the type of media used. When your friend receives the signals, they're decapsulated, or translated back into binary and then into application data so your friend can see your message.
A switch connects multiple devices to create a network, and a router connects various switches, and their respective networks, to form an even larger network.
As a DevOps engineer, It is important to understand ports and their importance to manage and deploy applications efficiently.
SSH (Secure Shell) - Port 22:- SSH is used for secure remote access to the server. It is required to manage servers, deploy code, and perform various administrative tasks.
HTTP - Port 80:- HTTP is the primary protocol used to transfer data over the Web. Port 80 is the default port for HTTP traffic.
HTTPS - Port 443:- HTTPS encrypts HTTP traffic for secure communications over the Internet. Port 443 is the default port for HTTPS.
FTP (File Transfer Protocol) - Port 21:- FTP is used to transfer files between a client and a server over a network. Port 21 is the default port for FTP control.
SMTP (Simple Mail Transfer Protocol) - Port 25: - SMTP is used to send email messages between servers. Port 25 is the default port for SMTP.
DNS (Domain Name System) - Port 53: DNS is responsible for translating domain names into IP addresses. Port 53 is used for DNS queries.
MySQL - Port 3306: MySQL is a popular relational database management system. Port 3306 is the default port for MySQL connections.
Docker - Port 2375 (unencrypted) / Port 2376 (encrypted):- Docker uses these ports for communication between the Docker client and the Docker daemon.
Kubernetes API Server - Port 6443: Kubernetes API Server exposes the Kubernetes API. port 6443
Nginx - Port 80/443:- Nginx, a high-performance web server, uses ports 80 and 443 for HTTP and HTTPS traffic, respectively.
Apache HTTP Server - Port 80/443:-The Apache HTTP Server, another widely used web server, typically uses ports 80 and 443 for HTTP and HTTPS traffic.
Python Default HTTP Server - Port 8000 (often customizable): Python's built-in HTTP server, used for development or lightweight applications, typically runs on port 8000. However, this port can be customized as needed.
SonarQube - Port 9000 (Web Interface) / Port 9001 (Compute Engine): SonarQube, a code quality and security analysis tool, typically exposes its web interface on port 9000. The compute engine, responsible for processing analysis tasks, often communicates on port 9001.
Jenkins - Port 8080 (Web Interface) / Port 50000 (Jenkins Agent): Jenkins, a popular continuous integration and continuous deployment (CI/CD) tool, exposes its web interface on port 8080 by default. Port 50000 is commonly used for communication between the Jenkins controller and its agents.
FIREWALL
A firewall is a network security device that monitors incoming and outgoing network traffic and decides whether to allow or block specific traffic based on a defined set of security rules
Conclusion
Networking enables devices to exchange data and share resources using protocols. Understanding network types, the OSI and TCP/IP models, and essential ports is crucial for DevOps engineers. It ensures secure communication, efficient data transfer, and seamless deployment of applications, making networking a fundamental skill in modern IT infrastructure and operations.
Subscribe to my newsletter
Read articles from Ayush Gurjar directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
