Unit 1:

Computer Networks

Computer networks connect multiple devices to share resources, exchange data, and communicate. From simple LANs in homes to the global Internet connecting billions of devices, networks form the backbone of modern computing.

What is a Network?

Definition: A computer network is a collection of interconnected devices (computers, servers, printers, mobile phones, IoT devices) that communicate using shared communication protocols and media.

Types of Networks

Type Range / Scope Example
PAN 1–10 m (personal) Bluetooth, USB devices.
LAN Building / campus Office WiFi, home network.
MAN City Cable TV city network.
WAN Country / global Internet.

Important Devices

Device Function
Router Routing between networks (IP layer).
Switch MAC‑based forwarding within LAN.
Hub Simple broadcast on LAN.
Bridge Connects LAN segments.

Network Topologies

Topology Structure Pros / Cons
Bus Single backbone cable. Simple & cheap; one fault can break whole network.
Star All devices → hub/switch. Easy fault isolation; central point of failure.
Ring Devices in circle, token‑passing. Predictable; ring breaks with one link failure.
Mesh Every device connected to many others. Very reliable; complex and expensive.

The Internet

The Internet is a global network of networks using the TCP/IP protocol suite. It is decentralized and connects government, academic, corporate, and private networks.

Protocols

Protocols are standardized rules for communication.

Protocol Layer Purpose
Ethernet Data Link LAN communication (MAC addresses).
IP Network Logical addressing and routing.
TCP Transport Reliable, connection‑oriented delivery.
UDP Transport Unreliable, fast datagram transport.
HTTP Application Web browsing.

OSI Model (7 Layers)

The OSI model divides network communication into 7 conceptual layers:

  1. Physical → bits on wire.
  2. Data Link → MAC addresses, frames.
  3. Network → IP, routing.
  4. Transport → TCP/UDP.
  5. Session → connection management.
  6. Presentation → encryption, compression.
  7. Application → HTTP, DNS, FTP.

Data flow: App Data → Segment → Packet → Frame → Bits (sending).

Receiving: Bits → Frame → Packet → Segment → App Data.

TCP/IP Model (4–5 Layers)

Internet actually uses TCP/IP model:

Addressing in Networks

Addresses uniquely identify source and destination.

Address Type Layer Scope Example
MAC (Physical) Data Link LAN only 00:1A:2B:3C:4D:5E
IP (Logical) Network Global 192.168.1.10
Port Transport Process 80 (HTTP)
URL Application Resource google.com/path
Unit 2 Unit 3 Unit 4 Unit 5