Networking Fundamentals for DevOps

Aditya GAIKWADAditya GAIKWAD
10 min read

week-1 of my 90-days of DevOps journey.

Content

1. OSI Model
2. TCP/IP Model
3. Important Protocols
4. Linux based networking commands

1. Understanding the OSI Model ๐Ÿงฑ

While the TCP/IP model is what we mostly deal with in practice, understanding the OSI (Open Systems Interconnection) Model helps clarify how networking works under the hood. It's a 7-layer conceptual framework that breaks down the communication process between two systems.

I found it super helpful when troubleshooting networking issues across different layers โ€” from physical connections to app-level bugs.


๐Ÿงฉ The 7 Layers of OSI (Top to Bottom):

LayerNameRoleDevOps Analogy
7ApplicationUser-facing services and protocols (HTTP, FTP, DNS, etc.)A browser requesting a website or Jenkins triggering a GitHub webhook
6PresentationData formatting, encryption, compressionSSL/TLS encrypting your HTTPS request
5SessionManages connections (start, maintain, end)SSH session between your terminal and server
4TransportReliable or fast delivery (TCP/UDP)Ensuring a Docker image uploads fully to a private registry
3NetworkRouting and IP addressingEC2 instances communicating across regions via IP
2Data LinkMAC addressing, switches, framingEthernet, VLANs, MAC filtering in cloud VPC
1PhysicalCables, signals, hardwareYour Wi-Fi adapter, Ethernet cable, or NIC card on a server

๐Ÿง  Real-Life Analogy: Sending a Letter

Imagine sending a letter through a postal system. Here's how the OSI layers relate:

  • Layer 7 (Application): You write the letter and choose a language (English, Spanishโ€ฆ).

  • Layer 6 (Presentation): You encrypt it with a secret code.

  • Layer 5 (Session): You call the recipient to let them know itโ€™s coming.

  • Layer 4 (Transport): You choose regular mail (UDP) or certified mail with tracking (TCP).

  • Layer 3 (Network): The postal system figures out the best route.

  • Layer 2 (Data Link): The local post office sorts it for delivery.

  • Layer 1 (Physical): The mail truck physically moves it to the destination.


2. The TCP/IP Model โ€” The Backbone of Modern Networking ๐Ÿ“ก

When I started learning networking as part of my DevOps journey, the TCP/IP model made more sense to me than the OSI model. It's simpler (only 4 layers) and more practical since itโ€™s what the internet and most real-world systems are based on.

So, letโ€™s break down each layer of the TCP/IP model with DevOps use cases, relatable analogies, and a real-life data flow example.

๐Ÿ“ฆ The 4 Layers of the TCP/IP Model

1. Application Layer

This is the top-most layer where user-facing applications interact with the network. It includes protocols like:

  • HTTP/HTTPS (web browsing)

  • FTP (file transfer)

  • SSH (secure shell access)

  • DNS (domain resolution)

๐Ÿ› ๏ธ DevOps Example: Running curl https://myapi.dev or pulling a Docker image over HTTPS.

๐Ÿง  Real-world analogy: It's like ordering food using a restaurantโ€™s mobile app.


2. Transport Layer

This layer ensures that data gets from one system to another reliably (TCP) or quickly (UDP). Itโ€™s responsible for:

  • Error detection

  • Flow control

  • Sequencing

๐Ÿ” TCP: Reliable, ordered delivery (e.g., Git push/pull, SSH)
โšก UDP: Fast but connectionless (e.g., DNS, live monitoring)

๐Ÿ› ๏ธ DevOps Example: Jenkins connects to GitHub using TCP to fetch commits.

๐Ÿง  Real-world analogy: The delivery person making sure your order is complete and intact.


3. Internet Layer

This layer handles addressing and routing. Itโ€™s where IP (Internet Protocol) operates.

Main responsibilities:

  • Assign IP addresses

  • Route packets across networks

๐Ÿ› ๏ธ DevOps Example: Your EC2 instance communicates with an external API using its public IP address.

๐Ÿง  Real-world analogy: The GPS system finding the best route to deliver your food.


This is the lowest layer and involves the actual hardware or network interface โ€” Ethernet, Wi-Fi, MAC addresses, etc.

๐Ÿ› ๏ธ DevOps Example: Docker containers get virtual Ethernet interfaces to communicate via bridge networks.

๐Ÿง  Real-world analogy: The road and delivery truck that physically brings the order to your doorstep.



๐Ÿ”„ Real-Life Example: Data Flow Through the TCP/IP Model

