0% found this document useful (0 votes)
57 views96 pages

End Sem CN

Uploaded by

Shelly Garg
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)
57 views96 pages

End Sem CN

Uploaded by

Shelly Garg
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/ 96

Computer Networks

Unit 1
Data Communications
Data Communications Components
Networks
The Internet
Protocols and Standards
Network Models: The OSI Model
TCP/IP Protocol Suite
A Comparison of the OSI and TCP/IP Reference Models
Addressing
Physical Layer: Analog and Digital Signals
Transmission Modes
Transmission Media: Guided Media and Unguided Media
Error Detection and Correction Codes
Switching: Circuit Switching (Space-Division, Time Division, and Space-Time Division)
Packet Switching: Virtual Circuit and Datagram Approach
Message Switching
Unit 2
Data Link Layer: Design Issues
Data Link Control and Protocols: Flow and Error Control, Stop-and-Wait ARQ
Sliding Window Protocol, Go-Back-N ARQ, and Selective Repeat ARQ
High-Level Data Link Control (HDLC)
Point-to-Point Access, PPP (Point-to-Point Protocol), and PPP Stack
Medium Access Sublayer: Channel Allocation Problem
Controlled Access in Network Communication
Channelization in Network Communication
Multiple Access Protocols in Network Communication
IEEE Standards for LANs and WLANs: 802.3 (Ethernet) and 802.11 (Wi-Fi)
high‐speed LANs
Token Ring and Token Bus
Fiber Distributed Data Interface (FDDI)-Based LAN
Network Devices: Repeaters, Hubs, Switches, and Bridges
Unit-3

Computer Networks 1
Network Layer:
Functions of the Network Layer:
Protocols and Devices at the Network Layer:
Network Layer: Design Issues:
Routing Algorithms:
Congestion Control Algorithms:
Host-to-Host Delivery:
Internetworking:
Addressing:
Routing:
Summary:
Classful IP Addressing:
Classes of IP Addresses:
Classless Inter-Domain Routing (CIDR) - Classless Addressing:
Features of CIDR:
Subnet
Purpose of Subnetting:
Components of a Subnet:
Subnetting Process:
Example:
Network Layer Protocols:
Address Resolution Protocol (ARP):
Internet Protocol version 4 (IPv4):
Internet Control Message Protocol (ICMP):
Internet Protocol version 6 (IPv6):
ICMPv6 (Internet Control Message Protocol version 6):
Unit 4
Transport Layer
Transport Layer Functions:
Key Protocols at the Transport Layer:
Transport Layer Ports:
Quality of Service (QoS):
UDP (User Datagram Protocol):
TCP (Transmission Control Protocol):
Congestion Control:
Quality of Service (QoS):
Summary:

Computer Networks 2
Application Layer
Client-Server Model:
Socket Interface:
Summary:
Domain Name System (DNS):
Simple Mail Transfer Protocol (SMTP):
File Transfer Protocol (FTP):
Hypertext Transfer Protocol (HTTP) and World Wide Web (WWW):

Unit 1
Data Communications
Data communications is the process of transmitting and receiving data between two
devices or systems through a medium such as a wired or wireless connection. It
plays a fundamental role in computer networks and is essential for information
exchange. This topic covers various aspects of data communications:

1. Data Communication Components:

Data - Data refers to the information that is being transmitted. It can be in


various forms, such as text, images, or videos.

Sender - The sender, also known as the transmitter, is the device or entity that
initiates data transmission.

Receiver - The receiver is the device or entity that receives the data transmitted
by the sender.

Transmission Medium - The transmission medium is the physical path through


which data travels. It can be wired, such as copper cables or optical fibers, or
wireless, such as radio waves or microwaves.

Protocol - A protocol is a set of rules and conventions that govern the data
communication process, ensuring data integrity, reliability, and proper
synchronization between sender and receiver.

2. Types of Data Communication:

Computer Networks 3
Data communication can be classified into two main types:

Analog Communication - In analog communication, data is transmitted in


continuous, variable waveforms. Examples include analog telephones and
AM/FM radio.

Digital Communication - Digital communication involves transmitting data in


discrete, binary form. Digital communication is widely used in modern computer
networks and includes techniques like digital modulation and encoding.

3. Data Transmission Modes:

Simplex - In simplex mode, data flows in one direction only, from sender to
receiver. This mode is unidirectional, much like a TV broadcast.

Half-Duplex - Half-duplex mode allows data to flow in both directions, but not
simultaneously. Devices take turns transmitting and receiving, similar to a
walkie-talkie.

Full-Duplex - Full-duplex mode enables simultaneous bidirectional


communication, where both sender and receiver can transmit and receive data
concurrently. This mode is commonly used in modern networking.

4. Data Transmission Techniques:

Baseband Transmission - Baseband transmission sends digital signals directly


without modulation. It's used in Ethernet networks.

Broadband Transmission - Broadband transmission uses modulation to send


analog signals over a wide range of frequencies. Cable TV and DSL use
broadband transmission.

5. Data Transmission Errors:

Noise - Noise refers to unwanted signals that can distort or disrupt the data
being transmitted. It's essential to have error detection and correction
mechanisms in place to deal with noise.

6. Data Communication Protocols:

TCP/IP - The Transmission Control Protocol/Internet Protocol is the foundation


of the internet. It ensures reliable data delivery between devices.

Computer Networks 4
HTTP/HTTPS - Hypertext Transfer Protocol (HTTP) and its secure version
(HTTPS) are used for transmitting web content.

SMTP/POP3/IMAP - Simple Mail Transfer Protocol (SMTP), Post Office


Protocol (POP3), and Internet Message Access Protocol (IMAP) are used for
email communication.

Data Communications Components

Data communication involves the transmission of digital data between devices or


systems. Several components play crucial roles in enabling this process. These
components can be broadly categorized into the following:

1. Message: The message is the information that needs to be transmitted from


one point to another. It can be in the form of text, images, audio, video, or any
other digital data.

2. Sender: The sender, also known as the transmitter or source, is the device or
entity that originates and initiates the data transmission. It is responsible for
encoding and sending the message.

3. Receiver: The receiver is the device or entity at the receiving end, which
decodes and processes the transmitted data. Its role is to extract the message
from the received signals.

4. Transmission Medium: The transmission medium is the physical or logical


path through which data is transmitted from the sender to the receiver. It can be
wired (e.g., copper cables, optical fibers) or wireless (e.g., radio waves,
microwaves).

Computer Networks 5
5. Protocol: Protocols are a set of rules and conventions that govern the format
and timing of data transmission, ensuring compatibility and successful
communication between sender and receiver.

6. Modem (Modulator-Demodulator): Modems are used when data transmission


involves both analog and digital signals. They modulate digital data into analog
signals for transmission and demodulate incoming analog signals back into
digital data.

7. Multiplexers/Demultiplexers (MUX/DEMUX): Multiplexers are devices that


combine multiple data streams into one signal for transmission, while
demultiplexers split the combined signal into individual data streams at the
receiving end.

8. Switches/Routers: In network communication, switches are used to connect


devices within a local area network (LAN), while routers are responsible for
directing data between different networks, ensuring it reaches the correct
destination.

9. Gateway: A gateway connects networks with different protocols, allowing data


to flow between them. It translates data from one network format to another.

10. Data Terminal Equipment (DTE) and Data Circuit-Terminating Equipment


(DCE): DTE represents devices like computers, while DCE represents
equipment like modems. These two work together to establish data
connections.

11. Physical Interface: The physical interface provides the connection point for the
transmission medium and ensures that the signals are compatible with the
medium used.

12. Error Detection and Correction: Techniques and mechanisms for detecting
and correcting errors that may occur during data transmission, ensuring data
integrity.

13. Flow Control: Flow control mechanisms manage the rate of data transmission
to avoid overwhelming the receiver and maintain data synchronization between
sender and receiver.

Computer Networks 6
14. Multiplexing Techniques: Multiplexing methods such as time-division
multiplexing (TDM) and frequency-division multiplexing (FDM) allow multiple
signals to share a single transmission medium.

15. Network Topology: The physical or logical layout of devices and their
connections in a network, which can be in the form of bus, star, ring, or mesh
topologies.

These are the fundamental components of data communication. Understanding


their roles and interactions is essential for designing and maintaining effective data
communication systems.

Networks
In the context of computer networks, there are various components and concepts to
consider:

1. Network Types:

Local Area Network (LAN): A LAN is a network that covers a small


geographical area, like an office, building, or campus. It typically uses
Ethernet technology.

Wide Area Network (WAN): A WAN covers a larger geographical area and
can connect LANs over long distances, often using technologies like the
Internet or leased lines.

Metropolitan Area Network (MAN): A MAN falls between LAN and WAN in
terms of geographic scope, typically covering a city or large campus.

2. Network Topologies:

Bus Topology: In a bus topology, all devices are connected to a single


central cable.

Star Topology: In a star topology, all devices are connected to a central


hub or switch.

Ring Topology: Devices are connected in a circular manner, with data


passing from one device to the next in a ring.

Computer Networks 7
Mesh Topology: In a mesh topology, every device is connected to every
other device, providing redundancy.

3. Networking Devices:

Router: A router connects different networks and forwards data between


them.

Switch: A switch connects devices within a single network and uses MAC
addresses to forward data.

Hub: Hubs are less intelligent and simply broadcast data to all devices on a
network.

Gateway: A gateway connects different networks with different protocols.

4. Network Protocols:

TCP/IP: The Transmission Control Protocol/Internet Protocol is the


foundation of the internet.

HTTP/HTTPS: Hypertext Transfer Protocol and its secure version are used
for web communication.

FTP: File Transfer Protocol is used for transferring files.

SMTP/POP3/IMAP: These are email protocols for sending and receiving


emails.

5. Network Addressing:

IP Address: An IP address is a unique identifier for devices on an IP


network.

MAC Address: A MAC address is a hardware address for devices on a


local network.

6. Subnetting and CIDR: Subnetting allows the division of IP networks into


smaller, manageable subnetworks. CIDR (Classless Inter-Domain Routing) is
used to allocate IP addresses more efficiently.

7. DNS (Domain Name System): DNS translates human-readable domain names


into IP addresses, making it easier to locate resources on the internet.

Computer Networks 8
8. Firewalls: Firewalls are used to secure networks by controlling incoming and
outgoing network traffic based on an organization's previously established
security policies.

9. Wireless Networks: Wireless networks use radio waves to connect devices


without physical cables. Common standards include Wi-Fi (802.11) and cellular
networks.

10. Network Security:

Authentication: Proving the identity of users or devices.

Encryption: Protecting data by converting it into a code.

Firewalls: Network firewalls filter incoming and outgoing traffic.

11. Network Troubleshooting:

Identifying and resolving network issues, such as connectivity problems and


slow data transmission.

12. Network Management:

Tools and practices for monitoring and managing network resources and
performance.

The Internet
The Internet is a global network of interconnected computer networks that allows for
the exchange of data, information, and communication across the world. It is a vast
and complex system with several key components and concepts:

1. World Wide Web (WWW):

The World Wide Web is a system of interconnected webpages, websites,


and web applications accessible through the internet.

2. Internet Service Providers (ISPs):

ISPs are companies or organizations that provide internet access to users.


They connect your local network to the global internet.

3. Web Browsers:

Computer Networks 9
Web browsers are software applications that allow users to access and
view web content. Common examples include Chrome, Firefox, and Safari.

4. URL (Uniform Resource Locator):

A URL is a web address used to identify resources on the internet. It


consists of a protocol (e.g., HTTP, HTTPS), domain name, and resource
path.

5. IP Addresses:

IP addresses are unique numerical identifiers assigned to devices on the


internet. They can be IPv4 (e.g., 192.168.1.1) or IPv6 (e.g.,
2001:0db8:85a3:0000:0000:8a2e:0370:7334).

6. Web Servers:

Web servers are computers or software that host websites and respond to
requests from web browsers. They deliver web content to users.

7. Web Hosting:

Web hosting services provide the infrastructure and services needed to


make websites accessible on the internet.

8. HTML (Hypertext Markup Language):

HTML is the standard markup language used to create webpages and


structure web content.

9. HTTP and HTTPS:

HTTP (Hypertext Transfer Protocol) is the protocol used for transmitting


data between a web browser and a web server. HTTPS is a secure version
of HTTP, encrypting data transmission for increased security.

10. Search Engines:

Search engines like Google and Bing help users find information on the
internet by indexing and ranking web content.

11. E-commerce:

Computer Networks 10
E-commerce refers to online buying and selling of products and services,
including platforms like Amazon and eBay.

12. Social Media:

Social media platforms like Facebook, Twitter, and Instagram enable users
to connect and share content with others online.

13. Cloud Computing:

Cloud services provide on-demand access to computing resources, data


storage, and applications over the internet.

14. Cybersecurity:

Cybersecurity is the practice of protecting data and systems from cyber


threats and attacks, including viruses, malware, and hacking.

15. Streaming Services:

Streaming services like Netflix and YouTube allow users to watch videos
and other media content over the internet in real-time.

The Internet is a dynamic and ever-evolving entity, constantly expanding and


changing. It has transformed the way we access information, communicate, and
conduct business on a global scale.

Protocols and Standards


