Last Minute Notes for Computer Networks (original) (raw)

Last Updated : 12 Jan, 2026

A computer network is a system of interconnected computing devices that communicate with one another over wired or wireless communication links to exchange data, share resources, and deliver services, using a well-defined set of communication protocols.

Computer networks form the foundation of modern communication systems, including the Internet, cloud services, and distributed applications.

Objectives of Computer Networks

The main goals of computer networking are:

Basics of Computer Networks

Network Components

Every computer network consists of the following fundamental components:

**Network Topologies

Network topologies refer to the physical or logical arrangement of devices (nodes) and communication links in a computer network. They define how devices are connected to each other and how data flows within the network. There are different topologies which are used in computer network:

**Mesh Topology

**Bus Topology

**Star Topology

**Ring Topology

Read more about Network Topologies.

**Transmission Modes

Read more about Transmission modes.

OSI Model

OSI stands for **Open Systems Interconnection. It has been developed by ISO– **International Organization for Standardization, in the year 1984. It is a seven-layer architecture with each layer having specific functionality to perform.

Understanding Layers of OSI Model

Physical Layer

The Physical Layer is the lowest layer of the OSI model and is responsible for the transmission of raw bits (0s and 1s) over a physical communication medium.
It defines the mechanical, electrical, and procedural characteristics required to establish and maintain physical connections between devices.

**Key Responsibilities of the Physical Layer

**Transmission Media

Transmission media refer to the physical or wireless paths through which data travels from the sender to the receiver in a computer network. They are mainly classified into guided (wired) and unguided (wireless) media.

**Guided Transmission Media (Wired)

Guided media use a physical path (cables) to transmit data signals.

**Characteristics

**Types

**Non-Guided Transmission Media (Wireless)

Non-guided media transmit data using electromagnetic waves without physical cables.

**Characteristics

**Types

Switching Techniques

Switching techniques are methods used in a network to establish a path and transfer data from a source to a destination through intermediate nodes.

**Circuit Switching

**Message Switching

**Packet Switching

**Comparison of Switching Techniques

Circuit Switching Packet Switching Message Switching
Uses a dedicated end-to-end path No dedicated path is established No dedicated path is used
Data is transmitted as a continuous stream Data is divided into packets Data is sent as a complete message
Delay is low after connection setup Delay is variable due to routing and queuing High delay due to store-and-forward
Bandwidth utilization is low Bandwidth utilization is high Bandwidth utilization is low
Used in traditional telephone networks Used in the Internet Used in old telegraph systems

It is the second layer of the OSI model and is responsible for node-to-node delivery of data. It ensures reliable transmission of frames over a physical link by handling framing, error control, flow control, and medium access control.

Basic Time Delays

**1. Transmission Delay (Td)

Time taken to place all bits of a frame onto the transmission medium.

Td = Length of packet / bandwidth

**2. Propagation Delay (Pd)

Time taken by a signal to travel from sender to receiver.

Pd = Distance / Propagation speed

**3. Round Trip Time (RTT)

Flow Control Mechanisms

Flow control ensures that the sender does not transmit data faster than the receiver can handle.

**1. Stop and Wait Protocol

Efficiency (Line Utilization):

E = Td(frame) / Td(frame)+2Pd+Qd+Prd+Td(ACK)

Throughput:

Throughput =L / Td(frame)+2Pd+Qd+Prd+Td(ACK)​

**2. Go-Back-N ARQ

Efficiency:

E = N×Td(frame) / Td(frame)+2Pd+Qd+Prd+Td(ACK)

Throughput:

Throughput = N×L / Td(frame)+2Pd+Qd+Prd+Td(ACK)

**3. Selective Repeat ARQ

Efficiency:

E = N×Td(frame) / Td(frame)+2Pd+Qd+Prd+Td(ACK)

Comparison of Data Link Layer Protocols

**Framing in DLL : Framing provides a way for a sender to transmit a set of bits that are meaningful to the receiver.

Medium Access Control Protocols

They manage how devices share a common communication medium and ensure efficient and collision-free data transmission. MAC protocols are generally classified into the following categories:

**Contention-Based Protocols

In these protocols, devices compete for the medium, and collisions may occur. They are suitable for networks with more traffic.

Examples :

**ALOHA

**CSMA (Carrier Sense Multiple Access)

**Controlled Access Protocols

These protocols avoid collisions by controlling access to the medium. Examples :

**Error Control

Redundant bits: 2 r ≥ m + r + 1
where, r = redundant bit, m = data bit

crc

checksum

Network Layer

The Network Layer is responsible for logical addressing, routing, and packet forwarding across different networks. It ensures that data reaches the correct destination, even across multiple routers.

**Class Full Addressing is an IP addressing method that divides the address space into five classes: A, B, C, D, and E, based on the first few bits of the IP address. Each class has a fixed network and host portion.

Class Full Addressing

The IPv4 header contains information required to **route, fragment, and control packets across networks.

**Subnetting

**Subnetting **is the process of dividing a large IP network into smaller logical networks (subnets). It improves network management, security, performance, and efficient IP address utilization.

Why Subnetting is Needed

**Implementation :

Let's consider a network **192.168.1.0/24 (subnet mask: 255.255.255.0), we need to create **4 subnets.

2n ≥ Number of Subnets
Here, n=2 (since 22 = 4).

A subnet mask is a 32-bit number used in IPv4 to divide an IP address into:

Network portion

Host portion

Routers use the subnet mask to identify the network address and determine routing decisions.

Original subnet mask: /24
Add n=2 bits for subnetting: /26
New subnet mask: 255.255.255.192

Subnet size = 232−New Prefix=232−26=64 IP addresses per subnet.
Usable IPs per subnet = 64−2=62 (excluding network and broadcast addresses).

Subnet 1: 192.168.1.0 to 192.168.1.63
Subnet 2: 192.168.1.64 to 192.168.1.127
Subnet 3: 192.168.1.128 to 192.168.1.191
Subnet 4: 192.168.1.192 to 192.168.1.255

Each subnet has:

A **subnet mask is a 32-bit number used in IPv4 to divide an IP address into network and host portions. It helps identify the size of the network and enables subnetting by determining which part of the address belongs to the network and which to the host.

ip_custom_subnet_masks

Subnet Mask of Class C IP address

**Supernetting

**Supernetting is the process of combining multiple smaller networks into a single larger network.

**Purpose

**Key Points

VLSM

**VLSM: It allows the use of different subnet masks within the same network, meaning subnets can have different sizes based on requirements.

**Characteristics

**Advantages

**Internet Control Message Protocol:

The Internet Protocol (IP) does not provide error reporting or control messages.
ICMP is used to report errors and provide network diagnostics.

**Functions

**Common ICMP Messages

**Difference between DVR and LSR:

Distance Vector Routing (DVR) Link State Routing (LSR)
Routers share routing information with neighbors only Routers share link-state information with all routers
Based on local knowledge Based on global network knowledge
Less bandwidth (small updates, no flooding) More bandwidth (flooding of link-state packets)
Periodic updates Event-based updates
Bellman–Ford Algorithm Dijkstra’s Algorithm
Slow Fast
Count-to-infinity problem exists No count-to-infinity problem
Persistent routing loops possible Only temporary (transient) loops
Not suitable for large networks Suitable for large networks
RIP, IGRP OSPF, IS-IS

Hop Count (Routing Metric)

Hop count is the number of routers a packet must pass through to reach the destination network.

Used by: Distance Vector Routing protocols such as RIP

Open Shortest Path First

OSPF is a link-state routing protocol that finds the best path between source and destination routers using the Shortest Path First (SPF) algorithm.

**Key Characteristics

Designated Router(DR) and Backup Designated Router(BDR) election takes place in the broadcast network or multi-access network.

Routing Information Protocol

RIP is a distance vector routing protocol that uses hop count as its routing metric.

**Key Characteristics

**Routing Information Protocol (RIP): RIP is a dynamic routing protocol that uses hop count as a routing metric to find the best path between the source and the destination network. It is a distance vector routing protocol that has an AD value of 120 and works on the application layer of the OSI model. RIP uses port number 520.

