0% found this document useful (0 votes)
4 views156 pages

CN- Notes

A computer network is a collection of interconnected devices that facilitate resource sharing and communication. Key advantages include resource and data sharing, cost reduction, and improved reliability, while various network topologies such as bus, star, and ring define the arrangement of these devices. Network hardware and software work together to establish communication, with hardware providing the physical infrastructure and software managing data exchange through protocols.

Uploaded by

2327bcse3
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views156 pages

CN- Notes

A computer network is a collection of interconnected devices that facilitate resource sharing and communication. Key advantages include resource and data sharing, cost reduction, and improved reliability, while various network topologies such as bus, star, and ring define the arrangement of these devices. Network hardware and software work together to establish communication, with hardware providing the physical infrastructure and software managing data exchange through protocols.

Uploaded by

2327bcse3
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

SECTION - A

Question 1: What is a Computer Network? Discuss its Advantages and Explain Various Network
Topologies.

Introduction

A computer network is a collection of two or more computers and other devices connected together
through communication links for the purpose of exchanging information and sharing resources.
These resources may include hardware devices, software programs, files, databases, and Internet
connections.

In a network, devices communicate with each other using a set of rules known as protocols. The
computers connected to a network are called nodes, and the communication medium may be wired
or wireless.

Today, computer networks have become an essential part of modern communication systems and
are widely used in homes, offices, industries, educational institutions, and banks.

Need for Computer Networks

Before networking, every computer worked independently. Sharing information and resources was
difficult and expensive. Computer networks were developed to:

 Share resources among multiple users.

 Facilitate communication.

 Reduce operational cost.

 Improve reliability and efficiency.

 Provide access to remote information.

Advantages of Computer Networks

1. Resource Sharing

One of the main advantages of networking is the sharing of resources. Expensive devices such as
printers, scanners, storage devices, and software can be shared among multiple users.

Example:

A single printer can serve all computers in an office instead of purchasing separate printers for each
computer.

2. Data Sharing

Networks allow users to share files and information easily. Data can be accessed and transferred
quickly from one computer to another.
Example:

Employees in an organization can access common databases and documents.

3. Communication

Computer networks enable communication between users through:

 E-mail

 Video conferencing

 Voice calls

 Instant messaging

Communication becomes faster and more efficient.

4. Cost Reduction

Since resources are shared among users, the overall cost of hardware and software is reduced.

Example:

Instead of buying software licenses for every computer, a centralized server can provide services to
multiple users.

5. Reliability

In a network, data can be stored at multiple locations. If one system fails, information can still be
retrieved from another device.

Hence, networks improve system reliability.

6. Centralized Management

Network administrators can manage data, software, and security from a central location.

This simplifies maintenance and reduces administrative effort.

7. Scalability

New computers and devices can easily be added to an existing network without affecting its
operation.

Thus, networks can grow according to requirements.

8. Remote Access
Users can access files and services from distant locations using the Internet.

Example:

Employees can work from home and access office servers remotely.

Network Topologies

Definition

Network topology refers to the physical or logical arrangement of computers and communication
links in a network. It determines how devices are connected and how information flows between
them.

Different topologies are suitable for different requirements.

The major network topologies are:

1. Bus Topology

2. Star Topology

3. Ring Topology

4. Mesh Topology

5. Tree Topology

6. Hybrid Topology

1. Bus Topology

Definition

In bus topology, all devices are connected to a single communication cable called the backbone cable
or bus.

Structure

A -----|

B -----|======== BUS ========|

C -----|

D -----|

Working

Whenever a computer sends data, the signal travels along the bus and reaches all nodes. The
intended receiver accepts the data, while other devices ignore it.
Advantages

 Simple and easy to install.

 Requires less cable.

 Economical for small networks.

 Easy to extend.

Disadvantages

 Failure of the main cable causes complete network failure.

 Difficult to identify faults.

 Performance decreases as the number of devices increases.

 Data collisions may occur.

Applications

 Small LANs

 Temporary networks

2. Star Topology

Definition

In star topology, all devices are connected to a central hub or switch.

Structure

B ---- Switch ---- C

Working

Data transmitted by one device first reaches the central hub or switch, which forwards it to the
destination device.

Advantages
 Easy installation and maintenance.

 Failure of one node does not affect others.

 Easy fault detection.

 Better performance.

Disadvantages

 Failure of the central hub causes the entire network to stop.

 Requires more cable.

 Cost is higher compared to bus topology.

Applications

 Ethernet LANs

 Office networks

3. Ring Topology

Definition

In ring topology, every device is connected to exactly two neighboring devices, forming a closed loop.

Structure

A ----- B

| |

D ----- C

Working

Data travels in one direction around the ring until it reaches the destination.

Advantages

 No collisions.

 Equal access for all devices.

 Better performance under heavy traffic.

Disadvantages
 Failure of one node affects the entire network.

 Difficult to add or remove devices.

 Troubleshooting is difficult.

Applications

 Token Ring Networks

4. Mesh Topology

Definition

In mesh topology, each device is directly connected to every other device.

Structure

Each node has multiple communication paths.

Working

Data can travel through several alternative paths.

Advantages

 Highly reliable.

 Provides high security.

 Failure of one link does not affect communication.

 Fault detection is easy.

Disadvantages

 Expensive.

 Requires large amount of cable.

 Installation is complex.

Applications

 Military networks

 Banking systems

 Internet backbone
5. Tree Topology

Definition

Tree topology is a combination of bus and star topologies arranged in a hierarchical form.

Structure

Root

/ \

Hub1 Hub2

/ \ / \

A B C D

Advantages

 Easy expansion.

 Suitable for large organizations.

 Supports hierarchical management.

Disadvantages

 Backbone failure affects the entire network.

 Installation cost is high.

Applications

 Universities

 Large companies

6. Hybrid Topology

Definition

Hybrid topology combines two or more different topologies to obtain their advantages.

Example

Combination of star and bus topology.

Advantages
 Flexible.

 Reliable.

 Easily expandable.

Disadvantages

 Complex design.

 Expensive.

Applications

 Large enterprises

 Industrial networks

Comparison of Topologies

Topology Cost Reliability Installation Main Disadvantage

Bus Low Low Easy Backbone failure

Star Medium High Easy Hub failure

Ring Medium Medium Difficult Node failure affects network

Mesh High Very High Complex Expensive

Tree High High Moderate Backbone dependency

Hybrid Very High Very High Complex Costly

Question: Explain Network Hardware and Network Software in Detail.

Introduction

A computer network is formed by combining various hardware devices and software components.
Hardware provides the physical means for communication, whereas software provides the rules and
programs that control the operation of the network.

Both hardware and software are essential for establishing reliable communication and ensuring
efficient transfer of information between devices.

Network Hardware

Definition
Network hardware refers to the physical devices and transmission media used to establish
communication among computers and other devices in a network.

These devices are responsible for transmitting, receiving, and processing data.

Components of Network Hardware

The major hardware components of a computer network are:

1. Nodes

2. Network Interface Card (NIC)

3. Repeater

4. Hub

5. Bridge

6. Switch

7. Router

8. Gateway

9. Modem

10. Transmission Media

1. Nodes

Nodes are the devices connected to the network. A node can be a computer, printer, server,
smartphone, or any other device capable of sending or receiving data.

Functions

 Send data.

 Receive data.

 Process information.

Examples

 Desktop computers

 Laptops

 Mobile phones

 Printers

2. Network Interface Card (NIC)

Definition
A Network Interface Card (NIC) is a hardware component that enables a computer to connect to a
network.

Every NIC has a unique physical address called the MAC Address.

Functions

 Establishes connection with the network.

 Converts data into electrical signals.

 Receives incoming signals and converts them back into digital data.

Types

(a) Wired NIC

Used with Ethernet cables.

(b) Wireless NIC

Used in Wi-Fi communication.

3. Repeater

Definition

A repeater is a device used to regenerate weakened signals.

As signals travel over long distances, they become weak. A repeater amplifies and retransmits these
signals to extend communication distance.

Functions

 Regenerates signals.

 Extends transmission range.

 Reduces signal loss.

Applications

 Telephone networks

 Optical fiber communication

4. Hub

Definition

A hub is a central connecting device that connects multiple computers in a network.

It works at the Physical Layer (Layer 1) of the OSI model.

Working
When a hub receives data from one device, it broadcasts that data to all connected devices
regardless of the destination.

Only the intended receiver accepts the frame, while others discard it.

Advantages

 Simple and inexpensive.

 Easy to install.

Disadvantages

 Causes unnecessary traffic.

 Low security.

 Poor performance.

5. Bridge

Definition

A bridge is a networking device used to connect two LAN segments.

It operates at the Data Link Layer (Layer 2).

Functions

 Divides a network into smaller segments.

 Reduces traffic congestion.

 Filters frames using MAC addresses.

Advantages

 Improves performance.

 Reduces collisions.

Disadvantages

 Slower than switches.

 Suitable only for small networks.

6. Switch

Definition

A switch is an intelligent networking device that connects multiple devices within a LAN and forwards
data only to the intended destination.

It operates at the Data Link Layer (Layer 2).

Working
The switch maintains a MAC address table.

When a frame arrives, the switch checks the destination MAC address and sends the frame only to
the corresponding device.

Advantages

 Reduces network traffic.

 Provides better security.

 High efficiency.

 Supports full-duplex communication.

Disadvantages

 More expensive than hubs.

 Configuration is relatively complex.

Difference Between Hub and Switch

Hub Switch

Physical layer device Data Link layer device

Broadcasts data to all devices Sends data only to destination

Less secure More secure

Lower speed Higher speed

No MAC table Uses MAC address table

7. Router

Definition

A router is a networking device used to connect different networks.

It operates at the Network Layer (Layer 3) of the OSI model.

Functions

 Routes packets from source to destination.

 Selects the best path.

 Connects LANs to the Internet.

Working

Routers examine IP addresses and determine the most suitable route for packet transmission.

Advantages
 Efficient routing.

 Supports large networks.

 Provides security and traffic management.

Applications

 Internet communication.

 Wireless networks.

 Enterprise networks.

8. Gateway

Definition

A gateway is a device that connects networks using different protocols.

It acts as a translator between incompatible networks.

Functions

 Protocol conversion.

 Data format conversion.

 Enables communication between heterogeneous systems.

Example

Communication between a TCP/IP network and another network architecture.

9. Modem

Definition

Modem stands for Modulator-Demodulator.

It converts digital signals into analog signals during transmission and converts analog signals back
into digital form during reception.

Functions

 Provides Internet access.

 Performs signal conversion.

Types

 DSL Modem

 Cable Modem

 Wireless Modem
10. Transmission Media

Transmission media provide the path through which data travels.

They are classified into two categories:

A. Guided Media (Wired Media)

In guided media, signals travel through physical cables.

(i) Twisted Pair Cable

Consists of two insulated copper wires twisted together.

Advantages

 Low cost.

 Easy installation.

Disadvantages

 Limited bandwidth.

 Susceptible to noise.

Applications

 Telephone systems.

 LAN networks.

(ii) Coaxial Cable

Consists of a central conductor surrounded by insulation and shielding.

Advantages

 Better noise resistance.

 Higher bandwidth than twisted pair cable.

Applications

 Cable TV.

 Broadband Internet.

(iii) Optical Fiber Cable

Uses light signals to transmit information.

Advantages
 Very high bandwidth.

 High speed.

 Immune to electromagnetic interference.

Disadvantages

 Expensive.

 Difficult installation.

Applications

 Internet backbone.

 Long-distance communication.

B. Unguided Media (Wireless Media)

In unguided media, signals travel through air.

Types

Radio Waves

Used in broadcasting and wireless communication.

Microwaves

Used in satellite communication and cellular networks.

Infrared Waves

Used for short-distance communication.

Network Software

Definition

Network software consists of programs and protocols that control the operation and communication
of the network.

It provides the logical framework necessary for data exchange.

Components of Network Software

Network software can be broadly classified into three categories:

1. Network Operating System

2. Protocol Software

3. Application Software
1. Network Operating System (NOS)

Definition

A Network Operating System manages network resources and controls communication among
connected devices.

Functions

 User authentication.

 File sharing.

 Device management.

 Security management.

Examples

 Windows Server

 Linux

 UNIX

2. Protocol Software

Definition

Protocols are sets of rules that govern communication between devices.

They determine:

 How data is transmitted.

 How errors are handled.

 How connections are established and terminated.

Examples

TCP (Transmission Control Protocol)

Provides reliable communication.

UDP (User Datagram Protocol)

Provides fast but unreliable communication.

IP (Internet Protocol)

Provides logical addressing and routing.

HTTP (HyperText Transfer Protocol)

Used for web communication.


FTP (File Transfer Protocol)

Used for file transfer.

DNS (Domain Name System)

Converts domain names into IP addresses.

3. Application Software

Application software provides services directly to users.

Examples

 Web browsers

 E-mail applications

 Video conferencing software

 File transfer programs

Functions

 Access Internet services.

 Exchange information.

 Support communication.

Relationship Between Hardware and Software

Network hardware provides the physical infrastructure, while network software provides the
intelligence required for communication.

Without hardware, no physical connection exists, and without software, devices cannot understand
each other.

Thus, both hardware and software work together to enable efficient and reliable network
communication.

Conclusion

Network hardware and software are the two fundamental components of a computer network.
Hardware establishes physical connectivity, whereas software provides communication rules and
services. Their combined operation enables resource sharing, communication, and efficient data
transfer across modern networks.

Question: Explain Various Switching Techniques Used in Computer Networks.


According to your PYQ, "Explain the significance of switching. Discuss the different switching
techniques used in computer networks" has been asked as a 20-mark question, and short notes on
Circuit Switching, Packet Switching, Message Switching and Hybrid Switching have also appeared.

Introduction

In a computer network, a large number of devices communicate simultaneously. It is therefore


necessary to establish a mechanism that can transfer data from the source to the destination
efficiently. This mechanism is known as switching.

Switching is the process of selecting a path through which data is transmitted from the sender to the
receiver.

In simple words, switching is responsible for determining how information travels from one device
to another.

Need for Switching

Switching is required because:

 A dedicated connection between every pair of devices is impractical.

 It improves utilization of communication links.

 It allows multiple users to share network resources.

 It reduces communication cost.

 It enables efficient routing of data.

Significance of Switching

Switching plays an important role in computer networks because:

1. Efficient Use of Bandwidth

Communication channels are shared among many users, resulting in better bandwidth utilization.

2. Reduced Cost

A separate physical path for every device pair is not required.

3. Reliable Communication

Switching provides alternative paths in case of failure.

4. Supports Large Networks

Millions of devices can communicate over the Internet because of switching.

5. Improved Performance

Data can be transmitted faster and more efficiently.


Types of Switching Techniques

Switching techniques are mainly classified into:

1. Circuit Switching

2. Message Switching

3. Packet Switching

4. Hybrid Switching

1. Circuit Switching

Definition

Circuit switching is a technique in which a dedicated communication path is established between


the sender and receiver before actual data transmission begins.

Once the path is established, it remains reserved until communication is completed.

This technique is used in traditional telephone systems.

Working of Circuit Switching

Communication takes place in three phases:

(i) Circuit Establishment

A dedicated path is established between source and destination.

Example:

A ---- Switch1 ---- Switch2 ---- B

No data transmission occurs during this phase.

(ii) Data Transfer

After the connection is established, data flows continuously through the reserved path.

Since the path is dedicated, no other user can use it.

(iii) Circuit Release

After communication is completed, the path is disconnected and resources are freed.

Characteristics of Circuit Switching


 Dedicated communication path.

 Fixed bandwidth.

 Connection-oriented.

 Sequential delivery of data.

 No congestion after setup.