In the realm of computer networks and communication, protocols and standards
play a fundamental role in ensuring that devices can effectively communicate and
share data. Here are key points related to protocols and standards:

1. Protocol Definition: A protocol is a set of rules and conventions that govern


how data is transmitted, received, and processed in a network. It ensures that
devices can understand and work together.

2. Open Systems Interconnection (OSI) Model: The OSI model is a conceptual


framework that standardizes network communication into seven layers, each
responsible for a specific aspect of communication, from physical transmission
to application-level interactions.

Computer Networks 11
Layer 1: Physical Layer

Layer 2: Data Link Layer

Layer 3: Network Layer

Layer 4: Transport Layer

Layer 5: Session Layer

Layer 6: Presentation Layer

Layer 7: Application Layer

3. TCP/IP Protocol Suite: The TCP/IP protocol suite is the foundation of the
internet. It includes protocols like:

TCP (Transmission Control Protocol): Ensures reliable data transmission.

IP (Internet Protocol): Manages addressing and routing of data packets.

UDP (User Datagram Protocol): Provides faster, but less reliable, data
transmission.

ICMP (Internet Control Message Protocol): Used for network diagnostics


and error reporting.

4. HTTP and HTTPS: Hypertext Transfer Protocol (HTTP) and its secure version
(HTTPS) define how web browsers and web servers communicate. HTTPS
adds encryption for secure data exchange.

5. Email Protocols:

SMTP (Simple Mail Transfer Protocol): Sending emails.

POP3 (Post Office Protocol Version 3) and IMAP (Internet Message Access
Protocol): Retrieving emails from servers.

6. Ethernet: Ethernet is a widely used standard for LANs, specifying how data
packets are framed, addressed, and transmitted over the physical network.

7. Wireless Protocols:

Wi-Fi (802.11 standards): Specify wireless LAN communication.

Computer Networks 12
Bluetooth: Used for short-range wireless connections between devices.

8. DNS (Domain Name System): DNS protocols translate domain names to IP


addresses, facilitating web address resolution.

9. Security Standards:

TLS/SSL (Transport Layer Security/Secure Sockets Layer): Ensure data


encryption and secure communication.

IPsec (Internet Protocol Security): Provides secure communication at the


network layer.

10. VoIP (Voice over Internet Protocol): Standards and protocols for transmitting
voice and multimedia over the internet.

11. Web Services Standards:

XML (eXtensible Markup Language) and JSON (JavaScript Object


Notation) for data interchange.

SOAP (Simple Object Access Protocol) and REST (Representational State


Transfer) for web services communication.

12. ITU-T and IEEE Standards: Organizations like ITU-T (International


Telecommunication Union - Telecommunication Standardization Sector) and
IEEE (Institute of Electrical and Electronics Engineers) develop and maintain
various networking standards.

13. RFCs (Request for Comments): RFCs are documents that specify internet
standards, protocols, and procedures. They are created and maintained by the
Internet Engineering Task Force (IETF).

Understanding and adhering to these protocols and standards is critical for ensuring
that diverse devices and systems can communicate effectively in a networked
world. They enable interoperability and reliable data transmission across the
internet and other communication systems.

Network Models: The OSI Model

Computer Networks 13
The Open Systems Interconnection (OSI) model is a conceptual framework used to
understand and standardize network communication. It divides the complex process
of network communication into seven distinct layers, each with its own specific
functions and responsibilities. Here's an overview of the OSI model:

1. Physical Layer (Layer 1):

Responsibilities: The physical layer deals with the physical medium and
transmission of raw bits over the network. It focuses on electrical,
mechanical, and functional characteristics of the hardware.

Examples: Cables, connectors, network interface cards (NICs).

2. Data Link Layer (Layer 2):

Responsibilities: This layer is responsible for framing, addressing, and error


detection in data transmission. It ensures reliable point-to-point and local
network communication.

Examples: Ethernet, MAC addresses.

3. Network Layer (Layer 3):

Responsibilities: The network layer deals with routing and forwarding data
packets between devices across different networks. It assigns logical
addresses (IP addresses) and makes routing decisions.

Examples: IP (Internet Protocol), routers.

4. Transport Layer (Layer 4):

Responsibilities: The transport layer ensures end-to-end communication by


segmenting, reassembling, and controlling data flow. It provides reliability
through error detection and correction.

Examples: TCP (Transmission Control Protocol), UDP (User Datagram


Protocol).

5. Session Layer (Layer 5):

Responsibilities: The session layer manages and controls the dialog


between devices, establishing, maintaining, and terminating connections. It

Computer Networks 14
ensures synchronization and checkpointing.

Examples: NetBIOS, RPC (Remote Procedure Call).

6. Presentation Layer (Layer 6):

Responsibilities: The presentation layer deals with data translation,


encryption, and compression. It ensures data is presented in a format that
applications can understand.

Examples: SSL/TLS, JPEG, ASCII.

7. Application Layer (Layer 7):

Responsibilities: The application layer is the topmost layer and is closest to


the end-user. It provides network services directly to applications and users,
such as file transfer, email, and web browsing.

Examples: HTTP, SMTP, FTP.

Key Points:

The OSI model provides a common framework for understanding and


discussing network protocols and their functions.

Each layer has its unique role and interacts with adjacent layers to ensure data
is transmitted reliably and accurately.

While the OSI model is a theoretical model, it helps in designing and


troubleshooting network systems.

Real-world networking standards, such as the TCP/IP suite, do not always align
perfectly with the OSI model but are often used alongside it for practical
implementation.

Understanding the OSI model is essential for network professionals as it helps in


diagnosing network issues, designing networks, and comprehending how different
protocols work together to facilitate communication in complex network
environments.

Computer Networks 15
TCP/IP Protocol Suite
The TCP/IP (Transmission Control Protocol/Internet Protocol) suite is a fundamental
set of networking protocols that underlies the functionality of the internet and most
modern networks. It is divided into four primary layers, and it serves as the basis for
internet communication. Here's an overview of the TCP/IP Protocol Suite:

1. Network Interface Layer (Link Layer):

Responsibilities: The lowest layer is responsible for the physical and data
link aspects of network communication. It interacts directly with the
hardware and deals with addressing at the MAC (Media Access Control)
layer. It includes protocols for Ethernet, Wi-Fi, and others.

Examples: Ethernet, Wi-Fi (802.11), ARP (Address Resolution Protocol).

Computer Networks 16
2. Internet Layer:

Responsibilities: This layer focuses on routing packets across different


networks and provides logical addressing (IP addresses) to devices. It is
responsible for routing decisions and addressing.

Examples: IPv4 (Internet Protocol version 4), IPv6 (Internet Protocol version
6), ICMP (Internet Control Message Protocol).

3. Transport Layer:

Responsibilities: The transport layer ensures end-to-end communication


between devices. It segments and reassembles data, offers flow control,
and provides error detection and correction. It's responsible for the reliability
of data transmission.

Examples: TCP (Transmission Control Protocol), UDP (User Datagram


Protocol).

4. Application Layer:

Responsibilities: The application layer interacts directly with end-user


applications and provides network services to them. It covers a wide range
of applications and protocols, including web browsing, email, file transfer,
and more.

Examples: HTTP (Hypertext Transfer Protocol), FTP (File Transfer


Protocol), SMTP (Simple Mail Transfer Protocol).

Key Points:

The TCP/IP suite is modular and can adapt to various networking technologies,
making it versatile and widely used.

IPv4 and IPv6 are the primary internet layer protocols. IPv6 was introduced to
address the exhaustion of IPv4 addresses and offers enhanced features.

TCP is connection-oriented and ensures reliable data delivery, while UDP is


connectionless and used when speed and efficiency are more critical than
reliability.

Computer Networks 17
The application layer encompasses a broad range of protocols, each tailored to
specific services and applications.

The TCP/IP Protocol Suite is the foundation of internet communication and is


extensively used in local and wide area networks. Understanding these protocols is
essential for anyone working with networking, as they form the basis for most
network interactions, including web browsing, email, and data transfer.

Computer Networks 18
A Comparison of the OSI and TCP/IP Reference
Models
The OSI (Open Systems Interconnection) and TCP/IP (Transmission Control
Protocol/Internet Protocol) reference models are two frameworks used to
conceptualize and standardize network communication. Here's a comparison of the
two models:

1. Number of Layers:

OSI: The OSI model has seven layers, which are designed to provide a
comprehensive and detailed breakdown of network communication functions.

TCP/IP: The TCP/IP model has four layers, providing a more concise
representation of the networking process.

2. Layers and Functions:

OSI:

1. Physical Layer

Computer Networks 19
2. Data Link Layer

3. Network Layer

4. Transport Layer

5. Session Layer

6. Presentation Layer

7. Application Layer

TCP/IP:

1. Network Interface Layer (Link Layer)

2. Internet Layer

3. Transport Layer

4. Application Layer

3. Adoption and Practical Use:

OSI: The OSI model is more of a theoretical concept and is less commonly
implemented directly in networking technologies. However, it serves as a
valuable reference for understanding network principles and interactions.

TCP/IP: The TCP/IP model is the basis for the internet and is more practically
used in real-world networking. It directly influences the design and operation of
the internet and most modern networks.

4. Historical Context:

OSI: The OSI model was developed in the late 1970s by the International
Organization for Standardization (ISO) and was intended to provide a universal
framework for networking.

TCP/IP: The TCP/IP model predates the OSI model and was developed as part
of the ARPANET project in the 1970s, with a focus on creating a practical
networking system.

5. Layer Correspondence:

Computer Networks 20
OSI and TCP/IP layers do not align perfectly. They have different names and
slightly different functionalities in some cases, but there is a general mapping:

OSI Application Layer aligns with the TCP/IP Application Layer.

OSI Transport Layer aligns with the TCP/IP Transport Layer.

OSI Network Layer aligns with the TCP/IP Internet Layer.

OSI Data Link and Physical Layers roughly align with the TCP/IP Network
Interface Layer.

6. Real-World Use:

OSI is mainly used for educational and theoretical purposes.

TCP/IP is used for practical networking implementations.

7. Simplification vs. Detail:

OSI provides a more detailed and granular breakdown of networking functions.

TCP/IP offers a more streamlined and practical representation of networking.

In summary, while both the OSI and TCP/IP models serve as valuable tools for
understanding network communication, the TCP/IP model is more widely used in
practical networking applications, including the internet. The OSI model offers a
more detailed and comprehensive framework for learning and theoretical
discussions but is less commonly used in real-world networking.

Computer Networks 21
Addressing
Addressing is a critical aspect of network communication, enabling devices to locate
and interact with each other within a network. Addressing can refer to various types
of identifiers and schemes used in networking:

1. IP Addressing (Internet Protocol Addressing):

IPv4: IPv4 addresses are 32-bit numerical identifiers, typically written in


dotted-decimal format (e.g., 192.168.0.1). These addresses are used to
identify devices on an IPv4 network.

IPv6: IPv6 addresses are 128-bit hexadecimal identifiers (e.g.,


2001:0db8:85a3:0000:0000:8a2e:0370:7334). They were introduced to
address the limitations of IPv4 and provide a vastly larger address space.

2. MAC Address (Media Access Control Address):

MAC addresses are hardware-based addresses associated with network


interface cards (NICs) and are used at the data link layer to identify devices
on a local network.

3. URL (Uniform Resource Locator):

