>_
EngineeringNotes
← Back to Computer Networks
Chapter 01

Introduction to Networks

Connecting the world, one packet at a time.

01

What is a Computer Network?

A Computer Network is a system that connects multiple computing devices, such as computers, servers, laptops, printers, and other devices together to facilitate communication and data sharing via communication medium (wired or wireless).

"A Computer Network is a collection of Communicating devices (Computers) and other devices, such as printers and smart computers."

The Communication Model 📡

In this system, we have two heterogeneous actors:

Sender
(Source)
Message + Protocol
Medium (Wired/Wireless)
Receiver
(Destination)
  • Sender: Writes a program to send some message to the receiver.
  • Protocol: A set of rules that must run at both ends. Without a proper protocol, even if data is sent and received, it is not "Communication" (understanding it).
  • Medium: Wired or Wireless connection required to transmit data.
02

IPC vs Network Communication

Network Communication

Communication between two different machines (Sender M1 and Receiver M2). This involves cables, signals, and protocols like TCP/IP.

Inter-Process (IPC)

Communication between two processes on the same machine.

Note: This is done by the Kernel (OS). It is NOT part of Computer Networks.
Example: Typing on keyboard (Process A) → Displaying on Screen (Process B).
03

Functionalities of Network

In a two-way communication, several functionalities are used. Some are mandatory, while others are optional.

Mandatory Functionalities

1. Error Control

Ensuring the message received is exactly what was sent. Noise can corrupt data.
"Did you say 'Hello' or 'Hell'?"

2. Flow Control

Constraint on sending speed. Prevent the sender from overwhelming the receiver's buffer/memory.
"Don't speak faster than I can listen!"

3. Multiplexing / Demultiplexing

Determining which process a received packet belongs to. Multiple apps run on one system; the network must deliver data to the right one.

Optional Functionalities

1. Encryption / Decryption

Mandatory only for sensitive data (Banking, Military). Adds complexity but ensures security.

2. Checkpoints

Recovery mechanism. If a 300MB download fails at 205MB, should it restart from 0 or 205?

04

Network Models (OSI)

The OSI (Open Systems Interconnection) model is a conceptual framework proposed by ISO. It enables communication between different systems irrespective of their underlying architecture (Hardware/Software).

  • It is a set of rules (Directive Principle), not a protocol itself.
  • Facilitates system communication without modifying hardware logic.
  • Follows a Layered Architecture where each layer acts as a peer to the same layer on the remote machine.
Sender (Device A)
Application
Presentation
Session
Transport
Network
Data Link
Physical
↓ Data flows down
Physical Medium

Bits transfer (010101...)

Receiver (Device B)
Application
Presentation
Session
Transport
Network
Data Link
Physical
↑ Data flows up

The 7 Layers of OSI (Click to Explore)

Scenario: Sending a "Hello" on WhatsApp 📱

Layer 7, 6, 5 (Software Layers)

You type "Hello". WhatsApp (App Layer) takes it. It encrypts the message (Presentation Layer) so no one else reads it. It creates a session ID (Session Layer) for your chat.

Layer 4 (Transport)

The message is broken into segments. TCP adds a header to ensure it reaches correctly. "If it fails, I'll resend it."

Layer 3 (Network)

IP Header is added. The Source IP (Your phone) and Destination IP (WhatsApp Server) are attached. The router decides the best path.

Layer 2 (Data Link)

MAC Address is added. The message is framed to go to the next router (Wifi Router or Cell Tower).

Layer 1 (Physical)

The frame is converted into Radio Waves (WiFi/4G) and sent into the air. 📡

At the receiver's end, this whole process is reversed (Physical → Application) to show "Hello" on their screen.

05

Types of Networks

LAN (Local Area Network)

Privately owned networks within a single building or campus of up to a few kilometers in size. High speed, low error rate.

MAN (Metropolitan Area Network)

Larger than LAN, covering a city. Example: Cable TV network, City-wide Wi-Fi.

WAN (Wide Area Network)

Long-distance transmission of data over large geographical areas (country, continent, world). Example: The Internet.