Advantages of Circuit Switching

1. Reliable Communication

Since a dedicated path exists, communication is reliable.

2. No Packet Loss

Data follows the same route.

3. Constant Transmission Rate

Bandwidth remains fixed during communication.

4. In-order Delivery

Data reaches the destination in the same order.

Disadvantages of Circuit Switching

1. Inefficient Utilization of Bandwidth

Resources remain reserved even when no data is being transmitted.

2. Long Setup Time

Connection establishment takes time.

3. Failure of Path Interrupts Communication

If the dedicated path fails, communication stops.

4. Expensive

Requires more resources.

Applications

 Telephone networks

 ISDN

 Video conferencing
2. Message Switching

Definition

In message switching, the entire message is treated as one unit and transmitted from one node to
another using the store-and-forward technique.

No dedicated path is established.

Working

Suppose a message travels from A to D through B and C.

A→B→C→D

Each intermediate node:

1. Receives the complete message.

2. Stores it temporarily.

3. Examines the destination address.

4. Forwards the message to the next node.

Thus, every node acts as a temporary storage device.

Characteristics

 No dedicated path.

 Store-and-forward mechanism.

 Entire message transmitted as a single unit.

 Large storage requirement.

Advantages

1. Efficient Use of Channels

Communication lines are shared among users.

2. No Need for Dedicated Connection

3. Traffic Prioritization Possible

Important messages can be given higher priority.

4. Better Channel Utilization

Disadvantages
1. Large Delay

Entire message must be stored before forwarding.

2. High Memory Requirement

3. Not Suitable for Real-Time Applications

Applications

 Telegraph systems

 Email systems

3. Packet Switching

Definition

Packet switching is a technique in which a message is divided into smaller units called packets, and
each packet is transmitted independently through the network.

It is the most widely used switching technique and forms the basis of the Internet.

Working

Suppose the message:

HELLO WORLD

is divided into packets:

Packet1

Packet2

Packet3

Packet4

Each packet contains:

 Source address

 Destination address

 Sequence number

 Error-checking information

 Data

Packets may travel through different paths and are reassembled at the destination.
Characteristics

 No dedicated path.

 Uses store-and-forward approach.

 Message divided into packets.

 Efficient utilization of bandwidth.

Types of Packet Switching

Packet switching is of two types:

(a) Datagram Packet Switching

In this method:

 Every packet is treated independently.

 Packets may follow different routes.

 No fixed path exists.

Therefore, packets may arrive out of order.

Example

Internet Protocol (IP).

(b) Virtual Circuit Packet Switching

Here:

 A logical path is established before transmission.

 All packets follow the same route.

 Packets arrive in sequence.

Example

ATM networks.

Advantages of Packet Switching

1. Better Utilization of Bandwidth

Communication links are shared among multiple users.

2. High Reliability

Failure of one path does not stop communication because alternate routes may exist.
3. Suitable for Bursty Traffic

Resources are used only when needed.

4. Cost Effective

No dedicated line is required.

5. Supports Simultaneous Communication

Many users can communicate at the same time.

Disadvantages

1. Delay and Congestion

Heavy traffic may cause delays.

2. Packets May Arrive Out of Order

Reassembly is required at the destination.

3. Complex Processing

Each packet requires addressing and routing information.

Applications

 Internet

 LANs

 Wireless networks

Comparison Between Circuit Switching and Packet Switching

Basis Circuit Switching Packet Switching

Path Dedicated Shared

Setup Required Yes No

Bandwidth Fixed Dynamic

Delay Low after setup Variable

Resource Utilization Poor Better

Reliability High High

Cost High Low

Used In Telephone Network Internet


4. Hybrid Switching

Definition

Hybrid switching combines the features of two or more switching techniques to achieve better
performance and efficiency.

It attempts to utilize the advantages of circuit switching and packet switching while minimizing their
disadvantages.

Characteristics

 Combination of multiple switching methods.

 Provides flexibility.

 Improves network performance.

 Efficient utilization of resources.

Advantages

 High efficiency.

 Better reliability.

 Flexible communication.

 Reduced delay.

Applications

 Broadband Integrated Services Digital Network (B-ISDN)

 ATM Networks

 Modern communication systems

Conclusion

Switching techniques are fundamental to data communication. Circuit switching provides dedicated
communication, message switching uses store-and-forward transmission, packet switching offers
efficient resource utilization and forms the basis of the Internet, while hybrid switching combines the
advantages of multiple techniques to improve performance.

Question: Explain the Internet in Detail. Discuss its Architecture, Working, Services, and
Applications.
This topic is important because understanding the Internet forms the foundation for studying the
TCP/IP Protocol Suite and Application Layer protocols. Questions related to Internet and its services
have appeared in previous papers.

Introduction

The Internet is a worldwide collection of interconnected computer networks that communicate with
one another using the TCP/IP protocol suite. It is often called a "network of networks" because it
connects millions of private, public, academic, and business networks around the world.

Through the Internet, users can exchange information, access resources, communicate with others,
and utilize various online services irrespective of geographical location.

Today, the Internet has become one of the most important technologies and has revolutionized
communication, education, business, entertainment, and scientific research.

Definition

Internet is a global system of interconnected computer networks that uses the TCP/IP protocol
suite to exchange information and provide communication services to users worldwide.

History and Evolution of Internet

The Internet evolved from a research project called ARPANET (Advanced Research Projects Agency
Network) developed by the U.S. Department of Defense in the late 1960s.

Important Milestones

1969 – ARPANET

 First packet-switched network.

 Connected four universities in the United States.

1970s

 Development of TCP/IP protocols.

1983

 TCP/IP became the standard protocol for communication.

1990

 ARPANET was replaced by the modern Internet.

1991

 Introduction of the World Wide Web (WWW).

Present

 Billions of devices are connected worldwide.


Characteristics of Internet

The major characteristics of the Internet are:

1. Global Connectivity

Provides communication across the world.

2. Decentralized Structure

No single organization controls the entire Internet.

3. Packet-Switched Network

Information is transmitted in the form of packets.

4. Uses Standard Protocols

Communication takes place using TCP/IP protocols.

5. Supports Multiple Services

Such as email, file transfer, web browsing, video conferencing, etc.

6. Scalability

New networks and devices can be added easily.

Architecture of Internet

The Internet consists of a hierarchical structure involving various components.

Components of Internet Architecture

1. End Systems (Hosts)

These are devices used by users.

Examples:

 Computers

 Smartphones

 Servers

 Tablets

End systems are also called hosts.

2. Communication Links

These provide the transmission path between devices.

Examples:
 Optical fiber

 Twisted pair cables

 Coaxial cables

 Wireless communication

3. Packet Switches

Packet switches are responsible for forwarding packets from source to destination.

Examples:

 Routers

 Switches

4. Internet Service Providers (ISPs)

ISPs provide access to the Internet.

Examples:

 Airtel

 Jio

 BSNL

ISPs are organized hierarchically:

 Local ISP

 Regional ISP

 National ISP

Layered Architecture of Internet

The Internet uses the TCP/IP architecture consisting of four layers:

Application Layer

Transport Layer

Internet Layer

Network Access Layer


Each layer performs specific functions and communicates with adjacent layers.

Working of Internet

Communication over the Internet takes place through packet switching.

Suppose a user wants to access a website.

Step 1: User Request

The user enters a URL in the browser.

Example:

[Link]

Step 2: DNS Resolution

DNS converts the domain name into an IP address.

Example:

[Link] → 142.250.x.x

Step 3: Packet Formation

Data is divided into packets.

Each packet contains:

 Source address

 Destination address

 Sequence number

 Control information

Step 4: Routing

Routers forward packets through the best available path.

Different packets may travel through different routes.

Step 5: Reassembly

At the destination, packets are reassembled into the original message.

Step 6: Response
The requested web page is sent back to the user.

Internet Services

The Internet provides a large number of services.

1. World Wide Web (WWW)

The WWW enables users to access information in the form of web pages.

It uses:

 HTTP

 HTML

 Web browsers

Examples:

 Google

 Wikipedia

2. Electronic Mail (E-Mail)

Allows users to send and receive messages electronically.

Examples:

 Gmail

 Outlook

3. File Transfer

Enables transfer of files between computers using FTP.

4. Remote Login

Users can remotely access another computer using:

 Telnet

 SSH

5. Voice and Video Communication

Supports:
 Video conferencing

 Internet telephony (VoIP)

Examples:

 Zoom

 Skype

6. Online Banking and E-Commerce

Provides electronic financial transactions and online shopping.

Examples:

 Amazon

 Flipkart

 Net banking

7. Social Networking

Enables interaction and communication among users.

Examples:

 Facebook

 Instagram

 X (Twitter)

8. Cloud Computing

Provides storage and computing services over the Internet.

Examples:

 Google Drive

 OneDrive

Advantages of Internet

1. Fast Communication

Enables instant communication across the globe.

2. Information Availability

Huge amount of information is available online.


3. Resource Sharing

Files and applications can be shared easily.

4. Online Services

Supports e-learning, banking, shopping, and entertainment.

5. Low Cost Communication

Reduces communication expenses.

6. Remote Access

Users can work from any location.

Disadvantages of Internet

1. Security Threats

Viruses, malware, and cyber attacks.

2. Privacy Issues

Unauthorized access to personal information.

3. Internet Addiction

Excessive use may affect health and productivity.

4. Spread of Misinformation

False information can spread rapidly.

Applications of Internet

The Internet is widely used in:

Education

 Online learning

 Digital libraries

Business

 E-commerce

 Online transactions

Communication

 E-mail

 Video conferencing

Entertainment
 Streaming services

 Online gaming

Research

 Scientific databases

 Collaboration among researchers

Healthcare

 Telemedicine

 Online consultation

Internet vs World Wide Web

Internet World Wide Web

Network of networks Information service running on Internet

Provides communication infrastructure Provides web pages and websites

Uses TCP/IP protocols Uses HTTP protocol

Includes many services One service among many

Developed before WWW Developed later

Question: Explain the TCP/IP Protocol Suite in Detail.

Introduction

The TCP/IP Protocol Suite is a collection of communication protocols used to connect computers and
devices over the Internet. It specifies how data should be transmitted, addressed, routed, and
received.

TCP/IP stands for:

 TCP (Transmission Control Protocol)

 IP (Internet Protocol)

The TCP/IP model was developed by the Department of Defense (DoD) as part of the ARPANET
project and later became the standard protocol suite for the Internet.

It follows a layered architecture in which each layer performs specific functions and provides services
to the layer above it.

Need for TCP/IP Protocol Suite


Before the development of TCP/IP, different networks used different communication rules, making
interconnection difficult.

TCP/IP was developed to:

 Provide reliable communication.

 Connect heterogeneous networks.

 Enable end-to-end communication.

 Support routing across multiple networks.

 Standardize communication over the Internet.

Layered Architecture of TCP/IP

The TCP/IP model consists of four layers:

Application Layer

Transport Layer

Internet Layer

Network Access Layer

Each layer is responsible for a specific set of functions.

1. Application Layer

Introduction

The Application Layer is the highest layer of the TCP/IP model. It provides services directly to users
and application programs.

This layer combines the functions of the Application, Presentation, and Session layers of the OSI
model.

Users interact with the network through this layer.

Functions of Application Layer

1. User Interface

Provides an interface between user applications and the network.

Examples:
 Web browsers

 Email applications

 File transfer programs

2. File Transfer

Allows users to transfer files between computers.

Example:

 FTP

3. Web Access

Enables users to access websites.

Example:

 HTTP

 HTTPS

4. Remote Login

Allows users to remotely access another computer.

Example:

 Telnet

 SSH

5. Name Resolution

Converts domain names into IP addresses.

Example:

 DNS

6. Electronic Mail Services

Provides email communication.

Examples:

 SMTP

 POP3
 IMAP

Protocols Associated with Application Layer

Protocol Function

HTTP Web page transfer

HTTPS Secure web communication

FTP File transfer

SMTP Sending emails

POP3 Receiving emails

IMAP Accessing emails

DNS Domain name resolution

Telnet Remote login

SSH Secure remote login

Importance of Application Layer

This layer acts as an interface between the user and the network. Without this layer, users would not
be able to access network services such as web browsing, email, and file transfer.

2. Transport Layer

Introduction

The Transport Layer provides process-to-process communication and ensures reliable delivery of
data.

It is responsible for dividing data into segments and reassembling them at the receiver.

Functions of Transport Layer

1. Segmentation

Large messages are divided into smaller segments for transmission.

2. Process-to-Process Delivery

Data is delivered from one application process to another using port numbers.
3. Flow Control

Controls the amount of data sent to prevent receiver overload.

4. Error Control

Detects lost or corrupted segments and retransmits them.

5. Reliable Communication

Ensures that data reaches the destination correctly and in order.

Protocols of Transport Layer

TCP (Transmission Control Protocol)

TCP is connection-oriented and reliable.

Features

 Connection-oriented.

 Error control.

 Flow control.

 Sequencing of packets.

 Acknowledgment mechanism.

Applications

 Web browsing

 Email

 File transfer

UDP (User Datagram Protocol)

UDP is connectionless and unreliable.

Features

 Faster transmission.

 No acknowledgment.

 No flow control.

 Less overhead.

Applications
 Video streaming

 Online gaming

 DNS

Importance of Transport Layer

The Transport Layer ensures that communication between applications is reliable and error-free.

3. Internet Layer

Introduction

The Internet Layer is responsible for delivering packets from source to destination across different
networks.

It performs logical addressing and routing.

It is analogous to the Network Layer of the OSI model.

Functions of Internet Layer

1. Logical Addressing

Assigns IP addresses to devices.

Example:

[Link]

2. Routing

Determines the best path for packet transmission.

Routers operate at this layer.

3. Packet Forwarding

Forwards packets through intermediate routers.

4. Fragmentation

Breaks packets into smaller fragments if required.

Protocols Associated with Internet Layer


IP (Internet Protocol)

Responsible for addressing and routing.

Two versions:

 IPv4

 IPv6

ICMP (Internet Control Message Protocol)

Used for reporting errors and diagnostics.

Example:

Ping command

ARP (Address Resolution Protocol)

Converts IP addresses into MAC addresses.

RARP (Reverse Address Resolution Protocol)

Converts MAC addresses into IP addresses.

Importance of Internet Layer

The Internet Layer is responsible for connecting multiple networks and ensuring that packets reach
the correct destination.

4. Network Access Layer

Introduction

This is the lowest layer of the TCP/IP model.

It handles actual transmission of bits through the physical medium.

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

Functions of Network Access Layer

1. Physical Transmission

Transmits bits through cables or wireless channels.


2. Framing

Converts packets into frames.

3. Error Detection

Detects transmission errors.

4. MAC Addressing

Uses physical addresses for communication.

5. Media Access Control

Determines how devices share the transmission medium.

Devices Operating at This Layer

 Hub

 Switch

 NIC

 Cables

Technologies Used

 Ethernet

 Wi-Fi

 Fiber optics

 Token Ring

Encapsulation in TCP/IP

When data moves from upper layers to lower layers, each layer adds its own header.

Application Layer

Transport Layer

(Adds TCP Header)


Internet Layer

(Adds IP Header)

Network Access Layer

(Adds Frame Header)

Physical Medium

At the receiver side, the reverse process called Decapsulation takes place.

Advantages of TCP/IP Model

1. Open Standard

Can be used by different manufacturers.

2. Scalable

Supports very large networks.

3. Reliable

Provides error detection and recovery.

4. Supports Routing

Allows communication across multiple networks.

5. Flexible

Can operate on various transmission media.