Computer Networks 22
A URL is a web address that identifies the location of a resource on the
internet. It typically consists of a protocol (e.g., http://), a domain name
(e.g., www.example.com), and a resource path (e.g., /page).

4. Port Numbers:

Port numbers are used in transport layer protocols (TCP and UDP) to
distinguish between different services running on the same device. For
example, port 80 is commonly used for HTTP (web), while port 25 is used
for SMTP (email).

5. Email Address:

An email address uniquely identifies an individual or entity for email


communication. It typically consists of a local part (e.g., username) and a
domain part (e.g., domain.com).

6. Domain Name:

Domain names are human-readable labels used to map to IP addresses.


They are essential for translating URLs into IP addresses, making it easier
for users to access resources on the internet.

7. Hostnames:

Hostnames are labels assigned to devices on a network, allowing them to


be identified by name instead of an IP address.

8. Subnet Mask:

Subnet masks define the range of IP addresses within a network. They are
used for subnetting and organizing IP addresses into smaller subnetworks.

9. Gateways:

A gateway, such as a router, serves as an intermediary between networks.


It routes data between different networks and provides a connection point
for devices to access external networks.

10. DNS (Domain Name System):

Computer Networks 23
DNS is a system for translating human-readable domain names into IP
addresses, allowing users to access resources on the internet by using
familiar names.

11. Logical Addressing:

Logical addressing includes addressing schemes that are used within


specific protocols or technologies, such as IP addressing in the internet or
VLAN IDs in local area networks.

12. Public and Private Addresses:

Public addresses are routable on the global internet, while private


addresses are used within local networks and are not directly reachable
from the internet.

Effective addressing is essential for data routing and communication in networks.


Different types of addressing schemes are used at various layers of the networking
stack to ensure that data reaches its intended destination accurately and efficiently.

Physical Layer: Analog and Digital Signals


The physical layer of the OSI model deals with the actual transmission of data over
the physical medium, whether it's wired or wireless. One fundamental aspect of the
physical layer is the distinction between analog and digital signals:

1. Analog Signals:

Definition: Analog signals are continuous and vary smoothly over time.
They can take any value within a range and represent information as a
wave or continuous signal.

Characteristics:

Infinite possible values within a range.

Susceptible to noise and interference.

Used in older technologies like analog telephones and AM/FM radio.

Computer Networks 24
Examples: A classic example is the audio signal produced by a
microphone, which varies continuously in response to sound waves.

2. Digital Signals:

Definition: Digital signals are discrete and represent information in a binary


format, using only two values (0 and 1). They are more resilient to noise
and interference.

Characteristics:

Limited to two distinct values (0 and 1).

Robust against noise, as they can be easily regenerated.

Used in modern computer and telecommunications systems.

Examples: Digital signals are used in digital devices, computers, and most
modern communication technologies, such as the internet.

Conversion between Analog and Digital Signals:

Modulation: To transmit digital information over an analog medium, modulation


is used to encode digital data into an analog signal. For example, in modems,
digital data is modulated into analog signals for transmission over telephone
lines.

Demodulation: At the receiving end, demodulation is used to convert the analog


signal back into digital data.

Advantages of Digital Signals:

Reduced susceptibility to noise and distortion during transmission.

Easier to regenerate and amplify, which improves signal quality.

Can carry more information per unit of bandwidth.

Advantages of Analog Signals:

Useful for representing continuous, real-world phenomena like sound and light.

Can carry an infinite range of values and can be more accurate for some
applications.

Computer Networks 25
In practice, modern telecommunications systems, including the internet,
predominantly use digital signals due to their robustness and efficiency. However,
analog signals are still used in specific applications where continuous, real-world
data representation is necessary. Understanding the differences between these
signal types is fundamental in the study of the physical layer in networking and
telecommunications.

Transmission Modes
In data communication and networking, transmission modes describe how data is
transmitted between devices or systems. There are three primary transmission
modes:

1. Simplex Mode:

Definition: In simplex mode, communication occurs in only one direction,


with data flowing from the sender to the receiver, but not in the reverse
direction.

Example: One-way radio broadcast is a classic example of simplex


communication. The radio station transmits data (audio) to the listeners, but

Computer Networks 26
the listeners cannot send data back to the station through the same
channel.

2. Half-Duplex Mode:

Definition: Half-duplex mode allows communication in both directions, but


not simultaneously. Devices can either send or receive data at a given time
but not both simultaneously.

Example: Walkie-talkies use half-duplex communication. When one person


is speaking, the other person cannot transmit their voice until the first
person finishes speaking and releases the button.

3. Full-Duplex Mode:

Definition: Full-duplex mode enables simultaneous two-way


communication. Devices can send and receive data concurrently, allowing
for real-time and bidirectional communication.

Example: Most telephone conversations are in full-duplex mode. Both


parties can speak and listen at the same time, providing a natural
conversational experience.

Key Points:

The choice of transmission mode depends on the specific communication


needs of a system or application.

Simplex is useful for situations where data only needs to flow in one direction.

Half-duplex is suitable when data needs to be sent and received, but not
simultaneously, as in walkie-talkies.

Full-duplex is common in many modern communication systems, including most


network connections, telephony, and video conferencing.

Understanding transmission modes is essential in network design and


communication systems to ensure that data flows in a manner that meets the
requirements of the application or service.

Computer Networks 27
Transmission Media: Guided Media and Unguided
Media
In networking and data communication, transmission media refers to the physical
pathways through which data is transmitted from one device to another. There are
two primary categories of transmission media: guided media (wired) and unguided
media (wireless).

Guided Media (Wired):

1. Twisted Pair Cable:

Description: Twisted pair cables consist of pairs of insulated copper wires


twisted together. They are commonly used for telephone lines and local
area networks (LANs).

Variants: Unshielded Twisted Pair (UTP) and Shielded Twisted Pair (STP).

2. Coaxial Cable:

Description: Coaxial cables have a central conductor surrounded by an


insulating layer, a metallic shield, and an outer insulating layer. They are
used for cable television and broadband internet connections.

Computer Networks 28
Advantages: Good bandwidth and resistance to interference.

3. Fiber-Optic Cable:

Description: Fiber-optic cables use thin strands of glass or plastic to


transmit data using light signals. They provide very high bandwidth and are
immune to electromagnetic interference.

Advantages: High data transmission rates and long-distance capabilities.

Unguided Media (Wireless):

1. Radio Waves:

Description: Radio waves are electromagnetic waves used for wireless


communication, including radio broadcasting, Wi-Fi, and Bluetooth.

Advantages: Wide coverage area, suitable for mobile and wireless


devices.

2. Microwaves:

Description: Microwaves are high-frequency radio waves used in point-to-


point communication, such as microwave links for long-distance data
transmission.

Advantages: High data rates and long-distance connectivity.

3. Infrared Waves:

Description: Infrared waves are used for short-range wireless


communication, such as in remote controls and IrDA (Infrared Data
Association) connections.

Advantages: Suitable for short-range, line-of-sight communication.

4. Satellite Communication:

Description: Satellite communication uses geostationary or low Earth orbit


satellites to relay data over long distances. It is commonly used for global
communication, including television broadcasting and internet access.

Advantages: Global coverage and long-distance connectivity.

Computer Networks 29
Key Points:

Guided media rely on physical cables to transmit data and are typically more
secure and reliable.

Unguided media use wireless signals and are suitable for mobile and remote
communication but can be subject to interference and signal degradation.

The choice of transmission media depends on factors such as distance,


bandwidth requirements, mobility, and environmental conditions.

Understanding the characteristics and uses of different transmission media is


crucial in network design and selecting the appropriate medium for specific
communication needs.

Error Detection and Correction Codes


Error detection and correction codes are essential techniques in data
communication and storage systems. They help ensure data integrity and reliability
by identifying and, in some cases, correcting errors that can occur during
transmission or storage. Here's an overview of these codes:

Error Detection:

1. Parity Bit:

Computer Networks 30
Description: Parity bit is a simple error detection method. An extra bit is
added to a data word (usually 7 or 8 bits) to make the total number of 1s
even (even parity) or odd (odd parity). If the parity bit doesn't match the
received data, an error is detected.

Use: Commonly used in memory systems and basic communication.

2. Cyclic Redundancy Check (CRC):

Description: CRC is a more sophisticated error detection technique. It uses


polynomial division to generate a checksum, which is appended to the data.
The receiver performs the same calculation and checks if the received
checksum matches the calculated one. If not, an error is detected.

Use: Commonly used in network communication and storage systems.

Error Correction:

1. Hamming Code:

Description: Hamming codes are a type of error-correcting code. They add


redundant bits to the data in a way that allows the correction of single-bit
errors and the detection of two-bit errors.

Use: Used in computer memory systems and data transmission where error
correction is critical.

2. Reed-Solomon Code:

Description: Reed-Solomon codes are widely used for error correction,


particularly in data storage and transmission. They can correct multiple
errors and are highly resilient.

Use: Common in applications like CDs, DVDs, and QR codes.

3. Turbo Codes and LDPC (Low-Density Parity-Check) Codes:

Description: These advanced error correction codes are used in modern


wireless communication and satellite transmission. They offer very efficient
error correction.

Computer Networks 31
Use: Applied in 4G and 5G mobile networks, deep-space communication,
and high-speed internet.

Key Points:

Error detection codes identify errors but do not correct them, while error
correction codes both detect and correct errors.

Parity and CRC are simple error detection methods, whereas Hamming, Reed-
Solomon, Turbo, and LDPC codes are advanced error correction techniques.

The choice of error correction code depends on the specific application, its error
tolerance, and the complexity of implementation.

Error detection and correction codes are critical in ensuring data integrity in various
communication and storage systems, from basic memory to advanced wireless
networks. The appropriate choice of code depends on the level of error protection
required for a given application.

Switching: Circuit Switching (Space-Division, Time


Division, and Space-Time Division)

Computer Networks 32
Circuit switching is one of the fundamental techniques for establishing a dedicated
communication path between two devices in a network. It is commonly associated
with traditional telephone networks but has variations to address different
requirements. Here's an overview of circuit switching methods:

1. Space-Division Circuit Switching:

Description: In space-division circuit switching, physical pathways, or


switches, are used to establish a dedicated connection between the calling
and receiving devices. It means that a physical circuit is dedicated for the
entire duration of the communication, even if no data is being transmitted.

Use: This approach is often found in early telephone networks and some
legacy communication systems.

2. Time-Division Circuit Switching:

Description: Time-division circuit switching breaks a communication


channel into time slots. Each user is allocated a specific time slot during
which they can send data. The channel is shared among multiple users in a
time-division multiplexing (TDM) fashion.

Use: Time-division circuit switching is more efficient than space-division


because it allows multiple users to share the same channel. It is commonly
used in digital telephone networks (T1 and E1 lines) and some legacy
systems.

3. Space-Time Division Circuit Switching:

Description: Space-time division circuit switching combines the concepts


of both space-division and time-division switching. It uses a combination of
physical pathways and time slots to establish dedicated connections.

Use: Space-time division circuit switching is used in complex


telecommunication systems that require both space and time division
capabilities.

Key Points:

Computer Networks 33
Circuit switching is characterized by the establishment of a dedicated
communication path for the entire duration of the conversation.

Space-division circuit switching is inefficient and expensive, as it dedicates a


physical circuit for each connection.

Time-division circuit switching is more efficient, allowing multiple users to share


a single communication channel by dividing it into time slots.

Space-time division circuit switching combines space and time division methods
to accommodate complex network requirements.

Circuit switching is less common in modern digital networks and has largely been
replaced by packet switching, which is more flexible and efficient. However, circuit
switching is still used in specific applications, such as dedicated communication
paths in some telecommunications systems.

Packet Switching: Virtual Circuit and Datagram


Approach
Packet switching is a fundamental technique in data communication, particularly in
modern computer networks. It involves breaking data into packets, which are small
units, and then routing these packets independently to their destination. Two
common approaches to packet switching are the virtual circuit approach and the
datagram approach:

Virtual Circuit Approach:

1. Description: In the virtual circuit approach, a logical path is established before


data transmission. This logical path is called a "virtual circuit." It resembles the
concept of a dedicated circuit, like in circuit switching, but it's a logical
connection rather than a physical one.

2. Characteristics:

The setup phase: A connection is established before data transmission


begins. During this phase, a route is determined, and resources are
allocated for the duration of the connection.

Packets are identified by a connection identifier, which simplifies routing.

Computer Networks 34
Sequencing and flow control are more straightforward because packets are
sent in a predetermined order.

3. Use: The virtual circuit approach is used in technologies like Frame Relay and
ATM (Asynchronous Transfer Mode) networks, where a stable, predictable
connection is required.

Datagram Approach:

1. Description: In the datagram approach, each packet is treated independently,


and there is no prior establishment of a connection or predefined route. Packets
are routed individually based on the destination address in each packet.

2. Characteristics:

No setup phase: No connection is established beforehand. Each packet


includes destination information for routing.

Packets can take different paths to reach the destination, providing network
redundancy.

Greater flexibility but can lead to out-of-order delivery or packet loss.

Computer Networks 35
3. Use: The datagram approach is the foundation of the Internet Protocol (IP) in
the context of the global internet and local area networks.

Key Points:

The virtual circuit approach is connection-oriented, providing a stable and


predictable path for data transmission, while the datagram approach is
connectionless, offering more flexibility.

Virtual circuit networks are suitable for applications that require predictable,
consistent communication paths, while datagram networks are more flexible
and often used in the public internet.

In practice, both approaches coexist in networking, with virtual circuit networks


being more common in specific applications and datagram networks being the
foundation of the global internet. The choice between these approaches depends
on the specific requirements of the application or network.

Message Switching
Message switching is a communication technique that predates modern packet
switching and circuit switching. It involves the transmission of complete messages
or data units, rather than breaking data into smaller packets as in packet switching.
Here's an overview of message switching:

1. Message-Based Communication:

Computer Networks 36
In message switching, the entire message is treated as a unit of data for
transmission. This message can be of arbitrary size and can contain text,
voice, or other forms of data.

Messages can include routing information to guide their path through the
network.

2. Store-and-Forward Process:

When a sender wants to transmit a message to a receiver, the message is


first stored at the source node. The source node then forwards the entire
message to the next hop in the network.

Each node in the network stores the complete message before forwarding it
to the next node, hence the term "store-and-forward."

3. Message Handling:

Message switching networks use message switches, which are specialized


devices responsible for routing, storing, and forwarding messages.

Each message switch examines the routing information within the message
to determine the next destination.

4. Message Queuing:

Messages may need to wait in queues at each node if the next hop is not
immediately available. This queuing mechanism can introduce delays.

5. Completion-Based Communication:

In message switching, the sender considers the transmission successful


when the entire message reaches its destination. There is no division of
data into packets or datagrams, as in packet switching.

Advantages and Disadvantages:

Advantages:

Simplicity: Message switching is conceptually simple, as it operates on


complete messages.

Computer Networks 37
Suitable for low-data-rate applications: It can be efficient for low-volume,
store-and-forward applications.

Disadvantages:

Inefficiency: Message switching can be inefficient for handling large


volumes of data, as the entire message must be stored and forwarded.

Longer Delays: Due to the store-and-forward process and message


queuing, message switching can introduce longer delays compared to
packet switching.

Lack of Scalability: It is not as scalable or adaptable as packet switching for


modern, high-speed networks.

Message switching was more common in earlier communication networks and was
used in some early telegraph and telex systems. However, it has largely been
supplanted by packet switching, which offers greater efficiency, flexibility, and
speed.

Difference between Message and Packet Switching

Computer Networks 38
Aspect Message Switching Packet Switching

A complete message is passed Message is broken into smaller


Data Unit
across a network. units known as Packets.

Data Uses computer languages like ASCII, In packet switching, binary data
Representation Baudot, Morse code. is used.

Packet switching places a tight


Block Size There is no limit on block size.
upper limit on block size.

Parts (i.e., packets) of the


Message A message exists in only one location
message exist in many places in
Location in the network.
the network.

Hop-by-hop Telex forwarding and


Examples include Frame Relay,
Examples UUCP (UNIX-to-UNIX Copy
IP (Internet Protocol), and X.25.
Protocol).

Physical links are allocated Virtual links are made


Link Allocation
dynamically. simultaneously.

Access time is reduced due to an


Packets are stored in main
Storage Location increase in performance as packets
memory.
are stored on disk.

packet switching:

Computer Networks 39
Unit 2
Data Link Layer: Design Issues
https://youtu.be/JRgmPco0KWI?si=pcjdudE9J_Qxwnat

The Data Link Layer is the second layer of the OSI model, and it plays a crucial role
in the reliable transmission of data over a physical medium. There are several
design issues to consider when implementing the Data Link Layer. Let's explore
these issues:

1. Framing:

Issue: Data sent over a network can be of varying lengths. Framing


involves dividing the data into manageable frames for transmission. The
challenge is to determine where one frame ends and the next begins.

Solution: Framing techniques like character counting, byte stuffing, and


flag bytes are used to delineate frames within a data stream.

2. Error Detection and Correction:

Issue: Data can get corrupted during transmission due to noise or


interference. The Data Link Layer must include mechanisms to detect and
correct these errors.

Solution: Error detection codes like CRC (Cyclic Redundancy Check) and
error correction codes like Hamming codes are employed to ensure data
integrity.

3. Flow Control:

Issue: The sender and receiver may operate at different speeds, leading to
a potential overflow of data at the receiver. Flow control mechanisms are
needed to regulate the data flow.

Solution: Flow control techniques like Stop-and-Wait, Sliding Window, and


credit-based flow control ensure that the sender does not overwhelm the

Computer Networks 40
receiver.

4. Addressing and Identification:

Issue: Each device on a network needs a unique identifier. The Data Link
Layer must include address fields to specify the source and destination.

Solution: MAC (Media Access Control) addresses are used to identify


devices on the same network, and logical addresses may be used for
addressing at higher layers.

5. Media Access Control (MAC):

Issue: In shared media networks, multiple devices may attempt to transmit


data simultaneously. MAC protocols determine how devices access the
medium without causing collisions.

Solution: MAC protocols like CSMA/CD (Carrier Sense Multiple Access


with Collision Detection) and CSMA/CA (Carrier Sense Multiple Access with
Collision Avoidance) help manage access to the medium.

6. Switching:

Issue: In networks with multiple segments or nodes, switches are used to


forward frames to the correct destination. Switching techniques determine
how frames are forwarded efficiently.

Solution: Techniques like store-and-forward and cut-through switching are


used to determine how frames are processed within switches.

7. Error Handling:

Issue: When errors are detected, the Data Link Layer must decide how to
handle them, whether by requesting retransmission or dropping the frame.

Solution: Error handling involves setting flags in frames to indicate errors,


prompting retransmission, or discarding frames with errors.

8. Duplexing:

Issue: Data links can support either full-duplex (simultaneous transmission


in both directions) or half-duplex (transmit or receive at one time). The

Computer Networks 41
choice impacts network efficiency.

Solution: Duplexing modes are determined by the hardware and network


design, with full-duplex becoming increasingly common in modern
networks.

9. Protocols and Standards:

Issue: The Data Link Layer operates using various protocols and
standards. Compatibility and adherence to these standards are essential for
seamless communication.

Solution: Standardization bodies like IEEE and ISO define protocols such
as Ethernet and PPP (Point-to-Point Protocol) to ensure interoperability.

Designing the Data Link Layer involves addressing these issues to create a reliable,
efficient, and error-resistant communication system. The specific solutions chosen
depend on the network's requirements and the technologies in use.

Computer Networks 42
Data Link Control and Protocols: Flow and Error
Control, Stop-and-Wait ARQ
https://www.youtube.com/watch?v=YIX1NfaUpsU&list=PLxCzCOWd7aiGFBD2-
2joCpWOLUrDLvVV_&index=23&pp=iAQB

Data Link Control (DLC) is a sublayer within the Data Link Layer that ensures
reliable data transmission over a physical medium. It includes techniques for flow
control and error control. One of the simplest and fundamental Automatic Repeat
reQuest (ARQ) protocols for error control is Stop-and-Wait ARQ. Let's explore each
of these aspects in detail:

1. Flow Control:
Flow control is a mechanism that ensures the sender doesn't overwhelm the
receiver with data. It regulates the rate of data transmission to match the receiver's
processing capability. There are various flow control techniques:

Stop-and-Wait Flow Control: In Stop-and-Wait, the sender transmits a data


frame and then waits for an acknowledgment (ACK) from the receiver before
sending the next frame. This process ensures that the sender doesn't send data
faster than the receiver can process it.

Sliding Window Flow Control: Sliding Window allows the sender to transmit
multiple frames before waiting for acknowledgments. The receiver maintains a
window that tracks the sequence numbers of the frames it expects to receive.
This allows for better utilization of the network's bandwidth.

Computer Networks 43
2. Error Control:

Error control mechanisms are designed to detect and correct errors that occur
during data transmission. Common error control techniques include:

Cyclic Redundancy Check (CRC): CRC is a widely used error detection


technique. A polynomial division is performed on the data, and the remainder is
included in the frame. The receiver performs the same division and checks if the
remainder matches. If not, an error is detected.

Hamming Codes: Hamming codes are a type of error correction code. They
add redundancy to the data, allowing the receiver to correct errors. Hamming
codes are particularly useful in applications where error correction is essential.

3. Stop-and-Wait ARQ:

Stop-and-Wait Automatic Repeat reQuest (ARQ) is a simple error control protocol


that ensures the reliable delivery of data frames. It works as follows:

Sender's Role:

1. The sender transmits a data frame to the receiver.

2. The sender waits for an acknowledgment (ACK) from the receiver.

Computer Networks 44
3. If the sender receives the ACK within a timeout period, it assumes
successful transmission and proceeds to send the next frame.

4. If no ACK is received within the timeout, the sender assumes the frame was
lost or corrupted and retransmits it.

Receiver's Role:

1. The receiver receives the data frame.

2. It checks the frame for errors (using techniques like CRC).

3. If the frame is error-free, the receiver sends an ACK to the sender.

4. If the frame contains errors, the receiver discards it.

Characteristics:

Simple and easy to implement.

Ensures that frames are delivered reliably.

Has a drawback of low efficiency, as the sender waits for the ACK before
sending the next frame, leading to underutilization of the network's
bandwidth.

Stop-and-Wait ARQ is suitable for low-error-rate and low-bandwidth networks. In


scenarios where higher efficiency and throughput are required, more advanced
ARQ techniques like Go-Back-N or Selective Repeat ARQ may be used.

Computer Networks 45
In summary, Data Link Control and Protocols, including flow control and error
control, are essential components of reliable data communication. Stop-and-Wait
ARQ is a simple yet effective error control protocol that ensures the successful
delivery of data frames with low overhead, making it suitable for specific network
scenarios.

Sliding Window Protocol, Go-Back-N ARQ, and


Selective Repeat ARQ
These are advanced communication techniques and protocols used in the Data
Link Layer to improve the efficiency of data transmission and error control. Let's
delve into each of them:

1. Sliding Window Protocol:

The Sliding Window Protocol is a flow control mechanism that allows for multiple,
unacknowledged frames to be in transit simultaneously. It is used to optimize
network efficiency by keeping the sender busy while ensuring that the receiver
processes data at its own pace. Key features include:

Computer Networks 46
Sender and Receiver Windows: The sender maintains a "sending window,"
which is a range of sequence numbers for frames that can be transmitted. The
receiver maintains a "receiving window," which is a range of sequence numbers
for frames it expects to receive.

Acknowledgments: The receiver sends cumulative acknowledgments to the


sender. For example, if the receiver acknowledges frame 5, it implicitly
acknowledges all frames up to 5.

Selective Repeat: Some implementations of the Sliding Window Protocol


employ a selective repeat mechanism, allowing the receiver to acknowledge
frames individually, rather than cumulatively.

Efficiency: Sliding Window increases network efficiency by allowing the sender


to have multiple unacknowledged frames in transit. This minimizes idle time and
optimizes bandwidth utilization.

2. Go-Back-N Automatic Repeat reQuest (ARQ):

Go-Back-N ARQ is an error control protocol that improves the efficiency of data
retransmission in cases of frame loss. Key characteristics include:

Computer Networks 47
Sender Behavior: The sender can transmit multiple frames before waiting for
acknowledgments. It maintains a send window of frames. If an acknowledgment
is not received for a particular frame, all subsequent frames in the window are
retransmitted, hence "Go Back" to the beginning of the window.

Receiver Behavior: The receiver acknowledges frames as they arrive.


However, it may discard out-of-sequence frames and only delivers frames to the
network layer in the correct order.

Efficiency: Go-Back-N is efficient for networks with a low error rate, as it


minimizes the impact of occasional lost frames.

3. Selective Repeat Automatic Repeat reQuest (ARQ):

Selective Repeat ARQ is another error control protocol, but it is more efficient in
handling errors than Go-Back-N. Key features include:

Sender Behavior: The sender can transmit multiple frames before waiting for
acknowledgments. It maintains a send window of frames. If an acknowledgment
is not received for a particular frame, only that frame is retransmitted, while the
rest continue to advance.

Computer Networks 48
Receiver Behavior: The receiver acknowledges frames as they arrive and
buffers out-of-sequence frames. Once missing frames are received, they are
delivered to the network layer in the correct order.

Efficiency: Selective Repeat is efficient in networks with a higher error rate, as


it only retransmits frames that were not successfully received.

Comparison:

Go-Back-N ARQ is suitable for networks with relatively low error rates and is
simpler to implement. However, it may lead to inefficiency in high-error
scenarios.

Selective Repeat ARQ is more efficient in networks with higher error rates, as it
avoids retransmitting frames unnecessarily.

Both Go-Back-N and Selective Repeat are used in various data link layer protocols,
including those in wireless communication and Ethernet networks, to improve
reliability and efficiency. The choice between them depends on the specific network
conditions and requirements.

High-Level Data Link Control (HDLC)

Computer Networks 49
High-Level Data Link Control (HDLC) is a widely used data link layer protocol that
standardizes the framing, addressing, and error-checking procedures for reliable
and efficient data transmission. HDLC is considered a foundation for many other
data link layer protocols. Here's an overview of HDLC:

1. Framing:

HDLC frames data for transmission. It uses a special flag sequence (01111110)
to delineate frames. This flag sequence helps identify the start and end of a
frame.

The frame structure includes fields for address, control, data, and error-
checking (FCS or Frame Check Sequence).

2. Addressing:

HDLC supports both point-to-point and multipoint communication. For point-to-


point communication, a single address field is used. For multipoint
communication, each station has its unique address.

Stations in a multipoint configuration listen to all traffic but only respond to


frames addressed to them.

3. Control Field:

The control field in an HDLC frame carries information about frame types, such
as data frames, acknowledgment frames, or supervisory frames (used for flow
control).

HDLC defines several frame types, including I-frames (Information frames), S-


frames (Supervisory frames), and U-frames (Unnumbered frames).

4. Error Checking:

HDLC uses the Frame Check Sequence (FCS) field to perform error checking.
A cyclic redundancy check (CRC) algorithm is often used to calculate the FCS.

The receiver checks the FCS to detect any errors in the received frame.

5. Flow Control:

Computer Networks 50
HDLC provides flow control mechanisms, allowing the sender to adjust the rate
of transmission based on the receiver's ability to process data.

Supervisory frames (S-frames) are used for flow control, including


acknowledgments, negative acknowledgments, and requests to send.

6. Modes of Operation:

HDLC operates in several modes, including Normal Response Mode (NRM),


Asynchronous Balanced Mode (ABM), and Asynchronous Unbalanced Mode
(AUM).

NRM is commonly used for point-to-point communication, while ABM is suitable


for multipoint communication.

7. Variants:

Several variants of HDLC exist, including SDLC (Synchronous Data Link


Control), LAPB (Link Access Procedure, Balanced), and LAPM (Link Access
Procedure for Modems).

SDLC is a proprietary version of HDLC developed by IBM and used in


mainframe environments.

Applications:

HDLC has been used in various applications, including wide-area networking


(WAN), Local Area Networks (LAN), and communication between devices within
a network.

Standardization:

HDLC is an ITU-T (formerly CCITT) standard, defined in recommendations like


X.25 and V.42. Variants and extensions of HDLC are used in a wide range of
network technologies.

HDLC's simplicity and robustness make it a foundation for various data link layer
protocols and a fundamental element in data communication and networking.

Computer Networks 51
Point-to-Point Access, PPP (Point-to-Point Protocol),
and PPP Stack
Point-to-Point (PPP) is a network protocol commonly used for establishing direct
connections between two network nodes, typically over serial communication links.
It's widely used in scenarios such as dial-up internet connections, serial connections
between routers, and more. Let's explore PPP and the PPP stack:

1. Point-to-Point Access:

Definition: Point-to-Point access refers to a network configuration where two


network devices communicate directly without the need for any intermediate
devices. It's a simple, dedicated connection between two endpoints.

Use Cases: Point-to-Point connections are common in scenarios like dial-up


connections between a user's computer and an Internet Service Provider (ISP),
dedicated lines connecting two routers, or serial communication between
devices in industrial applications.

2. PPP (Point-to-Point Protocol):

Definition: PPP is a widely used data link layer protocol for establishing and
maintaining direct connections between two nodes in a network. It offers a

Computer Networks 52
standard method for encapsulating and transmitting multi-protocol data over
point-to-point links.

Features:

Error Detection: PPP includes error-checking mechanisms like CRC to


ensure data integrity.

Authentication: It provides various methods for authenticating the two


endpoints, such as PAP (Password Authentication Protocol) and CHAP
(Challenge Handshake Authentication Protocol).

Multi-Protocol Support: PPP can transmit multiple network layer


protocols, making it versatile for various types of traffic.

Network Layer Negotiation: PPP allows both endpoints to negotiate and


agree on the network layer protocol to be used, such as IP, IPv6, or IPX.

3. PPP Stack:

The PPP stack refers to the layered structure of protocols and components
involved in PPP communications. It consists of the following layers:

PPP Frame: The PPP frame is the basic unit of data transfer. It includes
flags for frame delineation, control information, data, and error-checking
(CRC).

Link Control Protocol (LCP): LCP is responsible for establishing,


configuring, and testing the data link connection. It negotiates options and
parameters for the link, including authentication and error detection
protocols.

Authentication Protocols: PPP supports various authentication protocols,


including PAP (Password Authentication Protocol) and CHAP (Challenge
Handshake Authentication Protocol), which can be used for authenticating
the endpoints.

Network Control Protocols (NCPs): NCPs are used to configure and


manage network layer protocols. For example, the Internet Protocol Control
Protocol (IPCP) is used to negotiate IP address and related parameters.

Computer Networks 53
The PPP stack operates on the data link layer (Layer 2) of the OSI model,
allowing it to work with various network layer protocols (Layer 3), such as IP,
IPv6, and IPX.

In addition to the core components, PPP can also include security features,
quality of service (QoS) settings, and other options to meet the specific
requirements of the network connection.

PPP is a versatile and widely used protocol for point-to-point connections, offering
flexibility and reliability for various applications, including dial-up networking, serial
connections between routers, and more. The PPP stack defines a standardized
structure for establishing and maintaining these connections while supporting
multiple network layer protocols.

ppp phase: https://www.geeksforgeeks.org/point-to-point-protocol-ppp-phase-


diagram/

Medium Access Sublayer: Channel Allocation


Problem

Computer Networks 54
The Medium Access Control (MAC) sublayer is part of the Data Link Layer and is
responsible for managing access to the shared communication medium in a
network. One of the critical challenges it addresses is the Channel Allocation
Problem, which involves deciding how devices share the communication channel
efficiently. This problem is particularly relevant in shared media networks, such as
Ethernet or wireless LANs. Here's an overview:

1. Channel Allocation Problem:

In shared media networks, multiple devices share a common communication


channel, and they need a mechanism to avoid interference, collisions, and
congestion. The Channel Allocation Problem addresses how devices decide
when and how to access the channel.

2. Methods for Channel Allocation:

There are various methods for solving the Channel Allocation Problem:

1. Contention-Based Access:

Carrier Sense Multiple Access (CSMA): Devices listen to the channel and
wait for it to be idle before transmitting. If multiple devices sense an idle
channel simultaneously, they may contend to transmit. CSMA is used in
Ethernet networks.

CSMA/CD (Carrier Sense Multiple Access with Collision Detection):


Used in older Ethernet networks, devices can detect collisions and take
action to resolve them.

CSMA/CA (Carrier Sense Multiple Access with Collision Avoidance):


Used in wireless networks, devices try to avoid collisions by using
mechanisms like Request-to-Send (RTS) and Clear-to-Send (CTS) before
transmitting.

2. Controlled Access:

Time Division Multiple Access (TDMA): Devices are allocated specific


time slots during which they can transmit. This is common in cellular
networks.

Computer Networks 55
Frequency Division Multiple Access (FDMA): Devices are assigned
specific frequency bands to use for communication. It's used in some radio
and satellite networks.

3. Polling:

In a polling-based approach, a central device (e.g., a master station)


controls access to the channel and polls individual devices, allowing them
to transmit when it's their turn.

4. Reservation-Based:

Devices request reservations for specific time slots or frequency bands, and
the central authority grants or denies these requests. Used in some satellite
and wireless networks.

3. Challenges:

The Channel Allocation Problem poses several challenges:

Efficiency: The method chosen must ensure efficient use of the channel and
minimize idle time while avoiding excessive collisions.

Fairness: Fair allocation is essential to ensure that no device dominates the


channel, and all devices get a chance to transmit.

Scalability: The method should scale well with an increasing number of devices
on the network.

Collision Avoidance: Techniques like CSMA/CA aim to prevent collisions and


retransmissions that can reduce efficiency.

Quality of Service (QoS): In some networks, it's crucial to prioritize certain


types of traffic, so the channel allocation method must accommodate QoS
requirements.

The choice of channel allocation method depends on the specific network type,
requirements, and technologies in use. Different network technologies use various
combinations of these methods to manage the channel efficiently and provide
reliable communication.

Computer Networks 56
Controlled Access in Network Communication
Controlled access is a method of channel allocation used in network
communication. It involves a controlled, organized approach to determining which
devices on a network are allowed to transmit data at any given time. Unlike
contention-based methods like Carrier Sense Multiple Access (CSMA), where
devices contend for access to the medium, controlled access methods rely on
predefined schedules or controlled mechanisms for device access. One of the most
common examples of controlled access is Time Division Multiple Access (TDMA).

Time Division Multiple Access (TDMA):

Definition: TDMA is a controlled access method used in both wired and


wireless networks. It divides the communication channel into time slots or
frames, and devices are allocated specific time slots during which they can
transmit data.

Operation:

The channel is divided into a series of time slots or frames.

Each device is assigned a dedicated time slot within the frame.

Devices can transmit their data exclusively during their allocated time slots.

Devices wait for their specific time slot to send data and avoid transmitting
outside of their allocated time.

Advantages:

Predictable: TDMA provides a predictable schedule for device access,


reducing collisions and ensuring each device gets its turn to transmit.

Efficient: TDMA allows devices to utilize the channel fully, and there is no
contention for access.

Suitable for Real-Time Applications: TDMA is ideal for time-sensitive


applications, such as voice communication in cellular networks.

Applications:

Computer Networks 57
TDMA is commonly used in various wireless communication systems,
including cellular networks (2G, 3G, and 4G), satellite communication, and
some radio systems. It's also used in some wired communication systems.

Frequency Division Multiple Access (FDMA):

Definition: FDMA is another controlled access method used in network


communication. Instead of dividing the channel into time slots, FDMA divides it
into frequency bands. Each device is assigned a specific frequency band for its
transmissions.

Operation:

The channel's frequency spectrum is divided into multiple bands or


channels.

Each device is assigned a specific frequency band.

Devices transmit their data within their allocated frequency band.

There is no contention for the channel because devices are assigned


separate frequency bands.

Advantages:

Non-Interfering: FDMA ensures that devices do not interfere with each other
because they have their dedicated frequency bands.

Used in Radio and Satellite Communication: FDMA is commonly used in


radio communication and some satellite communication systems.

Controlled access methods like TDMA and FDMA are employed in scenarios where
predictable and organized access to the communication channel is required. These
methods help manage network traffic efficiently and minimize the chances of
collisions and interference, making them suitable for various applications in both
wired and wireless communication.

Channelization in Network Communication


Channelization is a technique used in network communication to divide a
communication medium into multiple, smaller, independent channels. Each channel

Computer Networks 58
operates as a separate communication path, allowing multiple devices or
conversations to occur simultaneously without interference. Channelization is
particularly relevant in scenarios where shared communication mediums need to
accommodate various data streams efficiently. There are various methods and
approaches to channelization:

1. Frequency Division Multiplexing (FDM):

Definition: FDM is a channelization technique that divides a


communication medium, typically a frequency band or spectrum, into
multiple sub-channels, each allocated to a different user or data stream.

Operation: Each channel in FDM is allocated a specific range of


frequencies. Devices or signals are assigned to individual sub-channels
based on their frequency range. This technique is widely used in cable
television and radio broadcasting.

Advantages: Efficient use of the available bandwidth, each sub-channel


operates independently, and multiple users or data streams can coexist
without interference.

2. Time Division Multiplexing (TDM):

Definition: TDM is a channelization technique that divides the


communication medium into time slots. Each channel or user is allocated a
specific time slot during which it can transmit data.

Operation: Time slots are cyclically allocated to different users or data


streams. In a TDM frame, each user's data is transmitted during their
designated time slot. TDM is commonly used in digital telephony (e.g., T1
and E1 lines).

Advantages: Efficient utilization of time slots, predictable schedule for


device access, and low chance of interference among users.

3. Code Division Multiple Access (CDMA):

Definition: CDMA is a channelization technique used in wireless


communication. Instead of dividing the communication medium by
frequency or time, CDMA assigns a unique code to each user or device.

Computer Networks 59
Operation: Each user's data is transmitted using a unique spreading code.
These codes are designed to be orthogonal, allowing multiple signals to
coexist in the same frequency range without significant interference. CDMA
is commonly used in 3G and 4G cellular networks.

Advantages: Efficient use of available bandwidth, high capacity, and


robustness against interference.

4. Wavelength Division Multiplexing (WDM):

Definition: WDM is a channelization technique used in optical fiber


communication. It divides the optical spectrum into multiple wavelength
channels, allowing multiple data streams to be transmitted simultaneously.

Operation: Each wavelength channel is allocated to a different data


stream. Devices and signals are assigned to specific wavelength channels
for transmission. WDM is used in high-speed optical networks.

Advantages: Efficient use of optical bandwidth, enabling high-speed data


transmission.

Channelization allows network designers to efficiently allocate resources and share


communication mediums among multiple users or data streams. The choice of
channelization method depends on the specific application, the medium being used,
and the communication requirements.

Multiple Access Protocols in Network


Communication
Multiple Access Protocols are used to manage how multiple devices or users share
a common communication medium, such as a network channel or a wireless
frequency band. These protocols determine how devices access the medium, avoid
collisions, and ensure efficient data transmission. There are several multiple access
methods, each with its own characteristics and applications:

1. Carrier Sense Multiple Access (CSMA):

CSMA: In CSMA, devices listen to the medium to check if it's idle before
transmitting. If the medium is busy, they wait until it's clear. CSMA can be

Computer Networks 60
divided into several variants:

CSMA/CD (Carrier Sense Multiple Access with Collision


Detection): Used in Ethernet networks, devices listen for collisions
while transmitting and can detect them to take appropriate action.

CSMA/CA (Carrier Sense Multiple Access with Collision


Avoidance): Common in wireless networks, this method attempts to
reduce collisions by using mechanisms like Request-to-Send (RTS) and
Clear-to-Send (CTS) before transmitting.

Advantages: Simple and widely used. It allows devices to share the


medium without colliding, which reduces data loss.

2. Time Division Multiple Access (TDMA):

TDMA: TDMA divides the medium into time slots, with each device
allocated a specific time slot during which they can transmit. This is
common in cellular networks.

Advantages: Predictable and efficient. Devices have dedicated time slots,


which minimizes contention and collisions.

3. Frequency Division Multiple Access (FDMA):

FDMA: FDMA divides the medium into frequency bands, and each device is
assigned a specific frequency band for transmission. This is used in some
radio and satellite networks.

Advantages: Non-interfering. Devices do not share the same frequencies,


reducing the chance of collisions.

4. Code Division Multiple Access (CDMA):

CDMA: CDMA assigns a unique code to each device, allowing them to


transmit simultaneously over the same frequency. This is common in 3G
and 4G cellular networks.

Advantages: Efficient use of bandwidth, high capacity, and robustness


against interference.

5. Token Passing:

Computer Networks 61
Token Passing: In this method, devices take turns to transmit data by
passing a token from one device to the next. Only the device holding the
token is allowed to transmit.

Advantages: Ensures fair access and avoids collisions. Common in token


ring networks.

6. Polling:

Polling: A central device (e.g., a master station) controls device access.


The central device polls individual devices and grants them permission to
transmit.

Advantages: Predictable and controlled access. Useful in scenarios where


a central authority manages device access.

7. Random Access:

Random Access: In this category, protocols like ALOHA and its variants
allow devices to transmit data at random times. Devices monitor the
medium for collisions and retransmit if necessary.

Advantages: Simple and suitable for low-traffic scenarios. However, it can


lead to higher collision rates.

The choice of a multiple access protocol depends on factors such as the network
type, technology, traffic patterns, and requirements. Each protocol has its strengths
and weaknesses, making it suitable for specific scenarios. Network designers select
the most appropriate protocol to optimize network performance and reliability.

IEEE Standards for LANs and WLANs: 802.3


(Ethernet) and 802.11 (Wi-Fi)
The Institute of Electrical and Electronics Engineers (IEEE) has developed several
standards for Local Area Networks (LANs) and Wireless Local Area Networks
(WLANs) to ensure interoperability and efficient communication. Two of the most
significant IEEE standards in this context are IEEE 802.3 (commonly known as
Ethernet) for wired LANs and IEEE 802.11 (commonly known as Wi-Fi) for wireless
LANs. Here's an overview of these standards:

Computer Networks 62
IEEE 802.3 (Ethernet) for LANs:

1. Definition: IEEE 802.3, commonly referred to as Ethernet, is the most widely


used LAN technology for wired network communication. It defines the physical
and data link layers of the OSI model and is known for its reliability and
simplicity.

2. Key Features:

CSMA/CD: Ethernet initially used Carrier Sense Multiple Access with


Collision Detection (CSMA/CD) as its access method. However, modern
Ethernet networks, such as Gigabit Ethernet and 10 Gigabit Ethernet,
typically use full-duplex communication without collision detection.

Data Link Layer: Ethernet operates at the Data Link Layer (Layer 2) of the
OSI model and uses MAC (Media Access Control) addresses to identify
devices on the network.

Copper and Fiber: Ethernet supports various physical media, including


twisted-pair copper cables (e.g., Cat 5, Cat 6) and fiber optics.

Frame Format: Ethernet frames contain source and destination MAC


addresses, a type field specifying the upper-layer protocol (e.g., IPv4, IPv6),
and the data payload.

3. Variants:

10/100/1000/10G/25G/40G/100G Ethernet: Ethernet has evolved to


support various speeds, including 10 Mbps, 100 Mbps, 1 Gbps, 10 Gbps,
and even higher data rates.

Ethernet Switching: Ethernet switches are common in modern networks,


providing high-speed, collision-free communication by learning and
forwarding frames based on MAC addresses.

IEEE 802.11 (Wi-Fi) for WLANs:

1. Definition: IEEE 802.11, commonly referred to as Wi-Fi, is the standard for


wireless LANs. It defines how devices communicate over radio frequencies

Computer Networks 63
without the need for physical cables. Wi-Fi enables wireless Internet access,
networking, and device connectivity.

2. Key Features:

Wireless Communication: Wi-Fi uses radio waves to transmit data


between devices. It operates in unlicensed frequency bands, such as 2.4
GHz and 5 GHz.

WLAN Configuration: Wi-Fi networks typically consist of Access Points


(APs) that provide wireless connectivity to client devices like laptops,
smartphones, and IoT devices.

Security Features: Wi-Fi standards include various security protocols,


such as WEP, WPA, and WPA2/WPA3, to protect the network from
unauthorized access.

Multiple Standards: IEEE 802.11 has evolved with multiple amendments


(e.g., 802.11b, 802.11g, 802.11n, 802.11ac, and 802.11ax) to improve data
rates, range, and network efficiency.

3. Variants:

Wi-Fi 4 (802.11n): Introduced MIMO (Multiple-Input Multiple-Output)


technology for improved performance.

Wi-Fi 5 (802.11ac): Enhanced speed and performance, including support


for multi-user MIMO (MU-MIMO).

Wi-Fi 6 (802.11ax): Provides higher data rates, lower latency, and better
performance in congested environments.

Wi-Fi 6E: An extension of Wi-Fi 6 that utilizes the 6 GHz band for even
greater capacity and less interference.

Both IEEE 802.3 (Ethernet) and IEEE 802.11 (Wi-Fi) are integral to modern
networking, offering wired and wireless solutions to cater to a wide range of
networking needs. The choice between them depends on factors like network
design, coverage area, and device mobility.

Computer Networks 64
high‐speed LANs
High-speed LANs (Local Area Networks) refer to networking environments that are
designed to provide fast data transmission rates within a limited geographical area,
typically within a building, campus, or data center. These networks are crucial for
supporting the increasing demands for bandwidth and performance, particularly in
businesses and organizations. High-speed LANs are characterized by their ability to
handle large volumes of data, support multiple users, and ensure low latency. Here
are some key aspects and technologies associated with high-speed LANs:

1. Ethernet: High-speed LANs often rely on Ethernet technology, which has


evolved to offer various speeds, including 1 Gigabit Ethernet (1 GbE), 10
Gigabit Ethernet (10 GbE), 25 Gigabit Ethernet (25 GbE), 40 Gigabit Ethernet
(40 GbE), and 100 Gigabit Ethernet (100 GbE). These high-speed Ethernet
variants allow for efficient data transfer within LAN environments.

2. Fiber Optic Cabling: To achieve high data rates, many high-speed LANs use
fiber optic cabling. Fiber optics can transmit data at very high speeds and over
longer distances compared to traditional copper cabling.

3. Switching: Switches are fundamental components in high-speed LANs. They


provide intelligent traffic management and ensure that data is forwarded only to
the appropriate destination, reducing collision and enhancing network
performance.

4. Virtual LANs (VLANs): VLANs are used to segment LANs into multiple logical
networks, enabling improved network organization and security. They are
essential in larger high-speed LANs.

5. Quality of Service (QoS): QoS mechanisms are employed to prioritize specific


types of network traffic, ensuring that time-sensitive data, like voice and video,
receive the necessary bandwidth and low latency.

6. Wireless LANs (Wi-Fi): While Wi-Fi is often associated with wireless networks,
it can also provide high-speed LAN connectivity when using technologies like
Wi-Fi 5 (802.11ac) and Wi-Fi 6 (802.11ax). These standards offer increased
data rates and improved network capacity.

Computer Networks 65
7. Network Management: High-speed LANs require robust network management
tools to monitor, optimize, and troubleshoot network performance. Network
management solutions help ensure smooth operation and minimize downtime.

8. Redundancy: Redundant components and failover mechanisms are often


implemented in high-speed LANs to enhance reliability and fault tolerance. This
ensures that network outages are minimized, critical for business-critical
applications.

9. Jumbo Frames: Some high-speed LANs make use of jumbo frames, which are
larger than standard Ethernet frames. Jumbo frames can reduce overhead and
improve data transfer efficiency.

10. 10GBASE-T: This is a high-speed Ethernet standard that uses copper cabling
(like Cat 6a or Cat 7) to support 10 Gbps data rates. It's commonly used for
high-speed LANs in data centers and enterprise networks.

11. Data Center LANs: High-speed LANs are especially prevalent in data centers,
where massive amounts of data need to be efficiently managed and
transmitted. Technologies like 100 Gigabit Ethernet (100 GbE) are often used to
meet these demands.

High-speed LANs play a crucial role in supporting the growing demands of


businesses and organizations for fast and reliable data transfer within their local
environments. These networks are designed to ensure that data-intensive
applications, cloud services, and multimedia content can be accessed and
transmitted with minimal delay and high performance.

Token Ring and Token Bus


Token Ring and Token Bus are two older network technologies that were used for
local area networks (LANs) in the past. They are based on the concept of token
passing, which is a method for controlling access to the network medium. Here's an
overview of both:

Token Ring:

Definition: Token Ring is a LAN technology where devices are connected in a


physical ring or star-wired ring topology. A token is continuously circulated

Computer Networks 66
around the network, and a device can only transmit data when it holds the
token.

Operation:

Devices are connected in a physical ring, but the actual data transmission
can occur in a star-wired configuration.

A token, a special data packet, circulates on the network. Only the device
holding the token can transmit data.

When a device completes its transmission, it releases the token, allowing


the next device in the ring to access the network.

Advantages:

Predictable access: Since devices must wait for the token to transmit,
collisions are minimized.

Fairness: Token Ring provides fair access to all devices on the network.

Reliability: It is known for its reliability, as it eliminates the possibility of data


collisions.

Disadvantages:

Slower adoption: Token Ring had slower adoption compared to Ethernet.

More complex cabling: Setting up a physical ring network could be more


complex than Ethernet's star topology.

Limited scalability: Token Ring networks had limitations in terms of


scalability.

Token Bus:

Definition: Token Bus is another LAN technology where devices are connected
in a linear bus topology. Like Token Ring, a token is used to control access to
the network.

Operation:

Devices are connected in a linear bus topology.

Computer Networks 67
A token is circulated along the bus, and only the device with the token can
transmit data.

When a device is done transmitting, it releases the token, allowing the next
device on the bus to access the network.

Advantages:

Simple cabling: Token Bus used a simpler linear bus topology compared to
the ring.

Predictable access: Collisions are minimized since devices must wait for
the token.

Disadvantages:

Slower adoption: Token Bus had limited adoption and was largely
overshadowed by Ethernet.

Limited scalability: Like Token Ring, Token Bus had limitations in terms of
scalability.

Lack of flexibility: The linear bus topology made it less flexible for network
expansion.

Both Token Ring and Token Bus were early attempts to address the problem of
medium access control in LANs. However, they were largely superseded by
Ethernet, which offered higher speeds and easier scalability. Ethernet's dominant
position in the LAN market led to its widespread adoption, while Token Ring and
Token Bus became less common over time.

Token Bus network is a standard in which tokens are passed along a virtual ring. In
the token bus network bus topology is used as physical media.

In this, the virtual ring is created with stations and therefore tokens are
subsequently passed from a station during a sequence with this virtual ring. Every
station or node in the token bus network knows the address of its predecessor
station and its successor station. A node (station) can transmit the data if and only if
it has a token. Its working rule is analogous to the token ring network.

Computer Networks 68
Token Bus

Token Ring is defined by the IEEE 802.5 standard. In the token ring network, the
token is passed over a physical ring instead of a virtual ring.

In this, a token is a special frame and a station can transmit the data frame if and
only if it has a token. And The tokens are issued on successful receipt of the data
frame.

Computer Networks 69
Token Ring

comparison between Token Bus and Token Ring networks:

S. No. Token Bus Network Token Ring Network

While in the token ring network, the


In the token bus network, the token
1. token is passed over a physical
is passed along a virtual ring.
ring.

The token bus network is simply While the token ring network is
2.
designed for large factories. designed for offices.

While the token ring network is


The token bus network is defined by
3. defined by the IEEE 802.5
the IEEE 802.4 standard.
standard.

While the token ring network does


Token bus network provides better
4. not provide better bandwidth as
bandwidth.
compared to the token bus.

In a token bus network, Bus While in token ring network, Star


5.
topology is used. topology is used.

6. The maximum time it takes to reach While the maximum time to reach
the last station in a token bus the last station in the token ring

Computer Networks 70
network cannot be calculated. network can be calculated.

In a token bus network, coaxial In token ring network, twisted pair


7.
cable is used. and fiber optic are used.

In a token bus network, the cable In a token ring network, the cable
8.
length is 200m to 500m. length is 50m to 1000m.

In a token ring network, a


In token bus network, distributed
9. designated monitor station
algorithms provide maintenance.
performs station maintenance.

The priority handling mechanism is The priority handling mechanism is


not associated with the associated with the transmission of
10.
transmission of data through data through workstations with this
workstations with this network. network.

These networks are not much


11. These networks are reliable.
reliable.

12. It does not keep routing details. It keeps the information of routing.

The network is less expensive


13. compared to the Token Ring It is expensive.
network.

Fiber Distributed Data Interface (FDDI)-Based LAN


Fiber Distributed Data Interface (FDDI) is a high-speed, robust, and reliable
technology used for building local area networks (LANs) and metropolitan area
networks (MANs). FDDI is particularly well-suited for environments where high data
transfer rates, fault tolerance, and redundancy are crucial. Here's an overview of
FDDI-based LANs:

1. Topology:

FDDI LANs are typically configured in a dual-ring topology. This means that
data travels in two counter-rotating rings, providing redundancy and fault
tolerance. If a break in one ring occurs, the network can still operate on the
other.

2. Data Rates:

Computer Networks 71
FDDI supports data transfer rates of 100 Mbps (megabits per second),
making it significantly faster than traditional Ethernet LANs.

3. Media:

FDDI networks use fiber optic cabling, which provides high bandwidth and
is immune to electromagnetic interference. This makes FDDI well-suited for
environments where reliability is essential.

4. Token Passing:

Similar to Token Ring, FDDI networks use token passing to control access
to the network. A token is passed between devices, and only the device
holding the token can transmit data.

5. Fault Tolerance:

FDDI is known for its built-in fault tolerance. In the event of a cable break or
other failure, the network can continue to operate by using the secondary
ring. This redundancy is essential for applications that require high
availability.

6. Management:

FDDI networks typically include management features for monitoring the


health of the network and identifying and isolating faults.

7. Standards:

FDDI is standardized by the American National Standards Institute (ANSI)


and the International Organization for Standardization (ISO).

8. Applications:

FDDI LANs are often used in critical applications such as data centers,
financial institutions, and other environments where network reliability and
high-speed data transfer are essential.

9. Data Link Layer:

FDDI operates at the data link layer (Layer 2) of the OSI model and uses
MAC (Media Access Control) addresses for device identification.

Computer Networks 72
10. Legacy Technology:

While FDDI was once a popular LAN technology, it has largely been
replaced by Ethernet in most modern LAN environments due to Ethernet's
widespread adoption and cost-effectiveness.

FDDI-based LANs are a prime example of how technology has evolved to meet the
demands of specific applications and industries. While they are no longer as
commonly deployed in new installations, FDDI networks continue to operate in
certain environments where high reliability and fault tolerance are critical.

Network Devices: Repeaters, Hubs, Switches, and


Bridges
These network devices play essential roles in connecting and managing data traffic
within a local area network (LAN). Each device has specific features and functions
that impact the efficiency and performance of the network. Let's explore them in
detail:

1. Repeater:

Function: A repeater is a simple device that operates at the physical layer


of the OSI model. It amplifies and regenerates data signals before sending

Computer Networks 73
them to the next segment of a network. Its primary function is to extend the
range of a network by boosting signal strength.

Use Cases:

Extending Cable Length: Repeaters are used to extend the maximum


cable length in a network, especially in Ethernet networks where cable
length limitations exist.

Reducing Signal Loss: They help overcome signal attenuation in long


cable runs.

2. Hub:

Function: A hub, also known as a network hub or Ethernet hub, operates at


the physical layer of the OSI model. It's a central connecting point for
multiple network devices. Unlike a switch, a hub does not intelligently
manage traffic. Instead, it broadcasts data to all devices connected to it.

Use Cases:

Small Networks: Hubs are suitable for small networks with minimal data
traffic.

Monitoring and Packet Capture: They are used for network monitoring
and packet capture, where all network traffic is required to be visible.

3. Switch:

Function: A switch operates at the data link layer (Layer 2) of the OSI
model. It intelligently forwards data to the specific device on the network by
using MAC addresses. Switches are more efficient than hubs because they
don't broadcast data to all devices. Instead, they create a MAC address
table to make forwarding decisions.

Use Cases:

Larger Networks: Switches are used in larger networks with multiple


devices due to their efficiency.

Reduced Network Congestion: They minimize network congestion by


only sending data to the intended recipient.

Computer Networks 74
VLAN Support: Switches often support virtual LANs (VLANs) to logically
segment a network.

4. Bridge:

Function: A bridge operates at the data link layer (Layer 2) and is used to
connect and filter traffic between two or more network segments. It is
primarily used to divide a network into smaller segments to reduce
broadcast domains and improve network performance.

Use Cases:

Segmenting a Network: Bridges are used to divide large networks into


segments to control traffic and reduce collision domains.

Isolating Network Issues: They help isolate network issues by


preventing broadcast storms from spreading to other segments.

In summary:

Repeater: Extends network range by amplifying and regenerating signals.


Typically used for long cable runs.

Hub: Central connecting point for devices in a network. Broadcasts data to all
connected devices. Suitable for small networks or monitoring purposes.

Switch: Efficiently forwards data to specific devices using MAC addresses.


Ideal for larger networks and critical for reducing network congestion.

Bridge: Connects and filters traffic between network segments. Segmenting


networks and isolating network issues are its primary functions.

In modern networks, switches are the most common and essential devices for
managing LAN traffic efficiently, while repeaters and hubs are less commonly used
due to their limited capabilities. Bridges are still relevant in certain scenarios where
network segmentation is necessary.

Unit-3

Computer Networks 75
Network Layer:
The network layer is the third layer of the OSI model and is primarily responsible for
the transportation of data packets from the source to the destination across various
interconnected networks. Its key functions include routing, logical addressing, and
fragmentation & reassembly.

Functions of the Network Layer:


1. Logical Addressing:

Provides a unique logical address to devices in the network.

IP addresses are the most common example of logical addresses used in


the Internet Protocol (IP).

2. Routing:

Determines the best path for data packets to reach their destination.

Routers utilize routing algorithms to make forwarding decisions based on


logical addresses.

3. Fragmentation and Reassembly:

Breaks down large packets into smaller fragments if needed for


transmission.

At the receiving end, it reassembles these fragments to reconstruct the


original packet.

4. Congestion Control:

Manages the flow of data traffic to avoid network congestion.

Various algorithms and techniques are employed to regulate the flow of


packets.

Protocols and Devices at the Network Layer:


1. Internet Protocol (IP):

Computer Networks 76
The primary protocol at the network layer responsible for addressing and
routing packets across networks.

IPv4 and IPv6 are the two versions of the Internet Protocol.

2. Routing Protocols:

Examples include RIP (Routing Information Protocol), OSPF (Open


Shortest Path First), and BGP (Border Gateway Protocol), used by routers
to determine the best paths for data transmission.

3. Devices:

Router: Operates at the network layer and connects different networks


together by forwarding packets based on their IP addresses.

Layer 3 Switch: Combines the functions of a router and a switch, making


forwarding decisions based on IP addresses.

Network Layer: Design Issues:


Design issues at the network layer focus on addressing various challenges and
optimizing the functioning of this layer in a network. Some key design issues
include:

1. Routing Algorithms:

Designing efficient algorithms for routing packets through complex networks


considering factors like shortest path, load balancing, and network
congestion.

2. Congestion Control:

Strategies to manage and alleviate congestion within the network, ensuring


smooth data flow.

3. Quality of Service (QoS):

Implementing mechanisms to prioritize certain types of traffic (voice, video,


data) to ensure consistent and reliable service.

4. Security:

Computer Networks 77
Designing protocols and mechanisms to secure data transmission and
prevent unauthorized access or attacks at the network layer.

5. IPv4 to IPv6 Transition:

Strategies for the migration from IPv4 to IPv6 to accommodate the


increasing number of devices and address the limitations of IPv4's address
space.

6. Scalability:

Creating networks that can easily expand to accommodate growth in the


number of devices and users without compromising performance.

Routing Algorithms:
Routing algorithms are fundamental to the network layer, determining the paths data
packets take from a source to their destination across interconnected networks.
Several types of routing algorithms exist, each with unique characteristics and
applications:

1. Distance Vector Routing:

Example: Routing Information Protocol (RIP)

Each router maintains a table with the distance (number of hops) to reach
all destinations.

Periodically exchanges routing tables with neighboring routers.

Simple and easy to implement but may result in slow convergence and
routing loops.

2. Link-State Routing:

Example: Open Shortest Path First (OSPF)

Routers create a detailed map of the network's topology by exchanging link-


state packets.

Uses Dijkstra's algorithm to compute the shortest path to each destination.

Computer Networks 78
Efficient and provides faster convergence, but requires more memory and
processing power.

3. Path Vector Routing:

Example: Border Gateway Protocol (BGP)

Similar to distance vector but includes additional information like policy and
path attributes.

Used in inter-domain routing on the internet.

4. Hierarchical Routing:

Divides the network into smaller, manageable groups to minimize routing


table size.

Reduces overhead in large networks by summarizing routes within specific


regions.

5. Adaptive Routing:

Adjusts dynamically to network conditions by considering factors like


congestion, link failures, and traffic load.

Examples include algorithms based on neural networks or machine


learning.

6. Static Routing:

Manual configuration of routing tables by network administrators.

Suitable for small networks with simple topologies but lacks adaptability.

Congestion Control Algorithms:


Congestion control algorithms manage network congestion, ensuring optimal
performance by regulating the flow of data and preventing packet loss. Some key
algorithms and mechanisms include:

1. Additive Increase Multiplicative Decrease (AIMD):

Used in TCP (Transmission Control Protocol) congestion control.

Computer Networks 79
Increases the congestion window by a small amount on successful
transmission and decreases it significantly upon congestion detection.

2. Random Early Detection (RED):

Active queue management algorithm used in routers.

Monitors queue lengths and selectively drops packets before the queue
becomes congested, preventing a sudden burst of congestion.

3. Explicit Congestion Notification (ECN):

Allows routers to notify endpoints about congestion by setting a bit in the


packet header.

Endpoints respond by reducing transmission rates without waiting for


packet loss indications.

4. Controlled Delay (CoDel):

Designed to maintain low latency by managing queuing delays.

Monitors packet queuing delays and drops packets if the queue delay
exceeds a threshold.

5. Quality of Service (QoS) mechanisms:

Prioritizes certain types of traffic to ensure better service for critical data,
like voice or video.

Uses mechanisms like Traffic Shaping, Weighted Fair Queuing (WFQ), or


Differentiated Services (DiffServ).

6. Buffer Management:

Efficient management of buffer space in routers to prevent overflow and


subsequent congestion.

Host-to-Host Delivery:
Host-to-host delivery refers to the process of transmitting data from one device
(host) to another across a network. It involves several interconnected layers and
protocols working together to ensure successful communication.

Computer Networks 80
Internetworking:
Internetworking refers to the concept of connecting multiple networks to enable
communication between devices or hosts that are part of different networks. This is
achieved through the use of devices like routers and switches that operate at the
network layer (Layer 3 of the OSI model) to forward data packets between
networks.

Routers: These devices connect different networks and determine the best
path for data packets to travel from the source to the destination. They use
routing tables and algorithms to make forwarding decisions based on logical
addresses (such as IP addresses).

Switches: Operate at Layer 2 (Data Link Layer) and forward data within a
single network based on MAC addresses. They help in creating and maintaining
local area networks (LANs).

Addressing:
Addressing in networking involves assigning unique identifiers to devices to
facilitate communication. At the network layer, IP addresses are used for addressing
hosts on a network. There are two primary versions of IP addresses:

IPv4 (Internet Protocol version 4): Uses a 32-bit address expressed in


decimal format (e.g., 192.168.0.1).

IPv6 (Internet Protocol version 6): Uses a 128-bit address expressed in


hexadecimal format (e.g., 2001:0db8:85a3:0000:0000:8a2e:0370:7334).

IP addresses help routers and other networking devices to correctly route data
packets to their intended destinations across interconnected networks.

Routing:
Routing is the process of determining the best path for data packets to reach their
destination. It involves various routing algorithms and protocols, such as:

Interior Gateway Protocols (IGPs): Used within an autonomous system (e.g.,


OSPF and RIP).

Computer Networks 81
Exterior Gateway Protocols (EGPs): Used between different autonomous
systems (e.g., BGP).

Routing decisions are based on factors like network topology, hop counts, link
costs, and quality of service requirements.

Summary:
Host-to-host delivery involves transmitting data across interconnected networks.

Internetworking employs routers and switches to connect and facilitate


communication between different networks.

Addressing involves assigning unique identifiers (IP addresses) to devices.

Routing determines the best path for data packets to travel through
interconnected networks.

Understanding internetworking, addressing, and routing is essential for designing,


managing, and troubleshooting complex networks to ensure efficient and reliable
communication between hosts across the internet.

Classful IP Addressing:
In the classful addressing scheme, IP addresses were divided into predefined
classes: A, B, C, D, and E.

Classes of IP Addresses:
1. Class A:

Range: 1.0.0.0 to 126.0.0.0

First octet (8 bits) reserved for the network address, and the next three
octets for hosts.

Supports a large number of networks, each with a large number of hosts.

Example: 10.0.0.0, 126.0.0.0

2. Class B:

Computer Networks 82
Range: 128.0.0.0 to 191.255.0.0

First two octets (16 bits) reserved for the network address, and the next two
octets for hosts.

Supports a moderate number of networks with a moderate number of hosts.

Example: 172.16.0.0, 191.255.0.0

3. Class C:

Range: 192.0.0.0 to 223.255.255.0

First three octets (24 bits) reserved for the network address, and the last
octet for hosts.

Supports a large number of networks with a small number of hosts per


network.

Example: 192.168.0.0, 223.255.255.0

4. Class D:

Range: 224.0.0.0 to 239.255.255.255

Reserved for multicast addressing.

Not used for defining network or host addresses.

5. Class E:

Range: 240.0.0.0 to 255.255.255.255

Reserved for future or experimental use.

Not used for defining network or host addresses.

Classful addressing had limitations in efficiently utilizing IP address space and did
not account for varying network size requirements, leading to IP address exhaustion
and inefficient allocation of address blocks.

Classless Inter-Domain Routing (CIDR) - Classless


Addressing:

Computer Networks 83
CIDR introduced a more flexible approach to IP addressing, allowing variable-length
subnet masking (VLSM) and supernetting to efficiently allocate IP addresses and
subnetting.

Features of CIDR:
1. Prefix Notation:

Represented as IP address followed by a forward slash and the number of


network bits (e.g., 192.168.1.0/24).

The notation specifies the network portion and the remaining bits for hosts.

2. Variable-Length Subnet Masks (VLSM):

Allows subnet masks of varying lengths within a single network address


space.

Enables more efficient allocation of IP addresses to different-sized


networks.

3. Supernetting:

Aggregates multiple contiguous network addresses into a single address


range.

Reduces the size of routing tables and enhances routing efficiency.

CIDR significantly improved address space utilization, enhanced routing efficiency,


and facilitated the allocation of IP addresses based on the actual requirements of
networks.

Subnet
A subnet, short for subnetwork, refers to a logical subdivision of an IP network.
Subnetting allows a larger network to be divided into smaller, more manageable
parts, each with its own unique network address. It's a fundamental concept in IP
networking that enables efficient use of IP addresses, improves network
performance, and enhances security.

Purpose of Subnetting:

Computer Networks 84
1. IP Address Conservation: Subnetting helps optimize the allocation of IP
addresses by breaking down a larger network into smaller subnetworks. This
prevents wastage of IP addresses in smaller networks.

2. Enhanced Network Performance: By dividing a large network into smaller


subnets, it can reduce network congestion, broadcast traffic, and optimize
network traffic flow, improving overall performance.

3. Improved Security: Subnets can create security boundaries by isolating


different departments or segments of a network, enhancing security through
segmentation and better control over traffic flow.

Components of a Subnet:
1. Subnet Mask: A subnet mask determines the network and host portions of an
IP address. It's a 32-bit number written in dotted-decimal notation (e.g.,
255.255.255.0 for a typical Class C network) that separates the network bits
from the host bits.