ARP (Address Resolution Protocol)

An **ARP (Address Resolution Protocol)request is a network protocol used to map an IP address to its corresponding MAC (Media Access Control) address within a local network.

**RARP Protocol (Reverse Address Resolution Protocol)

**Reverse Address Resolution Protocol (RARP) is a network protocol used to obtain an IP address for a device (like a diskless workstation) from its MAC address

Transport Layer

Transmission Control Protocol (TCP)

**TCP Congestion Control

**TCP Congestion Control manages network congestion by adjusting the data transmission rate **.**It ensures efficient and reliable data delivery while avoiding network overload. It uses algorithms like:

**TCP 3-Way Handshake Process

**The **TCP 3-Way Handshake Process is implemented in following steps:

**TCP Connection Termination

User Datagram Protocol (UDP)

**Difference between TCP and UDP

TCP (Transmission Control Protocol) UDP (User Datagram Protocol)
Connection-oriented protocol Connectionless protocol
Reliable data delivery using acknowledgments and retransmissions Unreliable data delivery (no acknowledgments)
Ensures in-order delivery using sequence numbers No guarantee of packet order
Uses checksum, ACKs, and retransmission Uses checksum only (optional in IPv4)
Supported using sliding window mechanism Not supported
Implemented using Slow Start, Congestion Avoidance, Fast Retransmit Not supported
Slower due to overhead Faster due to minimal overhead
Minimum 20 bytes Fixed 8 bytes
Uses 3-way handshake (SYN, SYN-ACK, ACK) No handshake
Byte-stream oriented Message-oriented
Detects and retransmits lost packets Lost packets are not recovered
High overhead due to control mechanisms Low overhead
HTTP, HTTPS, FTP, SMTP, SSH DNS, VoIP, Video Streaming, Online Games

**Session Layer

The Session Layer is the 5th layer of the OSI model. Its primary role is to establish, manage, and terminate sessions between two communicating devices.
A session refers to a logical connection that exists for the duration of communication.

**Why the Session Layer Is Needed

While the Transport Layer ensures reliable data transfer, the Session Layer manages the dialog itself:

**Key Functions of the Session Layer

**Session Establishment

**Session Maintenance

**Session Termination

**Synchronization

**Session Identification

**Presentation Layer

The Presentation Layer is the 6th layer of the OSI model. Its primary role is to prepare data for the Application Layer by ensuring that information sent from one system can be understood by another system, regardless of differences in data format, encoding, or security mechanisms.

In simple terms, this layer acts as a translator and formatter for network data.

**Why the Presentation Layer Is Needed

Different systems may use:

The Presentation Layer ensures compatibility and interoperability between these systems.

**Key Functions of the Presentation Layer

**Data Translation (Format Conversion)

**Examples

**Character Encoding

**Common encoding schemes

**Data Encryption and Decryption

**Used for

**Data Compression and Decompression

**Types

Application Layer

The Application Layer is the topmost layer of the OSI model and provides network services directly to end-user applications. It enables users and software applications to access network resources, exchange data, and perform communication tasks such as email, file transfer, and web browsing.

The Application Layer does not include the user interface itself, but it provides services used by applications like browsers, email clients, and FTP clients.

**Functions of Application Layer

**Network Resource Access : It Allows users to access remote resources such as

Supports services like file sharing and directory access.

**Email Services

**File Transfer and Management

**Name Resolution

**Application-Level Communication

TCP/IP Model

The TCP/IP model is a practical and implementation-oriented networking model used in real-world networks, including the Internet. It was developed by DARPA (Defense Advanced Research Projects Agency) and forms the foundation of modern data communication.

Unlike the OSI model (7 layers), the TCP/IP model consists of 4 layers, each responsible for a specific set of networking functions.

Layers of TCP/IP Model

  1. Application Layer
  2. Transport Layer
  3. Internet Layer
  4. Network Access Layer

Application Layer in TCP/IP Model