Disadvantages of TCP/IP Model

1. Complex Design

The protocol suite is large and complicated.

2. No Clear Separation of Services

Layer boundaries are not as strict as in the OSI model.

3. Network Access Layer Not Properly Defined

Its functions are not clearly specified.

Question: Explain the OSI Reference Model in Detail.


Introduction

Before the development of standard networking models, different manufacturers used their own
communication standards. Devices from different vendors often faced compatibility problems,
making communication difficult.

To overcome these problems, the International Organization for Standardization (ISO) developed
the OSI Reference Model in 1984.

The OSI model provides a standard framework for communication between different computer
systems by dividing the communication process into seven layers, where each layer performs a
specific function and provides services to the layer above it.

Definition

The OSI Reference Model is a seven-layer conceptual framework developed by ISO for standardizing
network communication and enabling interoperability among heterogeneous systems.

Need for OSI Model

The OSI model was developed to:

 Standardize communication protocols.

 Allow communication between different vendors' devices.

 Divide complex communication into simpler layers.

 Simplify troubleshooting and maintenance.

 Promote modular design.

 Enable independent development of protocols.

Principles of Layered Architecture

The OSI model follows the principle of layering. Each layer:

 Performs a specific set of functions.

 Provides services to the layer above it.

 Receives services from the layer below it.

 Operates independently of other layers.

Layers of OSI Model

The OSI model consists of seven layers:

7. Application Layer
6. Presentation Layer

5. Session Layer

4. Transport Layer

3. Network Layer

2. Data Link Layer

1. Physical Layer

Data moves from the Application Layer to the Physical Layer at the sender side and follows the
reverse path at the receiver side.

1. Physical Layer (Layer 1)

Introduction

The Physical Layer is the lowest layer of the OSI model. It is responsible for transmitting raw bits from
one device to another through the communication medium.

It deals with the physical characteristics of transmission media.

Functions of Physical Layer

1. Transmission of Bits

Transmits a stream of bits (0s and 1s).

2. Mechanical Specifications

Defines:

 Cable types

 Connectors

 Pin configurations

3. Electrical Specifications

Defines:

 Voltage levels

 Signal timing

 Data rates

4. Physical Topology
Specifies how devices are physically connected.

Examples:

 Bus

 Star

 Ring

Devices Operating at Physical Layer

 Hub

 Repeater

 Transmission Media

Examples

 Ethernet cables

 Optical fiber

 Wireless transmission

2. Data Link Layer (Layer 2)

Introduction

The Data Link Layer provides reliable node-to-node communication and converts raw bits into
frames.

It ensures error-free transmission over the physical medium.

Functions of Data Link Layer

1. Framing

Divides data into frames.

2. Physical Addressing

Uses MAC addresses for communication.

3. Error Detection

Detects transmission errors using checksums and CRC.


4. Flow Control

Controls data transmission speed.

5. Access Control

Determines which device can use the communication medium.

Sublayers

MAC (Media Access Control)

Controls access to transmission media.

LLC (Logical Link Control)

Provides error and flow control.

Devices Operating at Layer 2

 Switch

 Bridge

Examples

 Ethernet

 PPP

 HDLC

3. Network Layer (Layer 3)

Introduction

The Network Layer is responsible for delivering packets from source to destination across multiple
networks.

Its main function is routing and logical addressing.

Functions of Network Layer

1. Logical Addressing

Provides IP addresses to devices.


Example:

[Link]

2. Routing

Determines the best path for packet transmission.

3. Packet Forwarding

Forwards packets through routers.

4. Fragmentation

Breaks packets into smaller units when required.

Devices Operating at Layer 3

 Router

Protocols

 IP

 ICMP

 IGMP

4. Transport Layer (Layer 4)

Introduction

The Transport Layer provides process-to-process communication and ensures reliable delivery of
data.

It acts as the link between upper layers and lower layers.

Functions of Transport Layer

1. Segmentation

Divides messages into smaller segments.

2. Process-to-Process Delivery
Uses port numbers to identify applications.

3. Flow Control

Prevents receiver overload.

4. Error Control

Detects and recovers from transmission errors.

5. Sequencing

Ensures correct order of data.

6. Multiplexing

Allows multiple applications to communicate simultaneously.

Protocols

TCP

Provides reliable communication.

UDP

Provides faster but unreliable communication.

5. Session Layer (Layer 5)

Introduction

The Session Layer establishes, manages, and terminates communication sessions between
applications.

A session represents a dialogue between two devices.

Functions of Session Layer

1. Session Establishment

Creates communication sessions.

2. Session Maintenance
Keeps communication active.

3. Session Termination

Ends communication after completion.

4. Synchronization

Introduces checkpoints so that communication can resume after failures.

Examples

 Remote Procedure Call (RPC)

 NetBIOS

6. Presentation Layer (Layer 6)

Introduction

The Presentation Layer is responsible for the syntax and semantics of information exchanged
between systems.

It acts as the translator of the network.

Functions of Presentation Layer

1. Data Translation

Converts data formats between systems.

Example:

ASCII ↔ Unicode

2. Encryption

Protects data from unauthorized access.

3. Decryption

Converts encrypted data back into its original form.

4. Compression
Reduces the size of data to improve transmission efficiency.

Examples

 JPEG

 MPEG

 GIF

 SSL

7. Application Layer (Layer 7)

Introduction

The Application Layer is the topmost layer and provides network services directly to users.

Users interact with the network through this layer.

Functions of Application Layer

1. File Transfer

Allows transfer of files.

2. Email Services

Supports electronic mail communication.

3. Remote Login

Allows users to access remote systems.

4. Web Browsing

Provides access to websites.

5. Name Resolution

Converts domain names into IP addresses.

Protocols

 HTTP
 HTTPS

 FTP

 DNS

 SMTP

 POP3

 Telnet

 SSH

Data Encapsulation in OSI Model

During transmission, each layer adds its own header.

Application Layer

Presentation Layer

Session Layer

Transport Layer

(Adds Segment Header)

Network Layer

(Adds Packet Header)

Data Link Layer

(Adds Frame Header)

Physical Layer

(Transmits Bits)

At the receiver side, headers are removed layer by layer through decapsulation.

Advantages of OSI Model

1. Standardization
Provides a universal communication framework.

2. Modular Design

Each layer performs specific tasks.

3. Easier Troubleshooting

Problems can be isolated layer-wise.

4. Interoperability

Allows communication between different vendors' devices.

5. Independent Development

Changes in one layer do not affect other layers.

Disadvantages of OSI Model

1. Complex Architecture

Seven layers make implementation complicated.

2. Layer Overhead

Some functions are duplicated across layers.

3. Mostly Theoretical

The Internet actually follows the TCP/IP model rather than the OSI model.

Mnemonic for Remembering Layers

Top to Bottom

All People Seem To Need Data Processing

Application

Presentation

Session

Transport
Network

Data Link

Physical

Bottom to Top

Please Do Not Throw Sausage Pizza Away

Physical

Data Link

Network

Transport

Session

Presentation

Application

Comparison Between OSI Model and TCP/IP Model


Basis of Comparison OSI Model TCP/IP Model

Transmission Control
Full Form Open Systems Interconnection Model
Protocol/Internet Protocol Model

ISO (International Organization for DARPA (Department of Defense,


Developed By
Standardization) USA)

Year of Development 1984 1970s

Number of Layers 7 Layers 4 Layers

Nature Reference (Conceptual) Model Protocol Suite and Practical Model

Layer Structure Strictly follows layered architecture Less strict layering

Session and
Present as separate layers Included in Application Layer
Presentation Layers

Physical and Data Combined into Network Access


Separate layers
Link Layers Layer

Provides reliable (TCP) and


Transport Layer Provides reliable communication
unreliable (UDP) communication

Supports both connection-oriented and


Network Layer Mainly connectionless (IP)
connectionless communication

Protocol Dependency Protocol-independent model Protocol-dependent model

Development Model developed first, then protocols Protocols developed first, then
Basis of Comparison OSI Model TCP/IP Model

Approach model

Mainly used for understanding and Widely used in the Internet and
Usage
teaching networking concepts real-world networks

Complexity More complex due to seven layers Simpler due to fewer layers

Practical and widely implemented


Popularity Theoretical model
model

Layer-wise Comparison

OSI Model TCP/IP Model

Application Layer Application Layer

Presentation Layer Application Layer

Session Layer Application Layer

Transport Layer Transport Layer

Network Layer Internet Layer

Data Link Layer Network Access Layer

Physical Layer Network Access Layer

Question: Explain the Application Layer and Discuss the Services Provided by It.

Introduction

The Application Layer is the topmost layer of both the OSI model and the TCP/IP protocol suite. It
acts as an interface between the user and the network and provides various services that allow users
to access network resources.

Unlike lower layers, the Application Layer is directly visible to the user and supports applications such
as web browsers, email systems, file transfer utilities, and remote login services.
In simple words, the Application Layer enables communication between application programs
running on different computers.

Definition

The Application Layer is the layer responsible for providing network services directly to end users
and application processes.

It serves as an interface between user applications and the network.

Need for Application Layer

The Application Layer is needed because:

 Users require a way to interact with the network.

 Different applications need communication services.

 Network resources must be accessible in a standard manner.

 Data exchange between application processes must be supported.

Functions of Application Layer

The major functions performed by the Application Layer are:

1. Network Virtual Terminal

The Application Layer allows users to remotely log into another computer and access its resources.

Example

 Telnet

 SSH

A user sitting on one machine can execute commands on a remote machine.

2. File Transfer, Access and Management

The Application Layer provides mechanisms for transferring files between computers and managing
those files.

Example

 FTP (File Transfer Protocol)

Users can:

 Upload files
 Download files

 Rename files

 Delete files

3. Electronic Mail Service

It provides facilities for sending and receiving electronic messages.

Example

 SMTP

 POP3

 IMAP

These protocols enable users to exchange e-mails over the Internet.

4. Web Access Service

It allows users to access web pages and websites through web browsers.

Example

 HTTP

 HTTPS

Applications:

 Google Chrome

 Mozilla Firefox

 Microsoft Edge

5. Name Resolution Service

Humans remember names more easily than IP addresses.

The Application Layer provides name resolution services through DNS, which converts domain names
into IP addresses.

Example

[Link]

[Link]
6. Directory Services

Directory services maintain information about users, devices, and network resources.

These services help in locating resources in a network.

7. Resource Sharing

Users can share:

 Printers

 Files

 Databases

 Storage devices

through network applications.

8. Authentication and Security

The Application Layer provides mechanisms for:

 User authentication

 Access control

 Secure communication

Example

 HTTPS

 SSH

Services Provided by Application Layer

The important services provided by the Application Layer are:

1. Web Service

Provides access to information available on the World Wide Web.

Protocols Used

 HTTP

 HTTPS

2. File Transfer Service


Allows users to transfer files between computers.

Protocol Used

 FTP

3. Electronic Mail Service

Facilitates exchange of messages.

Protocols Used

 SMTP

 POP3

 IMAP

4. Remote Login Service

Allows users to access remote computers.

Protocols Used

 Telnet

 SSH

5. Domain Name Service

Converts domain names into IP addresses.

Protocol Used

 DNS

6. Multimedia Service

Supports audio and video communication.

Applications

 Video conferencing

 Streaming services

7. Network Management Service

Used to monitor and manage network devices.

Protocol
 SNMP (Simple Network Management Protocol)

Common Protocols of Application Layer

Protocol Purpose

HTTP Web browsing

HTTPS Secure web browsing

FTP File transfer

SMTP Sending e-mail

POP3 Receiving e-mail

IMAP Managing e-mail

DNS Name resolution

Telnet Remote login

SSH Secure remote login

SNMP Network management

Importance of Application Layer

The Application Layer is important because:

 It provides an interface between users and the network.

 It enables communication among applications.

 It supports Internet services like web browsing and email.

 It provides file sharing and remote access.

 It makes network resources easily accessible.

Advantages of Application Layer

 User-friendly interface.

 Supports multiple services.

 Enables resource sharing.

 Facilitates communication.

 Provides secure access mechanisms.


Conclusion

The Application Layer is the topmost layer of the networking architecture and provides services
directly to users and application programs. It enables web browsing, file transfer, electronic mail,
remote login, and name resolution, making it one of the most important layers in computer
networking.

Question: Explain the Client-Server Paradigm (Client-Server Architecture).


Introduction

The Client-Server Paradigm is one of the most widely used communication models in computer
networks. In this architecture, one computer called the client requests services, while another
computer called the server provides those services.

The client and server communicate through a network using various protocols. Most Internet
applications such as WWW, email, file transfer, and online banking are based on the client-server
model.

Definition

The Client-Server Paradigm is a network architecture in which a client sends requests for services or
resources, and a server processes those requests and provides the required response.

Components of Client-Server Architecture

1. Client

A client is a computer or application that requests services from a server.

Functions

 Sends requests.

 Receives responses.

 Provides user interface.

Examples

 Web browser

 Mobile applications

 Email clients

2. Server

A server is a powerful computer or software program that provides resources and services to clients.
Functions

 Processes client requests.

 Stores and manages data.

 Sends responses to clients.

Examples

 Web server

 File server

 Database server

 Mail server

Working of Client-Server Model

The communication follows the request-response mechanism.

Step 1

The client sends a request to the server.

Example:

Browser → Request for [Link]

Step 2

The server receives and processes the request.

Step 3

The server sends the required information back to the client.

Server → Web page → Browser

Step 4

The client displays the received information to the user.

Diagram

Request

Client ------------> Server


Response

Client <------------ Server

Types of Servers

1. Web Server

Stores and delivers web pages.

Example:

 Apache

 Nginx

2. File Server

Stores and manages files.

3. Database Server

Provides database services.

Example:

 MySQL

 Oracle

4. Mail Server

Handles email transmission.

Example:

 Gmail server

5. Application Server

Executes application programs and provides business services.

Characteristics of Client-Server Architecture

 Request-response communication.

 Centralized management.

 Multiple clients can access one server.


 Server provides shared resources.

 Supports scalability.

Advantages

1. Centralized Control

Data and resources are managed at a single location.

2. Better Security

Security policies can be implemented at the server.

3. Easy Maintenance

Server updates are easier to manage.

4. Resource Sharing

Resources can be shared among many users.

5. Scalability

New clients can easily be added.

Disadvantages

1. Single Point of Failure

Failure of the server affects all clients.

2. High Cost

Servers are expensive to maintain.

3. Network Dependency

Communication depends on network availability.

4. Heavy Load on Server

Performance may degrade when many clients access the server simultaneously.

Applications of Client-Server Architecture

 World Wide Web (WWW)

 Email systems

 File transfer systems

 Online banking

 E-commerce websites
 Cloud computing

 Social media applications

Question: Explain the World Wide Web (WWW).

Introduction

The World Wide Web (WWW), commonly known as the Web, is a system of interconnected web
pages and documents that can be accessed through the Internet using a web browser.

The WWW was proposed by Tim Berners-Lee in 1989 while working at CERN. It was developed to
facilitate the sharing of information among researchers.

Today, the World Wide Web is one of the most widely used services available on the Internet.

Definition

The World Wide Web (WWW) is a collection of interlinked hypertext documents, multimedia
resources, and web pages that are accessed through the Internet using web browsers.

WWW and Internet

Many students confuse the Internet with the WWW.

Internet

 A global network of interconnected computers.

 Provides the communication infrastructure.

WWW

 A service that operates on top of the Internet.

 Provides access to web pages and websites.

Example

Think of the Internet as a road network and the WWW as the vehicles traveling on those roads.

The Internet can exist without the Web, but the Web cannot exist without the Internet.

Components of WWW

