Basics Of Networking in DevOps

Sirsha ThapaSirsha Thapa
7 min read

What is the OSI Model?

The OSI model is a conceptual framework that represents how different devices communicate or data is transmitted across the network. It consists of 7 layers.

  1. Layer 1: Physical Layer

    • What it does: Physical transmission of raw bits (0s and 1s). Cables, signals, voltages.

    • Examples: Hubs, cables (Ethernet, fiber optics), NIC, radio signals.

    • Attacks: Jamming, wiretapping, cutting cables.

    🧠 Think: “How do bits physically move through Wi-Fi signals, fiber optic cables, or cellular data to reach your friends phone?”

  2. Layer 2: Data Link

    • What it does: MAC addresses, frames, error detection → communication between devices on the same network (LAN).

    • Protocols/Examples: Ethernet, PPP, Wi-Fi (802.11), Switches.

    • Attacks: MAC spoofing, ARP poisoning, CAM table overflow

    🧠 Think: “Router sends the packet to your friend’s phone’s unique MAC address. ”

  3. Layer 3: Network layer

    • What it does: Responsible for logical addressing and routing packets across networks.

    • Protocols: IP (IPv4/IPv6), ICMP, ARP, RIP, OSPF, BGP.

    • Examples: Routers, Layer 3 switches.

    • Attacks: IP spoofing, ICMP flood, DDoS, route injection

    🧠 Think: “The message is addressed with your public IP (from NAT) as the destination, so the internet can route it to your friend’s home router.”

  4. Layer 4: Transport layer

    • What it does: End-to-end delivery of data with error checking and reliability.

    • Protocols: TCP (connection-oriented, reliable), UDP (connectionless, fast).

    • Examples: TCP, UDP, SCTP.

    • Attacks: SYN Flood, TCP hijacking, UDP flood.

    🧠 Think: “Does you Message delivered in order (TCP) or does your video call lag or buffer (UDP)

  5. Layer 5: Session Layer

    • What it does: Establishes, manages, and terminates sessions between two devices.

    • Examples: NetBIOS, RPC, PPTP, SMB sessions.

    • Attacks: Session hijacking, replay attacks.

    🧠 Think: “How is manage the ongoing session with WhatsApp Server?”

  6. Layer 6: Presentation Layer

    • What it does: Data formatting, translation, encryption, compression.

    • Examples: SSL/TLS (encryption), JPEG, GIF, ASCII, MPEG.

    • Attacks: SSL stripping, malicious code injection in data formats.

    🧠 Think: “How your address is encoded and your message is encrypted in WhatsApp?”

  7. Layer 7: Application Layer

    • What it does: Closest to the user → provides services like email, web, and file transfer.

    • Protocols/Examples: HTTP, HTTPS, FTP, SMTP, DNS, Telnet.

    • Attacks: Phishing, SQL Injection, Cross-Site Scripting (XSS)

    🧠 Think: “How is your WhatsApp tagged message with your friend’s user ID (phone number)”

TCP/IP Model

TCP/IP is a 4-layer architecture that defines how data is sent and received across networks like the Internet.

🧠 Simple Analogy

  • OSI Model is like the instruction manual showing how mail should ideally flow step by step.

  • TCP/IP is the actual postal service we use today, with fewer steps, but working in real life.

  • Application Layer

    Usage:

    • Directly interacts with users and applications.

    • Provides services like web browsing, email, file transfer, remote login, and name resolution.

    • Combines OSI’s Application + Presentation + Session layers.

    Examples in use: • Web browsing → HTTP/HTTPS.

    • Email → SMTP, IMAP, POP3.

    • File Transfer → FTP, SFTP.

    • Name Resolution → DNS.

    • Remote Access → SSH, Telnet.

  • Transport Layer

    Usage:

    • Provides end-to-end communication between devices.

    • Ensures reliable delivery, sequencing, error detection, and flow control.

    • Supports both reliable (TCP) and fast-but-unreliable (UDP) communication.

    Examples in use: • TCP → Used in web browsing (HTTP), email, file transfer (guaranteed delivery).

    • UDP → Used in online gaming, VoIP calls, video streaming (fast, no retransmission).

  • Internet Layer

    Usage:

    • Decides where data should go by adding logical addresses (IP addresses).

    • Handles routing between networks.

    • Ensures data packets reach the correct destination, even if they cross multiple networks.

    Examples in Use: IP (IPv4/IPv6) → Assigns unique addresses to devices.

    • ICMP → Used in ping & traceroute.

    • ARP → Finds MAC address from IP.

  • Network Access Layer

    Usage:

    • Handles how data is physically transmitted (wires, Wi-Fi, fiber, etc.).

    • Deals with MAC addresses, network interfaces, and converting bits into signals.

    • Adds MAC addresses to frames and handles framing, addressing, and error detection at the hardware level.

    Examples in use: • Ethernet → Wired LAN communication.

    • Wi-Fi (802.11) → Wireless LAN communication.

    • PPP, DSL, Fiber → ISP connectivity.

    • Switches & NICs → Device-to-device connections.

Network Fundamentals

Subnetting and CIDR