2. Network Address: This is the address that identifies the subnet itself. It's
obtained by performing a logical AND operation between the IP address and the
subnet mask.

3. Host Address Range: Represents the range of usable IP addresses within a


subnet after excluding the network address (first address) and the broadcast
address (last address) of the subnet.

Subnetting Process:
1. Determine the Required Subnets: Based on the network's needs, decide on
the number and size of subnets required.

2. Choose Subnet Mask: Select an appropriate subnet mask based on the


number of subnets and hosts needed for each subnet.

3. Create Subnet Addressing Scheme: Use the subnet mask to determine the
network address range for each subnet and assign IP addresses accordingly.

4. Implement Subnetting: Configure routers, switches, and hosts with the


appropriate subnet masks and addresses according to the subnetting scheme.

Computer Networks 85
Example:
Given a Class C network address 192.168.1.0 and a subnet mask of 255.255.255.0
(/24), subnetting can create multiple smaller subnetworks (e.g., 192.168.1.0/24,
192.168.2.0/24, etc.) with their unique network addresses and host ranges.

Network Layer Protocols:


Here's an overview of the key protocols at the Network Layer:

Address Resolution Protocol (ARP):


Function: ARP is used for mapping an IP address to a MAC (Media Access
Control) address in a local network.

ARP Request: When a device wants to communicate with another device