The World Wide Web is based on three fundamental technologies:

1. HTML (HyperText Markup Language)

HTML is the language used to create web pages.


Functions

 Defines structure of web pages.

 Organizes text, images, links, and multimedia.

Example Elements

 Headings

 Paragraphs

 Images

 Tables

 Hyperlinks

2. URL (Uniform Resource Locator)

A URL is the address used to identify a resource on the Web.

Example

[Link]

A URL specifies:

 Protocol

 Domain name

 Resource location

3. HTTP (HyperText Transfer Protocol)

HTTP is the communication protocol used between web browsers and web servers.

It defines how requests and responses are exchanged.

(We will study HTTP separately in detail.)

Architecture of WWW

The WWW follows the Client-Server Architecture.

Components

Client

The client is usually a web browser.

Examples:

 Google Chrome
 Mozilla Firefox

 Microsoft Edge

Server

A web server stores web pages and responds to client requests.

Examples:

 Apache Server

 Nginx Server

Architecture

User

Web Browser (Client)

↓ HTTP Request

Web Server

↓ HTTP Response

Web Browser

Web Page Displayed

Working of WWW

The operation of the World Wide Web involves several steps.

Step 1: User Enters URL

The user enters a URL in the browser.

Example:

[Link]

Step 2: DNS Resolution

The browser contacts a DNS server to obtain the IP address corresponding to the domain name.

Example:
[Link]

[Link]

Step 3: Connection Establishment

The browser establishes a connection with the web server using TCP/IP protocols.

Step 4: HTTP Request

The browser sends an HTTP request to the server.

Example:

GET /[Link]

Step 5: Server Processing

The server processes the request and locates the required web page.

Step 6: HTTP Response

The server sends the requested page back to the browser.

Step 7: Web Page Display

The browser interprets the HTML code and displays the page to the user.

Features of WWW

1. Hypertext Based

Documents contain hyperlinks that connect one page to another.

2. Distributed System

Information is stored on servers located worldwide.

3. Multimedia Support

Supports:

 Text
 Images

 Audio

 Video

 Animation

4. Platform Independent

Can be accessed from different operating systems and devices.

5. User Friendly

Information can be accessed easily using browsers.

Advantages of WWW

1. Easy Access to Information

Large amounts of information are available instantly.

2. Global Connectivity

Users can access information from anywhere.

3. Multimedia Support

Supports various forms of content.

4. Resource Sharing

Facilitates sharing of documents and resources.

5. Supports E-Commerce

Enables online shopping and digital transactions.

Limitations of WWW

1. Security Risks

Websites may be vulnerable to attacks.


2. Privacy Concerns

Personal information may be exposed.

3. Information Overload

Huge amounts of information can make searching difficult.

4. Dependence on Internet

Cannot function without Internet connectivity.

WWW vs Internet

WWW Internet

Information service Network infrastructure

Uses HTTP Uses TCP/IP

Consists of web pages and websites Consists of interconnected networks

Invented by Tim Berners-Lee Developed from ARPANET

Depends on Internet Can exist without WWW

Question: Explain HTTP (HyperText Transfer Protocol).

HTTP is an important Application Layer protocol and questions related to the HTTP model, its role,
and functions have appeared in previous year papers.

Definition

HTTP (HyperText Transfer Protocol) is an Application Layer protocol used for transferring web pages
and other resources between a web browser (client) and a web server.

It follows the request-response model and forms the foundation of the World Wide Web (WWW).

HTTP Architecture
HTTP follows the Client-Server Architecture.

Components

1. Client

The client is usually a web browser that sends requests for web pages.

Examples:

 Google Chrome

 Mozilla Firefox

 Microsoft Edge

2. Server

The server stores web pages and responds to client requests.

Examples:

 Apache Server

 Nginx

Architecture

HTTP Request

Client -------------> Server

HTTP Response

Client <------------- Server

Request-Response Model

HTTP communication is based on the request-response mechanism.

Step 1

The client sends an HTTP request to the server.

Example:

GET /[Link] HTTP/1.1

Step 2

The server processes the request.

Step 3
The server sends an HTTP response containing:

 Status code

 Headers

 Requested resource

Step 4

The browser displays the received web page.

HTTP Messages

HTTP messages are of two types:

1. HTTP Request Message

Sent by the client to request a resource.

It consists of:

 Request line

 Header fields

 Blank line

 Message body (optional)

Example

GET /[Link] HTTP/1.1

Host: [Link]

2. HTTP Response Message

Sent by the server in response to the request.

It contains:

 Status line

 Header fields

 Blank line

 Message body

Example

HTTP/1.1 200 OK

Content-Type: text/html
HTTP Methods

HTTP methods specify the action to be performed on a resource.

1. GET

Used to retrieve information from the server.

Example

Requesting a web page.

2. POST

Used to send data to the server.

Example

Submitting a login form.

3. PUT

Used to upload or update a resource on the server.

4. DELETE

Used to remove a resource from the server.

5. HEAD

Returns only the header information without the message body.

6. OPTIONS

Returns the communication options supported by the server.

HTTP Status Codes

Status codes indicate the result of an HTTP request.

They are divided into five categories.

1xx – Informational

Indicates that the request has been received.


Example:

 100 Continue

2xx – Success

Indicates successful processing.

Examples:

 200 OK

 201 Created

3xx – Redirection

Indicates that further action is required.

Examples:

 301 Moved Permanently

 302 Found

4xx – Client Error

Indicates errors caused by the client.

Examples:

 400 Bad Request

 401 Unauthorized

 403 Forbidden

 404 Not Found

5xx – Server Error

Indicates errors occurring at the server side.

Examples:

 500 Internal Server Error

 503 Service Unavailable

Conclusion
HTTP is an Application Layer protocol that enables communication between web browsers and web
servers. It follows the client-server architecture and request-response model and uses various
methods and status codes to manage the exchange of web resources.

Question: Explain FTP (File Transfer Protocol).


Definition

FTP (File Transfer Protocol) is an Application Layer protocol used for transferring files between
computers connected through a network. It follows the client-server model in which the client
requests files and the server provides file transfer services. FTP allows users to upload files from a
local machine to a remote server and download files from the server to the local machine.

Architecture

FTP follows the client-server architecture. An FTP client establishes a connection with an FTP server
to perform file transfer operations. The communication is carried out through two separate
connections: a control connection and a data connection. The control connection is used for sending
commands and responses between the client and the server, while the data connection is used for
transferring the actual files. This separation enables FTP to manage commands and data
simultaneously.

FTP Client <--------> FTP Server

Control Connection

Data Connection

Working

The working of FTP begins when a client establishes a connection with the FTP server. After the
connection is established, the user provides authentication information such as username and
password. Once the server verifies the user, the client can request various operations such as
uploading, downloading, renaming, or deleting files. The requested file is transferred through the
data connection while commands and responses continue through the control connection. After the
transfer is completed, the connection is terminated.

Ports Used

FTP uses two port numbers for communication. Port 21 is used for establishing the control
connection and exchanging commands between the client and the server. Port 20 is used for
transferring the actual data or files. Thus, FTP uses separate channels for control information and
data transfer, making file communication more efficient.

Question: Explain Telnet, SSH and DNS.

1. Telnet
Definition

Telnet (Telecommunication Network) is an Application Layer protocol that allows a user to remotely
access and control another computer over a network. It provides a command-line interface through
which a user can execute commands on a remote machine as if working locally.

Working

When a Telnet client initiates a connection, it establishes communication with the Telnet server
running on the remote machine. After successful authentication, the user can enter commands
through the local system, which are executed on the remote computer. The results are then sent
back to the user.

Port Used

Telnet uses port number 23 for communication.

Limitation

Since Telnet transmits usernames, passwords, and data in plain text, it is considered insecure and is
rarely used today.

2. SSH (Secure Shell)

Definition

SSH (Secure Shell) is an Application Layer protocol used for secure remote login and communication
between computers. It was developed as a secure replacement for Telnet.

Working

An SSH client establishes a secure encrypted connection with the SSH server. After authentication,
the user can remotely execute commands and transfer files securely. All information exchanged
between the client and server is encrypted, protecting it from unauthorized access.

Port Used

SSH uses port number 22 for communication.

Advantages over Telnet

 Provides encrypted communication.

 Offers better authentication mechanisms.


 Protects passwords and sensitive information.

 Supports secure file transfer.

Difference Between Telnet and SSH

Telnet SSH

Insecure protocol Secure protocol

Data transmitted in plain text Data transmitted in encrypted form

Uses port 23 Uses port 22

Less secure authentication Strong authentication

Rarely used today Widely used for remote administration

3. DNS (Domain Name System)

Definition

The Domain Name System (DNS) is an Application Layer protocol that translates human-readable
domain names into their corresponding IP addresses. It acts like a directory service of the Internet
and enables users to access websites using names instead of numerical IP addresses.

Example

[Link]

[Link]

Need for DNS

Computers communicate using IP addresses, but it is difficult for humans to remember numerical
addresses. DNS solves this problem by providing meaningful domain names that are easier to
remember.

Architecture of DNS

DNS follows a hierarchical and distributed architecture consisting of:

 Root DNS Servers

 Top-Level Domain (TLD) Servers

 Authoritative DNS Servers

 Local DNS Servers


These servers work together to resolve domain names into IP addresses.

Working of DNS

When a user enters a domain name in a web browser, the request is first sent to the local DNS server.
If the required IP address is not available locally, the query is forwarded to the root server, then to
the top-level domain server, and finally to the authoritative server. The authoritative server returns
the corresponding IP address, which is then sent back to the user. Using this IP address, the browser
establishes communication with the desired web server.

Advantages

 Makes Internet usage easier.

 Eliminates the need to remember IP addresses.

 Provides distributed and scalable name resolution.

 Improves reliability and performance through caching.

Question: Explain Peer-to-Peer (P2P) Networks and Distributed Hash Table (DHT).

1. Peer-to-Peer (P2P) Networks

Definition

A Peer-to-Peer (P2P) network is a network architecture in which all computers, called peers, have
equal capabilities and responsibilities. Unlike the client-server model, there is no dedicated central
server. Each peer can act both as a client and as a server, sharing resources directly with other peers.

Architecture

In a P2P network, every node communicates directly with other nodes without depending on a
central server.

Peer A

/ \

Peer B ---- Peer C

\ /

Peer D

Working
When a peer requires a resource such as a file, it sends a request to other peers in the network. A
peer possessing the requested resource responds and transfers the data directly to the requesting
peer. Thus, all participating nodes contribute resources and services to the network.

Features

 No central server.

 Every node acts as both client and server.

 Resources are distributed among peers.

 Easy to add or remove nodes.

Advantages

 Low cost of implementation.

 No dependency on a central server.

 Highly scalable.

 Better resource utilization.

Disadvantages

 Security management is difficult.

 Data backup and recovery are complex.

 Performance may decrease with heavy traffic.

2. Distributed Hash Table (DHT)

Definition

A Distributed Hash Table (DHT) is a decentralized data structure used in P2P networks to efficiently
store and locate information. It distributes data among participating peers using key-value pairs.

Working

In a DHT system, each piece of data is assigned a unique key using a hash function. The key
determines which peer will store the corresponding value. When a node requests a resource, the
DHT mechanism locates the peer responsible for storing that data and retrieves it efficiently.

For example,
Key → Value

101 → File A

205 → File B

310 → File C

Different peers store different key-value pairs, and together they form a distributed database.

Features

 Decentralized architecture.

 Efficient searching and retrieval.

 Data distributed among peers.

 Scalable and fault tolerant.

Advantages

 Fast lookup of resources.

 No single point of failure.

 Supports large-scale networks.

 Efficient utilization of storage.

SECTION – B
Question 1: Explain the Transport Layer and Discuss the Services Provided by It.

This is the first major question of Section B and forms the basis for understanding UDP, TCP, flow
control protocols, and congestion control. Several questions in PYQs are directly or indirectly based
on the Transport Layer.

Introduction

The Transport Layer is the fourth layer of the OSI model and the second layer of the TCP/IP model. It
acts as an interface between the upper layers (Application Layer) and the lower layers (Network
Layer).
Its primary responsibility is to provide end-to-end or process-to-process communication between
applications running on different hosts.

While the Network Layer is concerned with delivering packets from one host to another, the
Transport Layer ensures that data reaches the correct application process in a reliable and orderly
manner.

Need for Transport Layer

The Network Layer only provides host-to-host delivery and does not guarantee:

 Reliable communication.

 Error-free delivery.

 Ordered delivery of packets.

 Flow control.

 Communication between application processes.

These functions are performed by the Transport Layer.

Functions of Transport Layer

The Transport Layer performs several important functions to ensure reliable communication.

1. Process-to-Process Delivery

Unlike the Network Layer, which delivers packets from one host to another, the Transport Layer
delivers data from one process (application) to another process.

For example, a web browser communicating with a web server involves process-to-process
communication.

This is achieved using port numbers, which uniquely identify application processes.

Examples:

 HTTP → Port 80

 FTP → Port 21

 DNS → Port 53

2. Segmentation and Reassembly

Application layer messages are usually very large and cannot be transmitted directly.

Therefore, the Transport Layer divides the message into smaller units called segments.

Each segment is transmitted independently through the network.


At the receiver side, these segments are reassembled into the original message.

Thus, segmentation improves efficiency and reliability of communication.

3. Multiplexing and Demultiplexing

A host may run multiple applications simultaneously.

For example:

 Browser

 Email client

 Video streaming application

The Transport Layer combines data from different applications before transmission. This process is
called multiplexing.

At the receiving end, the Transport Layer separates incoming data and delivers it to the correct
application. This process is called demultiplexing.

Port numbers are used to perform these functions.

4. Connection Control

The Transport Layer provides two types of services:

Connection-Oriented Service

Before transmitting data, a logical connection is established between sender and receiver.

Characteristics:

 Reliable communication.

 Ordered delivery.

 Error recovery.

Example:

 TCP

Connectionless Service

No connection establishment is required before sending data.

Characteristics:

 Faster communication.

 No guarantee of delivery.

Example:
 UDP

5. Flow Control

The sender may transmit data faster than the receiver can process it.

Flow control prevents the receiver from being overloaded by regulating the amount of data sent.

Thus, flow control maintains synchronization between sender and receiver.

6. Error Control

Errors may occur due to:

 Packet loss.

 Corrupted data.

 Duplicate packets.

The Transport Layer detects such errors and ensures reliable transmission through:

 Sequence numbers.

 Acknowledgments.

 Retransmissions.

 Checksums.

Hence, lost or corrupted segments are retransmitted.

7. Sequencing

Data segments may arrive out of order.

The Transport Layer assigns sequence numbers to segments so that the receiver can rearrange them
in the correct order.

This ensures ordered delivery of information.

8. Congestion Control

Network congestion occurs when too much data is injected into the network.

The Transport Layer controls congestion by adjusting the transmission rate and preventing excessive
traffic.

This improves network performance and reduces packet loss.


Question 2: Explain Flow Control Protocols. Discuss Stop-and-Wait, Go-Back-N and Selective
Repeat Protocols and Compare Them.

Flow control is one of the most important functions of the Transport Layer. It ensures that the sender
does not transmit data at a rate faster than the receiver can process. Flow control protocols regulate
the transmission of frames between sender and receiver to achieve reliable communication.

The three important flow control protocols are:

1. Stop-and-Wait Protocol

2. Go-Back-N Protocol

3. Selective Repeat Protocol

1. Stop-and-Wait Protocol

Introduction

The Stop-and-Wait protocol is the simplest flow control protocol. In this method, the sender
transmits one frame at a time and waits for an acknowledgment from the receiver before sending
the next frame.