Letโ€™s say I open a browser and type: https://devops-blog.io
Hereโ€™s
how that request flows through the TCP/IP stack:

  1. Application Layer:

    • The browser prepares an HTTPS request.

    • DNS resolves devops-blog.io to an IP address.

  2. Transport Layer:

    • A TCP connection is created on port 443 (HTTPS).

    • Data is broken into segments and numbered.

  3. Internet Layer:

    • Each TCP segment is packed into an IP packet.

    • The destination IP is set.

    • Routing is determined based on IP tables.

  4. Network Access Layer:

    • IP packets are turned into Ethernet frames.

    • Sent over Wi-Fi or Ethernet to the default gateway.

๐Ÿ‘‰ This process reverses at the destination server, with the server responding via the same layered approach.

Elaborate The Tcp/ip Model With Diagram


3. Some Important Protocols & Ports DevOps ๐Ÿ“ก

I'm new to DevOps, and understanding protocols felt tricky at first. But once I saw how they connect to real tasks like SSH access, API calls, and deployments, it all started making sense. Here's a simple breakdown of the most common protocols, grouped by TCP/IP layers, with practical examples I came across.


๐Ÿง  Application Layer

(TCP/IP Layer 4 / OSI Layer 7)

๐ŸŒ HTTP / HTTPS
Ports: 80 (HTTP), 443 (HTTPS)
Purpose: Web communication โ€” browser-to-server or service-to-service.
Where it shows up: APIs, monitoring dashboards, GitHub webhooks, frontend deployments.
In action: When your app fetches data from an external API securely, it uses HTTPS.

๐Ÿ” SSH
Port: 22
Purpose: Secure remote shell access.
Where it shows up: Connecting to Linux servers (e.g., EC2), Git over SSH, provisioning infrastructure.
In action: You SSH into an EC2 instance to deploy or debug your app manually.

๐Ÿ“ FTP / SFTP
Ports: 21 (FTP), 22 (SFTP via SSH)
Purpose: File transfers across systems.
Where it shows up: Uploading backups, config files, or logs to remote locations.
In action: Automating secure file uploads from Jenkins to a remote backup server.

๐Ÿงญ DNS
Port: 53
Purpose: Resolving domain names to IPs.
Where it shows up: Every time your app or CI tool reaches api.something.com.
In action: DNS resolution must work for your pipeline to pull a container image from Docker Hub.

๐Ÿ“จ SMTP
Ports: 25, 465, 587
Purpose: Sending emails and alerts.
Where it shows up: Alerting systems, incident notification tools like PagerDuty or custom apps.
In action: Your monitoring tool sends email alerts via an SMTP server when CPU spikes.

๐Ÿ•ฐ๏ธ NTP (Network Time Protocol)
Port: 123 (UDP)
Purpose: Synchronizing time across servers.
Where it shows up: All production servers, logs, distributed systems.
In action: Keeping your EC2 logs and app servers synced to avoid timestamp mismatches.

๐Ÿ“ก SNMP (Simple Network Management Protocol)
Ports: 161/162 (UDP)
Purpose: Network device monitoring and management.
Where it shows up: Routers, switches, hardware-level monitoring.
In action: Infrastructure monitoring dashboards pull metrics from network gear using SNMP.


๐Ÿšš Transport Layer

(TCP/IP Layer 3 / OSI Layer 4)

๐Ÿ” TCP (Transmission Control Protocol)
Ports: Dynamic (based on service)
Purpose: Reliable, ordered data transmission.
Where it shows up: Git, HTTPS, SSH, MySQL โ€” anything critical and stateful.
In action: Ensures your container image is uploaded completely and correctly to a remote registry.

โšก UDP (User Datagram Protocol)
Ports: Dynamic โ€” often 53 (DNS), 123 (NTP), etc.
Purpose: Fast, connectionless data delivery.
Where it shows up: Real-time monitoring, DNS requests, SNMP.
In action: Prometheus or Telegraf sends real-time metrics pings without overhead.


๐Ÿ›ฐ Internet Layer

(TCP/IP Layer 2 / OSI Layer 3)

๐ŸŒ IP (Internet Protocol)
Ports: N/A (Protocol-based)
Purpose: Addressing and routing packets between nodes/networks.
Where it shows up: VPC subnet design, firewall routing, Kubernetes pod communication.
In action: Your pod in GKE routes a request to another microservice using its internal IP.

๐Ÿงช ICMP
Ports: N/A (used by tools like ping)
Purpose: Diagnostics and reachability checks.
Where it shows up: ping, traceroute, Kubernetes node health probes.
In action: You ping an EC2 instance to confirm it's reachable before deploying.


