Skip to main content
โšก Calmops

Introduction to Computer Networks

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:

  1. Application: HTTP request created
  2. Transport: TCP segment
  3. Network: IP packet
  4. Data Link: Ethernet frame
  5. Physical: Binary transmission

TCP/IP Model

Four Layers

  1. Application: HTTP, FTP, SMTP
  2. Transport: TCP, UDP
  3. Internet: IP, ICMP
  4. 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: Localhost
  • 10.x.x.x: Private
  • 192.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

  1. No connectivity: Check cables, IP configuration
  2. Slow speeds: Check for congestion, malware
  3. DNS issues: Clear cache, try different DNS
  4. 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.


Resources

Comments