Networking Fundamentals & OSI Model Deep Dive
Networking is the bloodstream of enterprise technology. Every cyber attack moves through networks. Every defensive control monitors or filters network traffic. This module dissects how data travels across networks, the protocols that power the internet, and the security implications of each layer in the networking stack.
The OSI Model: Understanding Network Communication
The Open Systems Interconnection (OSI) model is a 7-layer framework that standardizes network functions from physical cables to application data. Developed by ISO in 1984, it remains fundamental to understanding network security, troubleshooting, and attack vectors.
Info
Application
Layer 7User-facing protocols and data formats. HTTP, HTTPS, FTP, SMTP, DNS operate here.
Key Protocols
Protocol Data Unit
DataAnalogy: Like the content of a letter you’re writing—the actual message you want to send.
Important
Presentation
Layer 6Data translation, encryption, compression, and formatting. Converts data into a format the Application layer can understand.
Key Protocols
Protocol Data Unit
DataAnalogy: Like translating a letter into a foreign language or encrypting it so only the recipient can read it.
Important
Session
Layer 5Establishes, maintains, and terminates connections between applications. Manages dialogues and control.
Key Protocols
Protocol Data Unit
DataAnalogy: Like a phone call—you dial (establish), talk (maintain), and hang up (terminate).
Important
Transport
Layer 4End-to-end communication, reliability, flow control, error recovery. TCP (reliable) vs UDP (fast but unreliable).
Key Protocols
Protocol Data Unit
Segments (TCP) / Datagrams (UDP)Analogy: Like postal service—TCP is registered mail with receipt (guaranteed delivery), UDP is regular mail (may or may not arrive).
Important
Network
Layer 3Logical addressing and routing. IP addresses determine where packets go. Routers operate at this layer.
Key Protocols
Protocol Data Unit
PacketsAnalogy: Like the postal address on an envelope—tells the post office where to deliver.
Important
Data Link
Layer 2Physical addressing (MAC addresses), error detection, flow control between directly connected nodes. Switches operate here.
Key Protocols
Protocol Data Unit
FramesAnalogy: Like the specific apartment number in a building—once mail reaches the building, this tells you which unit.
Important
Physical
Layer 1Actual physical medium: cables, fiber optics, radio waves, connectors, voltages. Defines how bits are transmitted as electrical/light signals.
Key Protocols
Protocol Data Unit
Bits (0s and 1s)Analogy: Like the road or fiber optic cable itself—the physical medium everything travels on.
Important
TCP/IP Model: The Internet's Architecture
The TCP/IP model (DoD model)is a 4-layer model that describes how the actual internet works. It's the practical implementation behind the theoretical OSI model.
Application Layer
Combines OSI layers 5-7. Protocols: HTTP, DNS, SMTP, FTP.
Maps to OSI Layers:
Application, Presentation, Session
Transport Layer
Direct mapping to OSI layer 4. Protocols: TCP, UDP.
Maps to OSI Layers:
Transport
Internet Layer
IP addressing and routing. Protocols: IP, ICMP, ARP.
Maps to OSI Layers:
Network
Network Access / Link Layer
Physical transmission and local network communication. Protocols: Ethernet, Wi-Fi.
Maps to OSI Layers:
Data Link, Physical
Tip
IP Addressing & Subnetting: Network Segmentation Fundamentals
IP addressing and subnetting control how networks are structured and how traffic flows. Understanding subnetting is essential for network security—proper segmentation contains breaches and limits lateral movement.
IPv4 Address Structure
An IPv4 address is 32 bits (4 octets) written as dotted decimal: 192.168.1.1
First two octets (192.168): Network portion | Last two octets (1.1): Host portion
Subnet Masks & CIDR Notation
Subnet mask defines network vs host bits. CIDR (Classless Inter-Domain Routing) notation: /24 means 24 bits for network.
1192.168.1.0/242255.255.255.0 = 24 network bits34192.168.1.0/265255.255.255.192 = 26 network bits6= 4 subnets with 62 hosts each
Real-World Subnetting Scenarios
Corporate Network Segmentation
Original Network:
1192.168.1.0/24 (256 addresses)
Split Into:
14 subnets of 62 hosts each: 192.168.1.0/26, 192.168.1.64/26, 192.168.1.128/26, 192.168.1.192/26
Security Reason:
Separate departments (Finance, Engineering, HR, Guest WiFi) to limit lateral movement if one segment is compromised.
DMZ Design
Original Network:
110.0.0.0/16 (65,536 addresses)
Split Into:
1Public web servers: 10.0.1.0/24, Database servers: 10.0.2.0/25, Admin network: 10.0.2.128/25
Security Reason:
Public-facing systems isolated from internal resources. Database subnet only accessible from application servers, not directly from internet.
Network Security Devices & Their Functions
Network security relies on specialized hardware at different layers of the stack. Each device serves distinct security functions.
Router
Layer 3 (Network)Function: Connects different networks. Routes traffic based on IP addresses. Makes forwarding decisions using routing tables.
Security Role: Enforces network boundaries, implements ACLs (Access Control Lists), terminates VPN tunnels, performs NAT (Network Address Translation).
Example: Corporate router blocks all incoming connections except HTTPS (443) and SSH (22) from known management IPs.
Switch
Layer 2 (Data Link)Function: Connects devices on the same network. Forwards frames based on MAC addresses.
Security Role: VLAN segmentation, port security (MAC limiting), 802.1X authentication, DHCP snooping, ARP inspection.
Example: Switch configured with 802.1X prevents unauthorized devices from connecting to corporate network—devices must authenticate with credentials before gaining network access.
Firewall
Layer 3/4 (Network/Transport)Function: Filters traffic based on rules. Can be stateful (tracks connections) or stateless.
Security Role: Enforces network security policy, blocks/allow traffic based on IP, port, protocol, application signatures.
Example: Next-Gen Firewall (NGFW) inspects HTTPS traffic, blocks known malware C2 communications, and enforces user-based policies.
IDS/IPS
Layer 2-7 (varies)Function: IDS detects, IPS prevents malicious traffic. Signature-based and anomaly-based detection.
Security Role: Network monitoring, threat detection, attack prevention, forensic logging.
Example: Snort IPS detected and blocked SMB exploit attempts from an internal machine contacting known malicious IPs during incident response.
Load Balancer
Layer 4-7Function: Distributes traffic across multiple servers for performance and redundancy.
Security Role: DDoS protection, SSL offloading, application layer filtering, WAF integration.
Example: Cloud load balancer acted as first line of defense during DDoS attack by absorbing traffic spikes and rate-limiting suspicious requests.
Network Attack Vectors: Deep Dive
Most cyber attacks begin with network reconnaissance followed by exploitation of network-based vulnerabilities. Understanding these attack methodologies is critical for defense.
Man-in-the-Middle (MITM)
Method: Attacker intercepts communication between two parties. Can be passive (eavesdropping) or active (injecting/modifying traffic).
Common Techniques:
- ARP spoofing/poisoning
- Rogue DHCP server
- DNS spoofing
- SSL stripping
- Evil Twin WiFi
Defensive Measures:
- End-to-end encryption (TLS with certificate pinning)
- network monitoring for ARP anomalies
- static ARP entries for critical servers.
Important
Denial of Service (DoS/DDoS)
Method: Overwhelm target with traffic or resource requests to make service unavailable.
Common Techniques:
- SYN Flood
- UDP Flood
- HTTP Flood
- DNS Amplification
- Ping of Death
Defensive Measures:
- Anycast network distribution
- rate limiting
- scrubbing centers
- DDoS mitigation services (Cloudflare
- Akamai)
- traffic shaping.
Important
ARP Spoofing/Poisoning
Method: Send fake ARP messages to associate attacker MAC with victim IP. Enables MITM on local network.
Common Techniques:
- Gratuitous ARP replies
- ARP cache poisoning
- ARP flood
Defensive Measures:
- Static ARP entries for critical systems
- Dynamic ARP Inspection (DAI) on switches
- VPN for all wireless communications
- port security.
Important
DNS Cache Poisoning
Method: Corrupt DNS resolver cache to return malicious IP for legitimate domain.
Common Techniques:
- DNS ID spoofing
- Cache poisoning via prediction
- Pharming attacks
Defensive Measures:
- DNSSEC (DNS Security Extensions)
- use trusted DNS resolvers (1.1.1.1
- 8.8.8.8)
- monitor DNS records for changes.
Important
BGP Hijacking
Method: Announce fake IP prefixes to reroute internet traffic through attacker-controlled networks.
Common Techniques:
- Prefix hijacking
- Subprefix hijacking
- Session hijacking
Defensive Measures:
- RPKI (Resource Public Key Infrastructure) for route validation
- BGP monitoring services
- multi-homing with diverse providers.
Important
Network Security Best Practices
Implement these proven security controls across your network architecture to reduce attack surface and detect intrusions.
Network Segmentation
Divide network into zones with firewalls between them. Critical systems get isolated segments. Compromise of one segment doesn’t mean full network compromise.
Zero Trust Architecture
Never trust, always verify. Authenticate and authorize every connection, user, and device—even inside the network. Microsegmentation enforces least-privilege east-west traffic.
Defense-in-Depth
Multiple overlapping security layers: perimeter firewall + internal segmentation + endpoint protection + application controls. If one layer fails, others still protect.
Encrypted Communications
Use TLS 1.3 everywhere. VPNs for remote access. SSH instead of Telnet. Disable legacy protocols (SSLv3, TLS 1.0/1.1). Perfect Forward Secrecy (PFS) key exchange.
Network Monitoring
Deploy IDS/IPS throughout network. Enable NetFlow/sFlow collection. Centralized logging from all network devices. Regular packet capture analysis.
Secure Configuration
Disable unused ports and services. Change default credentials. Apply security hardening guides (CIS Benchmarks). Regular vulnerability scanning.
Key Takeaways
- OSI Model (7 layers) is fundamental to understanding network security controls and attack surfaces.
- Each OSI layer hosts distinct protocols, attacks, and security controls. Know what operates at each layer.
- Subnetting and segmentation are primary defenses against lateral movement after breach.
- Router (L3) vs Switch (L2) distinction: routers connect different networks, switches connect devices within same network.
- Common attacks like MITM, DoS, ARP poisoning exploit protocol weaknesses—understanding protocols reveals vulnerabilities.
- Defense-in-depth means overlapping controls at multiple layers—no single point of failure.
Further Reading & Resources
Practice protocol analysis with free packet capture tool. Analyze real network traffic and understand protocol behavior.
The definitive book on TCP/IP protocol internals. Volume 1 is essential reading for network engineers.
Free networking fundamentals course covering CCNA-level material with hands-on labs.
MIT OpenCourseWare graduate-level networking course with lecture notes and assignments.