[go: up one dir, main page]

0% found this document useful (0 votes)
29 views49 pages

Module - 1 Notes

It's very good to refer for sem exam

Uploaded by

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

Module - 1 Notes

It's very good to refer for sem exam

Uploaded by

prajwalrahul4
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 49

Computer Networks BCS502

EPCET | CSE (AI & ML) 2025-2026

An Autonomous Institution Affiliated to Visvesvaraya Technological University (VTU) Belagavi


Approved by All India Council for Technical Education (AICTE), New Delhi.
Recognized by Govt. of Karnataka
Accredited by NAAC with A Grade
UG programs Accredited by National Board of Accreditation (NBA): CSE, ECE & ISE

DEPARTMENT OF CSE (ARTIFICIAL INTELLIGENCE AND MACHINE LEARNING)

V SEMESTER

BCS502 - Computer Networks

2022 Scheme

MODULE – 1: INTRODUCTION

Course Instructor:
Prof. Vetrikani R
Assistant Professor,
Department of CSE (AI & ML)
EPCET
1
Department of CSE (AI & ML)
Computer Networks BCS502

MODULE – 1: INTRODUCTION
Introduction: Data Communications, Networks, Network Types, Networks Models: Protocol Layering, TCP/IP
Protocol suite, The OSI model, Introduction to Physical Layer: Transmission media, Guided Media, Unguided
Media: Wireless. Switching: Packet Switching and its types.

Brief:
The module 1 offers a comprehensive overview of data communications and networks, beginning with
fundamental concepts such as the components of a communication system (message, sender, receiver,
transmission medium, protocol) and characteristics of data transfer (delivery, accuracy, timeliness, jitter). It
explores various data representations and data flow modes (simplex, half-duplex, full-duplex). The document
then transitions to network structures, outlining network criteria (performance, reliability, security), physical
connection types (point-to-point, multipoint), and topologies (mesh, star, bus, ring). Further sections
differentiate between Local Area Networks (LANs) and Wide Area Networks (WANs), detailing modern
switch-based LANs and various WAN types, including the concept of an internetwork. A significant portion
explains protocol layering, using the TCP/IP protocol suite as a primary example, describing each layer's
function (physical, data-link, network, transport, application) and crucial processes like encapsulation,
decapsulation, addressing, multiplexing, and demultiplexing. Finally, the text examines transmission media,
categorizing them as guided (twisted-pair, coaxial, fiber-optic cables) and unguided (radio waves, microwaves,
infrared), discussing their properties, applications, and the electromagnetic spectrum. The document concludes
by detailing packet switching, contrasting datagram networks and virtual-circuit networks, and explaining their
operational principles, including routing tables, delays, and connection phases.

1. Data Communications: Fundamentals and Characteristics

Data communication is defined as "the process of transferring data from one point to another using a
communication system." Effective data communication relies on a specific set of components and adherence
to key performance characteristics.

1.1. Components of a Data Communication System

A data communication system consists of five essential components:

• Message: The data or information being communicated (e.g., text, images, audio). This is the data or
information being communicated, which can include various forms such as text, images, or audio.

• Sender: The device that sends the message, such as a computer or smartphone. In the context of the
TCP/IP protocol suite, the source host (sender) is involved in all five layers, creating a message at the
application layer and sending it down through the stack for transmission.
2
Department of CSE (AI & ML)
Computer Networks BCS502

• Receiver: The device that receives the message, like another computer or a printer. At the destination
(receiver), the message is received at the physical layer and passed up through the layers until it reaches
the application layer for processing.

• Transmission Medium: The physical path through which the data is transmitted, like cables or radio
waves. Transmission media can be wired (like cables) or wireless (like air). They operate at a
fundamental level, often considered "layer zero" below the physical layer of the OSI model, directly
interfacing with the physical layer.

Guided Media provide a specific path for signals to travel and include:
▪ Twisted-Pair Cables: Consist of insulated copper wires twisted together, which helps reduce
electromagnetic interference and maintain signal quality. They are widely used in telephone lines, DSL,
and LANs.
▪ Coaxial Cables: Feature a central conductor, an insulating layer, and a metallic shield, which helps
protect the signal from interference and allows for high-speed data transmission.
▪ Fiber-Optic Cables: Use light signals transmitted through thin strands of glass or plastic, offering
extremely high-speed data transmission over long distances with minimal signal loss.
Unguided Media use wireless signals that travel through the air, including:
▪ Radio Waves: Characterized by omnidirectional propagation, allowing signals to spread in all
directions, making them suitable for multicasting applications like AM/FM radio and television
broadcasting.
▪ Microwaves: Require line-of-sight transmission and are used in applications like satellite
communications and cellular networks.
▪ Infrared: Used for short-range, highly directional communication and do not penetrate walls, making
them suitable for indoor uses like remote controls.