Thus, at any instant, only one frame remains unacknowledged.

Working

1. Sender transmits Frame 0.

2. Receiver receives the frame and sends an ACK.

3. After receiving the acknowledgment, the sender transmits the next frame.

4. This process continues until all frames are transmitted.

Operation

Sender Receiver

Frame 0 ------------>

<--------- ACK

Frame 1 ------------>

<--------- ACK

Frame 2 ------------>

<--------- ACK
Advantages

 Simple to implement.

 Reliable transmission.

 Easy error recovery.

Disadvantages

 Poor utilization of bandwidth.

 Low throughput.

 Sender remains idle while waiting for acknowledgment.

2. Go-Back-N Protocol

Introduction

Go-Back-N is a sliding window protocol in which the sender can transmit multiple frames without
waiting for acknowledgments.

The receiver accepts frames only in sequence. If a frame is lost or damaged, all subsequent frames
are discarded and retransmitted.

Working

Suppose the sender window size is 4.

1. Sender transmits Frames 0, 1, 2 and 3 continuously.

2. Assume Frame 2 is lost.

3. Receiver accepts Frames 0 and 1.

4. Frame 2 is missing, so Frame 3 is discarded.

5. Sender retransmits Frame 2 and all subsequent frames.

Operation

Sender Receiver

0 ---------------------->

1 ---------------------->

2 ----X (Lost)

3 ---------------------->
ACK0 <--------------------

ACK1 <--------------------

Retransmit 2 ------------>

Retransmit 3 ------------>

Characteristics

 Uses sliding window.

 Multiple frames can be outstanding.

 Receiver window size is one.

 Uses cumulative acknowledgments.

Advantages

 Better channel utilization.

 Higher throughput.

 More efficient than Stop-and-Wait.

Disadvantages

 Wastes bandwidth due to retransmission of correctly received frames.

 Receiver discards out-of-order frames.

3. Selective Repeat Protocol

Introduction

Selective Repeat is an advanced sliding window protocol in which only the lost or damaged frames
are retransmitted instead of retransmitting all subsequent frames.

The receiver accepts and stores out-of-order frames.

Working

Suppose frame 2 is lost.

1. Frames 0 and 1 are received successfully.


2. Frame 2 is lost.

3. Frame 3 arrives and is temporarily stored.

4. Sender retransmits only Frame 2.

5. Receiver rearranges frames in the correct sequence.

Operation

Sender Receiver

0 ----------------------->

1 ----------------------->

2 ----X (Lost)

3 ----------------------->

Frame 3 stored

Retransmit 2 ------------->

Frames delivered in order

Characteristics

 Uses sliding window.

 Receiver accepts out-of-order frames.

 Only erroneous frames are retransmitted.

 Requires buffering at the receiver.

Advantages

 Efficient use of bandwidth.

 High throughput.

 Less retransmission.

Disadvantages

 More complex implementation.


 Requires larger memory.

 Receiver must maintain buffers.

Question 3: Explain Bi-directional Protocol and Piggybacking.

In practical communication systems, data transfer often takes place in both directions
simultaneously. To improve efficiency and reduce overhead, mechanisms such as Bi-directional
Protocol and Piggybacking are used.

Bi-directional Protocol

Definition

A Bi-directional Protocol is a communication protocol in which both stations can transmit and
receive data simultaneously. Thus, each station acts as both a sender and a receiver.

Unlike one-way communication, data flows in both directions, resulting in better utilization of the
communication channel.

Working

Suppose two stations A and B are communicating.

1. Station A sends frames to Station B.

2. At the same time, Station B can also send frames to Station A.

3. Both stations acknowledge the received frames and continue transmission.

Operation

Station A <------------> Station B

(Send & Receive) (Send & Receive)

Hence, communication occurs in both directions simultaneously.

Advantages

 Better utilization of communication channel.

 Higher throughput.

 Supports full-duplex communication.

 Reduces idle waiting time.

Piggybacking

Definition
Piggybacking is a technique used in bi-directional communication in which the acknowledgment for a
received frame is attached to the next outgoing data frame instead of sending a separate
acknowledgment frame.

Thus, data and acknowledgment travel together in a single frame.

Working

Consider two stations A and B.

1. Station A sends a frame to B.

2. B receives the frame.

3. Instead of immediately sending an ACK, B waits until it has its own data to send.

4. The acknowledgment is attached to B's outgoing frame.

5. Station A receives both the data and acknowledgment together.

Operation

Without Piggybacking:

A --------> Data --------> B

A <-------- ACK <-------- B

B --------> Data --------> A

B <-------- ACK <-------- A

With Piggybacking:

A --------> Data --------> B

A <-------- Data + ACK --- B

Thus, separate acknowledgment frames are avoided.

Advantages

 Reduces overhead.

 Improves channel utilization.

 Increases efficiency.

 Reduces the number of frames transmitted.

Disadvantage
If a station has no data to send, it cannot delay the acknowledgment indefinitely. In such cases, a
separate ACK frame must be transmitted after a timeout period.

Question 4: Explain UDP (User Datagram Protocol) in Detail.

Introduction

User Datagram Protocol (UDP) is a connectionless Transport Layer protocol that provides process-to-
process communication without establishing a connection between the sender and receiver.

Unlike TCP, UDP does not provide error recovery, flow control, or congestion control. Therefore, it
offers faster communication with minimum overhead.

Services Provided by UDP

UDP provides the following services:

1. Process-to-Process Communication

UDP enables communication between application processes using port numbers.

2. Connectionless Service

No connection establishment is required before transmitting data.

3. Fast Data Transmission

Since there is no acknowledgment and retransmission mechanism, UDP provides faster


communication.

4. Multiplexing and Demultiplexing

Multiple applications can simultaneously use UDP through port numbers.

5. Error Detection

UDP uses checksum for detecting errors, although it does not provide error correction.

UDP Datagram

The data unit used in UDP is called a datagram. A UDP datagram consists of two parts:

1. Header

2. Data
The UDP header contains four fields.

--------------------------------

| Source Port Number (16 bits) |

--------------------------------

| Destination Port (16 bits) |

--------------------------------

| Length (16 bits) |

--------------------------------

| Checksum (16 bits) |

--------------------------------

| Data |

--------------------------------

Source Port Number

It identifies the application process that sends the datagram.

Destination Port Number

It identifies the application process that receives the datagram.

Length

It specifies the total length of the UDP datagram including both header and data.

Checksum

It is used for error detection during transmission.

Characteristics of UDP

 Connectionless protocol.

 No acknowledgment mechanism.

 No flow control.

 No congestion control.

 Faster than TCP.


 Low overhead.

 Unreliable data delivery.

Applications of UDP

UDP is preferred in applications where speed is more important than reliability.

1. DNS (Domain Name System)

UDP is used for DNS queries because quick responses are required.

2. Video Streaming

Applications like YouTube and Netflix use UDP since occasional packet loss is acceptable.

3. Voice over IP (VoIP)

Real-time voice communication requires fast delivery.

Examples:

 Skype

 WhatsApp Calling

4. Online Gaming

Multiplayer games require low latency and fast transmission.

5. Live Broadcasting

Live audio and video streaming applications use UDP.

Advantages of UDP

 Simple protocol.

 High speed communication.

 Less transmission overhead.

 Suitable for real-time applications.

 No connection establishment delay.

Disadvantages of UDP
 No guarantee of delivery.

 Packets may be lost.

 No retransmission mechanism.

 No flow control.

 No congestion control.

Difference Between TCP and UDP

TCP UDP

Connection-oriented Connectionless

Reliable Unreliable

Uses acknowledgments No acknowledgments

Provides flow control No flow control

Provides congestion control No congestion control

Slower Faster

Larger overhead Smaller overhead

Used in HTTP, FTP, Email Used in DNS, VoIP, Streaming

Question 5: Explain TCP (Transmission Control Protocol) in Detail.


Introduction

Transmission Control Protocol (TCP) is a connection-oriented Transport Layer protocol that provides
reliable, ordered, and error-free delivery of data between two communicating processes.

Before transmitting data, TCP establishes a connection between the sender and the receiver and
ensures that all data reaches the destination correctly and in sequence.

Services Provided by TCP

TCP provides several important services for reliable communication.

1. Process-to-Process Communication
TCP provides communication between application processes using port numbers.

2. Connection-Oriented Service

A connection is established before data transmission begins and is terminated after communication
is completed.

3. Reliable Data Transfer

TCP ensures that lost or corrupted segments are retransmitted, thereby providing reliable
communication.

4. Full-Duplex Communication

Both sender and receiver can transmit data simultaneously.

5. Flow Control

TCP prevents the sender from overwhelming the receiver by controlling the rate of transmission.

6. Error Control

TCP detects errors and retransmits lost segments using acknowledgments and sequence numbers.

7. Congestion Control

TCP controls network congestion and improves overall performance.

Features of TCP

The important features of TCP are:

 Connection-oriented protocol.

 Reliable data transmission.

 Full-duplex communication.

 End-to-end communication.

 Flow control mechanism.

 Error control mechanism.

 Congestion control support.

 Ordered delivery of data.


 Uses acknowledgments and retransmissions.

 Supports multiplexing and demultiplexing.

TCP Segment

The unit of data transmitted by TCP is called a segment. A TCP segment consists of a header and a
data field.

The TCP header contains several fields that help in ensuring reliable communication.

---------------------------------------------------

Source Port Number

---------------------------------------------------

Destination Port Number

---------------------------------------------------

Sequence Number

---------------------------------------------------

Acknowledgment Number

---------------------------------------------------

Header Length

---------------------------------------------------

Control Flags

---------------------------------------------------

Window Size

---------------------------------------------------

Checksum

---------------------------------------------------

Urgent Pointer

---------------------------------------------------

Options

---------------------------------------------------

Data

---------------------------------------------------
Fields of TCP Segment

Source Port Number

It identifies the application process that sends the data.

Destination Port Number

It identifies the application process that receives the data.

Sequence Number

It specifies the position of data in the transmission and helps in maintaining proper order.

Acknowledgment Number

It indicates the next byte expected from the sender and is used for reliable delivery.

Header Length

It specifies the size of the TCP header.

Control Flags

These flags control connection establishment and termination.

Important flags are:

 SYN (Synchronize)

 ACK (Acknowledgment)

 FIN (Finish)

 RST (Reset)

 PSH (Push)

 URG (Urgent)

Window Size

It specifies the number of bytes that can be transmitted before receiving an acknowledgment.

Checksum

It is used to detect errors in the segment.


Urgent Pointer

It indicates the location of urgent data.

Options

They provide additional features such as window scaling and timestamps.

Working of TCP

The operation of TCP consists of three phases:

1. Connection Establishment

A logical connection is established between sender and receiver using the three-way handshake.

2. Data Transfer

Segments are exchanged between the two hosts with acknowledgments ensuring reliable delivery.

3. Connection Termination

After the transmission is complete, the connection is closed.

Applications of TCP

TCP is used in applications where reliability is important.

Examples include:

 HTTP

 HTTPS

 FTP

 SMTP

 POP3

 Telnet

 SSH

Advantages of TCP

 Reliable communication.
 Ordered delivery of segments.

 Error detection and recovery.

 Flow control support.

 Congestion control support.

 High accuracy in data transmission.

Disadvantages of TCP

 Higher overhead.

 Slower than UDP.

 Requires connection establishment.

 More complex protocol.

Question 6: Explain TCP Connection Management using State Transition


Diagram.
Connection Establishment: Three-Way Handshake

TCP uses the Three-Way Handshake mechanism to establish a connection.

Step 1: SYN

The client initiates the connection by sending a segment with the SYN flag set and enters the SYN-
SENT state.

Client -------------------- SYN --------------------> Server

Step 2: SYN + ACK

The server acknowledges the request and sends a segment with both SYN and ACK flags set. The
server enters the SYN-RECEIVED state.

Client <--------------- SYN + ACK ------------------ Server

Step 3: ACK

The client sends an acknowledgment to the server. Both the client and server enter the ESTABLISHED
state, and data transmission can begin.

Client -------------------- ACK --------------------> Server

Three-Way Handshake

Client Server
CLOSED LISTEN

| |

|--------- SYN --------------------->|

| |

|<------ SYN + ACK ------------------|

| |

|---------- ACK -------------------->|

| |

ESTABLISHED ESTABLISHED

Connection Termination: Four-Way Handshake

TCP uses a Four-Way Handshake to terminate a connection.

Step 1

One side sends a FIN segment requesting termination.

Step 2

The other side acknowledges it by sending an ACK.

Step 3

When the receiver finishes transmitting its remaining data, it sends its own FIN segment.

Step 4

The sender acknowledges the FIN segment with an ACK, and the connection is closed.

Four-Way Handshake

Client Server

FIN ------------------------------->

<------------------------------- ACK

<------------------------------- FIN
ACK ------------------------------->

TCP State Transition Diagram

During connection establishment and termination, TCP passes through several states.

1. CLOSED

 Initial state.

 No connection exists.

2. LISTEN

 Server waits for connection requests.

3. SYN-SENT

 Client has sent a SYN segment and is waiting for a response.

4. SYN-RECEIVED

 Server has received SYN and sent SYN+ACK.

5. ESTABLISHED

 Connection has been successfully established.

 Data transfer takes place in this state.

6. FIN-WAIT-1

 One side has sent a FIN segment and is waiting for acknowledgment.

7. FIN-WAIT-2

 ACK for FIN has been received.

 Waiting for FIN from the other side.

8. CLOSE-WAIT

 One side has received FIN and is preparing to close the connection.
9. LAST-ACK

 FIN has been sent and acknowledgment is awaited.

10. TIME-WAIT

 Waits for sufficient time to ensure delayed packets have disappeared from the network.

11. CLOSED

 Connection is completely terminated.

Simplified State Transition Diagram

+--------+

| CLOSED |

+--------+

+--------+

| LISTEN |

+--------+

+------------+

| SYN-SENT |

+------------+

+---------------+

| SYN-RECEIVED |

+---------------+

+---------------+
| ESTABLISHED |

+---------------+

+---------------+

| FIN-WAIT-1 |

+---------------+

+---------------+

| FIN-WAIT-2 |

+---------------+

+---------------+

| TIME-WAIT |

+---------------+

+--------+

| CLOSED |

+--------+

Advantages of TCP Connection Management

 Ensures reliable communication.

 Prevents data loss.

 Establishes synchronization between sender and receiver.

 Provides orderly connection termination.

Question 7: Explain Windows in TCP, Flow Control and Error Control


Mechanisms.
Windows in TCP

Introduction

TCP uses a sliding window mechanism to control the number of bytes that can be transmitted
before receiving an acknowledgment.

The window represents the amount of data that the sender is allowed to send without waiting for an
acknowledgment.

Thus, multiple segments can be transmitted simultaneously, improving throughput and bandwidth
utilization.

Sender Window

The sender window contains:

 Segments already acknowledged.

 Segments sent but awaiting acknowledgment.

 Segments allowed to be sent.

 Segments that cannot yet be sent.

Sliding Window Operation

--------------------------------------

| ACKed | Sent | Can Send | Cannot Send |

--------------------------------------

As acknowledgments arrive, the window slides forward, allowing transmission of new segments.

Receiver Window

The receiver window specifies how much buffer space is available at the receiver.

The receiver advertises this value to the sender through the Window Size field present in the TCP
header.

This prevents the sender from transmitting excessive data.

Flow Control in TCP

Introduction

Flow control is a mechanism that prevents the sender from sending data faster than the receiver can
process.

Without flow control, the receiver's buffer may overflow, resulting in packet loss.

TCP uses the Sliding Window Protocol to perform flow control.