The Application Layer is the topmost layer of the TCP/IP model. It provides network services directly to user applications and enables communication between software applications over a network.

In the TCP/IP model, this layer combines the responsibilities of three OSI layers:

Key Functions

**User-Level Network Services

**Data Representation and Formatting: It handles

**Session Management

**Name Resolution

**Application Communication

Features of Application Layer (TCP/IP)

Transport Layer in TCP/IP Model

The Transport Layer is the second layer of the TCP/IP model. It is responsible for end-to-end (process-to-process) communication between applications running on different hosts.

It ensures that data sent from a source application is delivered to the correct destination application reliably or efficiently, depending on the protocol used.

Key Functions of the Transport Layer

**Process-to-Process Communication

**Segmentation and Reassembly

**Multiplexing and Demultiplexing

**Flow Control

**Error Control

**Congestion Control

Internet Layer in TCP/IP Model

The Internet Layer is the third layer of the TCP/IP model. It is responsible for logical addressing, packet routing, and delivery of data across interconnected networks.

This layer determines how packets move from the source host to the destination host, even if both are on different networks.

**Key Functions

**Logical Addressing

**Packet Routing

**Packet Forwarding

**Fragmentation and Reassembly

**Error Reporting and Diagnostics

Reports network-level errors such as:

**Network Access Layer in TCP/IP Model

The Network Access Layer is the lowest layer of the TCP/IP model. It is responsible for physical transmission of data over the network medium and defines how data is placed onto and received from the physical network.

This layer combines the functionalities of the Data Link Layer and Physical Layer of the OSI model.

Key Functions

**Framing

Encapsulates IP packets into **frames

**Adds:

**Physical Addressing (MAC Addressing)

**Media Access Control

**Examples:

**Error Detection

Detects transmission errors using mechanisms like:

Error correction is **not performed at this layer.

**Bit Transmission

Converts frames into binary signals (bits).

**Defines:

Difference Between OSI Model and TCP/IP Model

OSI Model TCP/IP Model
Open Systems Interconnection Transmission Control Protocol / Internet Protocol
ISO (International Organization for Standardization) DARPA (U.S. Department of Defense)
7 layers 4 layers
Conceptual and theoretical model Practical and implementation-based model
Strict layered architecture Flexible layered architecture
Protocol-independent Protocol-oriented
Supports only connection-oriented service Supports both TCP (reliable) and UDP (unreliable)
Supports both connection-oriented and connectionless services Supports only connectionless service (IP)
Implemented at Transport Layer Implemented mainly by TCP
Separate layers Combined into Application Layer
Data Link and Transport layers Transport layer (TCP)
Defined in Network Layer Defined in Internet Layer
Educational and reference model Used in real-world networks (Internet)
Rarely implemented fully Widely implemented (Internet)

**Common Network Protocols: Ports, Layers, and Functions

Protocol (Port Number) OSI / TCP-IP Layer Work / Function
HTTP (80) Application Transfers web pages using request–response model
HTTPS (443) Application Secure web communication using encryption (TLS/SSL)
FTP (21 control, 20 data) Application Transfers files between client and server
SMTP (25) Application Sends emails between mail servers
IMAP (143) Application Accesses and synchronizes emails on server
DNS (53 UDP/TCP) Application Resolves domain names to IP addresses
Telnet (23) Application Remote login (unencrypted)
SSH (22) Application Secure remote login and command execution
SNMP (161/162) Application Network monitoring and management
DHCP (67 server, 68 client) Application Automatically assigns IP configuration
TCP Transport Reliable, ordered, connection-oriented data delivery
UDP Transport Fast, connectionless data delivery
IP Internet / Network Logical addressing and packet routing
ICMP Internet / Network Error reporting and diagnostics
ARP Internet / Network Maps IP address to MAC address
Ethernet Data Link / Network Access Framing and MAC-based delivery
Wi-Fi / 802.11 Data Link / Network Access Wireless LAN communication

Network Devices

Network Devices are hardware components used to connect, manage, control, and communicate data between computers and other devices within a network. They enable data transmission, routing, security, and network management.

See Last Minute Notes on all subjects here.