Introduction
Computer networks form the backbone of modern computing. From browsing the web to cloud services, understanding networks helps diagnose issues and design better systems. This guide covers networking fundamentals.
What Is a Computer Network?
Definition
A computer network is a collection of interconnected devices that share resources and communicate.
Components
- Devices: Computers, servers, routers, switches
- Media: Cables, wireless signals
- Protocols: Rules for communication
- Software: Operating systems, applications
The OSI Model
Seven Layers
| Layer | Name | Function | Examples |
|---|---|---|---|
| 7 | Application | User interface | HTTP, DNS |
| 6 | Presentation | Data formatting | SSL/TLS |
| 5 | Session | Session management | NetBIOS |
| 4 | Transport | Reliable delivery | TCP, UDP |
| 3 | Network | Routing | IP, ICMP |
| 2 | Data Link | Frame transfer | Ethernet, WiFi |
| 1 | Physical | Binary transmission | Cables |
Data Flow
When you request a webpage:
- Application: HTTP request created
- Transport: TCP segment
- Network: IP packet
- Data Link: Ethernet frame
- Physical: Binary transmission
TCP/IP Model
Four Layers
- Application: HTTP, FTP, SMTP
- Transport: TCP, UDP
- Internet: IP, ICMP
- Network Access: Ethernet
IP Addresses
IPv4
32-bit address: 192.168.1.1
Classes:
- Class A: 1-126 (large networks)
- Class B: 128-191 (medium)
- Class C: 192-223 (small)
Special Addresses:
127.0.0.1: Localhost10.x.x.x: Private192.168.x.x: Private
IPv6
128-bit address: 2001:0db8:85a3:0000:0000:8a2e:0370:7334
Subnetting
# Calculate subnets
Network: 192.168.1.0/24
- /24: 256 addresses (254 hosts)
- /25: 128 addresses (126 hosts)
- /26: 64 addresses (62 hosts)
Protocols
TCP (Transmission Control Protocol)
- Connection-oriented
- Reliable delivery
- Ordered packets
- Use cases: Web, email, file transfer
UDP (User Datagram Protocol)
- Connectionless
- Fast, unreliable
- Use cases: Video streaming, gaming, DNS
HTTP/HTTPS
HTTP Request:
GET /index.html HTTP/1.1
Host: example.com
User-Agent: Mozilla/5.0
Accept: text/html
HTTPS adds TLS encryption.
DNS (Domain Name System)
Translates domain names to IP addresses:
User types: example.com
โ
Local DNS checks cache
โ
Root DNS: Ask .com TLD
โ
TLD DNS: Authoritative DNS for example.com
โ
Returns IP: 93.184.216.34
Network Devices
Router
- Connects different networks
- Makes forwarding decisions
- Operates at Layer 3
Switch
- Connects devices within a network
- Uses MAC addresses
- Operates at Layer 2
Access Point
- Wireless connections
- Bridges wireless and wired
Firewall
- Monitors traffic
- Blocks unauthorized access
- Can operate at multiple layers
Network Topologies
Physical Topologies
- Bus: Single cable, terminators
- Star: Central hub/switch
- Ring: Circular connection
- Mesh: Multiple connections
Logical Topologies
- Broadcast: One sender, all receive
- Point-to-Point: Direct connection
- Point-to-Multipoint: Central hub to endpoints
Wireless Networks
WiFi Standards
| Standard | Speed | Frequency |
|---|---|---|
| 802.11n | 600 Mbps | 2.4/5 GHz |
| 802.11ac | 3.46 Gbps | 5 GHz |
| 802.11ax (WiFi 6) | 9.6 Gbps | 2.4/5/6 GHz |
Security
- WPA3: Latest standard
- WPA2: Common
- WEP: Deprecated
Network Address Translation (NAT)
Allows multiple devices to share one public IP:
Private Network Public Network
192.168.1.2 โโโ
192.168.1.3 โโโผโโโ NAT โ Public IP
192.168.1.4 โโโ
Troubleshooting
Basic Commands
# Check connectivity
ping google.com
# Trace route
traceroute google.com
# Check IP configuration
ipconfig (Windows)
ip addr (Linux)
# Test port connectivity
telnet example.com 80
# DNS lookup
nslookup example.com
# Network connections
netstat -an
Common Issues
- No connectivity: Check cables, IP configuration
- Slow speeds: Check for congestion, malware
- DNS issues: Clear cache, try different DNS
- Firewall blocking: Check rules, temporarily disable
Security
Common Threats
- Malware: Viruses, ransomware
- Phishing: Fake communications
- Man-in-the-Middle: Intercepting traffic
- DDoS: Flooding with requests
Protection
- Firewalls
- VPNs
- Encryption
- Strong passwords
- Regular updates
Conclusion
Understanding networking fundamentals helps in troubleshooting, security, and system design. Start with the OSI model and build from there. Networks are the foundation of modern computing.
Comments