Networking Basics: Understanding TCP/IP, DNS, and Network Protocols
Learn the fundamentals of computer networking including the OSI model, TCP/IP protocol suite, IP addressing, subnetting, DNS, and network security essentials.
Why Networking Fundamentals Matter
Every cyber attack travels over a network. Whether an attacker is exploiting a web application, intercepting wireless traffic, or launching a denial-of-service attack, they are manipulating network protocols. To defend against these attacks — or to conduct authorized penetration testing — you must understand how networks operate at a fundamental level.
The OSI Model
The Open Systems Interconnection (OSI) model is a conceptual framework that standardizes networking functions into seven layers. Each layer provides services to the layer above it and receives services from the layer below.
| Layer | Name | Function | Example Protocols |
|---|---|---|---|
| 7 | Application | User-facing network services | HTTP, FTP, SMTP, DNS |
| 6 | Presentation | Data translation, encryption | SSL/TLS, JPEG, ASCII |
| 5 | Session | Session management | NetBIOS, RPC |
| 4 | Transport | End-to-end reliability | TCP, UDP |
| 3 | Network | Logical addressing, routing | IP, ICMP, ARP |
| 2 | Data Link | Framing, MAC addressing | Ethernet, Wi-Fi (802.11) |
| 1 | Physical | Raw bit transmission | Cables, radio signals |
While the TCP/IP model (four layers) is more practical, the OSI model remains invaluable for troubleshooting and understanding where different protocols operate.
The TCP/IP Protocol Suite
TCP/IP is the foundational protocol suite of the internet. It consists of four layers: Application, Transport, Internet, and Link.
TCP vs UDP
TCP (Transmission Control Protocol) is connection-oriented and guaranteed. It establishes a three-way handshake (SYN, SYN-ACK, ACK) before sending data, ensures ordered delivery, and retransmits lost packets. TCP is used where reliability matters: web browsing, email, file transfers.
UDP (User Datagram Protocol) is connectionless and best-effort. It sends datagrams without establishing a connection, with no guarantee of delivery or ordering. UDP is used where speed matters over reliability: streaming, VoIP, DNS queries, DHCP.
IP Addressing
Every device on a network needs a unique IP address. IPv4 addresses are 32-bit numbers typically written in dotted decimal notation (192.168.1.1). With address exhaustion, IPv6 (128-bit) is gradually being adopted.
Subnetting
Subnetting divides a network into smaller, manageable segments. A subnet mask defines which portion of the IP address represents the network and which represents the host.
For example, 192.168.1.0/24 means the first 24 bits are the network portion, leaving 8 bits for hosts (254 usable addresses). Understanding CIDR notation (/16, /24, /28) and subnet calculations is essential for network design and security zoning.
DNS Resolution Process
The Domain Name System translates human-readable domain names into machine-readable IP addresses.
DNS Record Types
| Record | Purpose |
|---|---|
| A | Maps a domain to an IPv4 address |
| AAAA | Maps a domain to an IPv6 address |
| CNAME | Canonical name alias |
| MX | Mail exchange server |
| TXT | Arbitrary text (often for verification) |
| NS | Nameserver for the domain |
| SOA | Start of authority — administrative information |
Network Security Fundamentals
Firewalls
Firewalls filter traffic based on rules. Packet-filtering firewalls inspect headers (source/destination IP, port, protocol). Stateful firewalls track connection states and allow return traffic automatically. Next-generation firewalls (NGFW) add application-layer inspection, intrusion prevention, and threat intelligence.
VPNs
Virtual Private Networks encrypt traffic between two endpoints, creating a secure tunnel over an untrusted network. Common protocols include WireGuard, OpenVPN, and IPsec. VPNs protect data in transit and provide remote access to internal networks.
Network Segmentation
Dividing a network into segments limits the blast radius of a breach. If an attacker compromises a workstation in a segmented network, they cannot easily reach the database server in a different segment. VLANs and firewalls enforce segmentation.
Practical Networking Tools
Every security professional should be proficient with these tools:
Understanding these networking fundamentals is the bedrock of cybersecurity. Every attack and defense operates within these protocols. Master the basics here, and advanced topics like penetration testing, traffic analysis, and network defense become far more approachable.
Frequently Asked Questions
Continue Learning
OSI Model Explained: The Seven Layers of Networking
Master the OSI model's seven layers, understand how each layer functions, learn real-world protocol examples, and use the model for troubleshooting.
Networking · IntermediateDNS Explained: How the Domain Name System Works and Its Security
An in-depth exploration of DNS architecture, resolution process, record types, caching, security threats, and privacy protocols like DoH and DoT.
Networking · IntermediateInternet Infrastructure: DNS, WHOIS, and Domain Systems
Understand the core infrastructure of the internet including DNS hierarchy, WHOIS databases, Regional Internet Registries, and how domain names are managed globally.
Networking · BeginnerPorts and Protocols: Understanding Network Communication
Learn about network ports, their numbering system, common protocols at each layer, how services use ports, and security implications.
Related Security Tools
Netcat
Learn how to use Netcat (nc) in Kali Linux to open a TCP or UDP connection, check a port, and see what a service sends back. Follow the examples to send your first message, inspect HTTP and SMTP responses, and transfer a test file without exposing sensitive data.
Information GatheringNmap
Learn how to use Nmap, the free open-source network scanner: run your first port scan, discover live hosts, detect services and operating systems, and check for vulnerabilities with NSE scripts — a beginner tutorial for Kali Linux.
Sniffing & SpoofingWireshark
Wireshark tutorial for beginners: capture packets, read the three panes, filter traffic and follow TCP streams — a hands-on guide to the world's foremost network protocol analyzer.
Stress Testinghping3
hping3 is a command-line network tool for crafting, sending, and analyzing custom TCP/IP packets. Built for firewall testing, port scanning, OS fingerprinting, path MTU discovery, and authorized stress testing, it gives you control over nearly every field of the TCP, UDP, ICMP, and raw IP headers — the flags, sequence numbers, window size, TTL, fragmentation, and payload — and then shows you exactly how the target answers. Where Nmap runs predefined scan types, hping3 is the packet workbench you reach for when the question is "what does the firewall do with THIS exact packet?" It runs on raw sockets (so it needs root), supports scan and listen modes, and includes a Tcl scripting engine for automating protocol experiments in a lab.