Computer Networking
A computer network is a group of computers connected together to share resources, data, and communication. Networking is what makes the internet, email, online banking, and cloud services possible. It is the foundation of modern digital communication.
A. What is Computer Networking?
Definition, Advantages & Disadvantages
What a network is, why it's used, and its trade-offs
| Point | Detail |
|---|---|
| Definition | A computer network is a system of two or more computers and devices connected together by communication links (wired or wireless) to share resources (files, printers, internet) and communicate. |
| Connection types | Wired — Ethernet cables (twisted pair, coaxial, fibre optic). Wireless — Wi-Fi, Bluetooth, cellular (3G/4G/5G), satellite. |
| Key Advantages | Resource sharing (printer, internet) · File sharing · Communication (email, chat) · Centralised data storage · Cost reduction · Remote access |
| Disadvantages | Security risks (hacking, viruses spread easily) · Setup cost · Maintenance complexity · Single point of failure (if server goes down) |
| Uses | Internet, email, online banking, streaming, cloud storage, VoIP calls, video conferencing, online gaming, ATM networks |
Definition
Two or more computers connected to share resources (files, printers, internet) and communicate.
Connection Types
WiredEthernet cables — twisted pair, coaxial, fibre optic
WirelessWi-Fi, Bluetooth, cellular (3G/4G/5G), satellite
Advantages
Resource sharing · File sharing · Communication · Centralised storage · Cost reduction · Remote access
Disadvantages
Security risks · Setup cost · Maintenance · Viruses spread network-wide
Uses
Internet · Email · Online banking · Video conferencing · Cloud storage · ATM networks · Online gaming
⚡ Exam Tip — "Minimum computers needed to form a network" = Two. The main advantage of networking = resource sharing. The main disadvantage = security risk.
B. Types of Computer Networks
Classified by Geographic Area
PAN → LAN → MAN → WAN
| Type | Full Name | Coverage Area | Speed | Examples |
|---|---|---|---|---|
| PAN | Personal Area Network | A few metres (personal space) | Low | Bluetooth devices, phone to earphone, phone to laptop via hotspot |
| LAN | Local Area Network | Single building or campus (up to ~1 km) | High (100 Mbps–10 Gbps) | School computer lab, office network, home Wi-Fi |
| MAN | Metropolitan Area Network | A city or large campus (10–50 km) | Medium-High | Cable TV network across a city, university campus connecting multiple buildings |
| WAN | Wide Area Network | Countries or worldwide | Lower (limited by distance) | The Internet, bank ATM networks across Pakistan, satellite communication |
PAN — Personal Area Network
RangeA few metres. Bluetooth, phone-to-earphone.
LAN — Local Area Network
RangeBuilding or campus (~1 km). School labs, office, home Wi-Fi. Fast: 100 Mbps–10 Gbps.
MAN — Metropolitan Area Network
RangeCity (10–50 km). Cable TV networks, university campus.
WAN — Wide Area Network
RangeCountries/worldwide. The Internet is the largest WAN. Bank ATM networks.
⚡ Exam Tips — LAN = largest/fastest within one building. WAN = largest geographic coverage. The Internet = largest WAN. LAN speed = 100 Mbps to 10 Gbps. Remember order: PAN → LAN → MAN → WAN (smallest to largest area).
C. Network Topologies
Physical Arrangement of Network Nodes
How computers are physically connected to each other
| Topology | Structure | Advantages | Disadvantages |
|---|---|---|---|
| Bus | All computers connected to a single central cable (backbone). Data travels in both directions along the bus. | Simple and cheap. Easy to add computers. Less cable needed. | If backbone cable fails, entire network fails. Performance drops with many computers. Difficult to troubleshoot. |
| Star | All computers connected to a central hub or switch. Each computer has its own cable to the central device. | If one cable fails, only that computer is affected. Easy to add/remove computers. Easy to troubleshoot. | If the hub/switch fails, entire network fails. More cable needed. Higher cost. |
| Ring | Computers connected in a closed loop. Data travels in one direction around the ring, passing through each node. | Equal access for all computers. No central device needed. Performs well under heavy load. | If one computer/cable fails, entire network may fail. Slower — data must pass through every node. Difficult to modify. |
| Mesh | Every computer connected directly to every other computer. Multiple paths exist between any two nodes. | Highly reliable — failure of one link doesn't affect the rest. Fast direct paths. High security. | Very expensive — too many cables. Complex to install and manage. Not practical for large networks. |
| Tree (Hierarchical) | Combination of Bus and Star. Computers connected in a tree-like hierarchy — groups of star networks connected to a bus backbone. | Scalable — easy to expand. Divides network into manageable groups. | If backbone fails, entire network down. More complex. Higher maintenance. |
| Hybrid | Combination of two or more different topologies. Most real-world networks are hybrid. | Flexible — combines strengths of different topologies. Scalable. | Complex design. Expensive. Difficult to troubleshoot. |
Bus Topology
All computers on one backbone cable. Cheap and simple. If backbone fails — whole network fails.
Star Topology
All computers connect to central hub/switch. Most popular today. One failure doesn't affect others. If hub fails — all fail.
Ring Topology
Computers in a closed loop. Data goes one direction. One failure can break the ring.
Mesh Topology
Every computer connected to every other. Most reliable. Very expensive. Used in critical systems.
Tree Topology
Star networks connected to a bus backbone. Scalable and hierarchical. Backbone failure = whole network fails.
Hybrid Topology
Combination of two or more topologies. Most real-world networks are hybrid. Flexible but complex and expensive.
BusCheapest · Simple · Backbone failure = whole network fails
StarMost popular today · Easy to manage · Hub failure = all fail
RingEqual access · One cable break can fail the whole network
MeshMost reliable · Most expensive · Every device connected to every other
⚡ Exam Tips — Most common topology used today = Star. Cheapest topology = Bus. Most reliable = Mesh. Bus failure = entire network down. Star hub failure = entire network down. Ring failure = entire network may fail. Mesh = every computer connected to every other.
D. Network Hardware Devices
Devices That Build a Network
What each piece of hardware does and when to use it
| Device | Function | Key Point |
|---|---|---|
| NIC Network Interface Card |
Hardware installed in a computer that connects it to the network. Every networked device has a NIC with a unique MAC address. | MAC = physical address of device. Built into motherboard of modern computers. |
| Hub | A simple device that connects multiple computers in a LAN. Broadcasts data to ALL connected devices — inefficient. Works at Physical Layer. | Older, inefficient, being replaced by switches. Does NOT filter traffic. |
| Switch | Connects multiple devices in a LAN. Smarter than hub — sends data only to the intended destination computer. Works at Data Link Layer. | Better than hub — reduces unnecessary traffic. Most modern LANs use switches. |
| Router | Connects different networks together (e.g. your home LAN to the Internet). Routes data packets using the best path. Works at Network Layer. Has an IP address. | Essential for internet access. Home Wi-Fi routers = router + switch + wireless access point combined. |
| Modem | Modulator Demodulator — converts digital signals from computer into analog signals for telephone lines (and vice versa). Used for internet access via telephone lines. | Needed when connecting via telephone lines (DSL). Converts digital ↔ analog. |
| Repeater | Amplifies and retransmits a network signal to extend its range over longer distances. Signals weaken over distance — repeater boosts them. | Used to extend network beyond normal cable length limits. |
| Bridge | Connects two network segments together. Filters traffic and forwards only the data that needs to cross to the other segment. | Divides a large network into smaller, more manageable segments. |
| Gateway | Connects two completely different networks that use different protocols. Translates between protocols so they can communicate. | More powerful than a router. Used at entry points between networks using different architectures. |
NIC (Network Interface Card)
Hardware that connects a computer to a network. Each NIC has a unique MAC address.
Hub vs Switch
Hub = sends to ALL devices (old, inefficient). Switch = sends to DESTINATION ONLY (smart, modern).
Router
Connects different networks. Routes data packets. Has IP address. Needed for internet access.
Modem
Modulator + Demodulator. Converts digital ↔ analog signals for telephone line internet.
Repeater
Boosts and retransmits weak signals to extend network range over distance.
Bridge
Connects two network segments. Filters traffic and only forwards data that needs to cross to the other segment.
Gateway
Connects different network types/protocols. More powerful than a router.
⚡ Exam Tips — Hub = sends to ALL (broadcasts). Switch = sends to TARGET ONLY (unicast). Router = connects different networks + routes packets. Modem = digital ↔ analog. NIC has MAC address (physical address). Router has IP address (logical address). MAC = Media Access Control.
E. Network Protocols & the OSI Model
Common Protocols
Rules that computers follow to communicate
| Protocol | Full Name | Purpose | Port |
|---|---|---|---|
| TCP/IP | Transmission Control Protocol / Internet Protocol | Foundation of the internet. TCP ensures reliable delivery; IP handles addressing and routing. | — |
| HTTP | HyperText Transfer Protocol | Transferring web pages from servers to browsers. Used for websites. | 80 |
| HTTPS | HTTP Secure | Encrypted version of HTTP. Uses SSL/TLS. Padlock in browser = HTTPS. | 443 |
| FTP | File Transfer Protocol | Transferring files between computers over a network. | 21 |
| SMTP | Simple Mail Transfer Protocol | Sending email messages from client to server and between servers. | 25 |
| POP3 | Post Office Protocol 3 | Receiving email — downloads messages from server to client device. | 110 |
| IMAP | Internet Message Access Protocol | Receiving email — keeps messages on server, syncs across devices. | 143 |
| DNS | Domain Name System | Translates domain names (google.com) into IP addresses. Internet's phone book. | 53 |
| DHCP | Dynamic Host Configuration Protocol | Automatically assigns IP addresses to devices on a network. | 67/68 |
TCP/IP
Foundation of the internet. TCP = reliable delivery. IP = addressing and routing.
HTTP / HTTPS
HTTP = web pages (port 80). HTTPS = encrypted web (port 443, padlock icon).
FTP
File Transfer Protocol — transferring files over network (port 21).
SMTP / POP3 / IMAP
SMTP = sending email. POP3 = receiving (downloads). IMAP = receiving (server-sync).
DNS
Translates domain names to IP addresses. "Internet's phone book".
DHCP
Dynamic Host Configuration Protocol — automatically assigns IP addresses to devices on a network (ports 67/68).
OSI Model — 7 Layers
Open Systems Interconnection — standard for networking
7 · AppUser interface — HTTP, FTP, SMTP, DNS, Telnet
6 · PresData format, encryption, compression (SSL/TLS)
5 · SessManages sessions/connections between applications
4 · TransReliable delivery, flow control — TCP, UDP
3 · NetRouting and IP addressing — IP, ICMP, Router
2 · DataMAC addressing, error detection — Ethernet, Switch, NIC
1 · PhysCables, signals, bits — Ethernet cable, Hub, Repeater
Quick Fire Revision
- Minimum computers for a networkTwo
- LAN stands forLocal Area Network
- WAN stands forWide Area Network
- MAN covers a _City (10–50 km)
- The Internet is the largest _WAN
- Most popular topology todayStar topology
- Cheapest topologyBus topology
- Most reliable topologyMesh topology
- Hub sends data toALL connected devices (broadcast)
- Switch sends data toDestination device only (unicast)
- Router connectsDifferent networks together
- Modem stands forModulator Demodulator
- Modem convertsDigital ↔ Analog signals
- NIC has a unique _ addressMAC address (physical address)
- Repeater is used toExtend network range (boost signal)
- TCP/IP is the foundation ofThe Internet
- HTTP port numberPort 80
- HTTPS port numberPort 443
- FTP is used forFile Transfer (port 21)
- SMTP is used forSending email (port 25)
- DNS translatesDomain names to IP addresses
- OSI model has _ layers7 layers
- OSI Layer 1 (Physical) devicesHub, Repeater, Cables
- OSI Layer 3 (Network) deviceRouter
- OSI mnemonic (7→1)All People Seem To Need Data Processing