Subnetting occurs when a larger network is split into smaller networks to keep security. As a result, fewer networks are easier to maintain. In CIDR, the notation system (/x) represents how big or small those chunks are.

For Example: The old Class C network always has /24 (256IP) but with CIDR, you can have 192.168.0.0/26 (64 IPs) or 192.168.0.0/28 (16 IPs). That’s means you don’t have to waste 256 IPs when you only need 16.

Basic calcualtion of CIDR

Q. I need to 64 usable IP address for a finance department. How do you do that?

You want 64 usable (≈ 66 total)

  • CIDR: /25

  • Mask: 255.255.255.128

  • Why: Need at least 64 usable → 2^h − 2 ≥ 64h = 732 − 7 = /25

  • Total: 2^(32−25) = 128

  • Usable hosts: 128 − 2 = 126

Example block: 192.168.10.0/25

  • Network: 192.168.10.0 , 192.168.10.128

  • Usable range: 192.168.10.1 - 192.168.10.126, 192.168.10.129-192.168.10.254

  • Broadcast: 192.168.10.127, 192.168.10.255

Common Ports and Protocol Used in DevOps

If the IP is the address of the office , then a Port is like a specific department in that office that leads to a particular service. Protocols is the language or process each department uses to do its work.

Address Resolution Protocol (ARP)

ARP is like a phonebook inside your local network.
It helps computers find the real physical address (MAC address) of another device when all they know is the IP address.

📦How it works

  • Your laptop wants to send data to 192.168.1.10.

  • It doesn’t know the MAC address of that device.

  • It sends a broadcast: “Who has 192.168.1.10?”

  • The device replies: “I do! Here’s my MAC address.”

  • Now your laptop can send the data directly.

✅ When debugging network issues, ARP helps explain why sometimes devices in the same subnet can’t communicate (e.g., if ARP cache is stale or spoofed). Tools like arp -a or packet sniffers (Wireshark, tcpdump) can show ARP requests/replies.

DNS (Domain Name Resolution)

DNS translates the human-friendly name into the machine-friendly IP address so your browser can find the website.

📦How it works'

  • You type example.com in your browser.

  • Your computer asks a DNS server: “Hey, what’s the IP of example.com?”

  • DNS replies: “It’s 93.184.216.34”

  • Your browser connects to that IP and loads the website.

Configuring DNS records is key when deploying services:

  • A record → maps domain to IPv4 address

  • AAAA record → maps domain to IPv6 address

  • CNAME → alias for another domain

  • MX → mail server

SSH

A protocol used to securely access and manage remote servers over a network. It is used in scripts, Ansible playbooks, and pipelines to deploy code or run commands remotely.

FTP

File Transfer Protocol is used to transfer files between local systems and remote servers. In environments without automated pipelines, FTP can be a way to quickly move files. FTP can transfer log files, reports, or backups to/from remote storage. There is secure and automated alternatives like SFTP, SCP, rsync.

Some Common Ports In DevOps are:

  • Port 80 → HTTP (websites)

  • Port 443 → HTTPS (secure websites)

  • Port 21 → FTP (file transfer)

  • Port 22 → SSH (remote login)

  • Port 25 → SMTP (sending emails)

  • Port 3306 → MySQL Database

  • Port 6643 → Kubernetes API

  • Port 6379 → Redis

  • Port 9090 → Prometheus

  • Port 3000 → Grafana Dashboard

  • Port 8080 → Jenkins (Default UI port)

Why a DevOps Engineer Needs the OSI Model & TCP/IP

  1. Troubleshooting Network Issues

    Most real-world outages come from network misconfigurations (wrong ports, firewalls, DNS, load balancers).

    • OSI model helps you pinpoint the layer where the issue lies:

      • DNS not resolving? (Layer 7 Application / Layer 3 Network)

      • Firewall blocking ports? (Layer 4 Transport)

      • Server not reachable? (Layer 2–3 Data Link/Network).

    • TCP/IP stack knowledge helps you read ping, traceroute, netstat, tcpdump, etc

  2. Understanding Cloud & Container Networking

    • In AWS, GCP, Azure, services like VPCs, subnets, security groups, and load balancers map directly to OSI/TCP concepts.

    • In Kubernetes/Docker, container networking, service discovery, and ingress controllers depend on TCP/IP.

    • Knowing which layer handles routing, ports, and encryption helps design scalable deployments.

  3. Security & DevSecOps

    • Firewalls, WAFs, VPNs, and TLS all map to different OSI layers.

    • Example:

      • WAF filters traffic at Layer 7 (Application).

      • Security Groups/ACLs block traffic at Layer 4 (Transport).

      • IPSec VPN works at Layer 3 (Network).

    • As a DevOps engineer, you need to secure systems end-to-end across layers.

Performance Optimization

  • Understanding TCP handshakes, retransmissions, and congestion control helps optimize latency and throughput.

  • Example:

    • Why is a service slow? Could be TCP retries, packet loss, or SSL negotiation delay.

    • OSI/TCP knowledge helps isolate the bottleneck.

0
Subscribe to my newsletter

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

Written by

Sirsha Thapa
Sirsha Thapa