๐ Networking Summary Guide
๐ Networking Summary Guide
I. What is Networking?
Computer Networking refers to the interconnection of computers and devices that share data and resources. It underpins nearly all IT and DevOps systems, including cloud infrastructure, server communication, and service discovery.
II. Basic Networking Concepts
Term | Description |
---|---|
IP Address | Unique identifier for a device on a network. IPv4 (e.g., 192.168.1.1 ), IPv6 (e.g., fe80::1 ). |
MAC Address | Hardware address of a NIC (e.g., 00:1A:2B:3C:4D:5E ). |
Subnet | Logical segmentation of a network (e.g., /24 = 255.255.255.0). |
Gateway | A router that connects a subnet to external networks. |
DNS | Domain Name System – resolves domain names to IP addresses. |
DHCP | Dynamic Host Configuration Protocol – assigns IPs automatically. |
III. OSI Model (7 Layers)
Layer | Name | Function |
---|---|---|
7 | Application | User interaction (HTTP, FTP, DNS) |
6 | Presentation | Data formatting (SSL, JPEG) |
5 | Session | Session management |
4 | Transport | Data delivery (TCP/UDP) |
3 | Network | Routing (IP) |
2 | Data Link | MAC addressing, frames |
1 | Physical | Hardware, cables, NICs |
IV. Key Protocols
Protocol | Layer | Purpose |
---|---|---|
IP | 3 | Addressing and routing |
TCP | 4 | Reliable communication |
UDP | 4 | Faster, connectionless communication |
HTTP/HTTPS | 7 | Web communication |
DNS | 7 | Name resolution |
SSH | 7 | Secure shell access |
ICMP | 3 | Ping/traceroute functionality |
FTP/SFTP | 7 | File transfer |
V. Networking Tools (Linux CLI)
Command | Usage |
---|---|
ip a | Show network interfaces & IPs |
ping | Test connectivity |
traceroute | Trace packet path |
netstat -tuln or ss -tuln | Show listening ports |
dig / nslookup | DNS resolution info |
curl / wget | HTTP requests |
tcpdump | Network packet capture |
nmap | Network scanning |
VI. Private vs Public IP
-
Private IP ranges (RFC1918):
-
10.0.0.0/8
-
172.16.0.0/12
-
192.168.0.0/16
-
-
Public IP: Routable on the internet.
-
NAT (Network Address Translation): Maps private to public IPs.
VII. TCP vs UDP
Feature | TCP | UDP |
---|---|---|
Connection | Connection-oriented | Connectionless |
Reliability | Guaranteed, ordered delivery | No guarantee/order |
Speed | Slower | Faster |
Use Cases | Web, email, SSH | DNS, video streaming |
VIII. Port Numbers
Port | Service |
---|---|
22 | SSH |
53 | DNS |
80 | HTTP |
443 | HTTPS |
25 | SMTP |
3306 | MySQL |
5432 | PostgreSQL |
6379 | Redis |
8080 | HTTP-alt (apps) |
IX. CIDR Notation & Subnetting
CIDR | Subnet Mask | Hosts |
---|---|---|
/8 | 255.0.0.0 | ~16M |
/16 | 255.255.0.0 | ~65K |
/24 | 255.255.255.0 | 254 |
/32 | 255.255.255.255 | 1 |
X. Firewalls and Security
-
iptables or nftables: Linux-based firewall tools.
-
UFW (Uncomplicated Firewall): Easy firewall management.
-
Security best practices:
-
Allow only required ports.
-
Block unused protocols.
-
Use VPNs for private access.
-
Monitor traffic with IDS/IPS (Snort, Suricata).
-
XI. DNS Concepts
Term | Description |
---|---|
A Record | Maps domain to IPv4 address |
AAAA | Maps domain to IPv6 |
CNAME | Alias to another domain |
MX | Mail exchange server |
NS | Nameservers for a domain |
TTL | Time to live (cache duration) |
XII. Network Services in DevOps
-
Load Balancers: Distribute traffic across servers (e.g., NGINX, HAProxy).
-
Reverse Proxies: Handle incoming requests and forward to services.
-
Service Discovery: Identify service locations dynamically (e.g., Consul, Kubernetes DNS).
-
Overlay Networks: Used in containers for cross-node communication (Flannel, Calico).
-
VPNs: Secure access to private networks (WireGuard, OpenVPN).
XIII. Common Network Troubleshooting Steps
-
Check IP:
ip a
-
Check DNS:
dig google.com
-
Test ping:
ping 8.8.8.8
-
Route check:
traceroute google.com
-
Port check:
ss -tuln
,nmap localhost
-
Logs:
/var/log/syslog
,/var/log/messages
-
Capture traffic:
tcpdump -i eth0
XIV. Best Practices
-
Use private networks and subnets for internal services.
-
Apply strict firewall rules.
-
Monitor traffic with tools like Netdata, Nagios, Prometheus.
-
Encrypt data in transit (TLS, VPN).
-
Use role-based access for network devices.
Comments
Post a Comment