• Protocol: A set of rules that governs the communication between devices to ensure proper data
exchange. Protocol layering is a design principle where communication tasks are broken down into
multiple layers, each performing a specific function. This approach offers advantages such as
modularity (changes in one layer don't affect others) and service separation. The TCP/IP protocol suite,
for example, is a collection of protocols organized into different layers, ensuring efficient and organized
communication across networks. Each layer (Application, Transport, Network, Data Link, Physical)

3
Department of CSE (AI & ML)
Computer Networks BCS502

handles specific tasks, enabling logical connections between peer layers on different devices. Protocols
also define addressing schemes (e.g., domain names at the application layer, port numbers at the
transport layer, IP addresses at the network layer, and MAC addresses at the link layer) and enable
processes like multiplexing and demultiplexing to ensure data is correctly sent and received by the
right applications.

1.2. Key Performance Characteristics

The performance of a data communication system is evaluated based on four characteristics:

• Delivery: Data must reach the correct destination. Only the intended recipient—whether a device or a
user—should receive the data.

• Accuracy: Data must be transmitted without errors. If data is altered during transmission and not
corrected, it becomes unusable.

• Timeliness: Data must be delivered promptly. Delayed data, especially in applications like video and
audio, lose their value. For real-time applications, data must be delivered in the same sequence and
without significant delays.

• Jitter: This refers to the inconsistency in packet arrival times. Inconsistent delays... can degrade the
quality of the audio or video.

Performance as a Network Criterion


• Interconnections of devices capable of communication and form the backbone of data communications,
performance is a crucial evaluation criterion. Network performance is assessed by several factors and
metrics:
Evaluation Factors:
◦ Transit time: This is the time it takes for a message to travel from one device to another.
◦ Response time: This measures the time elapsed between sending a request and receiving a response.
Influencing Factors:
The performance of a network can be influenced by the number of users on the network, the type of
transmission medium being used, the hardware capabilities of the devices, and the efficiency of the
software.
Key Metrics:
◦ Throughput: This refers to the amount of data transmitted successfully over a period.
◦ Delay: This is the time taken for data to reach its destination.
◦ The sources note that optimizing both throughput and delay often involves trade-offs.

4
Department of CSE (AI & ML)
Computer Networks BCS502

These characteristics and criteria collectively ensure that data communications systems and networks are
effective, reliable, and capable of supporting various applications efficiently.

1.3. Data Representation

Data representation refers to the various forms in which data can be structured and encoded to suit different
types of communication. This is a crucial aspect of data communications, as it ensures that the message, one
of the five key components of a data communication system1, can be properly prepared, transmitted, and
understood by the sender and receiver.

Data can be represented in various forms for communication:

• Text: Represented as a sequence of bits using encoding systems like ASCII or Unicode.

• Numbers: Represented directly in binary form, which allows for efficient computation and
transmission.

• Images: Represented as a matrix of pixels, where each pixel is assigned a bit pattern. Color images
often use RGB (Red, Green, Blue) or YCM (Yellow, Cyan, Magenta) encoding.

• Audio: Captured as a continuous signal, which can be sampled and digitized for transmission.

• Video: A sequence of images or frames... with each frame represented as individual bit patterns.

1.4. Data Flow Modes

Data flow refers to the direction of transmission between devices. This concept is fundamental to Data
Communications, which is the process of transferring data from one point to another using a communication
system, ensuring accurate and timely delivery. Understanding data flow is crucial for comprehending how data
moves across these systems.

The sources identify three distinct modes of data flow:

• Simplex: Data flows in one direction only, like a keyboard sending data to a computer (one-way
communication).

• Half-Duplex: Both devices can send and receive data, but not at the same time. An example is a walkie-
talkie.

• Full-Duplex: Both devices can transmit and receive data simultaneously, like in a phone conversation.

5
Department of CSE (AI & ML)
Computer Networks BCS502

These modes of data flow are integral to the larger context of Data Communications because they determine
the efficiency and interactivity of the communication system. The choice of data flow mode impacts system
design, protocol selection, and ultimately, the user experience, particularly for applications requiring real-time
interaction, as highlighted by the importance of characteristics like timeliness and jitter in data communication
performance.

6
Department of CSE (AI & ML)
Computer Networks BCS502

2. Networks: Criteria and Physical Structures

A network is defined as the interconnection of a set of devices capable of communication. These devices
include hosts such as computers, smartphones, and security systems, and connecting devices like routers,
switches, and modems.

2.1. Network Criteria

Effective networks meet specific criteria:

• Performance: Evaluated by transit time (time for a message to travel) and response time (time between
request and response). Factors include number of users, the transmission medium, hardware
capabilities, and software efficiency. Key metrics are Throughput (amount of data transmitted) and
Delay (time taken).

• Reliability: Encompasses Accuracy in data delivery, Frequency and recovery time from network
failures, and the ability to function during a catastrophe.

• Security: Involves protecting data from unauthorized access, damage, or corruption and establishing
recovery procedures for security breaches.

2.2. Physical Structures

Networks can be categorized by connection type and physical arrangement:

2.2.1. Type of Connection

• Point-to-Point: A direct link between two devices, providing the full capacity of the link for
communication (e.g., remote control to TV).

• Multipoint (Multidrop): Multiple devices share a single link, either spatially (simultaneous use) or
temporally (taking turns).

7
Department of CSE (AI & ML)
Computer Networks BCS502

2.2.2. Physical Topology

Topologies describe how devices are physically arranged:

• Mesh Topology: Every device is connected to every other device. Advantages include Dedicated links,
fault isolation, robust, secure. Disadvantages include being Expensive, complex installation, excessive
cabling. Example: Telephone networks between regional offices.

8
Department of CSE (AI & ML)
Computer Networks BCS502

• Star Topology: Each device is connected to a central hub. Advantages: Easy installation and fault
isolation. Disadvantage: Entire system fails if the hub goes down. Common in local area networks
(LANs).

• Bus Topology: All devices are connected to a single backbone cable. Advantages: Easy installation,
less cabling. Disadvantages: Difficult to add devices, faults in the backbone disrupt the entire network.
Example: Early Ethernet LANs.

• Ring Topology: Devices are connected in a loop, with signals traveling in one direction. Advantages:
Easy to install, simple fault detection. Disadvantage: A break in the ring can disable the entire network.
Example: IBM’s Token Ring LANs.

9
Department of CSE (AI & ML)
Computer Networks BCS502

3. Network Types and Switching

Networks can be categorized by their geographical scope and connection mechanisms. When networks
connect, they form an internetwork, or internet.

3.1. Local Area Network (LAN)

A LAN connects devices within a small geographical area, such as a home, office, or campus.

• Characteristics: Covers a limited area, High data transfer rates (up to 10 Gbps), and Typically owned
and managed by a single organization.

• Examples: Common examples of LANs include Ethernet networks and Wi-Fi networks in homes and
small offices.

• Modern LAN Setup: Today, most LANs use smart switches to handle packet delivery. Switches
recognize the destination address of each packet and send the packet directly to the destination host,
reducing traffic and allowing simultaneous communication.

3.2. Wide Area Network (WAN)

A WAN covers a large geographical area, such as a city, country, or even globally. It connects multiple LANs.

10
Department of CSE (AI & ML)
Computer Networks BCS502

• Characteristics: Slower data transfer rates than LANs, Often managed by multiple entities, and
Utilizes routers and public or private communication links.
• Examples:
◦ The Internet itself is a prime example of a WAN.
◦ Private networks connecting different company branches also serve as WANs

• Point-to-Point WAN: Connects two communication devices directly via transmission media. Provides
a Dedicated Line with minimal congestion and Security due to limited exposure. Applications:
Businesses commonly use point-to-point WANs to link branch offices or remote locations.
Advantages: They offer a dedicated line, resulting in minimal congestion and consistent bandwidth,
and provide enhanced security due to limited exposure to external devices

• Switched WAN: An infrastructure with multiple endpoints that are interconnected. Allows dynamic
routing between several nodes through switches and is scalable. Switched WANs are fundamental in
the backbone of modern global communication systems. Common Use: They are commonly used in
large-scale, high-traffic networks like the internet

3.3. Internetwork

An Internetwork (often simply called an internet) is formed when two or more individual networks connect.
This concept highlights a crucial evolution in modern networking, where it's uncommon for Local Area
Networks (LANs) or Wide Area Networks (WANs) to operate independently.

11
Department of CSE (AI & ML)
Computer Networks BCS502

• Definition and Purpose: An internetwork is essentially a network of networks. Its primary purpose is to
enable communication between devices located on different, interconnected networks.

• Formation via LANs and WANs: Internetworks are typically formed by connecting multiple LANs, often
through WANs. For example, a company with offices in different geographical locations might have a LAN
at each office. To allow employees in these distant offices to communicate, a dedicated WAN connection is
leased from a service provider to link these LANs, thereby creating an internetwork, or a private internet. This
connection can be a point-to-point WAN.

• Characteristics: Decentralized, Based on TCP/IP, and Enables various services such as web browsing,
email, file sharing, etc.

• Components: Clients, Servers, Routers and switches, and ISPs (Internet Service Providers).

3.4. Heterogeneous Network

A heterogeneous network is fundamentally a system that connects various types of devices and network
architectures. The term heterogeneous directly implies diversity in its composition, which can include different
hardware, operating systems, and communication protocols. This means it's a network that isn't limited to a
single type of technology or configuration but rather integrates multiple distinct elements.

• Role of LANs and WANs within a Heterogeneous Network: In such a setup, the WANs provide the
backbone for long-distance communication, while the LANs allow for local connectivity. This emphasizes
how different network types, previously discussed as distinct categories (LANs for small geographical areas
and high speeds; WANs for large geographical areas, connecting multiple LANs, and potentially slower
speeds), come together to form a comprehensive system.

12
Department of CSE (AI & ML)
Computer Networks BCS502

3.5 Switching

Switching is the process of forwarding data packets in a network from a source to a destination through
intermediate devices called switches.

• Circuit Switching: Establishes a fixed connection (circuit) between two devices. The network is only
efficient when operating at full capacity. If fewer devices are active, the unused capacity leads to
inefficiency. Example: When a phone call is made, a switch connects one phone to another, and a thick
line between switches has enough capacity to support simultaneous voice calls, which is shared by all
pairs. Disadvantages: Circuit-switched networks are only efficient when operating at full capacity. If
fewer devices are active, the unused capacity leads to inefficiency. The main connection requires
significant capacity to prevent call failures during peak usage.

13
Department of CSE (AI & ML)
Computer Networks BCS502

• Packet Switching: Communication between devices is carried out in blocks of data called packets,
rather than as continuous streams. Packets are independent units, which makes it possible for network
switches to store and forward them later if needed. Can introduce delays when network traffic is heavy.

• Message Switching: Entire messages are stored and forwarded from one switch to another (obsolete
in modern networks).

3.6. The Internet

The Internet is defined as a global system of interconnected computer networks that use the TCP/IP protocol
to link billions of devices worldwide. This directly aligns with the concept of an Internetwork, which is formed
When two or more networks connect. The Internet itself is a WAN and the ultimate example of an internetwork.
This signifies that the Internet is not a single, monolithic network but rather a vast network of networks.

• Characteristics:

◦ Decentralized: There is no central controlling entity for the Internet. This highlights its distributed nature.

◦ Protocol Basis: It is Based on TCP/IP for communication. The TCP/IP protocol suite is crucial, with its
layered architecture ensuring smooth data transmission.

◦ Services Enabled: The Internet Enables various services such as web browsing, email, file sharing, etc..

14
Department of CSE (AI & ML)
Computer Networks BCS502

• Components: The Internet, as a vast network, relies on several key components:

◦ Clients: These are the devices that request services from servers.

◦ Servers: These systems provide resources and services to clients.

◦ Routers and Switches: These are the essential Devices that direct data traffic across the network. As
discussed previously, routers primarily operate at the network layer to forward packets across different
networks, while link-layer switches manage data frames within the same LAN. In an internetwork scenario,
routers are crucial devices that interconnect LANs.

◦ ISPs (Internet Service Providers): These are Organizations that provide access to the Internet

3.7 Accessing the Internet

Common methods include:

• Dial-up: Low-speed, outdated method (up to 56 kbps).

• DSL (Digital Subscriber Line): Uses telephone lines but allows simultaneous voice and data
transmission. Faster than dial-up (up to 100 Mbps).

• Cable: Uses cable television lines to provide high-speed Internet (up to 1 Gbps).

15
Department of CSE (AI & ML)
Computer Networks BCS502

• Fiber Optic: Uses light to transmit data through optical fibers. Extremely high-speed (up to 10 Gbps
and beyond).

• Satellite: Provides Internet access via satellite communication, useful in remote areas. Slower than
fiber or cable but offers wide coverage.

• Mobile Broadband: Wireless Internet access through cellular networks (3G, 4G, 5G).

• Wi-Fi Access: Wireless local area networking technology that allows devices to access the Internet
within the range of a wireless router.

16
Department of CSE (AI & ML)
Computer Networks BCS502

4. Protocol Layering

Protocol layering is a design principle in computer networks where communication tasks are broken down
into multiple layers. Each layer performs a specific function and works together.

4.1. Design Principle

Involves breaking down complex communication tasks into multiple, distinct layers, each performing a
specific function. The layers then work together to enable communication between devices over a network.

First Principle: Bidirectional Communication

To achieve communication in both directions (bidirectional), each layer must be designed to handle two
complementary tasks. This means that for every function performed in one direction (e.g., sending), there must
be a corresponding function for the opposite direction (e.g., receiving) within the same layer. Examples given
illustrate this:

▪ The Third Layer is Responsible for listening in one direction and transmitting in the other.

▪ The Second Layer Handles encryption in one direction and decryption in the other.

▪ The First Layer Manages sending and receiving mail.

◦ This ensures that Each layer must be capable of performing its specific function for both incoming and
outgoing data.

• Second Principle: Identical Objects

This principle dictates that the objects processed by each layer at both communicating sites must be identical.

◦ This consistency across communicating devices at the same layer is crucial for proper communication and
processing. Examples provided include:

▪ At Layer 3, the object should be a plaintext letter at both sites.

▪ At Layer 2, the object should be a ciphertext letter at both sites.

▪ At Layer 1, the object should be a piece of mail at both sites.

◦ This principle is also visualized in the context of the TCP/IP protocol suite, showing identical objects exist
below each layer for connected devices.

4.2 Scenarios

First Scenario: Simple Communication in One Layer

17
Department of CSE (AI & ML)
Computer Networks BCS502

◦ Description: This scenario depicts Maria and Ann, who are neighbours and share many common interests,
communicating face-to-face, in the same language. Their interaction occurs in a single layer.

◦ Purpose: This simple scenario serves as a baseline, showing direct communication where certain rules
govern their communication even in a straightforward setup. It implicitly contrasts with more complex
communication needs that necessitate layering.

Second Scenario: A Three-Layer Protocol

◦ Description: This scenario introduces complexity as Ann and Maria relocate far apart but wish to continue
collaborating on a project with confidentiality. To achieve this, they employ a secure encryption/decryption
technique.

◦ Layer Breakdown: Their communication is visualized as taking place in three distinct layers:

1. Third Layer (Plaintext Creation): Maria speaks to a third-layer machine, which listens and generates
the plaintext (the original letter) and passes it to the second-layer machine.
18
Department of CSE (AI & ML)
Computer Networks BCS502

2. Second Layer (Encryption/Decryption): The second-layer machine encrypts the plaintext, creating
ciphertext (the encrypted letter), which is then passed to the first-layer machine.

3. First Layer (Mailing): The first-layer machine puts the ciphertext in an envelope, adds the sender's
and receiver's addresses, and mails it.

4.3 Advantages of Protocol Layering

• Modularity: Each layer is independent, allowing for changes in one layer without affecting others.
For example, illustrate this with a scenario where if a secure communication system needs its
encryption technique upgraded, only the second-layer machine (responsible for encryption/decryption)
would need to be replaced, leaving the other layers untouched. This prevents a ripple effect of changes
across the entire system.

• Service Separation: Separates the services from their implementation. This principle offers flexibility,
as it means that as long as a layer provides its required services, the specific method or entity
performing those tasks can be varied.

◦ For instance, in the three-layer scenario, Maria could perform the tasks of the first layer herself if
needed, as long as she provides the required services. This highlights that the functionality is defined,
but the implementation can be adapted without breaking the overall communication structure.

• Intermediate Systems: In more complex networks, intermediate systems only need to handle specific
layers, making the overall system less complex and less expensive. For example, a router primarily
operates at the network, data-link, and physical layers, while a link-layer switch operates only at the
data-link and physical layers, without needing to process transport or application layer information.

4.4 Disadvantage

• Complexity in Layer Integration: While modularity is presented as a significant advantage of


protocol layering, offering flexibility by allowing changes in one layer without affecting others, it also
introduces a potential drawback: increased complexity in integrating these separate layers.

4.5. Principles of Protocol Layering

• Bidirectional Communication: Each layer must be designed to handle two complementary tasks, one
for each direction of communication. For example, if a layer is responsible for encrypting data on the
sending side, it must also be capable of decrypting data on the receiving side. The sources provide
specific examples for a three-layer protocol scenario:

▪ The Third Layer is Responsible for listening in one direction and transmitting in the other.

19
Department of CSE (AI & ML)
Computer Networks BCS502

▪ The Second Layer Handles encryption in one direction and decryption in the other.

▪ The First Layer Manages sending and receiving mail.

◦ This ensures that communication can flow both ways smoothly, with each layer performing its
designated function for both incoming and outgoing data.

• Identical Objects: The objects processed by each layer at both communicating sites must be identical.
This consistency in the type of data unit at a given layer between two communicating devices is crucial
for proper communication and processing across different layers. Using the example of the three-layer
protocol (Maria and Ann):

▪ At Layer 3, the object should be a plaintext letter at both sites. This refers to the original, unencrypted
message Maria generates.

▪ At Layer 2, the object should be a ciphertext letter at both sites. This is the encrypted version of the
letter.

▪ At Layer 1, the object should be a piece of mail at both sites. This represents the physical envelope
containing the ciphertext, ready for mailing.

4.6. Logical Connections

Logical connections are virtual connections established between the same layers in different devices. They
provide the abstraction necessary to hide the complexities of the underlying transmission methods, giving the
appearance that communication occurs at a single layer. The primary benefit of logical connections is to
provide abstraction. This abstraction hides the complexities of the underlying physical transmission methods,
giving the appearance that communication occurs solely at a single, specific layer. For example, the
application layer of two computers can communicate as though directly connected, without needing to
understand the intricacies of how data physically traverses the network. This principle ensures that
communication protocols at each layer, such as TCP at the transport layer or HTTP at the application layer,
can interact correctly without the user or higher-level protocols needing to understand the details of network
transmission.

20
Department of CSE (AI & ML)
Computer Networks BCS502

21
Department of CSE (AI & ML)
Computer Networks BCS502

5. TCP/IP Protocol Suite

The TCP/IP Protocol Suite is the widely used collection of protocols for communication on the Internet today.
It is a hierarchical protocol suite, meaning that higher-level protocols rely on services provided by lower-level
protocols, ensuring efficient and organized communication across networks. This suite is designed to manage
complex communication processes by organizing them into distinct layers, each handling specific tasks. While
historically represented differently, it is now commonly represented as a five-layer model.

5.1. Layered Architecture

The TCP/IP protocol suite operates through a layered architecture, where each layer performs a specific
function and works collaboratively to enable communication. This layered structure ensures smooth data
transmission.

When a source Host A communicates with a destination Host B through an internetwork that includes link-
layer switches and routers, five devices are involved: the source host, link-layer switch in LAN 1, router, link-
layer switch in LAN 2, and the destination host. Each of these devices operates at different layers of the TCP/IP
stack based on its role.

22
Department of CSE (AI & ML)
Computer Networks BCS502

• Hosts (Source and Destination): Both the source (Host A) and destination (Host B) are involved in
all five layers of the TCP/IP model. The source host creates a message at the application layer, which
is then passed down through the transport, network, data-link, and physical layers for transmission.
The destination host receives the message at the physical layer and passes it up through the layers until
it reaches the application layer for processing.

• Router: A router operates at the network, data-link, and physical layers. Its primary function is to route
packets across networks based on their destination IP address. Routers are connected to multiple links,
each potentially using different data-link and physical-layer protocols, and they handle the conversion
between these protocols to forward packets. Importantly, a router does not deal with the transport or
application layers.

• Link-Layer Switch: A link-layer switch operates only at the data-link and physical layers. It processes
data frames and forwards them to the correct device within the same LAN. Unlike routers, link-layer
switches do not need to handle different protocol sets for different links as they operate within a single
LAN.

5.2. Understanding Logical Connections Between Layers

Understanding logical connections enhances comprehension of layering in data communication. In the TCP/IP
model, logical connections are virtual connections established between the same layers in different devices.
This allows layers to communicate as if they are directly connected, providing abstraction that hides the
23
Department of CSE (AI & ML)
Computer Networks BCS502

complexities of underlying physical transmission. For example, the application layers of two computers
communicate as though directly connected, even though physical transmission involves multiple lower layers.
This ensures that communication protocols at each layer, such as TCP or HTTP, interact correctly without
requiring user understanding of network transmission intricacies.

The sources distinguish between two types of logical connection duties:

• End-to-End Communication: The application, transport, and network layers (the top three layers) are
responsible for end-to-end communication, managing data from one end device to the other across the
entire network or internet. Data units (packets) created at these layers are not modified by intermediate
routers or link-layer switches.

• Hop-to-Hop Communication: The data-link and physical layers (the lower two layers) handle
communication on a hop-to-hop basis, where a hop refers to a host or router. These layers manage
communication on individual network segments or links. Packets created at these layers can be
modified by routers but not by link-layer switches.

A key principle related to this is that identical objects exist below each layer for connected devices. For
instance, at the network layer, even if a router fragments packets, the fundamental object at that layer is
preserved across hops.

24
Department of CSE (AI & ML)
Computer Networks BCS502

5.3. Description of Each Layer

Physical Layer:

• Role: Focuses on transmitting bits from the data-link layer as electrical or optical signals over a
physical medium (e.g., cables, wireless channels). It converts bits into signals that can travel through
the medium.

• Transmission Media: The physical connection uses various media like cables (twisted-pair, fiber-
optic) or air (wireless). The medium transmits signals (electrical or optical), not raw bits.

• Logical Communication: Despite being the lowest layer, it enables logical communication by
ensuring signals are accurately transmitted and interpreted. The bit is the logical unit of data at this
layer.

• Signal Transformation: Defines how bits are transformed into signals based on the medium.

Data-link Layer:

• Role: Manages the process of transmitting the datagram across a specific link once the next link is
chosen by a router. It accommodates various link types (wired/wireless LANs and WANs) and their
respective protocols.
• Protocol Flexibility: The TCP/IP model allows for a wide range of standard and proprietary protocols
at this layer, as long as they can encapsulate a datagram and move it across a link.
• Data Unit: At this layer, the datagram is encapsulated into a packet called a frame. Some protocols at
this layer offer error detection and correction.
25
Department of CSE (AI & ML)
Computer Networks BCS502

Network Layer:

• Role: Crucial for establishing communication between source and destination computers across
multiple devices (routers). It manages host-to-host communication and determines the best path for
data transmission.
• Internet Protocol (IP): The primary protocol. IP defines the structure and format of data packets
(datagrams), determines the addressing system, and handles forwarding packets from router to router.
• Connectionless: IP is a connectionless protocol, meaning it does not manage flow control, error
control, or congestion control; these are handled by the transport layer if needed.
• Auxiliary Protocols: Supported by protocols like ICMP (reports issues), IGMP (multicast
communication), DHCP (assigns addresses), and ARP (converts network-layer to link-layer addresses).
• Data Unit: Datagram.

Transport Layer:

• Role: Ensures end-to-end communication between application layers on different devices. It handles
reliable and efficient data transfer.
• Encapsulation and Transmission: Takes messages from the application layer, encapsulates them into
transport layer packets (segments in TCP or user datagrams in UDP), and transmits them to the
destination transport layer.
• Service Separation: Provides end-to-end connection while separating data transmission tasks from
the application, offering flexibility with multiple protocols for different needs.
• Protocols:
o TCP (Transmission Control Protocol): Connection-oriented, establishes a connection, provides
flow control (matches sending to receiving capability), error control (retransmits corrupted
segments), and congestion control (adjusts transmission rate based on network conditions).
o UDP (User Datagram Protocol): Connectionless, sends each user datagram independently, is
lightweight with minimal overhead, but does not provide flow, error, or congestion control. Best
for applications needing speed and small, independent messages.
o SCTP (Stream Control Transmission Protocol): Designed for modern multimedia applications
with advanced features for high-demand data transmissions.
• Data Unit: Segment (TCP) or User Datagram (UDP).

Application Layer:

• Role: Facilitates end-to-end communication between two application layers (processes/programs


running on separate machines). One process sends a request, and another responds.

26
Department of CSE (AI & ML)
Computer Networks BCS502

• Protocols: Includes HTTP (web access), SMTP (email), FTP (file transfer), TELNET/SSH (remote
access), SNMP (network management), and DNS (finds IP addresses). Users can also create custom
processes.
• Data Unit: Message.

5.4. Encapsulation and Decapsulation

These are key concepts in protocol layering within the Internet, occurring at hosts and routers.

Encapsulation at the Source Host:

1. Application Layer: Data is a message passed to the transport layer.

2. Transport Layer: Treats the message as payload, adds a transport layer header (source/destination
application IDs, flow/error/congestion control info), forming a segment (TCP) or user datagram
(UDP). Passed to the network layer.

3. Network Layer: Treats the transport layer packet as payload, adds a network layer header
(source/destination IP addresses, error checking, fragmentation info), forming a datagram. Passed to
the data-link layer.

4. Data-Link Layer: Encapsulates the network layer packet into a data-link layer frame by adding a
header (sending host and next hop addresses). Passed to the physical layer for transmission.

Encapsulation and Decapsulation at the Router:

1. Decapsulation at Data-Link Layer: Router receives a frame, extracts the datagram, and passes it to
the network layer.

27
Department of CSE (AI & ML)
Computer Networks BCS502

2. Network Layer Processing: Examines datagram header (source/destination addresses), uses its
forwarding table to determine the next hop. The datagram's content is generally not altered unless
fragmentation is required for the next link.

3. Encapsulation at Data-Link Layer: The processed datagram is encapsulated into a new frame
suitable for the next link and passed to the physical layer for transmission.

Decapsulation at the Destination Host:

This is the reverse process of encapsulation.

1. Data-Link Layer: Receives the frame, removes its header, and extracts the network layer datagram.

2. Network Layer: Removes its header to extract the transport layer segment or user datagram.

3. Transport Layer: Removes its header to deliver the original message to the application layer.

Error checking is performed at each layer during decapsulation to ensure data integrity. The process continues
until the original message reaches the application layer.

5.5. Addressing in Network

Addressing is crucial for logical communication between pairs of layers in the Internet. For any
communication, a source address and a destination address are required. While theoretically each layer could
have addresses, in practice, only four are needed as the physical layer does not use addresses (it deals with bits
which do not have addresses).

• Application Layer: Uses names like domain names (e.g., someorg.com) or email addresses (e.g.,
somebody@coldmail.com) to represent services or resources. The data unit is a Message.

28
Department of CSE (AI & ML)
Computer Networks BCS502

• Transport Layer: Uses port numbers to identify specific application-layer programs (e.g., web server-Port
80) on the source and destination devices. The data unit is a Segment (TCP) or User Datagram (UDP).

• Network Layer: Uses global addresses known as IP addresses (e.g., 45.113.122.159) to uniquely identify a
device's connection to the Internet and enable routing across networks. The data unit is a Datagram.

• Link Layer: Uses link-layer addresses (also known as MAC addresses, e.g., 78-45-C4-29-17-E8) which are
local addresses uniquely identifying physical devices on a specific network (LAN or WAN). The data unit is
a Frame.

5.6. Multiplexing and Demultiplexing

These are essential concepts for managing data flow between different layers.

• Multiplexing at the Source: Occurs when a protocol at a certain layer can handle multiple types of data
from higher layers. For example, at the transport layer, TCP and UDP can receive messages from various
application-layer protocols (FTP, HTTP, DNS, SNMP), encapsulate them into segments, and add a header field
indicating the originating application-layer protocol.

• Demultiplexing at the Destination: Happens when a protocol needs to deliver the data to the appropriate
higher-layer protocol. At the transport layer, TCP or UDP examines the header to determine which application-
layer protocol should receive the data. Similarly, at the network layer, IP can handle segments from TCP or
UDP, or packets from other protocols like ICMP or IGMP, and at the data-link layer, a frame may carry
payloads from IP or ARP.

These processes ensure that data is correctly sent and received by the right application, maintaining the
integrity and order of communication in a complex network environment.

29
Department of CSE (AI & ML)
Computer Networks BCS502

6. The OSI Model:

Established in 1947, the International Organization for Standardization (ISO) is a multinational body dedicated
to worldwide agreement on international standards. Almost three-fourths of the countries in the world are
represented in the ISO. An ISO standard that covers all aspects of network communications is the Open
Systems Interconnection (OSI) model. It was first introduced in the late 1970s.

The OSI model is a layered framework for the design of network systems that allows communication between
all types of computer systems. It consists of seven separate but related layers, each of which defines a part of
the process of moving information across a network.

6. 1 OSI Versus TCP/IP :

30
Department of CSE (AI & ML)
Computer Networks BCS502

7. Transmission Media

Transmission media are fundamental to Data Communications & Networks, serving as the physical pathways
through which information travels. They are considered a layer zero component, directly interfacing with the
physical layer of the OSI model. The information transmitted through these media is typically in the form of
signals generated from data.

The performance of data communication systems relies on four key characteristics: delivery, accuracy,
timeliness, and jitter. The choice of transmission medium significantly impacts these characteristics,
influencing how data reaches the correct destination, remains error-free, arrives promptly, and experiences
consistent packet arrival times. For instance, the transmission medium is one of the factors influencing network
performance criteria like transit time and response time.

Transmission media are broadly categorized into two main types: Guided Media and Unguided Media.

The electromagnetic spectrum is particularly crucial for understanding unguided, or wireless, transmission
media.

Computers and telecommunication devices fundamentally transmit data as electromagnetic energy, which
encompasses various forms such as radio waves, infrared, visible light, ultraviolet light, and X-rays. While the
electromagnetic spectrum ranges broadly, only specific portions are suitable for telecommunications.

31
Department of CSE (AI & ML)
Computer Networks BCS502

7.1. Guided Media

Guided media provide a specific path for signals to travel. Guided media consist of physical conduits that
confine and direct the signal along a specific route. This ensures that the signal reaches its intended destination
via a defined pathway, unlike unguided (wireless) media where signals spread freely. The primary types of
guided media used in network communications include:

• Twisted-Pair Cable

• Coaxial Cable

• Fiber-Optic Cable

Twisted-Pair Cable:

A twisted-pair cable comprises two insulated copper conductors twisted together. One wire carries the signal,
and the other acts as a ground reference, with the receiver processing the difference between the two to retrieve
the signal.

• Noise and Interference Reduction: The twisting of the wires is crucial for minimizing the impact of
interference (noise) and crosstalk. By constantly changing the relative positions of the wires to the noise source
in each twist, both wires experience similar levels of interference. This balance helps the receiver cancel out
most of the unwanted signals when calculating the difference between the wires.

• Types:

◦ Unshielded Twisted-Pair (UTP): This is the most common type in communications. UTP cables do not
have additional shielding, making them less expensive and less bulky, but potentially more susceptible to
interference. The Electronic Industries Association (EIA) classifies UTP cables into categories (e.g., Category
1 for telephone lines, Category 5E and 6 for LANs, Category 7 for high-speed LANs) based on performance
criteria like data rates (from 2 Mbps for Category 1 to 600 Mbps for Category 7).

32
Department of CSE (AI & ML)
Computer Networks BCS502

◦ Shielded Twisted-Pair (STP): STP cables include an additional metal foil or braided mesh covering each
pair, which reduces interference and improves signal quality. However, STP is bulkier and more costly and is
primarily used by IBM.

• Connectors: The RJ45 connector is the most common connector for UTP cables, designed for proper, one-
directional insertion.

• Performance: While capable of handling a broad range of frequencies, attenuation (signal loss) increases
significantly at frequencies above 100 kHz.

• Applications: Twisted-pair cables are widely used in telephone lines (for voice and DSL data), and Local
Area Networks (LANs), such as 10Base-T and 100Base-T Ethernet.

33
Department of CSE (AI & ML)
Computer Networks BCS502

Coaxial Cable:

Coaxial cable, or coax, is designed to carry high-frequency signals. Its distinctive structure helps it transmit
signals with less interference than twisted-pair cables.

• Components:

◦ Central Core Conductor: A solid or stranded copper wire that carries the signal.

◦ Insulating Sheath: Separates the core from the outer conductor.

◦ Outer Conductor: Made of metal foil or braid, it acts as a shield against external noise and completes the
circuit as the second conductor.

◦ Additional Insulation and Plastic Cover: Provide further protection for the cable.

• Standards: Coaxial cables are classified by Radio Government (RG) ratings, which specify physical
characteristics like wire gauge, insulation, and shielding for different specialized applications (e.g., RG-59 for
Cable TV, RG-58/11 for Thin Ethernet).

• Connectors: The Bayonet Neill-Concelman (BNC) connector is common, with variations like the BNC T
Connector (for splitting signals) and BNC Terminator (to prevent signal reflection).

34
Department of CSE (AI & ML)
Computer Networks BCS502

• Performance: Coaxial cables offer higher bandwidth than twisted-pair cables, but experience greater
attenuation over distance, necessitating frequent use of repeaters to maintain signal strength.

• Applications: Historically used in analog and digital telephone networks for large amounts of voice signals
(up to 10,000 channels) and digital data (up to 600 Mbps). However, they have largely been replaced by fiber-
optic cables due to superior performance.

Fiber-Optic Cable:

Fiber-optic cables transmit signals as light pulses through thin strands of glass or plastic.

• Principle of Operation: Light travels in a straight line in a uniform material but changes direction (refracts)
when passing into a substance with different density. Optical fibers guide light using internal reflection: a

35
Department of CSE (AI & ML)
Computer Networks BCS502

core (higher density) is surrounded by cladding (lower density). When the angle of incidence is greater than
the critical angle, light reflects back into the core, trapping it within the fiber.

• Structure: Typically consists of an outer jacket (PVC or Teflon), Kevlar strands for strength, a plastic coating
for cushioning, and the core and cladding for light transmission.

• Propagation Modes:

36
Department of CSE (AI & ML)
Computer Networks BCS502

◦ Multimode: Multiple light beams travel through the core along different paths. This can be step-index
(uniform core density, abrupt light changes at cladding) or graded-index (core density gradually decreases
from center, reducing distortion).

◦ Single-Mode: Uses a smaller core and tightly focused light, causing beams to travel nearly parallel,
which minimizes delay and distortion.

• Fiber Sizes: Classified by the ratio of core to cladding diameter (in micrometers), with single-mode fibers
typically having smaller cores.

• Connectors: Common types include SC (Subscriber Channel) with push/pull locking (used in cable TV), ST
(Straight Tip) with bayonet locking (used in networking), and MT-RJ (similar size to RJ45, for data
networks).

37
Department of CSE (AI & ML)
Computer Networks BCS502

• Performance: Fiber-optic cables exhibit less signal attenuation than twisted-pair or coaxial cables, requiring
fewer repeaters over long distances. They also support significantly higher data transfer rates, especially with
techniques like wavelength-division multiplexing (WDM).

• Applications: Widely used in backbone networks (e.g., SONET), hybrid networks (combining fiber-optic
and coaxial cables for cable TV), and Local Area Networks (LANs) like 100Base-FX and 1000Base-X.

• Advantages:

◦ Higher Bandwidth: Supports greater data rates.

◦ Less Signal Attenuation: Allows longer transmission distances without repeaters.

◦ Immunity to Electromagnetic Interference: Not affected by electrical noise.

◦ Resistance to Corrosive Materials: More durable in harsh environments.

◦ Lightweight: Lighter than copper cables.

◦ Greater Immunity to Tapping: More secure than copper cables.

• Disadvantages:

◦ Installation and Maintenance: Requires specialized skills.

◦ Unidirectional Light Propagation: Necessitates two fibers for bidirectional communication.

38
Department of CSE (AI & ML)
Computer Networks BCS502

◦ Cost: Generally, more expensive than other cables, particularly if bandwidth demand is low.

In summary, guided media, as a category of transmission media, provides structured and contained pathways
for data signals, each type offering distinct characteristics, performance levels, and applications tailored to
different networking needs.

7.2. Unguided Media: Wireless

Unguided Media, also known as wireless communication, refers to channels where signals travel through free
space, such as air and vacuum, without physical conductors. These media operate at layer zero, directly
interfacing with the physical layer, transmitting information as signals generated from data.

Fundamental Principle: Wireless communication involves transmitting electromagnetic waves without


physical conductors. Signals are broadcast through free space and are accessible to any device equipped to
receive them. Computers and telecommunication devices transmit data as electromagnetic energy, which
includes various forms like radio waves, infrared, and visible light.

Electromagnetic Spectrum: Wireless communication uses frequencies from 3 kHz to 900 THz.

Types of Propagation:

• Ground Propagation: This method involves low-frequency radio waves. They travel close to the
Earth’s surface, following its curvature. Signals radiate from the transmitting antenna in all directions.
The distance these signals cover is dependent on the power of the signal; higher power allows for
greater travel distances. Radio waves, particularly those with low and medium frequencies, are known
to penetrate walls, which is beneficial for indoor reception but means signals cannot be restricted to
inside or outside a building. Applications include long-range radio navigation, radio beacons, and
navigational locators typically found in the Very Low Frequency (VLF) and Low Frequency (LF)
bands.

• Sky Propagation: This method utilizes higher-frequency radio waves that are transmitted upward into
the ionosphere. Once in the ionosphere, these signals are reflected back to Earth. This mechanism
enables long-distance communication with relatively low power. Common applications for sky

39
Department of CSE (AI & ML)
Computer Networks BCS502

propagation are found in the Middle Frequency (MF) band for AM radio and the High Frequency (HF)
band for Citizens Band (CB) and ship/aircraft communication. The Very High Frequency (VHF) band
also employs sky propagation for applications like VHF TV and FM radio.

• Line-of-Sight Propagation: This method is used for very high-frequency signals. Signals are
transmitted directly between antennas in a straight line. It requires that the transmitting and receiving
antennas be properly aligned and either tall enough or close enough to avoid being affected by the
Earth's curvature. A key characteristic is that radio waves cannot be perfectly focused. Unlike lower-
frequency radio waves, signals using line-of-sight propagation are less effective at penetrating
obstacles like buildings. Infrared signals, for instance, do not penetrate walls, making them suitable for
indoor use where confinement is desired. This propagation method is vital for higher frequency bands
such as Ultra-High Frequency (UHF), Super High Frequency (SHF), Extremely High Frequency
(EHF), and Light Wave (Infrared). Applications include UHF TV, cellular phones, paging, satellite
communication, radar, and infrared communication (e.g., remote controls, short-range data
transmission).

The choice of propagation method is dictated by the frequency band being used, which is often regulated by
government authorities. For instance, radio waves (3 kHz to 1 GHz) primarily use omnidirectional
propagation, encompassing ground and sky propagation for applications like broadcasting. In contrast,
microwaves (1 GHz to 300 GHz) and infrared (300 GHz to 400 THz) predominantly rely on line-of-sight
propagation due to their higher frequencies, making them suitable for point-to-point links and short-range,
confined communication respectively.

Frequency Bands:

The electromagnetic spectrum is divided into eight regulated bands based on frequency, ranging from Very
Low Frequency (VLF) to Extremely High Frequency (EHF). Each band has specific propagation
characteristics and applications. Examples include:

40
Department of CSE (AI & ML)
Computer Networks BCS502

◦ AM radio in the Middle Frequency (MF) band (300 kHz–3 MHz) using sky propagation.

◦ VHF TV and FM radio in the Very High Frequency (VHF) band (30–300 MHz) using sky and line-of-
sight propagation.

◦ Cellular phones and satellite communication in the Ultra-High Frequency (UHF), Super High Frequency
(SHF), and Extremely High Frequency (EHF) bands, primarily using line-of-sight.

◦ Infrared communication in the Light Wave (Infrared) band (300 GHz–900 THz) also using line-of-sight.

Specific Frequency Bands and their Characteristics:

◦ Very Low Frequency (VLF)

▪ Range: 3–30 kHz

▪ Propagation: Ground Propagation (low-frequency radio waves travel close to the Earth's surface,
following its curvature).

▪ Application: Long-range radio navigation.

◦ Low Frequency (LF)

▪ Range: 30–300 kHz

▪ Propagation: Ground Propagation.

▪ Application: Radio beacons, navigational locators.

◦ Middle Frequency (MF)

▪ Range: 300 kHz–3 MHz

▪ Propagation: Sky Propagation (higher-frequency radio waves are transmitted into the ionosphere and
reflected back to Earth, enabling long-distance communication with relatively low power).

▪ Application: AM radio.

◦ High Frequency (HF)

▪ Range: 3–30 MHz

▪ Propagation: Sky Propagation.

▪ Application: Citizens band (CB), ship/aircraft communication.

◦ Very High Frequency (VHF)

41
Department of CSE (AI & ML)
Computer Networks BCS502

▪ Range: 30–300 MHz

▪ Propagation: Sky and Line-of-Sight Propagation (very high-frequency signals are transmitted directly
between antennas in a straight line, requiring alignment).

▪ Application: VHF TV, FM radio. The FM band is specifically licensed between 88-108 MHz for radio
broadcasting.

◦ Ultra-High Frequency (UHF)

▪ Range: 300 MHz–3 GHz

▪ Propagation: Line-of-Sight Propagation.

▪ Application: UHF TV, cellular phones, paging, satellite communication. This range also includes
unlicensed bands like Wi-Fi at 2.4 GHz and 5 GHz.

◦ Super High Frequency (SHF)

▪ Range: 3–30 GHz

▪ Propagation: Line-of-Sight Propagation.

▪ Application: Satellite communication.

◦ Extremely High Frequency (EHF)

▪ Range: 30–300 GHz

▪ Propagation: Line-of-Sight Propagation.

▪ Application: Radar, satellite communication.

Types of Wireless Communication:

Radio Waves:

• Frequency Range: Typically, from 3 kHz to 1 GHz.

42
Department of CSE (AI & ML)
Computer Networks BCS502

• Characteristics: Mostly omnidirectional propagation, meaning signals spread in all directions, and
antennas do not need alignment. This allows any receiving antenna in range to pick up the signal. They
can travel long distances, especially in sky mode, and penetrate walls (particularly low and medium
frequencies), making them suitable for indoor reception but also leading to potential signal leakage.
• Limitations: The radio wave band is relatively narrow, leading to low data rates for digital
communications when divided into subbands. Most of the spectrum is regulated by government
authorities, requiring official permission for use.
• Antennas: Typically utilize omnidirectional antennas.

• Applications: Widely used for multicasting (one sender to many receivers), including AM and FM
radio, television broadcasting, maritime radio, cordless phones, and paging systems. Unlicensed bands
like Wi-Fi (2.4 GHz, 5 GHz) also use radio waves.

Microwaves:

• Frequency Range: From 1 GHz to 300 GHz.


• Characteristics: Require line-of-sight transmission, meaning transmitter and receiver must be
directly visible. They are less effective at penetrating obstacles like buildings.
• Applications: Used in satellite communications, radar systems, microwave ovens, point-to-point
communication links, and cellular networks. These typically use unidirectional antennas.

43
Department of CSE (AI & ML)
Computer Networks BCS502

Infrared:

• Frequency Range: From 300 GHz to 400 THz.


• Characteristics: Used for short-range communication and do not penetrate walls, making them
suitable for indoor, confined use. They are highly directional and require line-of-sight.
• Applications: Common in remote controls, short-range data transmission (e.g., between computers
and peripherals), and infrared sensors for security systems or medical devices.

In summary, Unguided Media leverage the electromagnetic spectrum to transmit data wirelessly, offering
distinct advantages and disadvantages compared to Guided Media, primarily in terms of mobility, coverage,
and susceptibility to interference, with different wireless technologies optimized for varying ranges and data
rates.

44
Department of CSE (AI & ML)
Computer Networks BCS502

8. Packet Switching:

Packet switching is the process where data messages are divided into smaller units called packets before being
sent from a source to a destination through a network. These packets can be of either fixed or variable sizes,
depending on the network and protocol used. A key characteristic is that these packets are independent units,
which allows network switches to store and forward them later if needed.

Resource Allocation and Efficiency: A defining feature of packet switching is its approach to resource
allocation:

• No Resource Reservation: Unlike circuit-switched networks that reserve specific resources (like bandwidth
or processing time) for the duration of a connection, packet switching does not reserve any specific resources.

• On-Demand Allocation: Resources are allocated only when needed. Packets are processed on a first-come,
first-served basis.

• Efficiency: This on-demand allocation makes packet-switched networks more efficient than circuit-switched
networks because resources like bandwidth are allocated only when packets are actively being transmitted,
leading to better utilization of network resources. For example, if the main connection line has twice the
capacity of smaller data lines, packets can move without delay when traffic is low.

Potential for Delays: While efficient, packet switching can introduce delays, particularly under heavy network
traffic. If a switch (router) is busy processing other packets, newly arrived packets must wait their turn in a
queue. This waiting time can increase the overall transmission time for packets.

45
Department of CSE (AI & ML)
Computer Networks BCS502

Types of Packet-Switched: Two primary types of packet-switched networks:

8.1. Datagram Networks

• Packet Independence: In a datagram network, each packet (or datagram) is handled independently. The
network treats each packet as a standalone unit, even if it's part of a larger message. This means packets
belonging to the same transmission can take different paths to their destination.

• Connectionless: Datagram networks are often described as connectionless because they do not require a
setup phase before data transmission. No information about the connection is saved, and each packet is routed
independently.

• Routing: Packet routing primarily occurs at the network layer, where routers forward packets based on their
destination address. Each router uses a dynamic routing table that maps destination addresses to appropriate
output ports. The destination address in a packet's header remains unchanged throughout its journey.

46
Department of CSE (AI & ML)
Computer Networks BCS502

• Arrival Order and Delays: Because packets can take different routes, they might arrive at their destination
out of order or with varying delays. Some packets could even be dropped if the network runs out of resources.
Upper-layer protocols are typically responsible for reordering and retransmitting lost packets. The total delay
for a packet in a datagram network includes transmission times (T), propagation delays (τ), and waiting times
(w) at switches: Total delay = 3T + 3τ + w1 + w2.

8.2. Virtual-Circuit Networks

Hybrid Model: A VCN is a hybrid network model that combines features from both circuit-switched and
datagram networks, balancing connection-oriented and connectionless transmission.

• Connection Phases: VCNs operate in three distinct phases:

1. Setup Phase: A predetermined path is established between the sender and receiver before any data is
sent. During this phase, switches along the path create table entries to store information about the virtual

47
Department of CSE (AI & ML)
Computer Networks BCS502

circuit.... This involves a setup request from the source and an acknowledgment from the destination to update
switch tables.

2. Data Transfer Phase / Acknowledgement Phase: Once the path is established, all packets belonging to
that communication session follow the same predetermined path. Data is sent in packets, but they use a local
address known as a Virtual-Circuit Identifier (VCI), which only indicates to the next switch where to forward
the packet. The VCI changes at each switch along the path.

3. Teardown Phase: After data transfer, the connection is terminated, and network resources are released
by removing the table entries at the switches.

• Resource Allocation: Resources in a VCN can be either allocated and reserved during the setup phase
(similar to circuit-switched) or dynamically allocated on demand during data transmission (similar to datagram
48
Department of CSE (AI & ML)
Computer Networks BCS502

networks). If resources are reserved during setup, all packets experience the same delay. If allocated on
demand, packet delays may vary, but the source can check resource availability before data transfer.

• Layer of Operation: VCNs typically operate at the data-link layer, distinct from datagram networks
(network layer) and circuit-switched networks (physical layer).

• Delay: VCNs incur one-time delays during the setup and teardown phases. The total delay for a packet in a
VCN includes transmission times (3T), propagation delays (3τ), and these setup and teardown delays: Total
delay = 3T + 3τ + setup delay + teardown delay.

In essence, Packet Switching, through its variations like Datagram and Virtual-Circuit Networks, forms the
backbone of modern Data Communications & Networks, particularly for efficient utilization of shared
resources in environments like the Internet.

49
Department of CSE (AI & ML)

You might also like