within the same subnet, it sends out an ARP request to find the MAC address
associated with a particular IP address.

ARP Reply: The device that holds the IP address responds with its MAC
address, allowing the requesting device to build its ARP cache and establish
communication.

Internet Protocol version 4 (IPv4):


Function: IPv4 is the foundational protocol for addressing and routing packets
across networks.

Addressing: Uses 32-bit IP addresses expressed in dotted-decimal notation


(e.g., 192.168.1.1).

Routing: Defines how data packets are routed between devices using logical
addressing.

Internet Control Message Protocol (ICMP):


Function: ICMP operates within the IP layer and is used primarily for error reporting
and diagnostic functions.

Computer Networks 86
Error Reporting: Provides feedback about problems encountered during
packet transmission (e.g., destination unreachable, time exceeded).

Network Diagnostics: Used for tools like Ping (to check connectivity) and
Traceroute (to trace the path of packets).

Internet Protocol version 6 (IPv6):


Function: IPv6 is the upgraded version of IPv4, designed to address the limitations
of IPv4.

Addressing: Uses 128-bit IP addresses expressed in hexadecimal notation


(e.g., 2001:0db8:85a3:0000:0000:8a2e:0370:7334).

Enhancements: Provides larger address space, better security, and improved


support for multicast and quality of service (QoS).

