Networking Concepts
A short theory page without the heavy copy-paste and image clutter from older cheat sheets.
OSI and TCP/IP
OSI
- Physical
- Data Link
- Network
- Transport
- Session
- Presentation
- Application
TCP/IP
- Link
- Internet
- Transport
- Application
In practice, it is useful to think about it like this:
IP Addressing
Example:
192.168.10.25/24
192.168.10.0is the network192.168.10.25is the host address/24is the prefix length
Private IPv4 Ranges
10.0.0.0/8172.16.0.0/12192.168.0.0/16
Special Addresses
127.0.0.1loopback0.0.0.0unspecified or default255.255.255.255broadcast169.254.0.0/16link-local or APIPA
IPv4 vs IPv6
- IPv4 uses 32 bits
- IPv6 uses 128 bits
- IPv6 is written as hex groups separated by
: - In dual-stack environments, troubleshooting must account for both stacks, not just IPv4
Routing
A router makes decisions based on the route table. If no more specific route exists, traffic usually goes through the default gateway.
Useful questions:
- Is there a route to the target network?
- What is the next hop?
- Is the return path symmetric?
NAT
NAT rewrites the source or destination address. The most common DevOps case is a private workload reaching the outside world through a single public IP.
DNS
DNS resolves names into records such as:
AAAAACNAMEMXTXTNSPTR
Basic flow:
- The client talks to a resolver.
- The resolver goes to the root if needed.
- Then it queries the TLD.
- Then it reaches the authoritative nameserver.
- The answer is cached according to TTL.
Proxy
- a forward proxy acts on behalf of the client
- a reverse proxy accepts traffic for an application and forwards it to a backend
The most common reverse proxy in infrastructure work is Nginx.
Firewall and Ports
- a TCP or UDP port is a transport-layer concept
connection refusedusually means the host is reachable but no service is listeningtimeoutmore often points to a firewall, routing issue, or silently dropped traffic
Practice
- During troubleshooting, think in layers rather than in tool names.
- If DNS is broken, that does not automatically mean the whole network is broken.
- If ping works, that does not guarantee TCP 443 works too.