Working of Flow Control

1. The receiver maintains a buffer to store incoming data.

2. It informs the sender about the available buffer space using the receiver window.

3. The sender transmits data according to the advertised window size.

4. As data is processed, acknowledgments are sent, and the window slides forward.

Example

Suppose the receiver advertises a window size of 5000 bytes.

Sender --------------------> 5000 Bytes

Receiver <------------------- ACK + New Window Size

The sender cannot transmit more than 5000 bytes until acknowledgments are received.

Advantages of Flow Control

 Prevents receiver overload.

 Avoids buffer overflow.

 Improves communication efficiency.

 Provides reliable data transmission.

Error Control in TCP

Introduction

Errors may occur due to:

 Loss of segments.

 Corrupted data.

 Duplicate segments.

 Out-of-order arrival.

TCP provides reliable communication by detecting and correcting these errors.

Mechanisms Used for Error Control

1. Sequence Numbers
Each byte transmitted by TCP is assigned a sequence number.

Sequence numbers help:

 Maintain correct order.

 Detect lost segments.

 Eliminate duplicate segments.

2. Acknowledgments

The receiver sends an acknowledgment (ACK) indicating the next expected byte.

Example:

Received bytes: 1–1000

ACK = 1001

This means the receiver expects byte number 1001 next.

3. Retransmission

If an acknowledgment is not received within a specified time, the sender assumes that the segment
has been lost and retransmits it.

This mechanism ensures reliable delivery.

4. Checksum

TCP computes a checksum over the header and data.

At the receiver side, the checksum is recalculated.

If the values do not match, the segment is discarded.

Thus, checksum provides error detection.

Working of Error Control

Sender Receiver

Segment 1 -------------------->

ACK 2 <------------------------
Segment 2 ----X (Lost)

(No ACK received)

Retransmit Segment 2 -------->

ACK 3 <-----------------------

Hence, lost segments are recovered through retransmission.

Question 8: Explain Congestion Control in TCP.


Congestion is a condition in which the network becomes overloaded due to excessive traffic. When
too many packets are present in the network, routers and buffers become congested, leading to
increased delay, packet loss, and reduced throughput.

TCP provides congestion control mechanisms to regulate the amount of data entering the network
and prevent congestion.

Need for Congestion Control

Congestion control is necessary because:

 Excessive traffic can overload the network.

 Packet loss may occur.

 Network throughput decreases.

 Delay and retransmissions increase.

 Overall network performance deteriorates.

Therefore, TCP dynamically adjusts the transmission rate to avoid congestion.

Congestion Window (cwnd)

TCP maintains a variable called the Congestion Window (cwnd), which determines the maximum
amount of data that can be transmitted without receiving acknowledgments.

The effective window size is given by:

where:

 cwnd = Congestion Window

 rwnd = Receiver Window


The sender can transmit only up to the smaller of these two values.

Congestion Control Mechanisms in TCP

TCP uses four major mechanisms:

1. Slow Start

2. Congestion Avoidance

3. Fast Retransmit

4. Fast Recovery

1. Slow Start

Initially, TCP assumes that the network conditions are unknown. Therefore, it starts with a small
congestion window.

The congestion window increases exponentially with each acknowledgment received.

Working

Suppose:

cwnd = 1 MSS

After receiving acknowledgments:

1 → 2 → 4 → 8 → 16

Thus, the transmission rate increases rapidly until a threshold value called ssthresh is reached.

Advantages

 Quickly utilizes available bandwidth.

 Suitable when network conditions are favorable.

2. Congestion Avoidance

Once the congestion window reaches the threshold value, TCP enters the congestion avoidance
phase.

Instead of exponential growth, the congestion window now increases linearly.

Growth Pattern

16 → 17 → 18 → 19 → 20

This slower growth helps prevent congestion and provides stable network performance.

3. Fast Retransmit
Normally, TCP waits for a timeout before retransmitting a lost segment.

However, waiting for timeout increases delay.

If the sender receives three duplicate acknowledgments, it assumes that a segment has been lost
and immediately retransmits that segment without waiting for timeout.

Thus, packet loss is detected earlier and communication becomes faster.

4. Fast Recovery

After Fast Retransmit, TCP does not return to the beginning of Slow Start.

Instead, it enters the Fast Recovery phase.

In this phase:

 The threshold value (ssthresh) is reduced.

 The congestion window is decreased.

 Transmission continues without restarting from one segment.

This avoids unnecessary reduction in throughput and improves efficiency.

Phases of TCP Congestion Control

Slow Start

Congestion Avoidance

Packet Loss

Fast Retransmit

Fast Recovery

Congestion Avoidance

Question 9: Explain Timers and Options in TCP.

TCP Timers

A timer is used to determine how long the sender should wait for a particular event before taking
corrective action.
TCP mainly uses four timers:

1. Retransmission Timer

2. Persistence Timer

3. Keepalive Timer

4. Time-Wait Timer

1. Retransmission Timer

Definition

The Retransmission Timer is used to detect lost segments.

Working

 After transmitting a segment, TCP starts a timer.

 If the acknowledgment is received before the timer expires, the timer is stopped.

 If the timer expires before receiving the acknowledgment, the segment is retransmitted.

Thus, this timer ensures reliable delivery of data.

2. Persistence Timer

Definition

The Persistence Timer prevents deadlock situations caused by lost window update messages.

Working

Suppose the receiver advertises a window size of zero, indicating that it cannot receive more data.

If the subsequent window update message is lost, the sender may wait indefinitely.

To avoid this, TCP uses the Persistence Timer. When the timer expires, the sender sends a probe
segment to determine whether the receiver is ready to accept data again.

3. Keepalive Timer

Definition

The Keepalive Timer is used to detect whether an idle connection is still active.

Working

If no communication occurs for a long period, TCP sends a keepalive probe.

 If the other host responds, the connection remains active.

 If no response is received after several attempts, the connection is terminated.


Thus, the Keepalive Timer helps in identifying dead connections.

4. Time-Wait Timer

Definition

The Time-Wait Timer is activated after connection termination.

Working

After sending the final acknowledgment, TCP waits for a specified amount of time before completely
closing the connection.

This waiting period ensures that delayed or duplicate segments present in the network are discarded.

Hence, it prevents confusion with future connections.

TCP Options
TCP options provide additional features and improve the efficiency of communication.

Important TCP options are:

1. Window Scaling

2. Timestamp

3. Selective Acknowledgment (SACK)

1. Window Scaling

In high-speed networks, the normal TCP window size may not be sufficient.

Window Scaling increases the effective window size, allowing more data to be transmitted before
receiving acknowledgments.

Thus, it improves throughput in high-bandwidth networks.

2. Timestamp

The Timestamp option records the time at which a segment is transmitted.

It helps in:

 Calculating Round Trip Time (RTT).

 Improving timeout estimation.

 Detecting duplicate segments.

Thus, timestamps enhance the performance and reliability of TCP.


3. Selective Acknowledgment (SACK)

Normally, TCP acknowledges data cumulatively. If a segment is lost, several correctly received
segments may have to be retransmitted.

Selective Acknowledgment allows the receiver to inform the sender exactly which segments have
been received successfully.

As a result, only the missing segments are retransmitted, improving efficiency and reducing
unnecessary retransmissions.

SECTION – C
Question 1: Explain the Network Layer and discuss the services provided by it. Explain Packet
Switching and IPv4 Addressing.

Introduction

The Network Layer is the third layer of the OSI model and is responsible for delivering packets from
the source host to the destination host across multiple interconnected networks.

Unlike the Data Link Layer, which provides node-to-node communication, the Network Layer
provides host-to-host communication. It determines the best route for packet transmission and
ensures that packets reach the correct destination.

The major protocol used at this layer is the Internet Protocol (IP).

Services Provided by the Network Layer

The Network Layer performs several important functions.

1. Logical Addressing

Every device connected to a network is assigned a logical address called an IP address.

This address uniquely identifies the source and destination hosts.

Example:

[Link]

Logical addressing allows communication between devices located on different networks.

2. Routing

The Network Layer determines the most suitable path for transmitting packets from source to
destination.
Routers use routing algorithms and routing tables to select the best path.

3. Packet Forwarding

Once the route is determined, routers forward packets from one network to another until they reach
the destination.

4. Fragmentation and Reassembly

Different networks support different frame sizes.

If a packet is larger than the Maximum Transmission Unit (MTU), the Network Layer divides it into
smaller fragments. These fragments are reassembled at the destination.

5. Internetworking

The Network Layer enables communication among heterogeneous networks, thereby making the
Internet possible.

Packet Switching

Definition

Packet Switching is a technique in which a message is divided into smaller units called packets. These
packets are transmitted independently through the network and are reassembled at the destination.

It is the fundamental switching technique used in the Internet.

Working of Packet Switching

1. The message is divided into packets.

2. Each packet contains:

o Source address

o Destination address

o Sequence number

o Data

3. Packets travel independently through the network.

4. At the receiver, packets are reassembled into the original message.

Message


Packet 1

Packet 2

Packet 3

Packet 4

Network

Destination

Advantages of Packet Switching

 Efficient utilization of bandwidth.

 Reliable communication.

 Supports multiple users simultaneously.

 Suitable for bursty traffic.

 Forms the basis of Internet communication.

IPv4 Protocol

Introduction

IPv4 (Internet Protocol Version 4) is the most widely used Network Layer protocol. It provides logical
addressing and packet delivery between hosts.

IPv4 is a connectionless and best-effort protocol, meaning it does not guarantee reliable delivery.

IPv4 Datagram

The packet used by IPv4 is called an IPv4 Datagram.

An IPv4 datagram consists of:

1. Header

2. Data

Important Fields of IPv4 Header

---------------------------------

Version

Header Length
Type of Service

Total Length

---------------------------------

Identification

Flags

Fragment Offset

---------------------------------

Time to Live (TTL)

Protocol

Header Checksum

---------------------------------

Source IP Address

---------------------------------

Destination IP Address

---------------------------------

Options

---------------------------------

Data

---------------------------------

Important Header Fields

Version

Specifies the IP version being used.

For IPv4, the value is 4.

Total Length

Indicates the total size of the datagram including header and data.

Time To Live (TTL)

Specifies the maximum number of routers through which the packet can pass.

It prevents packets from circulating indefinitely in the network.


Protocol Field

Identifies the upper-layer protocol.

Examples:

 TCP → 6

 UDP → 17

 ICMP → 1

Source Address

Contains the IP address of the sender.

Destination Address

Contains the IP address of the receiver.

IPv4 Addressing

Definition

An IPv4 address is a 32-bit logical address used to uniquely identify a device on a network.

It is represented as four decimal numbers separated by dots.

Example:

[Link]

Structure of IPv4 Address

192 . 168 . 1 . 10

8-bit 8-bit 8-bit 8-bit

Thus,

32 bits = 4 octets × 8 bits

Classes of IPv4 Addresses

Class A

 First bit = 0

 Range:
[Link] – [Link]

Used for very large networks.

Class B

 First two bits = 10

 Range:

[Link] – [Link]

Used for medium-sized networks.

Class C

 First three bits = 110

 Range:

[Link] – [Link]

Used for small networks.

Class D

Used for multicasting.

Range:

[Link] – [Link]

Class E

Reserved for experimental purposes.

Range:

[Link] – [Link]

Question 2: Explain IP Packet Forwarding and ICMPv4.

IP Packet Forwarding

Introduction

Packet forwarding is the process of moving a packet from one network to another until it reaches its
destination. This operation is performed by routers using information stored in routing tables.
The router examines the destination IP address and determines the next hop through which the
packet should be sent.

Routing Table

A routing table contains information about:

 Destination network.

 Next-hop address.

 Interface through which the packet should be forwarded.

 Cost or metric of the route.

Example:

Destination Network Next Hop Interface

[Link] Router A Interface 1

[Link] Router B Interface 2

[Link] Router C Interface 3

Next-Hop Forwarding

Instead of storing the complete path to the destination, routers store only the address of the next
router.

Thus, each router forwards the packet to the next hop, and eventually the packet reaches the
destination.

Working of Packet Forwarding

1. A packet arrives at a router.

2. The router extracts the destination IP address.

3. It searches the routing table for a matching entry.

4. The next hop is determined.

5. The packet is forwarded through the appropriate interface.

6. This process continues until the packet reaches the destination host.

Operation

Source Host

Router A

Router B

Router C

Destination Host

ICMPv4 (Internet Control Message Protocol Version 4)

Introduction

ICMPv4 is a companion protocol of IPv4 used for reporting errors and providing diagnostic
information. It does not carry user data but assists IP in detecting problems during packet delivery.

ICMP messages are encapsulated inside IPv4 datagrams.

Functions of ICMPv4

ICMPv4 performs the following functions:

 Reports transmission errors.

 Provides diagnostic information.

 Helps in testing connectivity.

 Assists routers in forwarding packets.

Types of ICMPv4 Messages

ICMPv4 messages are broadly classified into:

1. Error-Reporting Messages

2. Query Messages

1. Error-Reporting Messages

These messages are generated whenever a problem occurs during packet delivery.

(a) Destination Unreachable

Generated when the destination host or network cannot be reached.

(b) Time Exceeded


Generated when the Time-To-Live (TTL) field becomes zero.

This prevents packets from circulating indefinitely in the network.

(c) Parameter Problem

Generated when an invalid field is found in the IP header.

(d) Source Quench

Used to indicate congestion in the network.

2. Query Messages

These messages are used for obtaining information and performing diagnostics.

(a) Echo Request and Echo Reply

Used by the Ping utility to test connectivity between two hosts.

Example:

Ping [Link]

If the destination host is reachable, an Echo Reply is returned.

(b) Timestamp Request and Reply

Used to measure transmission delays.

(c) Address Mask Request and Reply

Used by a host to obtain subnet mask information.

(d) Router Solicitation and Advertisement

Used by hosts to discover routers present in the network.

Working of ICMPv4

Suppose a packet cannot reach its destination because the network is unavailable.

1. The router detects the problem.

2. It generates an ICMP "Destination Unreachable" message.

3. The message is sent back to the source host.


4. The source host becomes aware of the error.

Thus, ICMP provides feedback about problems encountered during packet transmission.

Applications of ICMPv4

Ping

Uses Echo Request and Echo Reply messages to check connectivity.

Traceroute

Uses Time Exceeded messages to determine the path taken by packets.

Network Diagnostics

Helps in identifying routing and connectivity problems.

Question 3: Explain Unicast Routing Algorithms. Compare Distance Vector


Routing and Path Vector Routing.
Routing is the process of selecting the best path for transmitting packets from the source to the
destination. In unicast routing, a packet is sent from one source host to one destination host.
Routers use routing algorithms to determine the most efficient path for packet delivery.

Two important unicast routing algorithms are:

1. Distance Vector Routing Algorithm

2. Path Vector Routing Algorithm

Unicast Routing

Definition

Unicast routing is a routing technique in which data packets are transmitted from a single source to a
single destination. Each router maintains routing information and forwards packets toward the
destination using the best available route.

Distance Vector Routing Algorithm

Introduction

Distance Vector Routing is a dynamic routing algorithm in which each router maintains a routing
table containing:

 Destination network.

 Distance (cost) to the destination.


 Next-hop router.

Routers periodically exchange their routing tables with neighboring routers and update their own
tables based on the received information.

Working

1. Initially, each router knows only its directly connected networks.

2. Routers exchange routing information with neighboring routers.

3. Each router calculates the shortest distance to every destination.

4. Routing tables are updated continuously.

The shortest path is selected using the Bellman-Ford algorithm.

Example

Suppose Router A can reach Router B in 1 hop and Router B can reach Router C in 2 hops.