ICMPv6 (Internet Control Message Protocol version 6):


Function: Similar to ICMP in IPv4, ICMPv6 serves as a crucial part of IPv6 for error
reporting and network diagnostics.

Error Reporting: Provides error messages for IPv6 packet handling, such as
destination unreachable or packet too big.

Neighbor Discovery: Helps nodes discover other nodes on the same link and
performs functions like address resolution and router discovery.

Understanding these Network Layer protocols is essential for network


administrators, as they form the backbone of internet communication, enabling
devices to communicate, resolve addresses, diagnose network issues, and route
data across networks efficiently and securely.

Unit 4
Transport Layer
The Transport Layer is a critical component of the OSI (Open Systems
Interconnection) model responsible for ensuring reliable and efficient data transfer

Computer Networks 87
between devices across a network. Here's an overview of the Transport Layer:

Transport Layer Functions:


1. Segmentation and Reassembly:

Breaks down large data units from the Session Layer into smaller segments
for transmission.

Reassembles received segments into complete data units at the


destination.

2. End-to-End Connection:

Provides end-to-end communication between devices and ensures data


integrity and sequencing.

3. Flow Control:

Manages the flow of data between sender and receiver to prevent


overwhelming the receiver and avoid congestion.

4. Error Detection and Correction:

Implements error detection mechanisms to identify and, in some cases,