๐Ÿงท Network Access Layer

(TCP/IP Layer 1 / OSI Layers 1 & 2)

๐Ÿ” ARP (Address Resolution Protocol)
Purpose: Resolves IP addresses to MAC addresses.
Where it shows up: Local subnet communication, Docker bridge networking, VM-to-VM traffic.
In action: Your host uses ARP to find the MAC address of another container on the same network before sending data.

๐Ÿงฑ Ethernet / Wi-Fi
Ports: N/A
Purpose: Actual transmission over cables or air.
Where it shows up: Local VMs, containers using bridge networks, cloud instances with virtual NICs.
In action: Your Docker container communicates via a virtual Ethernet bridge to another container.


4. Important Linux Networking Commands ๐Ÿงช

These are the commands I keep in my toolbox โ€” from checking connectivity to digging into DNS and inspecting network traffic in real-time. Whether youโ€™re deploying to the cloud or debugging locally, these tools are essentials.


๐Ÿ›ฐ๏ธ ping โ€” Check basic network reachability

Purpose: Sends ICMP echo requests to test if a remote host is up.
Command:

ping example.com

DevOps Use: Test if your service, database, or API endpoint is online before deployment.


๐Ÿงญ traceroute / tracert โ€” Trace packet hops

Purpose: Shows the route taken by packets to reach the destination.
Command:

traceroute google.com    # Linux

DevOps Use: Diagnose network slowness or packet loss across hops in the delivery path.


๐ŸŒ curl โ€” Make HTTP requests

Purpose: Sends HTTP requests to test APIs and services.
Command:

curl -I https://example.com       # Get headers  
curl -X POST -d '{"x":1}' -H "Content-Type: application/json" https://api.example.com

DevOps Use: Test API endpoints, webhook URLs, microservices, and load balancer behavior.


๐Ÿ“ก netstat / ss โ€” Check open ports and connections

Purpose: Show active TCP/UDP ports and process bindings.
Command:

netstat -tulnp       # Legacy  
ss -tuln             # Preferred

DevOps Use: Find which process is using port 80 or confirm your backend is listening.


๐Ÿ” dig / nslookup โ€” DNS queries

Purpose: Query DNS records and name resolution.
Command:

dig github.com  
nslookup api.myapp.dev

DevOps Use: Debug DNS misconfigurations, check domain propagation.


๐ŸŒ ip โ€” View or configure IP, routing, and interfaces

Purpose: Replace old ifconfig for IP address and route management.
Command:

ip a           # Show IP addresses  
ip route       # Show routing table  
ip link show   # Show interface status

DevOps Use: Inspect pod interfaces, container bridges, custom routes.


๐Ÿ”Ž tcpdump โ€” Packet sniffer for network traffic

Purpose: Capture network packets at the interface level.
Command:

sudo tcpdump -i eth0 port 443

DevOps Use: Analyze traffic between services, debug SSL negotiation, find anomalies.


๐Ÿ” nmap โ€” Network scanner and port mapper

Purpose: Scan hosts for open ports and services.
Command:

nmap -sT 192.168.1.1  
nmap -p 22,80,443 myserver.dev

DevOps Use: Audit open ports on cloud instances or internal services before hardening.


๐Ÿงฐ hostname โ€” View or set system hostname

Purpose: Shows or changes the system hostname.
Command:

hostname        # View  
hostnamectl set-hostname web-node-1

DevOps Use: Useful when provisioning infrastructure and tagging instances.


๐ŸŒ route / ip route โ€” Show network routing

Purpose: Displays or modifies the system routing table.
Command:

ip route show

DevOps Use: Check how your system routes packets โ€” especially in multi-subnet setups like VPCs.


๐Ÿงช lsof -i โ€” List open files by network port

Purpose: Show which processes are using network ports.
Command:

sudo lsof -i :3000

DevOps Use: See whatโ€™s holding onto a port before your app fails to bind.


๐Ÿงฎ ethtool โ€” Ethernet interface statistics

Purpose: Show or change low-level NIC settings.
Command:

ethtool eth0

DevOps Use: Check NIC speed, duplex, or drop issues on physical servers.


๐Ÿ“‰ watch โ€” Monitor command output live

Purpose: Run any command at intervals and watch changes.
Command:

watch -n 1 ip a  
watch -n 2 ss -tuln

DevOps Use: Watch network status during deployments or scaling events.


โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€” Happy Learning โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”

0
Subscribe to my newsletter

Read articles from Aditya GAIKWAD directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Aditya GAIKWAD
Aditya GAIKWAD