Then Router A determines:

Distance from A to C = 1 + 2 = 3 hops

Characteristics

 Periodic exchange of routing tables.

 Uses hop count or distance as a metric.

 Suitable for small networks.

 Simple implementation.

Advantages

 Easy to implement.

 Requires less processing power.

 Suitable for smaller networks.

Disadvantages

 Slow convergence.

 Generates more routing traffic.

 Suffers from routing loops.


 Count-to-infinity problem may occur.

Path Vector Routing Algorithm

Introduction

Path Vector Routing is an advanced routing algorithm used mainly between autonomous systems on
the Internet.

Instead of storing only the distance, each router stores the complete path (sequence of autonomous
systems) to reach the destination.

Thus, routing decisions are based on the entire path rather than merely the distance.

Working

1. Routers exchange routing information with neighboring autonomous systems.

2. Each route advertisement contains the complete path to the destination.

3. Routers select the most suitable route.

4. Routing loops are avoided because the complete path is known.

Example

Destination Network

AS1 → AS2 → AS3 → AS4

The router stores the entire sequence of autonomous systems.

Characteristics

 Stores complete path information.

 Used in inter-domain routing.

 Prevents routing loops.

 Highly scalable.

Advantages

 Eliminates routing loops.

 Suitable for large networks.

 Provides policy-based routing.


 Better scalability.

Disadvantages

 More complex.

 Requires larger routing tables.

 Higher memory requirement.

Comparison Between Distance Vector and Path Vector Routing

Distance Vector Routing Path Vector Routing

Uses distance as routing metric Uses complete path information

Exchanges routing tables periodically Exchanges path information

Suitable for small networks Suitable for large networks

Routing loops may occur Routing loops are avoided

Uses Bellman-Ford algorithm Uses path information for route selection

Slow convergence Faster and more stable convergence

Less memory requirement More memory requirement

Example: RIP Example: BGP

Question 4: Explain Routing Protocols RIP and OSPF.


Routing protocols are used by routers to exchange routing information and determine the best path
for packet delivery. Two important routing protocols used within an Autonomous System (AS) are:

1. Routing Information Protocol (RIP)

2. Open Shortest Path First (OSPF)

Both are Interior Gateway Protocols (IGPs), but they differ significantly in their operation and
performance.

Routing Information Protocol (RIP)


Introduction

RIP (Routing Information Protocol) is a distance vector routing protocol that uses hop count as its
routing metric. It is one of the oldest routing protocols and is suitable for small networks.

The maximum hop count allowed in RIP is 15 hops. A network requiring more than 15 hops is
considered unreachable.

Working

1. Each router maintains a routing table.

2. Routers periodically exchange routing information with neighboring routers.

3. The shortest path is selected based on the minimum hop count.

4. Routing tables are updated every 30 seconds.

Characteristics

 Distance vector routing protocol.

 Uses Bellman-Ford algorithm.

 Metric used is hop count.

 Maximum hop count = 15.

 Periodic routing updates.

Advantages

 Simple to configure.

 Easy implementation.

 Requires less processing power.

Disadvantages

 Slow convergence.

 Routing loops may occur.

 Limited to small networks.

 Generates excessive routing traffic.

Open Shortest Path First (OSPF)

Introduction
OSPF (Open Shortest Path First) is a link-state routing protocol designed for large and complex
networks. It determines the shortest path using Dijkstra's Shortest Path Algorithm.

Unlike RIP, OSPF does not use hop count. Instead, it uses cost as the routing metric.

Working

1. Routers exchange information about their neighboring routers.

2. Each router constructs a complete map of the network.

3. Dijkstra's algorithm is used to calculate the shortest path.

4. Routing tables are updated whenever a topology change occurs.

Characteristics

 Link-state routing protocol.

 Uses Dijkstra's algorithm.

 Metric used is cost.

 Fast convergence.

 Supports hierarchical routing.

Advantages

 Fast convergence.

 Suitable for large networks.

 Loop-free routing.

 Efficient use of bandwidth.

 Supports load balancing.

Disadvantages

 More complex to configure.

 Requires higher memory and processing power.

Difference Between RIP and OSPF

RIP OSPF

Distance Vector Protocol Link-State Protocol


Uses Bellman-Ford Algorithm Uses Dijkstra's Algorithm

Metric is Hop Count Metric is Cost

Maximum hop count is 15 No hop count limitation

Slow convergence Fast convergence

Periodic updates every 30 Updates only when topology changes


seconds

Suitable for small networks Suitable for large networks

Simple implementation More complex implementation

More routing traffic Less routing traffic

Less efficient More efficient

Question 5: Explain Border Gateway Protocol Version 4 (BGP4).

Introduction

Border Gateway Protocol Version 4 (BGP4) is an Exterior Gateway Protocol (EGP) used for
exchanging routing information between different Autonomous Systems (AS). It is based on the Path
Vector Routing Algorithm and is widely used for inter-domain routing on the Internet.

BGP4 enables routers belonging to different organizations or Internet Service Providers (ISPs) to
communicate and determine the best route for packet transmission.

Autonomous System (AS)

An Autonomous System (AS) is a collection of networks and routers managed by a single


administrative authority and having a common routing policy.

Examples:

 Airtel Network

 Jio Network

 BSNL Network

Each Autonomous System is identified by a unique Autonomous System Number (ASN).

Working of BGP4

1. BGP routers establish connections with neighboring BGP routers.

2. Routers exchange routing information containing the path to various destinations.


3. Each route advertisement includes the sequence of Autonomous Systems through which the
packet must travel.

4. Routers select the most appropriate path based on routing policies and path information.

5. The routing table is updated accordingly.

Example

Suppose a packet must travel from AS1 to AS4.

AS1 → AS2 → AS3 → AS4

The complete path is stored and advertised by BGP routers.

Since the entire path is known, routing loops are avoided.

Characteristics of BGP4

 Based on Path Vector Routing.

 Used for inter-domain routing.

 Exchanges routing information between autonomous systems.

 Supports policy-based routing.

 Prevents routing loops.

 Highly scalable.

 Supports large Internet networks.

Types of BGP

1. External BGP (eBGP)

eBGP is used for communication between routers belonging to different Autonomous Systems.

Example:

AS1 <------> AS2

2. Internal BGP (iBGP)

iBGP is used for communication between routers within the same Autonomous System.

Example:

Router A <------> Router B

(Same AS)
Advantages of BGP4

 Suitable for very large networks.

 Prevents routing loops.

 Provides policy-based routing.

 Supports scalability.

 Forms the backbone of Internet routing.

Disadvantages of BGP4

 Complex configuration.

 Requires more memory and processing power.

 Convergence is slower compared to OSPF.

 Large routing tables must be maintained.

Question 6: Explain Framing, Error Control and Flow Control in the Data Link
Layer.
The Data Link Layer is the second layer of the OSI model and is responsible for reliable node-to-node
delivery of data. It performs functions such as framing, error control, and flow control to ensure
efficient and error-free communication.

Framing

Introduction

The Network Layer passes a packet to the Data Link Layer. The Data Link Layer divides the stream of
bits into manageable units called frames. This process is known as framing.

Framing helps the receiver identify the beginning and end of each frame.

Types of Framing

1. Character Count Method

In this method, a field in the header specifies the number of characters present in the frame.

Example:

Count = 5

ABCDE
The receiver uses the count field to determine the frame boundary.

Disadvantage: If the count field becomes corrupted, synchronization is lost.

2. Byte Stuffing

Special characters are used to indicate the beginning and end of a frame.

If these characters appear inside the data, an extra escape character is inserted before them.

Thus, ambiguity is avoided.

3. Bit Stuffing

Frames begin and end with a special bit pattern:

01111110

Whenever five consecutive 1s appear in the data, a 0 is inserted automatically.

At the receiver side, the inserted bit is removed.

This method is widely used in protocols such as HDLC.

Error Control

Introduction

During transmission, frames may be corrupted or lost because of noise and interference. Error
control mechanisms are used to detect and recover from such errors.

Methods of Error Control

1. Error Detection

Errors are detected using techniques such as:

 Parity Check

 Checksum

 Cyclic Redundancy Check (CRC)

Among these, CRC is the most widely used technique.

2. Error Correction

Once an error is detected, the receiver may request retransmission of the frame.

Error correction is achieved using:


 Acknowledgments

 Sequence Numbers

 Retransmissions

 ARQ Protocols

Examples:

 Stop-and-Wait ARQ

 Go-Back-N ARQ

 Selective Repeat ARQ

Flow Control

Introduction

Flow control ensures that the sender does not transmit frames faster than the receiver can process
them.

Without flow control, the receiver's buffer may overflow, resulting in frame loss.

Techniques of Flow Control

1. Stop-and-Wait Flow Control

In this method, the sender transmits one frame and waits for its acknowledgment before sending the
next frame.

Thus, only one frame remains outstanding at a time.

2. Sliding Window Flow Control

In this technique, multiple frames can be transmitted before receiving acknowledgments.

The sender maintains a window that specifies how many frames may be sent without waiting.

This method provides better throughput and bandwidth utilization.

Advantages of Framing, Error Control and Flow Control

 Reliable communication.

 Proper identification of frames.

 Prevention of receiver overload.

 Detection and correction of transmission errors.

 Improved channel utilization.


Difference Between Error Control and Flow Control

Error Control Flow Control

Detects and corrects errors Controls transmission rate

Ensures reliable communication Prevents receiver overload

Uses acknowledgments and retransmissions Uses Stop-and-Wait and Sliding Window

Concerned with corrupted frames Concerned with buffer management

Question 7: Explain Medium Access Control Techniques. Discuss Random


Access, Controlled Access and Channelization.
In a shared communication medium, multiple devices attempt to transmit data simultaneously. To
avoid collisions and ensure efficient utilization of the channel, the Data Link Layer provides Medium
Access Control (MAC) techniques.

The three major access methods are:

1. Random Access

2. Controlled Access

3. Channelization

1. Random Access

Introduction

In random access methods, all stations have equal access to the channel. A station transmits data
whenever it has frames to send. If two or more stations transmit simultaneously, collisions may
occur.

(a) ALOHA

ALOHA is the simplest random access protocol. Whenever a station has data to send, it transmits
immediately without checking whether the channel is busy or not.

If a collision occurs, the station waits for a random amount of time before retransmitting.

Types of ALOHA

Pure ALOHA

Frames can be transmitted at any time.

Slotted ALOHA

Time is divided into slots, and transmission is allowed only at the beginning of a slot.
Advantages

 Simple implementation.

 Suitable for low traffic networks.

Disadvantages

 High collision probability.

 Low efficiency.

(b) CSMA (Carrier Sense Multiple Access)

In CSMA, a station first listens to the channel before transmitting.

 If the channel is idle, transmission begins.

 If the channel is busy, the station waits.

Thus, collisions are reduced compared to ALOHA.

(c) CSMA/CD (Collision Detection)

CSMA/CD is used in traditional Ethernet networks.

Working

1. Listen to the channel.

2. If idle, transmit.

3. If collision occurs, stop transmission immediately.

4. Wait for a random time.

5. Retransmit.

Advantages

 Reduces collision time.

 Efficient channel utilization.

Application

 Standard Ethernet.

(d) CSMA/CA (Collision Avoidance)

CSMA/CA attempts to avoid collisions before they occur.

Working

1. Sense the channel.


2. If free, wait for a specified time.

3. Transmit data.

4. Receiver sends acknowledgment.

Application

 Wireless LANs (Wi-Fi).

2. Controlled Access

Introduction

In controlled access methods, stations obtain permission before transmitting. Therefore, collisions
are avoided.

(a) Reservation

In reservation systems, stations reserve time slots before transmission.

Thus, only stations with reserved slots are allowed to transmit.

Advantage

 Collision-free communication.

(b) Polling

A central controller determines which station can transmit.

Working

1. Controller polls each station sequentially.

2. The station that receives permission transmits data.

3. Other stations wait.

Advantages

 No collisions.

 Orderly communication.

Disadvantage

 Failure of controller affects the system.

(c) Token Passing

A special frame called a token circulates among stations.


Only the station possessing the token is allowed to transmit.

After transmission, the token is passed to the next station.

Advantages

 Collision-free communication.

 Fair access to all stations.

Applications

 Token Ring Networks.

3. Channelization

Introduction

In channelization methods, the available bandwidth is divided among users so that multiple stations
can communicate simultaneously without collisions.

(a) FDMA (Frequency Division Multiple Access)

In FDMA, the available frequency spectrum is divided into several frequency bands, and each user is
assigned a separate band.

Applications

 Radio broadcasting.

 Television transmission.

Advantage

 Simultaneous transmission is possible.

(b) TDMA (Time Division Multiple Access)

In TDMA, all users share the same frequency but are assigned different time slots.

Each station transmits only during its allotted time slot.

Applications

 GSM cellular systems.

Advantage

 Efficient utilization of bandwidth.

(c) CDMA (Code Division Multiple Access)


In CDMA, all users share the same frequency and time simultaneously, but each user is assigned a
unique code.

The receiver uses the corresponding code to recover the desired signal.

Applications

 3G mobile communication systems.

Advantages

 High capacity.

 Better security.

 Resistance to interference.

Question 8: Explain Ethernet Protocols and IEEE Project 802 Standards.


Ethernet is the most widely used Local Area Network (LAN) technology. It specifies the rules and
procedures for communication between devices connected to a network. The standards for Ethernet
are defined by the IEEE Project 802.

IEEE Project 802

Introduction

The IEEE 802 Project is a set of standards developed by the Institute of Electrical and Electronics
Engineers (IEEE) for Local Area Networks (LANs) and Metropolitan Area Networks (MANs).

It mainly specifies the functions of the Physical Layer and Data Link Layer of the OSI model.

Important IEEE 802 Standards

Standard Description

IEEE 802.1 Bridging and Virtual LAN (VLAN)

IEEE 802.2 Logical Link Control (LLC)

IEEE 802.3 Ethernet

IEEE 802.4 Token Bus

IEEE 802.5 Token Ring

IEEE 802.11 Wireless LAN (Wi-Fi)

Among these, IEEE 802.3 defines Ethernet standards.

Standard Ethernet

Introduction
Standard Ethernet is based on the IEEE 802.3 standard and uses the CSMA/CD (Carrier Sense
Multiple Access with Collision Detection) access method.

It supports a data transmission rate of 10 Mbps.

Characteristics

 Data rate = 10 Mbps.

 Uses CSMA/CD.

 Supports bus and star topology.

 Uses coaxial cable or twisted pair cable.

Advantages

 Simple and inexpensive.

 Easy installation.

 Widely used.

Fast Ethernet

Introduction

Fast Ethernet was developed to provide higher speed than Standard Ethernet.

It supports a transmission speed of 100 Mbps, which is ten times faster than Standard Ethernet.

Characteristics

 Data rate = 100 Mbps.

 Based on IEEE 802.3u.

 Uses twisted pair or optical fiber.

 Backward compatible with Standard Ethernet.

Advantages

 Higher speed.

 Better performance.

 Suitable for multimedia applications.


Gigabit Ethernet

Introduction

Gigabit Ethernet was introduced to meet the increasing demand for bandwidth.

It provides a transmission speed of 1 Gbps (1000 Mbps).

Characteristics

 Data rate = 1 Gbps.

 Based on IEEE 802.3z.

 Uses optical fiber and twisted pair cables.

 Supports full-duplex communication.

Advantages

 High throughput.

 Suitable for high-speed networks.

 Improved network performance.

10 Gigabit Ethernet

Introduction

10 Gigabit Ethernet provides a transmission speed of 10 Gbps and is mainly used in backbone
networks and data centers.