correct errors in transmitted data.

5. Multiplexing and Demultiplexing:

Multiplexing allows multiple applications or sessions to use the network


simultaneously by assigning different identifiers (ports) to each.

Demultiplexing ensures that the received data is directed to the correct


application based on these identifiers.

Key Protocols at the Transport Layer:


1. Transmission Control Protocol (TCP):

Function: TCP provides reliable, connection-oriented communication


between devices.

Computer Networks 88
Features: Ensures data integrity, sequencing, acknowledgment of received
data, and retransmission of lost packets.

Use Cases: Ideal for applications where data accuracy and reliability are
crucial (e.g., web browsing, email).

2. User Datagram Protocol (UDP):

Function: UDP is a connectionless, unreliable protocol.

Features: Provides fast transmission but lacks mechanisms for error


detection, correction, or retransmission of lost packets.

Use Cases: Used in applications where speed is more critical than data
integrity (e.g., video streaming, online gaming).

Transport Layer Ports:


Ports: Used to differentiate between different services or applications running
on a single device.

Well-Known Ports (0-1023): Reserved for standard services like HTTP (80),
FTP (21), SSH (22), etc.

Registered Ports (1024-49151): Assigned to user or vendor-specific


applications.

Dynamic/Private Ports (49152-65535): Used for temporary purposes by client


