Computer networking is the technology that allows computers and other devices to communicate with one another. Whether you are browsing the web, sending an email, streaming a video, or accessing a remote server, networking makes these activities possible.
This tutorial introduces the fundamental concepts of computer networking, including IP addresses, protocols, ports, routing, and common networking tools used in Linux and Unix-like operating systems.
What Is a Computer Network?
A computer network is a collection of devices connected together so they can exchange data.
Examples of networked devices include:
- Computers
- Smartphones
- Servers
- Printers
- Routers
- IoT devices
Networks can range from a small home network to the global Internet.
Why Networking Is Important
Networking allows computers to:
- Share files
- Access websites
- Send email
- Connect to remote systems
- Share printers
- Stream media
- Access cloud services
Modern computing would be impossible without networking.
Types of Networks
Local Area Network (LAN)
A LAN connects devices within a limited geographic area.
Examples:
- Home networks
- Office networks
- School networks
Typical LAN technologies include:
- Ethernet
- Wi-Fi
Wide Area Network (WAN)
A WAN connects networks across large distances.
The Internet is the largest WAN in existence.
Metropolitan Area Network (MAN)
A MAN covers a city or large campus.
Examples include municipal or university networks.
Understanding IP Addresses
Every device on a network requires an address.
An IP address uniquely identifies a device.
Example IPv4 address:
192.168.1.100
An IPv4 address consists of four numbers separated by periods.
Each number ranges from:
0 to 255
Private IPv4 Address Ranges
Common private networks use:
10.0.0.0/8
172.16.0.0/12
192.168.0.0/16
Home routers typically assign addresses such as:
192.168.1.x
IPv6
IPv6 was developed to solve IPv4 address exhaustion.
Example:
2001:db8::1
Advantages include:
- Vast address space
- Improved routing
- Better support for modern networks
Most modern operating systems support both IPv4 and IPv6.
Understanding Subnets
Subnets divide networks into smaller segments.
Example:
192.168.1.0/24
The /24 indicates that the first 24 bits represent the network portion.
Available host addresses:
192.168.1.1
through
192.168.1.254
Subnetting helps organize and manage networks efficiently.
What Is a MAC Address?
A MAC (Media Access Control) address uniquely identifies a network interface card.
Example:
00:1A:2B:3C:4D:5E
Unlike IP addresses, MAC addresses are typically assigned by the hardware manufacturer.
Network Protocols
A protocol is a set of rules governing communication between devices.
Common protocols include:
TCP
Transmission Control Protocol (TCP) provides:
- Reliable communication
- Error checking
- Ordered delivery
Examples:
- Web browsing
- File transfers
UDP
User Datagram Protocol (UDP) provides:
- Faster communication
- Lower overhead
- No delivery guarantees
Examples:
- Online gaming
- Video streaming
- DNS queries
ICMP
Internet Control Message Protocol is used for diagnostics.
Example:
ping google.com
Ping uses ICMP messages to test connectivity.
Understanding Ports
Ports allow multiple network services to operate on a single device.
Common ports include:
| Port | Service |
|---|---|
| 22 | SSH |
| 25 | SMTP |
| 53 | DNS |
| 80 | HTTP |
| 443 | HTTPS |
| 3306 | MySQL |
| 5432 | PostgreSQL |
When you visit a website, your browser usually connects to:
Port 80 (HTTP)
Port 443 (HTTPS)
DNS: The Internet’s Phone Book
Humans prefer names:
www.example.com
Computers use IP addresses:
93.184.216.34
The Domain Name System (DNS) translates names into IP addresses.
Example:
nslookup example.com
or:
dig example.com
Routing
Routers move traffic between networks.
Example:
Laptop
|
Router
|
Internet
|
Web Server
Each router examines the destination address and forwards packets appropriately.
This process is called routing.
Packets
Data is divided into small units called packets.
Each packet contains:
- Source address
- Destination address
- Protocol information
- Payload data
Large files are split into many packets and reassembled at the destination.
The TCP/IP Model
Networking is often described using layers.
Application Layer
Examples:
- HTTP
- HTTPS
- SMTP
- DNS
Transport Layer
Protocols:
- TCP
- UDP
Internet Layer
Protocols:
- IPv4
- IPv6
- ICMP
Network Access Layer
Examples:
- Ethernet
- Wi-Fi
Each layer performs specific functions and works together to deliver data.
Common Linux Networking Commands
View IP Addresses
ip addr
View Routing Table
ip route
Test Connectivity
ping google.com
Display Active Connections
ss -tuln
Example output:
tcp LISTEN 0 128 *:22
This indicates that SSH is listening on port 22.
Display Network Interfaces
ip link
DNS Lookup
dig example.com
or:
nslookup example.com
What Happens When You Visit a Website?
Suppose you enter:
https://www.example.com
The process typically follows these steps:
- Browser requests DNS lookup.
- DNS returns an IP address.
- Browser establishes a TCP connection.
- HTTPS encryption is negotiated.
- Browser sends an HTTP request.
- Server returns the webpage.
- Browser displays the content.
All of this usually happens within seconds.
Network Security Basics
Important security practices include:
- Use firewalls.
- Keep software updated.
- Use strong passwords.
- Enable encryption.
- Limit exposed services.
- Use SSH instead of Telnet.
Common Linux firewall tools include:
- nftables
- iptables
- ufw
- pf (BSD)
Networking and Linux Servers
Linux servers commonly provide services such as:
- Web hosting
- Databases
- File sharing
- DNS
- VPN access
Understanding networking is essential for managing Linux systems effectively.
Conclusion
Networking allows computers and devices to communicate across local and global networks. Concepts such as IP addresses, protocols, DNS, routing, ports, and packets form the foundation of modern network communication. By understanding these basics and becoming familiar with common Linux networking tools, users gain valuable skills for system administration, software development, cybersecurity, and cloud computing.