Characteristics

 Data rate = 10 Gbps.

 Based on IEEE 802.3ae.

 Uses optical fiber.

 Supports full-duplex communication only.

Advantages

 Very high speed.

 Suitable for enterprise and backbone networks.

 High bandwidth availability.


Virtual LAN (VLAN)

Introduction

A Virtual LAN (VLAN) is a logical grouping of devices within a network, regardless of their physical
location.

It allows devices belonging to different physical LAN segments to communicate as if they are part of
the same network.

Working

Using switches, devices are divided into separate logical groups called VLANs. Communication
between devices belonging to the same VLAN is possible directly, while communication between
different VLANs requires routing.

Advantages

 Improved security.

 Reduced broadcast traffic.

 Better network management.

 Increased flexibility.

Applications

 Corporate networks.

 Educational institutions.

 Large enterprise environments.

Question 1: Explain Network Management and Discuss its Functional Areas.


As computer networks become larger and more complex, it becomes necessary to monitor, control,
and maintain network resources efficiently. This process is known as Network Management.

Network management ensures that the network operates efficiently, faults are detected quickly,
performance is maintained, and security is provided.

Introduction

Network Management is the process of monitoring, configuring, controlling, and maintaining


network devices and services to ensure reliable and efficient operation of the network.
It involves managing routers, switches, servers, links, and other network resources.

Need for Network Management

Network management is necessary because:

 Modern networks are large and complex.

 Failures must be detected and corrected quickly.

 Performance should be maintained.

 Security must be ensured.

 Resource utilization must be monitored.

Functional Areas of Network Management

The ISO has defined five major functional areas of network management, commonly known as the
FCAPS model.

They are:

1. Configuration Management

2. Fault Management

3. Performance Management

4. Security Management

5. Accounting Management

1. Configuration Management

Introduction

Configuration Management deals with the installation, setup, and maintenance of network devices
and software.

It ensures that network components are properly configured and updated.

Functions

 Installing hardware and software.

 Configuring routers and switches.

 Maintaining configuration files.

 Managing network changes.

 Updating network devices.


Example

Assigning IP addresses and configuring routing tables in routers.

2. Fault Management

Introduction

Fault Management is responsible for detecting, isolating, and correcting network failures.

Its purpose is to minimize downtime and maintain uninterrupted communication.

Functions

 Detecting faults.

 Locating faulty devices.

 Isolating problems.

 Correcting errors.

 Generating alarm messages.

Example

Detecting a failed router and replacing or repairing it.

3. Performance Management

Introduction

Performance Management monitors and evaluates the efficiency of the network.

It ensures that the network operates with acceptable speed and reliability.

Functions

 Measuring throughput.

 Monitoring delay.

 Analyzing traffic.

 Identifying bottlenecks.

 Improving network efficiency.


Parameters Monitored

 Bandwidth

 Throughput

 Response time

 Packet loss

 Utilization

Example

Monitoring traffic load on a server to prevent congestion.

4. Security Management

Introduction

Security Management protects the network and its resources from unauthorized access and attacks.

It ensures confidentiality, integrity, and availability of information.

Functions

 User authentication.

 Access control.

 Encryption.

 Monitoring security threats.

 Maintaining security policies.

Example

Using passwords and firewalls to prevent unauthorized access.

5. Accounting Management

Introduction

Accounting Management keeps track of network resource usage and allocates costs to users or
departments.

It helps in efficient utilization of network resources.


Functions

 Recording resource usage.

 Monitoring bandwidth consumption.

 Generating usage reports.

 Billing users.

 Allocating costs.

Example

Internet Service Providers maintaining records of customer data usage.

FCAPS Model

F → Fault Management

C → Configuration Management

A → Accounting Management

P → Performance Management

S → Security Management

Advantages of Network Management

 Improves network reliability.

 Minimizes downtime.

 Enhances security.

 Optimizes network performance.

 Facilitates efficient resource utilization.

 Simplifies administration and maintenance.

Question 2: Explain SNMP (Simple Network Management Protocol).


Modern networks contain a large number of devices such as routers, switches, servers, and printers.
To monitor and manage these devices efficiently, a standard protocol called SNMP (Simple Network
Management Protocol) is used.

SNMP is an Application Layer protocol used for managing and monitoring network devices in TCP/IP
networks.
Introduction

SNMP (Simple Network Management Protocol) is an Application Layer protocol that enables
network administrators to monitor, configure, and control network devices from a central location.

It is widely used for managing:

 Routers

 Switches

 Servers

 Printers

 Hubs

 Firewalls

SNMP Architecture

The SNMP architecture consists of four major components:

1. Managed Devices

2. Agent

3. Network Management Station (NMS)

4. Management Information Base (MIB)

Network Management Station

(NMS)

SNMP Messages

------------------------------------------

| | |

Agent Agent Agent

| | |

Router Switch Server

(Managed Device)(Managed Device)(Managed Device)


1. Managed Devices

Managed devices are the network devices whose information is monitored and controlled using
SNMP.

Examples include:

 Routers

 Switches

 Servers

 Printers

These devices contain management information about their operation and performance.

2. Agent

An agent is a software module installed on a managed device.

It performs the following functions:

 Collects information about the device.

 Stores management information.

 Communicates with the Network Management Station.

 Responds to SNMP requests.

Thus, the agent acts as an interface between the managed device and the manager.

3. Network Management Station (NMS)

The Network Management Station is a central management system that monitors and controls
network devices.

Functions

 Sends requests to agents.

 Receives responses.

 Displays network status.

 Detects faults.

 Maintains performance statistics.

Examples:

 SolarWinds

 Cisco Prime

 HP OpenView
4. Management Information Base (MIB)

MIB is a database that stores information about managed devices.

It contains variables describing:

 Device status

 Traffic statistics

 Memory usage

 Interface information

 Error counts

Agents access the MIB to provide information requested by the manager.

Working of SNMP

1. The Network Management Station sends a request to the agent.

2. The agent accesses the MIB and retrieves the required information.

3. The agent sends a response back to the NMS.

4. If an abnormal event occurs, the agent automatically informs the manager.

Thus, SNMP enables centralized network monitoring and management.

SNMP Operations

SNMP supports four important operations.

1. GET

The GET operation is used by the Network Management Station to retrieve information from a
managed device.

Example:

Obtaining CPU utilization of a router.

2. SET

The SET operation is used to modify or configure a parameter in a managed device.

Example:

Changing the IP address of a router.


3. RESPONSE

The RESPONSE operation is sent by the agent to provide the requested information to the manager.

It is generated as a reply to GET or SET requests.

4. TRAP

TRAP messages are generated automatically by agents when important events occur.

Examples:

 Device failure.

 Link failure.

 High traffic congestion.

Thus, TRAP messages provide immediate notification of network problems.

Advantages of SNMP

 Centralized network management.

 Easy monitoring of devices.

 Fault detection and diagnosis.

 Performance monitoring.

 Reduced maintenance cost.

 Supports heterogeneous networks.

Question 3: Explain Network Security Goals, Security Attacks, Security


Services, and Security Techniques.
With the increasing use of computer networks and the Internet, protecting information from
unauthorized access, modification, and destruction has become essential. Network Security aims to
provide secure communication and safeguard network resources.

Introduction

Network Security refers to the protection of network resources and information against
unauthorized access, misuse, modification, and attacks. It ensures that data is transmitted securely
and reaches the intended destination without alteration.

Security Goals
The primary objectives of network security are:

1. Confidentiality

Confidentiality ensures that information is accessible only to authorized users.

It prevents unauthorized disclosure of data.

Example

Encryption of passwords and confidential documents.

2. Integrity

Integrity ensures that data is not modified or altered during transmission.

Any unauthorized modification can be detected.

Example

Using hash functions and checksums.

3. Availability

Availability ensures that network resources and services remain accessible to authorized users
whenever required.

Example

Web servers should remain available even during heavy traffic.

4. Authentication

Authentication verifies the identity of communicating users or systems.

Example

Login using username and password.

5. Non-Repudiation

Non-repudiation prevents a sender from denying that a message was sent.

Example

Digital signatures provide non-repudiation.

Security Attacks

A security attack is any attempt to compromise the confidentiality, integrity, or availability of


information.
Security attacks are classified into two categories:

1. Passive Attacks

2. Active Attacks

1. Passive Attacks

In passive attacks, the attacker monitors or observes communication without modifying the data.

The objective is to obtain information secretly.

Types of Passive Attacks

(a) Release of Message Contents

The attacker reads confidential information.

(b) Traffic Analysis

The attacker studies communication patterns to gather useful information.

Characteristics

 Difficult to detect.

 Does not alter data.

 Affects confidentiality.

2. Active Attacks

In active attacks, the attacker modifies, interrupts, or destroys data.

These attacks affect the integrity and availability of information.

Types of Active Attacks

(a) Masquerade Attack

An attacker pretends to be an authorized user.

(b) Replay Attack

Previously transmitted messages are captured and retransmitted.

(c) Modification of Messages

The attacker alters the contents of messages.


(d) Denial of Service (DoS)

The attacker prevents legitimate users from accessing network resources.

Characteristics

 Easier to detect.

 Alters system resources.

 Affects integrity and availability.

Security Services

Security services are mechanisms designed to provide protection against security attacks.

Important security services are:

1. Authentication Service

Verifies the identity of users and systems.

2. Access Control Service

Restricts access to authorized users only.

3. Data Confidentiality Service

Protects information from unauthorized disclosure.

4. Data Integrity Service

Ensures that data remains unchanged during transmission.

5. Non-Repudiation Service

Prevents denial of message transmission.

6. Availability Service

Ensures uninterrupted access to network resources.

Security Techniques
Security techniques are methods used to implement security services and protect information.

1. Encryption

Transforms plaintext into ciphertext to prevent unauthorized access.

2. Digital Signatures

Provide authentication, integrity, and non-repudiation.

3. Access Control Mechanisms

Restrict unauthorized access to resources.

4. Authentication Techniques

Verify the identity of users.

Examples:

 Passwords

 Biometrics

5. Firewalls

Protect networks by filtering incoming and outgoing traffic.

6. Cryptographic Techniques

Use symmetric and asymmetric key algorithms to secure communication.

Relationship Among Goals, Attacks, Services and Techniques

Security Goals

Security Services

Security Techniques

Protection Against
Security Attacks

Advantages of Network Security

 Protects confidential information.

 Prevents unauthorized access.

 Ensures integrity of data.

 Provides secure communication.

 Increases reliability and trustworthiness.

Question 4: Explain Symmetric Key Ciphers and Asymmetric Key Ciphers.


Compare them.
Cryptography is an important technique used in network security to protect information from
unauthorized access. It converts readable information into an unreadable form and allows only
authorized users to recover the original data.

Cryptographic systems are broadly classified into:

1. Symmetric Key Ciphers

2. Asymmetric Key Ciphers

Symmetric Key Cipher

Introduction

A Symmetric Key Cipher is a cryptographic technique in which the same key is used for both
encryption and decryption.

The sender and receiver must share a common secret key before communication begins.

Working

1. The sender encrypts the plaintext using a secret key.

2. The encrypted message (ciphertext) is transmitted.

3. The receiver uses the same secret key to decrypt the ciphertext and recover the original
message.

Operation

Plaintext


Encryption

(Secret Key)

Ciphertext

Transmission

Decryption

(Same Secret Key)

Plaintext

Characteristics

 Uses a single key.

 Faster encryption and decryption.

 Suitable for large amounts of data.

 Requires secure key distribution.

Advantages

 High speed.

 Simple implementation.

 Less computational overhead.

 Efficient for bulk data transmission.

Disadvantages

 Key distribution is difficult.

 Security depends on keeping the key secret.

 Large number of keys required in large networks.

Examples

 DES (Data Encryption Standard)


 AES (Advanced Encryption Standard)

 Triple DES

Asymmetric Key Cipher

Introduction

An Asymmetric Key Cipher is a cryptographic technique that uses two different keys:

 Public Key

 Private Key

The public key is known to everyone, while the private key is kept secret by the owner.

Working

1. The sender encrypts the message using the receiver's public key.

2. The ciphertext is transmitted.

3. The receiver decrypts the message using the corresponding private key.

Operation

Plaintext

Encryption

(Public Key)

Ciphertext

Transmission

Decryption

(Private Key)

Plaintext

Characteristics

 Uses two keys.


 More secure.

 Simplifies key distribution.

 Computationally intensive.

Advantages

 Better security.

 Easy key management.

 Supports digital signatures.

 Provides authentication and non-repudiation.

Disadvantages

 Slower than symmetric encryption.

 Requires more processing power.

 More complex implementation.

Examples

 RSA

 Diffie-Hellman

 ElGamal

Difference Between Symmetric and Asymmetric Key Ciphers

Symmetric Key Cipher Asymmetric Key Cipher

Uses one key Uses two keys

Same key for encryption and Different keys for encryption and decryption
decryption

Faster operation Slower operation

Less computational complexity More computational complexity

Difficult key distribution Easier key distribution

Suitable for bulk data encryption Suitable for secure communication and authentication

Provides confidentiality Provides confidentiality, authentication and non-


repudiation
Examples: AES, DES Examples: RSA, Diffie-Hellman

Question 5: Explain Digital Signatures and Firewalls.

Digital Signature

Introduction

A Digital Signature is an electronic equivalent of a handwritten signature that is used to verify the
authenticity and integrity of a message. It provides authentication and prevents the sender from
denying the transmission of a message.

Digital signatures are based on asymmetric key cryptography.

Working of Digital Signature

1. The sender generates a hash value (message digest) from the original message.

2. The hash value is encrypted using the sender's private key.

3. The encrypted hash forms the digital signature.

4. The message and digital signature are sent to the receiver.

5. The receiver decrypts the signature using the sender's public key.

6. The receiver also computes the hash of the received message.

7. If both hash values match, the message is authentic and unaltered.

Operation

Sender

Message

Hash Function

Message Digest

Encrypt with Private Key


Digital Signature

Message + Signature

-------------------------->

Receiver

Digital Signature

Decrypt with Public Key

Message Digest

Compute Hash of Received Message

Compare Hash Values

Match → Message Authentic

Services Provided by Digital Signature

 Authentication

 Data Integrity

 Non-repudiation

Advantages

 Ensures message authenticity.

 Detects modification of data.

 Prevents denial of transmission.

 Provides secure communication.

Firewall
Introduction

A Firewall is a hardware device, software program, or combination of both that protects a network
from unauthorized access. It acts as a barrier between a trusted internal network and an untrusted
external network such as the Internet.

It monitors incoming and outgoing traffic and permits or blocks communication based on predefined
security rules.

Working of Firewall

When data packets enter or leave a network, the firewall examines them and decides whether to
allow or block them according to the security policy.

Internet

Firewall

Internal Network

Thus, firewalls protect the network from malicious users and attacks.

Types of Firewalls

1. Packet Filtering Firewall

This firewall examines packet headers and filters packets based on:

 Source address

 Destination address

 Port number

 Protocol type

2. Stateful Inspection Firewall

It monitors active connections and keeps track of the state of communication.

It provides better security than packet filtering firewalls.

3. Application-Level Gateway Firewall


Also called a Proxy Firewall, it examines application-level data and provides high security.

4. Circuit-Level Gateway Firewall

It monitors TCP connections and verifies session establishment.

Advantages of Firewalls

 Prevent unauthorized access.

 Protect against network attacks.

 Monitor network traffic.

 Enforce security policies.

 Improve network security.

Applications of Firewalls

 Corporate networks.

 Banking systems.

 Educational institutions.

 Data centers.

 Internet-connected organizations.

You might also like