"Essential Networking for DevOps: A Step-by-Step Guide"
Devops and Networking essentials:
DevOps is a set of practices that combines software development and IT operations, aiming to shorten the development lifecycle and improve the delivery of high-quality software. It emphasizes collaboration, automation, and continuous integration/deployment.
Networking in DevOps ensures smooth communication between components like servers, containers, and microservices. This article covers the basics of computer networking and its role in DevOps.
In its simplest form, a network is nothing more than “two connected computers sharing resources with one another.” • It is composed of two main aspects:
Physical Connection (wires, cables, wireless media)
Logical Connection (data transporting across the physical media)
Some Basic Networking Rules :
The computers in a network must use the same procedures for sending and receiving data. We call these communication protocols.
• Data must be delivered uncorrupted. If it is corrupted, it’s useless. (There are Exceptions)
• Computers in a network must be capable of determining the origin and destination of a piece of information, i.e., its IP and Mac Address
Types of Computer Networks (by Size)
Personal Area Network (PAN)
Local Area Network (LAN)
Wireless Local Area Network (WLAN)
4. Campus Area Network (CAN)
5. Metropolitan Area Network (MAN)
6. Wide Area Network (WAN)
Here are some important networks :
LAN (Local Area Network) - interconnects computer within a limited area, such as residences, schools. e.g.: Wi-Fi, Ethernet
MAN (Metropolitan area network) - used in metropolitan area (cities).
WAN (Wide Area Network) - extends LAN over a large geographic area. e.g:- optical fiber cable.
Network Components:
Switch: Connects devices within a network and forwards data only to the intended recipient.
Router: It is a device which is actually used to connect one network with another.
NIC: It is known as Network Interface Card which is used to connect your computer with the internet. It is wireless card preinstalled on motherboard now-a-days. It has a MAC (Media Access Control) address.
Bridge: It is also a networking device that connects multiple LANs (local area networks) together to form a larger LAN. It reduces the broadcasting part, and it store the MAC address of the computer but now this device is also obsoleted and replaced by switch.
IP Addressing:
An IP (Internet Protocol) address is a unique number assigned to each device on a network, allowing them to communicate with each other. Itʼs like a device's "address" on the internet or local network.
Types of IP Addresses:
1. IPv4: A 32-bit address (e.g.,
192.168.1.1
) limited to 4.3 billion addresses, written as four numbers separated by dots (e.g., ). This 32-bit IP address contains a combo of 32 (1 and 0's). In this version of IP address there are 4 groups or Octets (8 bits), and each octet is represented by a decimal value in the address. It is easy to remember.- IPv6: A 128-bit address (e.g.,
2001:db8::ff00:42:8329
) offering a vast number of addresses.Provides a vastly larger pool of addresses, designed to replace IPv4 as it runs out.
- IPv6: A 128-bit address (e.g.,
Public vs. Private IPs:
Public IP: Globally unique, used to access the internet.Assigned by ISPs and accessible globally.
Private IP: Used within private networks (like home or office networks).Not accessible from the internet; usually in ranges like 192.168.x.x , 10.x.x.x or 172.16.x.x - 172.31.x.x .
Static vs. Dynamic IPs:
Static: Manually assigned and do not change.Often used for servers and devices that need a consistent address.
Dynamic: Automatically assigned by DHCP and may change periodically.commonly used for home devices.
Subnetting:
Dividing a large network into smaller, manageable sub-networks. Example: A
192.168.1.0/24
network can be split into two subnets: Subnet 1:192.168.1.0/25
(supports 126 hosts)Subnet 2:192.168.1.128/25
(supports 126 hosts).
Network Models:
There are mainly two types of network model -
OSI Reference Model
TCP/IP Model
OSI Reference Model: The OSI (Open Systems Interconnection) Model is a set of rules that explains how different computer systems communicate over a network. OSI Model was developed by the International Organization for Standardization (ISO). The OSI Model consists of 7 layers and each layer has specific functions and responsibilities.
Physical Layer: Handles the physical connection between devices, transmitting raw data as bits over cables, radio signals, etc.
Data Link Layer: Manages data transfer between directly connected nodes. It handles error detection and flow control. Examples: Ethernet, Wi-Fi.
Network Layer: Manages packet forwarding and routing through the network. Uses IP addressing. Example: IP (Internet Protocol).
Transport Layer: Ensures reliable data transfer with error correction and flow control. Examples: TCP, UDP.
Session Layer: Establishes, maintains, and manages communication sessions between applications.
Presentation Layer: Translates data formats to ensure compatibility between systems. Handles encryption and compression.
Application Layer: Interfaces directly with the user and provides network services like HTTP, FTP, SMTP.
Understanding Protocols, Ports, and Sockets :
Protocols:
Computers communicate with each other with network protocols.
Protocols are rules governing how machines exchange data and enable effective communication.
In an operating system (OS), a protocol runs as a process or service.
HTTP: Protocol for web browsing. Example: Accessing
www.google.com
uses HTTP or HTTPS.FTP: Protocol for transferring files. Example: Uploading files to a web server.
TCP/IP: Core internet protocols for reliable communication. Example: Ensures emails are sent without errors.
Some more Protocols:
Dynamic Host Configuration Protocol (DHCP) : Protocol that automatically assigns IP address configurations to devices on a network: o IP Address o Subnet Mask o Default Gateway o DNS Server.
Simple Network Management Protocol (SNMP) • Protocol used to monitor and manage network devices
Allows admins to monitor and manage network devices and traffic.
Allows network devices to communicate information about their state:
Memory , CPU and Bandwidth .
Secure Shell (SSH) • A cryptographic protocol that’s used to securely connect to a remote host
Utilizes a terminal console Typically Unix and Linux Machines, but also available on Windows and Mac OS.
Remote Desktop Protocol (RDP) • A Microsoft protocol that allows users to remotely connect to, view, and control a remote computer from a Windows desktop. It is Built into the Microsoft operating system. and Uses TCP port 3389 by default.
Secure File Transfer Protocol (SFTP) • A secure cryptographic version of FTP that uses SSH to provide encryption services. It Provides file transfer over SSH .It Uses TCP port 22 by default (same port as SSH).
Simple Mail Transfer Protocol (SMTP) • Email protocol that is used to deliver emails from an email client (Outlook) to a destination email server.
Post Office Protocol Version 3 (POP3) • Email protocol that is used to retrieve emails from an email server • Can be configured to use encryption (recommended) or plain text • Uses TCP Port 110 by default.
Domain Name System (DNS) • Protocol that is used to resolve a domain name to its corresponding IP address o InstructorAlton.com → 162.0.232.236 .It Uses TCP port 53 by default .
Ports
Ports are logical constructs that bind a unique port number to a protocol process or service.
Sockets
Sockets are a combination of an IP address and a port number, for example, 192.168.1.1:80.
Why We Need Ports and Sockets
Computers require ports because of network application multitasking.
Because a computer may have only one IP address, it needs ports to differentiate network protocols and services running on it.
TCP/IP has 65,536 ports available.
- TCP/IP Model:
The TCP/IP model, also known as the Internet Protocol Suite, is a simplified version of the OSI model with only 4 layers instead of 7. This model is a real model which actually works in real. This model consists of 4 layers. Commonly called the Internet Protocol suite because it was designed for the Internet, but LANs use it too.
Application Layer = (Application Layer + Presentation Layer + Session Layer) of OSI model
Transport Layer
Internet Layer
Network Interface Layer = (Data Link Layer + Physical Layer) of OSI model Ports and Protocols: (remaining all are same like OSI model discussed above.)