applications.

Quality of Service (QoS):


The Transport Layer may implement QoS mechanisms to prioritize certain types
of traffic (such as real-time video or voice) over others to ensure better service
quality.

UDP (User Datagram Protocol):


1. Function:

Computer Networks 89
UDP is a connectionless, unreliable transport protocol.

It delivers data without establishing a connection, making it faster but less


reliable than TCP.

2. Characteristics:

Low overhead due to lack of error checking, acknowledgment, or


retransmission mechanisms.

Simple and lightweight, suitable for applications where speed is prioritized over
data reliability.

3. Use Cases:

Real-time applications like VoIP (Voice over Internet Protocol), DNS (Domain
Name System), online gaming, and streaming media.

TCP (Transmission Control Protocol):


1. Function:

TCP is a connection-oriented, reliable transport protocol.

It establishes a connection, ensures reliable data delivery, and maintains end-


to-end communication.

2. Characteristics:

Provides error checking, sequencing, acknowledgment, and retransmission of


lost data.

Slower compared to UDP due to overhead but guarantees data integrity and
reliability.

3. Use Cases:

Applications where data accuracy and reliability are critical, such as web
browsing, email, file transfer, etc.

Computer Networks 90
Congestion Control:
1. Purpose:

Congestion control mechanisms manage network congestion to maintain


optimal performance.

2. Techniques:

AIMD (Additive Increase Multiplicative Decrease): Used in TCP congestion


control, it gradually increases transmission rate until congestion occurs, then
reduces it proportionally.

Random Early Detection (RED): A queue management technique that drops


packets before congestion to avoid sudden congestion.

Explicit Congestion Notification (ECN): Notifies endpoints about congestion,


allowing them to respond without packet loss.

Quality of Service (QoS):


1. Purpose:

QoS mechanisms prioritize certain types of traffic to ensure better service for
critical applications.

2. Techniques:

Computer Networks 91
Traffic Prioritization: Assigning priority levels to different types of traffic (voice,
video, data) to ensure consistent service.

Traffic Shaping: Regulating the flow of network traffic to improve performance


and reduce congestion.

Differentiated Services (DiffServ): Assigning different levels of service to


different types of traffic, allowing networks to be classified and managed
accordingly.

Summary:
UDP vs. TCP: UDP is faster but less reliable, while TCP provides reliable data
delivery.

Congestion Control: AIMD, RED, and ECN are used to manage network
congestion.

Quality of Service: Prioritizes critical traffic for better service through traffic
prioritization, shaping, and differentiated services.

Application Layer
The Application Layer in networking encompasses various protocols and models
that enable communication between applications running on different devices.
Here's an explanation of the Client-Server Model and the Socket Interface:

Client-Server Model:
1. Concept:

The Client-Server Model is a computing model where tasks or workloads are


divided between providers of resources or services (servers) and service
requesters (clients).

Servers provide resources or services, and clients make requests to access


these resources/services.

2. Roles:

Server: It hosts resources or services and responds to client requests.

Computer Networks 92
Client: Initiates requests to the server and uses the services provided.

3. Characteristics:

Centralized Service: Servers offer centralized access to resources or services.

Asymmetric Role: Clients and servers perform different functions within the
communication.

4. Examples:

Web servers (e.g., Apache, Nginx) serving web pages to clients (browsers like
Chrome, Firefox).

Email servers (e.g., SMTP, IMAP) providing email services to email clients
(Outlook, Thunderbird).

Socket Interface:
1. Definition:

A socket is an endpoint for communication between two machines across a


network.

A socket represents one endpoint of a connection used by applications to send


and receive data.

2. Socket Types:

Stream Sockets (TCP): Provides reliable, connection-oriented communication.


TCP uses stream sockets.

Datagram Sockets (UDP): Provides connectionless, unreliable communication.


UDP uses datagram sockets.

3. Functions:

Creation: Applications create sockets to establish communication.

Binding: Associates a socket with a specific address and port.

Connection Establishment: For stream sockets, a connection is established


before data transfer.

Computer Networks 93
Data Transfer: Allows sending and receiving data through the socket.

Termination: Properly closes the socket connection after communication is


completed.

4. Implementation:

Sockets are implemented using APIs (Application Programming Interfaces)


provided by the operating system or programming languages (e.g., Berkeley
Sockets API in C, socket library in Python).

Summary:
Client-Server Model: Divides tasks between service providers (servers) and
service requesters (clients) in a centralized manner.

Socket Interface: Provides an endpoint for communication between two


devices over a network, enabling data transfer using different protocols like TCP
or UDP.

Domain Name System (DNS):


1. Function:

DNS translates domain names (e.g., www.example.com) into IP addresses


(e.g., 192.0.2.1) that computers use to communicate over a network.

2. Components:

DNS Servers: Store domain name/IP address mappings and handle DNS
queries.

DNS Resolver: Receives DNS queries from client applications and interacts
with DNS servers to resolve domain names.

3. Hierarchical Structure:

Top-Level Domains (TLDs): (.com, .org, .net) - Managed by domain registries.

Domain Name Registrars: Facilitate domain name registration for users.

Root Servers: At the top of the DNS hierarchy, manage TLDs.

Computer Networks 94
4. Operations:

Name Resolution: Resolves domain names to IP addresses.

Zone Transfers: Synchronize DNS data between DNS servers.

Caching: Stores previously resolved DNS queries to improve efficiency.

Simple Mail Transfer Protocol (SMTP):


1. Function:

SMTP is a protocol used for sending and receiving email over the internet.

2. Operations:

Mail Transfer: Transmits outgoing mail from a client to a server or between


servers.

Mail Retrieval: Fetches incoming mail from the server by a client.

3. Message Format:

Uses a set of commands to transfer emails and a simple text-based message


format.

4. Port: Standard port for SMTP is 25 (TCP).

File Transfer Protocol (FTP):


1. Function:

FTP facilitates file transfer between a client and a server on a network.

2. Operations:

File Transfer: Upload and download files between the client and server.

Directory Listing: Allows viewing directory contents on the server.

3. Modes:

FTP Modes: FTP operates in two modes - the default is the standard FTP
mode and the other is the passive mode, which can resolve issues related to

Computer Networks 95
firewalls.

4. Ports: Uses port 21 for control (commands) and port 20 for data transfer (in
active mode).

Hypertext Transfer Protocol (HTTP) and World Wide


Web (WWW):
1. Function:

HTTP is the protocol used for transferring hypertext documents on the web.

WWW refers to the collection of web pages accessible via the internet.

2. Operations:

Request-Response Model: Clients (browsers) send requests for web pages,


and servers respond with HTML content.

3. HTTP Methods:

GET: Retrieves data from the server.

POST: Sends data to the server for processing.

PUT, DELETE, etc.: Used for different operations on resources.

4. Ports: HTTP typically uses port 80 (TCP) for communication.

updated version here: https://yashnote.notion.site/Computer-Networks-


007086fb01a94399bcc27544284d0f7e?pvs=4

Computer Networks 96

You might also like