0% found this document useful (0 votes)
20 views97 pages

CNC Unit-1

The document outlines the syllabus for a Computer Network and Communication course, covering topics such as data communications, network types, and various network models including TCP/IP and OSI. It details the structure and characteristics of data communication systems, including components like senders, receivers, and protocols, as well as different network topologies like mesh, star, bus, and ring. Additionally, it discusses local area networks (LANs) and wide area networks (WANs), emphasizing their definitions, characteristics, and interconnections.

Uploaded by

manimgl555
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)
20 views97 pages

CNC Unit-1

The document outlines the syllabus for a Computer Network and Communication course, covering topics such as data communications, network types, and various network models including TCP/IP and OSI. It details the structure and characteristics of data communication systems, including components like senders, receivers, and protocols, as well as different network topologies like mesh, star, bus, and ring. Additionally, it discusses local area networks (LANs) and wide area networks (WANs), emphasizing their definitions, characteristics, and interconnections.

Uploaded by

manimgl555
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/ 97

1

COMPUTER NETWORK AND COMMUNICATION


Course code: CS3001-1
Syllabus :
UNIT-I
(15 Hours)

1. Introduction: Data Communications, Networks, Network Types, Connection-


Oriented Versus Connectionless Service, Introduction to network Devices-Modem,
Hub, Switch, Router, Network Models: TCP/IP Protocol Suite, OSI Model, OSI versus
TCP/IP.

2. Physical Layer: Introduction to Physical Layer: Digital Signals, Transmission


Impairment, Data Rate Limits, Performance, Example Problems(self-learning), Line
Coding Schemes (Unipolar and Polar only)

3. Transmission Media: Guided Media, Switching: Introduction, Packet Switching.

4. Data-Link Layer: Introduction, Link-Layer Addressing (up to ARP) Error Detection


and Correction Introduction, Block Coding, Cyclic Redundancy Check,

5. Media Access Control: CSMA, CSMA/CD. (Textbook T1)

UNIT-II
16 Hours

Data Link Layer Contd.


1. Wired LANs: Ethernet Protocol, Standard Ethernet (up to Access Method), Wireless
LANs: Introduction (Textbook T1)
2. Network Layer: Network-Layer Services, Packet Switching, Network Layer
Performance. IPv4 Addresses, Packet Format of IPv4, IPv6 Address and packet
format, ICMPv4 (Textbook T1)
3. Routing Algorithms up to Multicast Routing, Congestion Control Algorithms, Quality
of Service, Internetworking. (Textbook T2)
Routing for Mobile Hosts (self-learning)
UNIT-III
(9 hours)
1. Transport Layer: Transport Layer Services, Port Numbers, User Datagram Protocol,
Transmission Control Protocol
2. Application Layer: Introduction, Client/Server Paradigm, Standard Client-Server
Protocols: World Wide Web and HTTP, FTP, Electronic Mail, DNS, (Textbook T1)
2

UNIT-I

• Review Questions
1. How data communication is done? Explain in brief.
2. What Computer Network?
1. Explain types of network.
2. What is prototype layering?
3. What are the principles of protocol layering?
4. Explain the TCP/IP Protocol in brief.
5. Explain the OSI Model in brief.
6. Differentiate between the OSI and TCP/IP referential model Aca
3

Introduction :

• Data communications and networking have significantly impacted business operations


and daily life by enabling faster decision-making and access to information.
• Business reliance on computer networks and internetworks has grown, allowing for
instantaneous data exchange.
• Data communications and networking have also influenced political and social issues,
allowing global communities to connect and share opinions.
• Before setting up a network, it's essential to understand how networks operate, available
technologies, and suitable designs.

Chapter Overview:
• Section 1: Introduction to data communications, components, types of data,
representation, and data flow.
• Section 2: Introduction to networks, criteria, structures, and four network topologies.
• Section 3: Discussion on different types of networks (LANs, WANs, internetworks), the
Internet, and network switching.
• Section 4: Brief history of the Internet, divided into early history, the Internet's birth, and
current issues (optional reading).
• Section 5: Coverage of standards and standards organizations, focusing on Internet
standards and administration.
DATA COMMUNICATIONS :

• Data communications are the exchange of data between two devices via some form
of transmission medium such as a wire cable.
Ex:Sending an email from one computer to another.

• Telecommunication refers to communication over a distance, including technologies


like telephony, telegraphy, and television.
Ex:Making a phone call to talk to someone far away
Characteristics of Data communications :

• Delivery: Data must reach the correct destination, meant for the specific device
or user.
• Accuracy: Data must be transmitted without errors; any alterations must be
corrected.
• Timeliness: Data must be delivered on time, especially important for real-time
audio and video.
• Jitter: The system should minimize variation in packet arrival times to maintain
consistent audio and video quality.
4

Components of a data communication system :

• Message: The information (data) being communicated, including text, numbers,


pictures, audio, and video.

• Sender: The device that sends the data message, such as a computer, workstation,
telephone handset, or video camera.

• Receiver: The device that receives the message, such as a computer, workstation,
telephone handset, or television.

• Transmission Medium: The physical path through which the message travels from
sender to receiver, like twisted-pair wire, coaxial cable, fiber-optic cable, or radio
waves.

• Protocol: A set of rules that govern data communications, ensuring that connected
devices can communicate effectively.

Data Representation :
• Text: Represented as bit patterns (0s and 1s). Unicode, using 32 bits per character, is
the commonly used coding system. ASCII, a subset of Unicode, represents the first
127 characters.
• Numbers: Converted directly to binary for easier computation.
• Images: Made of pixels with bit patterns; black-and-white uses 1-bit, while color uses
RGB or YCM methods.
• Audio: : Continuous recording or broadcasting of sound.
• Video: Moving pictures, either continuous or a sequence of discrete images creating
motion.
5

✓ Data flow (simplex, half-duplex, and full-duplex)

NETWORKS
A network is the interconnection of a set of devices capable of communication.
6

Computer Network
A computer network is a system that connects two or more computing devices for
transmitting and sharing information.
Computing devices include everything from a mobile phone to a server.
These devices are connected using physical wires such as fiber optics, but they can also
be wireless.

Network Criteria
• Performance: Measured by transit time (time for a message to travel) and
response time (time between inquiry and response). Performance depends on
factors like the number of users, transmission medium, hardware, and software.
Throughput and delay are key metrics; increasing throughput can lead to more
delay due to congestion.
• Reliability: Involves the accuracy of data delivery, frequency of failures, recovery
time, and the network’s ability to withstand catastrophes.
• Security: Focuses on protecting data from unauthorized access, damage, and
establishing policies for recovery from breaches and data losses.

Physical Structures in Networks:

• Type of Connection:

link
o Point-to-Point:
▪ A dedicated link between two devices.
▪ Entire link capacity is reserved for communication between these two
devices.
▪ Commonly uses wires or cables, but can also use microwave or
satellite links.
▪ Example: Infrared remote control and a television.

o Multipoint (Multidrop):
• Link

▪ A single link shared by more than two devices.


▪ Channel capacity can be shared either:
▪ Spatially: Multiple devices use the link simultaneously.
▪ Temporally: Devices take turns using the link.
7

• Physical Topology: Refers to the physical layout of a network, including how devices
and links are arranged.

• Types of Topologies:

• Mesh Topology:

o Description: Every device is connected to every other device with dedicated


point-to-point links.
o Link Calculation: For n nodes, the number of links required is n(n - 1) / 2 in
duplex (bidirectional) links .
o Advantages:
▪ Dedicated Links: Prevents traffic problems as each link carries its own
data load.
▪ Robustness: Failure of one link does not affect the entire network.
▪ Privacy/Security: Messages are only visible to intended recipients.
▪ Fault Identification: Easy to detect and isolate faults due to point-to-
point connections.
o Disadvantages:
▪ Cabling and Ports: Requires a lot of cabling and I/O ports.
▪ Installation Complexity: Difficult to install and reconnect due to
extensive wiring.
▪ Cost: Expensive due to the amount of hardware needed.
o Example: Connection of telephone regional offices where each office is linked
to every other office.
• Star Topology :

HUB

• Description: Each device is connected to a central controller (hub) with a dedicated


point-to-point link. Devices do not connect directly to each other.
8

• Operation: - Data from one device is passed through the hub to Advantages:
• Cost: Generally less expensive than mesh topology.
• Ease of Installation: Simple to set up and reconfigure; each device needs only one
link to the hub.
• Robustness: If one link fails, only that link is affected; other links remain operational.
• Fault Identification: Easy to monitor and isolate faults through the hub.
Disadvantages:
• Dependency: The entire network relies on the central hub; if the hub fails, the whole
network is down.
• Cabling: Requires more cabling than some topologies (like ring or bus) due to
connections to the central hub.
Usage: Commonly used in local-area networks (LANs), especially in high-speed LANs with a
central hub.
• Bus Topology:

• Description: Uses a single long cable (backbone) to connect all devices in the
network. Devices are linked to the backbone via drop lines and taps.
Operation:
• Signals travel along the backbone, the main cable connecting network devices.
• Signals weaken over distance due to attenuation.
• Limit the number of taps and the distance between them to maintain signal
quality.
Advantages:
o Ease of Installation: Simple to lay the backbone cable and connect devices
with drop lines.
o Less Cabling: Requires less cable compared to mesh or star topologies, as
only one backbone cable runs through the facility.
• Disadvantages:
o Reconnection and Fault Isolation: Difficult to add new devices or isolate
faults. A fault or break in the backbone cable disrupts all transmissions,
causing noise and signal degradation.
o Signal Reflection: When a signal (data) is sent down the bus, it travels along
the cable. At each tap (where a device is connected), some of the signal can
bounce back, or "reflect," instead of continuing smoothly down the cable.
9

o Signal Degradation: These reflections can mix with the original signal,
weakening it or causing distortions. This weakening or distortion of the signal
is what we call "signal degradation."

• Usage: Historically used in early local-area networks (LANs). Traditional Ethernet


LANs used bus topology but are less common now.

Ring Topology:

• Description: Each device is connected to two other devices, forming a ring. Signals
pass through each device in one direction until reaching the destination.
• Operation: Each device has a repeater to regenerate and forward signals. A signal
circulates continuously around the ring.
• Repeater Function: The repeater within each device boosts the signal strength and
regenerates the data bits as they pass through. This prevents signal degradation and
ensures that the signal maintains its quality as it travels around the ring.

• Signal Circulation: The signal continuously circulates around the ring, and each
device checks for the signal. If a device does not receive a signal within a certain
timeframe, it alerts the network operator about the fault.
• Advantages:
o Ease of Installation and Reconfiguration: Devices are linked only to their
immediate neighbour. Adding or removing devices requires only two
connections.
o Fault Isolation: The network can detect faults if a device does not receive a
signal within a set time, triggering an alarm to locate the issue.
10

• Disadvantages:
o Unidirectional Traffic: A break in the ring or a malfunctioning device can
disrupt the entire network. This can be mitigated with a dual ring or a switch
to bypass the fault.
• Usage: Previously used in IBM's Token Ring LANs. Less common today due to the
need for higher-speed LANs.

• Hybrid Topologies :
A hybrid topology is a network structure that integrates different types of topologies,
such as star, bus, ring, and mesh, within the same network.

Network Types:
Networks can be categorized based on various criteria, including size, geographical
coverage, and ownership.
• Local Area Networks (LANs): Typically cover a small geographical area, like a single
building or campus. They are often owned and managed by a single organization.
• Wide Area Networks (WANs): Span large geographical areas, potentially covering
entire countries or continents. WANs often involve multiple organizations and can
use public or leased communication lines.
• Switching: A key concept used to connect multiple networks, forming an
internetwork (a network of networks), allowing for broader communication across
different network types.
This categorization helps in understanding how different network types serve various needs
in terms of scale and scope.
11

• Local Area Network (LAN):

• Definition: A LAN is a privately owned network that connects hosts (such as


computers, printers, etc.) within a limited geographical area, like an office, building,
or campus.
• Addressing: Each host in a LAN has a unique identifier (address) used for sending and
receiving data packets.
• Communication: In traditional LANs, all devices were connected to a common cable,
meaning every device would receive each data packet sent across the network.
However, only the device for which the packet was intended would actually process
and keep the data, while the other devices would simply ignore it.
• Modern LANs: Nowadays, most LANs use a smart switch that directs packets only to
the intended recipient, reducing traffic and allowing multiple communications
simultaneously.
• Flexibility: The number of hosts in a LAN can vary, with no strict minimum or
maximum.

Wide Area Network (WAN):


• Definition: A WAN is a network that interconnects devices over a large geographical
area, such as a town, state, country, or even worldwide.
• Comparison with LAN: Unlike a LAN, which is confined to a small area like an office
or campus, a WAN covers a broader area. LANs interconnect hosts, whereas WANs
interconnect connecting devices like switches, routers, or modems.
• Ownership: LANs are typically privately owned by the organization that uses them,
while WANs are usually created and managed by communication companies and
leased by organizations.
12

• Types of WANs:
o Point-to-Point WAN: Connects two communicating devices via a transmission
medium (cable or air).
o An example of a point-to-point WAN is a dedicated leased line between two
office locations.

o Switched WAN: Involves multiple connection points, functioning as a


combination of several point-to-point WANs connected by switches, and is
used in the backbone of global communication.
o An example of a switched WAN is the public telephone network (PSTN)

Internetwork:

• Definition: An internetwork (or internet with a lowercase "i") is formed when two or
more networks (LANs or WANs) are connected.
(The most notable internet is called the Internet (uppercase I) and is composed of
millions of interconnected networks. )
• Example Scenario: Consider a company with two offices, one on the east coast and
one on the west coast. Each office has its own LAN. By leasing a point-to-point WAN
from a service provider, the company can connect these two LANs, creating an
internetwork.
13

• Functionality:
o Within the Same Office: Communication within the same LAN (e.g., west
coast office) is managed by a switch that directs messages to the correct host.
The router blocks unnecessary communication outside the LAN.
o Between Offices: Communication between different offices (e.g., west to east
coast) involves routing packets through interconnected routers, allowing the
message to reach its destination across the WAN.
Expanded Internetwork: An internetwork can include multiple LANs and WANs, with
some WANs functioning as switched WANs, connecting multiple points through
switches for global communication.

Switching:

• Circuit-Switched Network:

o Dedicated Connection: A continuous circuit is available between two systems,


activated or deactivated by a switch.
o Example: Traditional telephone networks using circuit switching to handle
multiple voice communications.
o Efficiency: Efficient when fully utilized but often inefficient when underused.

• Packet-Switched Network:

o Data Packets: Communication is done in packets, which switches store and


forward.
o Example: Routers in a packet-switched network queue and forward packets,
improving efficiency over circuit-switched networks.
14

o Efficiency: More efficient, though may introduce delays during high traffic.

The Internet :
• Definition: An internet (lowercase 'i') consists of multiple interconnected networks.
The most prominent example is the Internet (uppercase 'I') and is composed of
millions of interconnected networks..
• Structure:
o Backbones: Large networks owned by major communication companies (e.g.,
Sprint, Verizon, AT&T, NTT). They form the top layer and are interconnected
through peering points.
o Provider Networks: Smaller networks that connect to backbones and
sometimes other provider networks. They use backbone services for a fee.
o Customer Networks: Networks at the edge of the Internet that use services
from provider networks and pay fees for these services.
• Types of ISPs:
o International ISPs: Typically referred to as backbones.
o National or Regional ISPs: Usually provider networks.
Diagram Reference:

Figure shows a conceptual view of the Internet, illustrating backbones, provider networks,
and customer networks.
15

Accessing the Internet:


• Overview: To access the Internet, users need a physical connection through an ISP.
This is typically achieved via a point-to-point WAN.

• Connection Methods:
o Using Telephone Networks:
▪ Dial-up Service:
▪ Description: Uses a modem to convert data to voice over a telephone
line.
▪ Limitations: Slow speed and the line can't be used for voice calls while
connected to the Internet.
▪ DSL Service:
▪ Description: Upgraded telephone lines that offer higher-speed Internet
while allowing simultaneous voice and data communication.
o Using Cable Networks:
▪ Description: Uses upgraded cable TV networks to connect to the Internet.
▪ Advantages: Higher speed compared to dial-up or DSL, but speed can vary based
on shared usage with neighbors.
o Using Wireless Networks:
▪ Description: Provides Internet access through wireless WANs.
▪ Advantages: Increasingly popular, allows for flexible connectivity options
combining wireless and wired connections.
o Direct Connection to the Internet:
▪ Description: Large organizations can become ISPs themselves by leasing high-
speed WANs and connecting to regional ISPs.
▪ Example: Universities with multiple campuses can create their own internetwork
and connect it to the Internet.

Connection-Oriented vs. Connectionless Service


Connection-Oriented Service:
• Concept: Modeled after the telephone system. Establishes a connection, uses it, and
then releases it.
16

o Process:
1. Establish Connection: Similar to dialing a number.
2. Use Connection: Communication occurs.
3. Release Connection: Hang up or close the connection.
o Negotiation: Parameters like maximum message size and quality of service
may be negotiated.
o circuit refers to a dedicated communication path established between two
endpoints, ensuring fixed resources like bandwidth are allocated for the
connection.
o Reliability:
▪ Reliable Service: Guarantees that data is not lost. Typically involves
acknowledgements, which may introduce overhead and delays.
▪ Use Case: Suitable for file transfers where data integrity is crucial.
Examples include:
▪ Message Sequences: Preserves message boundaries (e.g.,
sending pages of a book).
▪ Byte Streams: No message boundaries (e.g., streaming a DVD
movie).
Connectionless Service:
• Concept: Modeled after the postal system. Each message carries the full destination
address and is routed independently.
o Service Types:
▪ Unreliable Service (Datagram Service): Messages are sent without
acknowledgements. Ideal for applications where high probability of
arrival is sufficient but 100% reliability is not necessary. Examples
include spam emails.
▪ Reliable Service: Provides some level of acknowledgment, though not
always guaranteed. Suitable for cases where reliability is critical but
connection setup is not required.
▪ Request-Reply Service: Sends a single datagram request and receives
a reply. Common in client-server models, such as querying a map
server for location data.
17

Key Differences:
• Connection-Oriented:
o Connection Establishment: Required before communication.
o Reliability: Ensured through acknowledgements.
o Example Use Cases: File transfers, applications requiring guaranteed delivery
and ordering.
• Connectionless:
o No Connection Setup: Messages are sent independently.
o Potential for Loss: Acknowledgement is optional, often leading to lower
reliability.
o Example Use Cases: VoIP, quick messages where speed is preferred over
reliability, simple request-reply communications.
18

Summary of the types of services :

Network Devices: Network devices, also known as networking hardware, are physical
devices that allow hardware on a computer network to communicate and interact with one
another.
For example
Repeater, Hub, Bridge, Switch, Routers, Gateway, Brouter, and NIC, etc

1. Modem:
• Function: Converts signals between analog and digital formats to facilitate
communication between a computer and an ISP.
• Common Types:
o Internet Modem: Connects to an ISP and converts the incoming signals to a
format usable by connected devices.
o Connections: Can use Ethernet cables, DSL, fiber optics, or wireless mediums.
• Layer of OSI Model: Operates at Layer 1 (Physical Layer) or Layer 2 (Data Link Layer).
19

2. Hub:
• Function: Connects multiple devices within a LAN, allowing them to communicate
with each other.
• Operation: Broadcasts incoming messages to all ports, regardless of the destination.
• Connectivity: Must connect to a router or switch for communication outside the
LAN.
• Limitation: No frame examination or message isolation.
3. Switch:
• Function: Forwards data to specific devices based on the MAC address of incoming
frames.
• Operation: Stores MAC addresses in an address table and uses it to direct frames to
the correct port.
• Connectivity: Devices connect via Ethernet cables; directs data to the specific
destination port.
• Difference from Router: Operates within a network, directing data to specific
devices, unlike a router which directs data across networks.
4. Router:
• Function: Directs data between different networks by examining and forwarding
packets based on their IP addresses.
• Operation: Uses routing tables to determine the best path for forwarding packets
and employs routing protocols for data exchange.
• Connectivity: Can provide internet access through its connection to a modem or as a
combined modem-router.
Types of routers typically used in enterprise networks include the following:
• edge routers
• core routers
• distribution routers
• wireless routers

These devices are fundamental for building and managing networks, each serving distinct
roles in ensuring effective communication and connectivity.
20

Short summary :

Network Models :
A network model is a conceptual framework that defines the structure and interactions of
network components to facilitate communication and data exchange.
THE OSI (Open System Interconnection) MODEL :
• Established by ISO (International Standard Organization) in 1947: A global body for
setting international standards.
• OSI Model Introduced in the Late 1970s: A standard for network communications.
• Purpose: Provides a framework for designing and understanding network systems.
• Open System: Refers to protocols enabling communication between computers
regardless of their architecture.
• Not a Protocol: It’s a model, not a specific protocol.
• Seven Layers: Defines the process of moving information across a network, with each
layer addressing a different aspect of communication.
• ISO: The organization that developed the OSI model.
• OSI: The model for network communication developed by ISO.
21

The OSI 7 Layers :

The interaction between layers in the OSI model :

The interaction between layers in the OSI model :


22

• LAYERS IN THE OSI MODEL :

1. Physical layer:

• Function: Carries individual bits in a frame across the link.


• Communication: Logical communication between devices via a hidden transmission
medium.
• Transmission Medium: Transmits electrical or optical signals, not direct bits.
• Bit Transformation: Converts bits into signals for transmission.
• Protocols: Defines methods to transform bits into signals.
• The physical layer is responsible for movements of individual bits one hop(node) to
the next.

2. Data-link Layer

• Function:
o Moves datagrams across links (LANs/WANs).
o Hop-to-Hop Delivery: Ensures data moves from one network node to
another.

o Framing: Divides the stream of bits into manageable data units called frames.
o Physical Addressing: Adds sender and receiver addresses to each frame for
identification.
o Flow Control: Manages data flow to prevent congestion.
o Error Control: Detects and corrects errors to ensure data integrity.
23

o Access Control: Determines which device has the right to use the
transmission medium.
• Link Types: Works with wired/wireless LANs and WANs.
• Protocol Flexibility: TCP/IP does not define a specific data-link protocol.
• Support: Compatible with all standard and proprietary link-layer protocols.
• Frame Encapsulation: Encapsulates datagrams into frames.
• Error Handling: Varies by protocol; may offer error detection and/or correction.

2. Network layer :

• Responsible for Source-to-Destination Delivery: Ensures that packets are delivered


across multiple networks from the source host to the destination host.
• Logical Addressing: Adds sender and receiver addressing information to the packet,
helping to identify the source and destination within the network.
• Routing: Forwards packets to the appropriate network. Routers or switches are
responsible for this process, determining the best path for the packet to reach its
destination.

Main Protocol: Internet Protocol (IP)


• Packet Format: Defines the structure of packets (datagrams).
• Addressing: Defines IP address formats.
• Routing: Each router forwards datagrams to the next router.
• Characteristics: Connectionless; no flow, error, or congestion control.

• Routing Protocols:

o Unicast: One-to-one routing.


o Multicast: One-to-many routing.
o Forwarding Tables: Created by routing protocols to assist routers.
Auxiliary Protocols:
• ICMP (Internet Control Message Protocol): Reports routing issues.
• IGMP (Internet Group Management Protocol): Manages multicast groups.
• DHCP (Dynamic Host Configuration Protocol): Assigns network-layer addresses to
hosts.
24

Source-to-destination delivery :

3) Transport layer :

• Process-to-Process Delivery: Ensures communication between specific processes on


source and destination hosts.
• Service Point Addressing: Uses port addresses to specify the receiving process.
• Segmentation and Reassembly: Divides messages into segments with sequence
numbers for reassembly.

• Connection Control:
o Connection-Oriented: Establishes a connection before data transfer.
o Connectionless: Sends data without establishing a connection.
• Flow Control: Manages data transfer rates between sender and receiver.
• Error Control: Prevents data loss and ensures reliable delivery.
25

Reliable process-to-process delivery of a message :

4. Session layer :

It establishes, maintaining and synchronizes the interaction among communicating systems.


It is called dialog controller
Dialog Control : Allowing two systems to process to communicate in half duplex or full –
duplex mode.
Synchronization : Adding the check points to the data.
The session layer is responsible for dialog control and synchronization.
5. Presentation layer :

o Translation : Changing information of the sender into its receiver –


dependent format.
o Encryption : Sending original information in another form for security of the
information.
o Compression: Reducing the data for transmission to use the line (physical
media) efficiently.
26

o The presentation layer is responsible for translation, compression, and


encryption.
6.Application layer :

It provides user interfaces and support for services such as electronic mail , remote
file access and transfer.
Network Virtual Terminal : Emulation of software version of physical terminal
File Transfer, access and management : Allowing user to access remote computer to
retrial file and use in local computer .
Mail Services : Email forwarding and storage.
Directory Services : Provides Distributed Data base sources and access for global
information about various objects and services.
The application layer is responsible for providing services to the user.
Summary of layers :
27

OSI versus TCP/IP :

• When we compare the two models, we find that two layers, session and presentation
are missing from the TCP/IP protocol suite.
• These two layers were not added to the TCP/IP protocol suite after the publication of the
OSI model.
• The application layer in the suite is usually considered to be the combination of three
layers in the OSI model.
• Two reasons were mentioned for this decision.
• First, TCP/IP has more than one transport-layer protocol.
• Some of the functionalities of the session layer are available in some of the
transport-layer protocols.
• Second, the application layer is not only one piece of software. Many applications
can be developed at this layer.
• If some of the functionalities mentioned in the session and presentation layers are
needed for a particular application, they can be included in the development of that
piece of software.
• TCP/IP PROTOCOL SUITE :
• Also Known As: Internet Protocol Suite
• two most important Protocols :
1. TCP (Transmission Control Protocol)
2. IP (Internet Protocol)
• Layers in TCP/IP:
o Host-to-Network Layer:
▪ Combines OSI’s Physical Layer and Data Link Layer.
▪ host-to-network layer → (physical + data link layer) of OSI
28

o Internet Layer:
▪ Corresponds to OSI’s Network Layer.
▪ Internet → Network Layer of OSI

o Transport Layer:
▪ Corresponds to OSI’s Transport Layer.
▪ Transport → Transport layer of OSI.

o Application Layer:
▪ Combines OSI’s Session Layer, Presentation Layer, and
Application Layer.
▪ application→ (Session + Presentation + application) of OSI model.
• TCP/IP suite :

TCP/IP Layers
• Physical and Data Link Layers :
It supports all the standard and proprietary data base
• Network Layers :
• Internet Protocol (IP) : Used to send datagram (packets) from the
source host to the destination host solely based on its address.
• Unreliable and connection less
• Best effort service
• IP data is called datagrams
29

• Address Resolution Protocol (ARP) : Used to find physical address


when its internet address is known.
• Reverse Address Resolution Protocol (RARP): Used to find internet
address when its physical address is known.
• Internet Control Message Protocol (ICMP) : Used to send query and
error reporting messages.
• Internet Group Message Protocol (IGMP) : Simultaneous
transmission to a group of recipients.
• Transport Layers :
• User Datagram Protocol : Used to send short messages sometimes known as
datagram.
• Process to Process protocol that adds only port address , checksum, error control
and length information to the data.
• UDP does not guarantee reliability or ordering
• Transmission Control Protocol : Connection oriented and reliable
• Data is called segments
• reordering of the segments
• Stream Control Protocol : Newer application support, such as voice over
network.
• Application Layer : Equivalent to combined session , presentation and application
layers of the OSI model.
• Relationship of layers and addresses in TCP/IP :
30

Port addresses :
31

Review Questions
1. Differentiate between analog and digital signal
2. Explain the terms a) Wavelength
3. Explain Digital Signals with suitable example
4. What are the causes of impairment transmission?
5. Explain data rate limits with different factors
6. How performance is measured? Explain with suitable example
7. How the data is converted from one form to another form
8. What are the ways of digital to analog conversion?
9. Explain digital-to-analog conversion.
10. Explain analog-to-analog conversion in brief.
11. Describe the purpose of multiplexing.
12. What are the three main multiplexing techniques?
13. What is difference between a FDM and TDM.
14. Briefly describe the services provided by the data link layer.
15. Define framing and the reason for its need.

Introduction to Physical Layer


Outline
• SIGNALS – data , signals both analog and digital
• SIGNAL IMPAIRMENT – transmission and performance of network
• DIGITAL TRANSMISSION – analog and digital data to digital signal
• TRANSMISSION MEDIA – guided(wires and cables) and unguided(air)
SIGNALS
32

Figure:- Communication at the physical layer : A scenario where a scientist Alice


working at sky research needs to order a book for her research from bob, the
manager of scientific books, an online bookstore

The communication between Alice and Bob represents a network data flow through various
devices, involving multiple network layers and segments. Here’s a simplified explanation:
1. Network Topology:
o Alice's host device is connected to a LAN switch.
o The LAN switch is connected to router R2 via a point-to-point WAN link.
o Router R2 connects to router R4, also through a point-to-point WAN link.
o Router R4 is linked to a WAN switch, which is part of a switched WAN
network with multiple switches.
o From the third WAN switch, the connection goes to router R5 via a point-to-
point WAN.
o Router R5 connects to router R7 in the ISP network.
o Router R7 is connected to a LAN switch in Bob's network, which includes
Bob's host device (a mainframe).
2. Data Flow:
o Data flows through several layers and devices as follows:
▪ From the physical layer of Alice's host to router R2 (across multiple
layers like physical, data-link, and network).
▪ The data continues from router R2 to router R4, then to router R5,
and finally to router R7.
▪ From router R7, the data reaches the physical layer of Bob's host
device.
3. Device Layers:
33

o Each router (R2, R4, R5, R7) operates across multiple layers, primarily
involving the physical layer, data-link layer, and network layer for
transmitting data.
o The hosts (Alice's and Bob's devices) and the routers use the physical layer to
ensure the signal is carried from source to destination.

SIGNALS
What is exchanged between Alice and Bob is data, but what goes through the network at the
physical layer is signals.
Analog and Digital Data
• Data can be analog or digital.
• The term analog data refers to information that is continuous
• digital data refers to information that has discrete states.
• For example, an analog clock that has hour, minute, and second hands gives
information in a continuous form; the movements of the hands are continuous.
• On the other hand, a digital clock that reports the hours and the minutes will change
suddenly from 8:05 to 8:06.

Signals:
• Analog Signals: Have infinitely many levels of intensity over time. As the signal moves
between two values (A and B), it passes through an infinite number of intermediate
values.
o Example: Audio waves, where the sound varies continuously.
• Digital Signals: Have a limited number of distinct values, often just 1 and 0. Unlike
analog signals, they switch between these discrete levels.
o Example: Binary data in computers, where 1 represents a high state, and 0
represents a low state.
In networking, both analog and digital signals are used depending on the type of
communication or technology being implemented.
34

Analog Signal :
An Analog signal can be either:
• Periodic: Repeats over a fixed interval of time.
• Aperiodic: Does not repeat over a fixed interval.
In data communication, periodic signals are commonly used because they are easier
to manage and predict.
• A simple periodic signal, a sine wave, cannot be decomposed into simpler signals.

Peak Amplitude
The peak amplitude of a signal is the absolute value of its highest intensity.
Period and Frequency
The period (T) refers to the amount of time, in seconds, that a signal needs to
complete one cycle.
The frequency (f), measured in Hertz (Hz), refers to the number of periods in one
second.
Note that period and frequency are just one characteristic defined in two ways.
Period and frequency are inverse of each other, in other words.
f = 1/ T

Phase
The term phase describes the position of the waveform relative to time 0. If we think
of the wave as something that can be shifted backward or forward along the time
axis, phase describes the amount of that shift.

Wavelength
The wavelength is the distance a simple signal can travel in one period. Wavelength
binds the period or the frequency of a simple sine wave to the propagation speed in
the medium. If we represent wavelength by l, propagation speed by c, and frequency
by f, and period by T, we get

 = c f = c T
Where:
• λ = wavelength
• c = propagation speed of the signal in the medium
• f = frequency of the signal
35

Time and Frequency Domain


• Time Domain: In the time domain, a sine wave is represented as a function of time.
The graph shows how the amplitude of the wave changes over time. It fully describes
the wave in terms of:
o Amplitude: The peak intensity of the wave.
o Frequency: The number of cycles the wave completes per second (in Hertz).
o Phase: The relative position of the wave at time 0.
• Frequency Domain: In the frequency domain, the sine wave is represented by its
frequency components. Instead of focusing on how the signal changes over time, this
approach describes the signal in terms of its constituent frequencies. For simple sine
waves, this would show a single spike at the wave's frequency. The frequency domain
provides a clearer understanding of the signal’s frequency content.

Composite Signal
• Simple Sine Waves: Up to this point, we've looked at simple sine waves, which
consist of a single frequency.
• Composite Signal: A composite signal, on the other hand, is made up of multiple sine
waves combined. These sine waves may have different frequencies, amplitudes, and
phases.
• Bandwidth: The bandwidth of a composite signal refers to the range of frequencies
it contains. It is calculated as the difference between the highest and lowest
frequencies in the signal:
Bandwidth=fhighest−flowest
The larger the bandwidth, the more information the signal can carry

Digital Signal :
• Definition: A digital signal represents information using discrete values. Unlike analog
signals, which can vary continuously, digital signals have distinct, separate levels.
36

• Example: A common representation involves using two levels:


o Value 1: Encoded as a positive voltage.
o Value 0: Encoded as zero voltage.
• Multiple Levels: A digital signal can have more than two levels. For example, with
four levels, you can encode two bits per level (00, 01, 10, 11).
• Advantages: Digital signals are less susceptible to noise and interference compared
to Analog signals, which helps in maintaining the integrity of the transmitted data.

Bit Rate
• Definition: Bit rate is the number of bits transmitted per second in a digital signal. It
is used instead of frequency for nonperiodic signals.
• Example Calculation:
o Given:
▪ Download rate: 100 pages per minute
▪ Each page: 24 lines
▪ Each line: 80 characters
▪ Each character: 8 bits

Bit Length:
• The bit length is the distance that one bit occupies on the transmission medium.
• It is similar to the wavelength concept used for analog signals but applies to digital
signals.
Relation to Bit Rate:
• Bit length is inversely related to bit rate.
• The higher the bit rate, the shorter the bit length, and vice versa.
bit length = 1 / bit rate

Transmission of Digital Signal:


• A digital signal can be considered a composite analog signal because it consists of
multiple frequencies ranging from zero to infinity.
There are two types of transmission:
1. Baseband Transmission:
37

The digital signal is sent as it is, without converting it to an analog signal.


o
o Used for short-distance communication, such as within local networks (e.g.,
Ethernet).
2. Broadband Transmission:
o The digital signal is first converted to an analog signal and then transmitted.
o This method is commonly used for long-distance communication (e.g., over
cable television networks).
The key difference is whether the digital signal is kept in its original form (baseband)
or converted to Analog (broadband).

SIGNAL IMPAIRMENT :
• Signals travel through transmission media, which are not perfect.
• The imperfection causes signal impairment.
• This means that the signal at the beginning of the medium is not the same as the
signal at the end of the medium.
• “What is sent is not what is received”.
• Three causes of impairment are attenuation, distortion, and noise.

Attenuation and Amplification

• Attenuation means a loss of energy.


• To compensate for this loss we need amplification.
• When a signal, simple or composite, travels through a medium, it loses some of its
energy in overcoming the resistance of the medium.

Example:- Suppose a signal travels through a transmission medium and its power is reduced
to one half. This means that P2 = 0.5 P1. In this case, the attenuation (loss of power) can be
calculated as

10 log10 P2 P1 = 10 log10 (0.5P1 ) P1 = 10 log10 0.5 = 10  ( − 0.3) = −3dB.


A loss of 3 dB (−3 dB) is equivalent to losing one-half the power.
Distortion
• Distortion means that the signal changes its form or shape.
• Distortion can occur in a composite signal made up of different frequencies.
38

Noise
• Noise is another cause of impairment.
• Several type of noise may occur during the signal transmission.
• Signal-to-Noise Ratio (SNR) is defined as
SNR = (average signal power) / (average noise power)

SNRdB = 10log10SNR

Data Rate Limits :


A very important consideration in data communications is how fast we can send data,
in bits per second, over a channel.
Data rate depends on three factors:
1. The bandwidth available
2. The level of the signals we use
3. The quality of the channel (the level of noise)
Two theoretical formulas were developed to calculate the data rate: one by Nyquist
for a noiseless channel, another by Shannon for a noisy channel.
39

Noiseless Channel: Nyquist Bit Rate


For a noiseless channel, the Nyquist bit rate formula defines the theoretical
maximum bit rate.

Where B is the bandwidth


L is the Levels in signal

Example:- Consider a noiseless channel with a bandwidth of 3000 Hz transmitting a


signal with two signal levels. The maximum bit rate can be calculated as

Example:-
We need to send 265 kbps over a noiseless (ideal) channel with a bandwidth of 20
kHz. How many signal levels do we need?
We can use the Nyquist formula as shown:
265,000 = 2  20,000  log 2 L → log 2 L = 6.625 L = 26.625 = 98.7 levels

Since this result is not a power of 2, we need to either increase the number of levels
or reduce the bit rate.
If we have 128 levels, the bit rate is 280 kbps. If we have 64 levels, the bit rate is 240
kbps.
Noisy Channel: Shannon Capacity :
For a noisy channel, we have

C = B . log 2 (1 + SNR)
In this formula,
B is the bandwidth of the channel,
SNR is the signal-to noise ratio, and
C is the capacity of the channel in bits per second

Example:- Consider an extremely noisy channel in which the value of the signal-to-
noise ratio is almost zero.
In other words, the noise is so strong that the signal is faint.
For this channel the capacity C is calculated as shown below.
C = B log 2 (1 + SNR) = B log 2 (1 + 0) = B log 2 1 = B  0 = 0
This means that the capacity of this channel is zero regardless of the bandwidth.
In other words, the data is so corrupted in this channel that it is useless when
received.
40

Example:- We can calculate the theoretical highest bit rate of a regular telephone
line. A telephone line normally has a bandwidth of 3000 Hz (300 to 3300 Hz) assigned
for data communications. The signal-to-noise ratio is usually 3162.
For this channel the capacity is calculated as shown below.

C = B log 2 (1 + SNR) = 3000 log 2 (1 + 3162) = 34,881 bps

This means that the highest bit rate for a telephone line is 34.881 kbps.

If we want to send data faster than this, we can either increase the bandwidth of the
line or improve the signal-to noise ratio.

Using Both Limits :


In practice, we need to use both limits.

C = B . log 2 (1 + SNR)
AND

Bit Rate = 2 . B . log 2 L

Example:-
We have a channel with a 1-MHz bandwidth. The SNR for this channel is 63. What
are the appropriate bit rate and signal level?
Solution
First, we use the Shannon formula to find the upper limit.

C = B log 2 (1 + SNR) = 106 log 2 (1 + 63) = 106 log 2 64 = 6 Mbps


The Shannon formula gives us 6 Mbps, the upper limit. For better performance we
choose something lower, 4 Mbps, for example. Then we use the Nyquist formula to
find the number of signal levels.

4 Mbps = 2  1 MHz  log 2L → log 2L = 2 → L = 4


Performance :
• Bandwidth
• Throughput
• Latency (Delay)
• Bandwidth-Delay Product
• Jitter
41

Up to now, we have discussed the tools of transmitting data (signals) over a network
and how the data behave.
One important issue in networking is the performance of the network—how good is
it?
Bandwidth
One characteristic that measure network performance is bandwidth.

Example:- The bandwidth of a subscriber line is 4 kHz for voice or data. The
bandwidth of this line for data transmission can be up to 56 kbps, using a
sophisticated modem to change the digital signal to analog.
If the telephone company improves the quality of the line and increases the
bandwidth to 8 kHz, we can send 112 kbps.

Example:- For example, one can say that the bandwidth of a fast Ethernet network is
100 Mbps. This means we can send 100 Mbps through this network.

Throughput:
• The throughput is the measure of how fast we can actually send data through a
network.
Latency (Delay):
• The latency or delay defines how long it takes for an entire message to completely
arrive at the destination from the time the first bit is sent out from the source.
• We say that normally have four types of delay: propagation delay, transmission delay,
queuing delay, and processing delay.
The latency or total delay is
Latency = propagation delay + transmission delay + queuing delay + processing
delay

Bandwidth-Delay Product : Bandwidth and delay are two performance metric of a


link.
However, what is very important in data communications is the product of the two,
the bandwidth-delay product.

Example:-
We can think about the link between two points as a pipe.
We can say that the volume of the pipe defines the bandwidth-delay product
42

Bandwidth-Delay Product :

Case 1

Case 2
43

Jitter Another performance issue that is related to delay is jitter.


We can roughly say that jitter is a problem if different packets of data encounter
different delays and the application using the data at the receiver site is time-
sensitive (audio and video data, for example).
If the delay for the first packet is 20ms, for the second is 45ms, and for the third is
40ms, then the real-time application that uses the packets endures jitter.

DIGITAL TRANSMISSION :

• A computer network is designed to send information from one point to


another.
• This information needs to be converted to either a digital signal or an analog
signal for transmission.

Digital-to-Digital Conversion :
• In this section, we see how we can represent digital data by using digital
signals.
• The conversion involves three techniques: line coding, block coding, and
scrambling.
• Line coding is always needed; block coding and scrambling may or may not be
needed.

Line Coding :

• Line coding is the process of converting digital data to digital signals.


• We assume that data, in the form of text, numbers, graphical images, audio,
or video, are stored in computer memory as sequences of bits.

Line Coding: Line coding is the process of converting a sequence of bits into a digital
signal. At the sender’s side, digital data is encoded into a digital signal, and at the
receiver’s side, the digital data is decoded back from the signal.
Signal Element vs. Data Element:
44

• Data Element: The smallest unit of information that can be transmitted, which is the
bit in digital communications.
• Signal Element: The shortest time-based unit of the digital signal that carries the
data element.
Essentially, data elements (bits) represent the information to be sent, while signal
elements are the actual carriers used for transmission over the medium.

We define a ratio r which is the number of data elements carried by each signal
element. Figure shows several situations with different values of r.

Line Coding Schemes :


We can roughly divide line coding schemes into five broad categories,

Unipolar Scheme: In a unipolar scheme, all the signal levels are positioned on one
side of the time axis, either above or below it. This means that the signal uses only
positive or zero voltage, but not both.
NRZ (Non-Return-to-Zero):
45

• In a Non-Return-to-Zero (NRZ) unipolar scheme, the positive voltage represents a bit


1, and zero voltage represents a bit 0.
• The term "non-return-to-zero" refers to the fact that the signal does not return to the
zero level in the middle of a bit period—it stays at the same level for the entire
duration of the bit.

Polar Schemes: In polar encoding, the signal voltages are positioned on both sides of
the time axis, meaning the voltage can be either positive or negative.
Non-Return-to-Zero (NRZ):
• Polar NRZ encoding uses two distinct voltage levels to represent binary data.
• There are two variations of polar NRZ encoding: NRZ-L and NRZ-I.
NRZ-L (NRZ-Level):
• In NRZ-L, the level of the voltage defines the bit's value:
o Positive voltage: represents bit 0 or 1 (depending on the scheme).
o Negative voltage: represents the opposite bit.
NRZ-I (NRZ-Invert):
• In NRZ-I, the bit's value depends on the change or lack of change in the voltage level:
o If the voltage remains the same (no change), the bit is 0.
o If the voltage changes (inverts), the bit is 1.
46

Unipolar vs Polar Scheme:


• Power Efficiency:
o Unipolar Scheme: Requires double the power compared to its polar
counterpart (for NRZ). This makes it more costly and less efficient for data
communication.
o Polar Scheme: Uses less power for transmitting the same amount of data,
making it more energy-efficient.
• Baseline Wandering: refers to the gradual shift in the average voltage level of a
signal, which can occur when there is a long sequence of identical bits (such as all 0s
or all 1s).

o Unipolar Scheme: Baseline wandering is a significant issue, especially when


there is a long sequence of identical bits (0s or 1s), causing the average signal
power to drift.
o Polar Scheme (NRZ-L): Also experiences baseline wandering, but it is less
severe compared to the unipolar scheme. However, this issue is still
prominent in NRZ-L encoding.
• Synchronization:
o Unipolar Scheme: Synchronization problems arise when the sender and
receiver clocks are not in sync.
o Polar NRZ-L: Suffers from synchronization issues, especially during long
sequences of the same bit, causing more severe problems.
o Polar NRZ-I: Better handles synchronization because a change in voltage can
help maintain sync between the sender and receiver clocks.
47

Transmission Media :
• Positioning:
o Transmission media are the physical materials through which data is
transmitted. They are situated below the physical layer in the OSI model.
o Technically, they are considered to be at Layer 0, which is below the defined
OSI layers.
• Role:
o The physical layer is responsible for managing and controlling the
transmission media. It defines how data is encoded into signals and
transmitted through these media.
• Examples:
o Copper cables: such as twisted pair and coaxial cables.
o Fiber optics: which use light to transmit data.
o Wireless: such as radio waves and microwaves used in Wi-Fi and cellular
networks.

In telecommunications, transmission media can be divided into two broad


categories: guided and unguided.
Guided media include twisted-pair cable, coaxial cable, and fiber-optic cable.
Unguided medium is free space.

Guided Media :
Guided media, which are those that provide a conduit from one device to another,
include twisted-pair cable, coaxial cable, and fiber-optic cable.
• A signal traveling along any of these media is directed and contained by the physical
limits of the medium.
• Twisted-pair and coaxial cable use metallic (copper) conductors that accept and
transport signals in the form of electric
• 1. Twisted-Pair Cable:
• A twisted pair consists of two conductors (normally copper), each with its own plastic
• insulation, twisted together, as shown in Figure 7.3.
48


• One of the wires is used to carry signals to the receiver, and the other is used only
• as a ground reference. The receiver uses the difference between the two.
• In addition to the signal sent by the sender on one of the wires, interference (noise)
• and crosstalk may affect both wires and create unwanted signals.

If the two wires are parallel, the effect of these unwanted signals is not the same in
both wires because they are at different locations relative to the noise or crosstalk
sources (e.g., one is closer and the other is farther). This results in a difference at the
receiver

Twisted-Pair Cable:
• Purpose: Reduces interference and crosstalk by maintaining a balance between the
two wires.
• How It Works: Wires are twisted around each other. In one twist, one wire might be
closer to a noise source, and in the next twist, the other wire might be closer. This
helps ensure that both wires are equally affected by external noise, reducing
interference at the receiver.

Unshielded Twisted-Pair (UTP) Cable:


• Description: The most common type of twisted-pair cable used for communication.
• Advantages: Cost-effective and relatively simple to install.
• Drawbacks: More susceptible to external noise and interference compared to
shielded cables.

Shielded Twisted-Pair (STP) Cable:


• Description: Features additional metal shielding around each pair of wires.
• Advantages: Improved protection against external noise and crosstalk, leading to
better signal quality.
• Drawbacks: Bulkier and more expensive compared to UTP cables.
49

Connectors
The most common UTP connector is RJ45 (RJ stands for registered jack), as shown
in Figure 7.5. The RJ45 is a keyed connector, meaning the connector can be inserted
in only one way.

Performance
One way to measure the performance of twisted-pair cable is to compare
attenuation versus frequency and distance. A twisted-pair cable can pass a wide
range of frequencies.
Figure shows that with increasing frequency, the attenuation, measured in
decibels per kilometer (dB/km), sharply increases with frequencies above 100 kHz.
Note that gauge is a measure of the thickness of the wire.
50

Coaxial Cable
Structure:
• Central Core Conductor: Solid or stranded wire (usually copper) for carrying electrical
signals.
• Insulating Sheath: Prevents interference and maintains signal integrity.
• Outer Conductor: Metal foil or braid for shielding against noise.
• Outer Insulating Sheath: Provides additional protection.
• Plastic Cover: Final layer for extra protection.
Functionality:
• Handles higher frequencies than twisted-pair cables.
• Shields against external noise for clearer signals.
Applications:
• Cable TV, internet connections, and high-frequency data transmission.

Coaxial Cable Standards


Coaxial cables are categorized by their Radio Government (RG) ratings. Each RG
number denotes a unique set of physical specifications, including the wire gauge of
the inner conductor, the thickness and type of the inner insulator, the construction of
the shield, and the size and type of the outer casing. Each cable defined by an RG
rating is adapted for a specialized function, as shown in Table 7.2.
51

Coaxial Cable Connectors


To connect coaxial cables to devices, various connectors are used. The most common
is the Bayonet Neill-Concelman (BNC) connector.
Types of BNC Connectors:
• BNC Connector: Standard connector for coaxial cables.
• BNC T Connector: Allows for branching a single coaxial cable into two.
• BNC Terminator: Used to terminate the end of a coaxial cable to prevent signal
reflection.
Figure 7.8 illustrates these connector types.

Performance of Coaxial Cable


• Attenuation: Coaxial cables generally exhibit higher attenuation compared to
twisted-pair cables. This means that signals weaken more rapidly over distance in
coaxial cables.
• Bandwidth: Despite the higher attenuation, coaxial cables support much higher
bandwidths than twisted-pair cables. This allows them to carry a greater amount of
data at higher frequencies.
• Repeaters: Due to the higher attenuation, coaxial cables often require the use of
repeaters to boost the signal strength and maintain signal quality over long distances.
52

Switching :

Introduction
• Problem of Connection: In a network with multiple devices, connecting each pair
directly or through a central device (in a mesh or star topology) becomes impractical
and inefficient as the network grows larger.
• Solution - Switching: Switching involves using a network of interconnected devices
called switches. These switches facilitate communication by creating temporary
connections between devices.
• Switched Network: This network architecture uses switches to manage and direct
data traffic efficiently, reducing the need for a direct, dedicated connection between
every pair of devices. Switches dynamically establish connections as needed,
optimizing the use of network resources.

The end systems (communicating devices) are labeled A, B, C, D, and so on, and the
switches are labeled I, II, III, IV, and V. Each switch is connected to multiple links.
53

Packet Switching
• Packet switching involves dividing a message into packets of fixed or variable size for
transmission across a network. Each packet is sent independently and can take
different routes to the destination.
• Resource Allocation: Unlike circuit switching, packet switching does not reserve
bandwidth or processing time for packets. Instead, resources are allocated
dynamically on a first-come, first-served basis. Packets wait in queue if there is
congestion or if other packets are being processed.
• Types of Packet-Switched Networks:
o Datagram Networks
o Virtual Circuit Networks

Datagram Networks:

• Independent Packets: In a datagram network, each packet (datagram) is treated


independently. Packets from the same message can travel different paths to the
destination.
• Figure 8.7 shows how the datagram approach is used to deliver four packets from
station A to station X. The switches in a datagram network are traditionally referred
to as routers.
54

• Connectionless Nature: Datagram networks are called connectionless because


switches (packet switches) do not maintain any information about the state of a
connection. There are no setup or teardown phases for connections.
• Destination Address: Each packet has a header that includes a destination address.
When a switch receives a packet, it uses this address to consult its routing table and
forward the packet through the appropriate port.

• Efficiency: Datagram networks are generally more efficient than circuit-switched


networks. Resources are allocated dynamically only when there are packets to
transfer. If there is a delay between packets from the same source, the network can
use the available resources for other packets during this time.
• Delay: The delay in a datagram network can be higher compared to a virtual-circuit
network. Packets may experience variable delays at switches, and since packets from
the same message may not travel the same path, their delays can vary.
55

Virtual-Circuit Networks
• Virtual-circuit networks combine features of both circuit-switched and datagram
networks.
• Setup and Teardown: Like circuit-switched networks, virtual-circuit networks involve
setup and teardown phases in addition to data transfer. During the setup phase,
resources may be allocated for the connection.
• Resource Allocation: Resources can be allocated either during the setup phase (as in
circuit-switched networks) or on demand (as in datagram networks).
• Packetization: Data is packetized, and each packet includes a header with an address.
However, this address has local jurisdiction, specifying the next switch and channel,
rather than end-to-end destination.
• Path Consistency: All packets from the same virtual circuit follow the same path,
which is established during the connection setup phase. This ensures consistent
routing for packets.
• Implementation: Virtual-circuit networks are typically implemented in the data-link
layer. In contrast, circuit-switched networks operate at the physical layer, and
datagram networks function at the network layer. However, these implementations
may evolve over time.

Addressing
In a virtual-circuit network, two types of addressing are involved: global and local
Addressing in Virtual-Circuit Networks
56

Global Addressing:
• Definition: Unique address assigned to each source or destination, either within the
network or internationally.
• Purpose: Used to create a virtual-circuit identifier (VCI) for managing connections.
Three Phases:
1. Setup Phase:
o Function: Source and destination use global addresses to help switches create
table entries for the connection.
2. Data Transfer Phase:
o Function: Data is transmitted using the established virtual circuit.
3. Teardown Phase:
o Function: Source and destination notify switches to delete the virtual circuit
entry.

Data-Transfer Phase
To transfer a frame from a source to its destination, all switches need to have a table
entry for this virtual circuit. The table, in its simplest form, has four columns. This
means that the switch holds four pieces of information for each virtual circuit that is
already set up.
57

Setup Phase :

1. Setup Request:
o Action: Source A sends a setup request to destination B, including global
addresses.
o Process: Request travels through the network to intermediate switches.
2. Switch Actions:
o Intermediate Switches: Update routing tables with the virtual circuit
information and map identifiers to ports and next switches.
o Path Establishment: Ensure a path from A to B is established and resources
are allocated.
3. Acknowledgment:
o Action: Setup acknowledgment is sent back from destination B to source A.
o Process: Each switch updates its table to confirm successful setup.
4. Completion:
o Outcome: Virtual circuit is established; data transfer can begin using the
assigned identifier.

Setup Phase
1. Source A Sends Setup Frame:
o Action: Source A sends a setup frame to Switch 1.
2. Switch 1 Processing:
o Action: Switch 1 receives the setup request frame.
o Process:
▪ Incoming Port: Port 1.
▪ Incoming VCI: Chooses an available VCI (14).
▪ Outgoing Port: Port 3.
▪ Unknown: Outgoing VCI (to be determined during acknowledgment).
▪ Forwarding: Switch 1 forwards the frame through port 3 to Switch 2.
58

3. Switch 2 Processing:
o Action: Switch 2 receives the setup request frame.
o Process:
▪ Incoming Port: Port 1.
▪ Incoming VCI: Chooses VCI (66).
▪ Outgoing Port: Port 2.
▪ Unknown: Outgoing VCI (to be determined during acknowledgment).
▪ Forwarding: Switch 2 forwards the frame through port 2 to Switch 3.
4. Switch 3 Processing:
o Action: Switch 3 receives the setup request frame.
o Process:
▪ Incoming Port: Port 2.
▪ Incoming VCI: Chooses VCI (22).
▪ Outgoing Port: Port 3.
▪ Unknown: Outgoing VCI (to be determined during acknowledgment).
▪ Forwarding: Switch 3 forwards the frame to Destination B.
5. Destination B Processing:
o Action: Destination B receives the setup frame.
o Process:
▪ Assign VCI: Chooses VCI (77) for incoming frames from Source A.
▪ Purpose: Identifies frames coming from A.
Acknowledgment Phase
1. Acknowledgment from Destination B:
o Action: Destination B sends an acknowledgment frame to Switch 3.
o Content:
▪ Global Addresses: Source and Destination addresses.
▪ Incoming VCI: 77 (for frames from A).
▪ Switch Action: Switch 3 updates its table with VCI 77 as the outgoing
VCI for the entry.
2. Acknowledgment from Switch 3 to Switch 2:
o Action: Switch 3 sends an acknowledgment to Switch 2.
o Content:
▪ Incoming VCI: 22 (from Switch 2).
▪ Switch Action: Switch 2 updates its table with the outgoing VCI for the
entry.
3. Acknowledgment from Switch 2 to Switch 1:
o Action: Switch 2 sends an acknowledgment to Switch 1.
o Content:
▪ Incoming VCI: 66 (from Switch 1).
▪ Switch Action: Switch 1 updates its table with the outgoing VCI for the
entry.
4. Acknowledgment from Switch 1 to Source A:
o Action: Switch 1 sends an acknowledgment to Source A.
o Content:
59

▪ Incoming VCI: 14 (assigned by Switch 1).


▪ Switch Action: Source A uses this as the outgoing VCI for data frames.
5. Completion:
o Outcome: All switches and the source have updated their tables with the
appropriate VCI information, and the virtual circuit is ready for data transfer.

Teardown Phase
1. Teardown Request:
o Action: After all frames have been sent, Source A sends a special teardown
request frame to Destination B.
o Purpose: Initiates the process of releasing resources and closing the virtual
circuit.
2. Teardown Confirmation:
o Action: Destination B responds with a teardown confirmation frame.
o Purpose: Acknowledges the teardown request and indicates readiness to
close the circuit.
3. Table Deletion:
o Action: All switches involved in the virtual circuit delete the corresponding
entries from their tables.
o Purpose: Frees up resources and updates internal tables to reflect the
circuit's closure.
Efficiency
• Resource Reservation:
o Setup Phase: Resources are reserved in advance, leading to consistent delays
for packets (since the path is established).
o On-Demand: Resources are allocated as packets arrive, which can lead to
varying delays depending on the current network load.
• Resource Availability Check:
o Like checking for table availability at a restaurant without making a
reservation, a source can verify resource availability without committing to a
reservation. This can help in efficient planning and saving time.
60

Delay in Virtual-Circuit Networks


• Setup Delay: A one-time delay occurs when setting up the virtual circuit, which is the
time needed to establish the path through the network.
• Teardown Delay: A one-time delay occurs when tearing down the virtual circuit after
data transfer is complete.
• Data Transfer: If resources are allocated during the setup phase, packets experience
uniform delays. If resources are allocated on demand, delays may vary.
Example:
• A packet traveling through two switches in a virtual-circuit network will experience
delays based on the setup phase and teardown process, but once the circuit is
established, individual packets encounter consistent delays through the network.
61

Review Questions :
1. Explain CSMA/CD
2. Explain three types of addresses.
3. Explain Standard Ethernet frame format.

Data-Link Layer:

Introduction :
The internet consists of multiple networks connected by devices like routers or
switches.
• For data (packets) to travel from one host to another, it must pass through various
networks.
• At the data-link layer, the focus is on how these packets are transmitted across the
physical connections between networks.

Communication at the data-link layer:


62

(extra:
This diagram represents a network setup between two organizations, "Sky Research"
(represented by Alice) and "Scientific Books" (represented by Bob), and the
communication between them through various networks.
1. Alice's Side (Sky Research)
o Alice is connected to the network through routers (R1, R2) and switches.
o Each layer of the OSI model is depicted (Application, Transport, Network,
Data-link, Physical).
o Data moves from Alice through a series of routers (R1, R2, R3, R4, R5) in
different networks (ISP, WAN).
2. Bob's Side (Scientific Books)
o Bob's network setup is similar, with routers (R6, R7) connecting them to their
ISP.
o Data passes through similar layers (Application, Transport, Network, Data-link,
Physical) for Bob as well.
3. Network Layers and Routing
o The network layers, from the application layer to the physical layer, show how
data is encapsulated and transmitted across the network.
o The routers (R1–R7) and switches manage data routing and switching over
WANs and ISPs, connecting both organizations.
o Different links (Point-to-point WAN) show the connections between routers
and across ISPs.
4. Key Network Devices
o Routers (R1–R7): Direct data between networks.
o Switches: Enable data communication within the local networks.
5. Communication Flow
o Data from Alice goes through her local network and routers, crosses the
National ISP, and reaches Bob’s network through another ISP.
o Each router in the path forwards data using the network and data-link layers,
ensuring communication between the two organizations.
)
Nodes and Links :

• Node: Any device that can send or receive data, like a computer, printer, or server.
Example: A laptop connected to the internet is a node.
• Router: A device that directs data between different networks, helping it find the
best path.
Example: Your home Wi-Fi router directs internet traffic between your devices and
the internet.
• Links in a network refer to the pathways or connections (physical or logical) that
allow data to travel between nodes, such as computers and routers.
• Communication at the data-link layer is node-to-node.
63

• Data must pass through several networks (LANs and WANs) to reach its destination.
• Routers connect these LANs and WANs.
• Nodes refer to the end hosts and routers, while the networks in between are called
links.

Two Types of Links :


• The data-link layer manages the use of the transmission medium (cable, air, etc.).
• It can either utilize the entire capacity or just part of it.
• Point-to-point link: Uses the full capacity of the medium between two nodes.
• Broadcast link: Shares the medium's capacity among multiple nodes.
Two Sublayers :
1)Data Link Control (DLC)
2)Media Access Control (MAC)
Dividing the data-link layer into two sublayers:

Data Link Control (DLC):


• Handles communication procedures between two adjacent nodes.
• Manages both dedicated and broadcast links.
• Includes functions for framing, flow control, and error control.
64

• It manages how data is transmitted between two devices on the same network.
• Includes functions for framing, flow control, and error control.

• Framing: Breaks data into smaller units (frames) for easier transmission

• Error detection and correction: Ensures that data is correctly sent and received, fixing
errors if they occur.
• Flow control: Regulates the pace of data transmission to prevent overwhelming the
receiver.

Framing:

• Framing in the Data Link Layer refers to the process of organizing raw bits into units
called frames to distinguish one set of data from another.
• Just as the envelope separates and organizes letters for delivery, framing separates
data for transmission, so the receiving device can easily identify and process each unit
of data.
• framing ensures that data is packaged in a way that makes it easy to send, receive, and
identify.
• Purpose: The data link layer needs to pack bits into frames so that each frame is
distinguishable from another.

• (Example: Just like pauses in speech or full stops in writing help distinguish sentences,
framing helps distinguish different sets of data.
• Similar to how letters are inserted into envelopes to keep them separate, frames
encapsulate data to distinguish one set of bits from another during transmission.)

Frame Size:

• Fixed Size: No need to define boundaries. Example: ATM WAN.


• Variable Size: Boundaries need to be defined.

Approaches:

• Character-Oriented: Uses specific characters to define frame boundaries.


• Bit-Oriented: Uses bit patterns for boundary definition

Character-Oriented Framing:
65

• Data is composed of 8-bit characters (e.g., ASCII).


• Frame includes:
o Header: Contains source, destination addresses, and control info.
o Trailer: Contains error detection bits.
• A flag (1-byte) is added at the beginning and end of each frame to separate
them.

A frame in a character-oriented protocol :

Character-Oriented Framing (Issues and Solution):

• Popular when only text was exchanged.


• The flag could be any unused character.
• When a flag (special character) appears in the actual data, it could cause confusion.
To avoid this, the character ESC (Escape) is stuffed before the flag in the data.
• Example:

• Data: AflagC (flag is part of data)

• To solve this, a byte-stuffing technique was introduced, where extra bytes are added
to differentiate between data and the actual flag.

Byte stuffing and unstuffing :


66

In byte stuffing, special characters called flags are used to mark the beginning and end of a
frame. If the data itself contains this flag, it can confuse the receiver, as the flag is meant to
indicate control information.

To prevent confusion, the ESC (Escape) character is inserted before any occurrence of the
flag within the data. The receiver, upon detecting the ESC character, knows that the next
character is part of the data and not a delimiter.

Example:

• Original Data: AflagC (where flag is part of the data)


• After Byte Stuffing: FlagAESCFlagCFlag
o An ESC is inserted before the flag in the data (ESCFlag), telling the receiver
that this flag is part of the data.

Thus, byte stuffing ensures correct interpretation of data and control characters during
transmission.

Byte Unstuffing is the reverse process of byte stuffing, used at the receiver's end to restore
the original data by removing the ESC (Escape) characters that were added during byte
stuffing.

Steps in Byte Unstuffing:

• The receiver examines the incoming data.


• When the receiver encounters an ESC character, it understands that the following
character is part of the actual data, not a control character (like a flag).
• The receiver removes the ESC character and treats the next character as data.

Example:

• Received Data (with stuffing): FlagAESCFlagCFlag


o The receiver detects the ESC before the second flag and knows this flag is
part of the data, not a delimiter.
• After Byte Unstuffing: AflagC
67

o The ESC is removed, and the flag is correctly interpreted as part of the
original data.

In short, byte unstuffing removes the ESC characters and restores the original frame,
allowing the receiver to differentiate between data and frame delimiters.

Bit-Oriented Framing :

• In bit-oriented framing data is a sequence of bits.


• To separate one frame from another, we normally use an 8-bit flag (01111110).
• To prevent that a byte to be interpreted as a flag, we do bit stuffing.
• A frame in a bit-oriented protocol :

Frame Format:
• Beginning Sequence: 8 bits (e.g., 01111110)
• Header: 16 bits
• Body: Variable length
• Ending Sequence: 8 bits (same as beginning sequence)

Bit Stuffing Concept

• Issue: If the data contains a pattern resembling the beginning or ending sequence, it
may be misinterpreted as the start or end of a frame, leading to framing errors.
• Solution: Bit stuffing to prevent misinterpretation.
o Procedure:
▪ Detect: If five consecutive 1s are encountered in the data.
▪ Stuff: Insert a 0 after these five 1s.
How Bit Stuffing Works :
• Sender’s Role:
o Checks for five consecutive 1s.
o Inserts a 0 after the fifth 1.
68

• Receiver’s Role:
o Detects the 0 after five 1s.
o Removes the 0 to reconstruct the original data.

Bit stuffing and unstuffing:


69

Error Control:

• Error occurs when the data received is not the same as the data sent.
• Error Control Involves both error detection and error correction.
• Ensures the receiver can inform the sender of any lost or damaged frames during
transmission and coordinates the retransmission of those frames.
• Error Detection: Helps identify if an error has occurred in the transmitted data.
• Error Correction: Goes a step further by identifying which specific bit(s) are
erroneous and correcting them

Types of Errors:

• Single-bit error: Only 1 bit of the data unit (byte, character, or packet) changes from
1 to 0 or 0 to 1.

• Burst error: Two or more bits in the data unit are changed from 1 to 0 or 0 to 1 due
to interference affecting signal shape.

o Example: If 101010 is sent and 111011 is received, more than one bit has
changed, indicating a burst error.
o Length of Burst Error: Calculated by counting the number of bits from the
first to the last changed bit, including unchanged bits in between.
70

Redundancy :

The central concept in detecting or correcting errors is redundancy.

To be able to detect or correct errors, we need to send some extra bits with our data.

These redundant bits are added by the sender and removed by the receiver.

Redundant bits enable the receiver to detect or correct corrupted bits.

Coding:

• Redundancy is achieved through various coding schemes.


• The sender adds redundant bits through a process that creates a relationship
between the redundant bits and the actual data bits.
• The receiver checks the relationships between the two sets of bits to detect errors.
• The ratio of redundant bits to data bits and the robustness of the process are
important factors in any coding scheme.

Categories:

• Block Coding
• Convolution Coding

Block Coding :
Definition:
• Block coding is an error detection and correction technique where data is divided
into fixed-size blocks, and redundant bits are added to detect or correct errors during
transmission.
• In block coding, we divide our message into blocks, each of k bits, called data-words.
• We add r redundant bits to each block to make the length n = k + r.
• The resulting n-bit blocks are called codewords.
Error Detection:
How can errors be detected by using block coding?
If the following two conditions are met, the receiver can detect a change in the original
codeword.
71

1. The receiver has (or can find) a list of valid codewords.


2. The original codeword has changed to an invalid one.
Process of error detection in block coding :

Example:Let us assume that k = 2 and n = 3. Table 3.1 shows the list of datawords and
codewords.

Datawords Codewords Datawords Codewords

00 000 10 101

01 011 11 110

1. The receiver receives 011. It is a valid codeword. The receiver extracts the dataword
01 from it.
2. The codeword is corrupted during transmission, and 111 is received (the leftmost bit
is corrupted). This is not a valid codeword and is discarded.
3. The codeword is corrupted during transmission, and 000 is received (the right two
bits are corrupted). This is a valid codeword. The receiver incorrectly extracts the
dataword 00. Two corrupted bits have made the error undetectable.
Dataword: The Block of data is called dataword and size of data word is k.
Codeword:Combination of dataword (k) and redundant bit (r) called Codeword(n).
In a block coding scheme with k=2 and n=3:
• Dataword Length (k): 2 bits
• Codeword Length (n): 3 bits
72

• Redundant Bits (r): 1 bit


To ensure even parity in the codewords:
• Dataword: 2 bits
• Add a parity bit to make the total number of 1s in the 3-bit codeword even.
• Example: For the dataword 10 (which has 1, an odd number), the parity bit added
would be 1, making the codeword 101, which has an even number of 1s (2 1s).
This process ensures that the codeword maintains even parity.
Hamming Distance:
Hamming Code is used for error detection and correction in data transmission.

• Definition: Hamming distance between two code words is the number of positions at
which the corresponding bits differ.
• Calculation: Perform XOR between two code words; the number of 1s in the result
gives the Hamming distance.
• Error Detection Capability: If the minimum Hamming distance of a code is d, the
code can detect up to d−1 bit errors. For example, if the minimum Hamming distance
is 2, it can detect only single-bit errors.
Note: that the Hamming distance is a value greater than or equal to zero.
Example:
Let us find the Hamming distance between two pairs of words.
1. The Hamming distance d (000, 011) is 2 because (000 XOR 011) is 011 (two 1s).
2. The Hamming distance d (10101, 11110) is 3 because (10101 XOR 11110) is 01011
(three 1s).
Geometric concept explaining dmin in error detection:

Linear Block Codes :

• If XOR of 2 valid codewords is a valid codewords, then we can say that set of
codewords are linear block codes.
73

• Today almost all error detecting codes are linear block codes because Non-zero block
codes are difficult to implement.
• These codes have special property that minimum hamming distance is the minimum
number of 1’s in an non-zero valid codeword.
• consider a simple linear block code with k=2k = 2k=2 (dataword length) and n=3n =
3n=3 (codeword length). The codeword is generated by adding a parity bit for error
detection.
Datawords (k = 2 bits)
• 00
• 01
• 10
• 11
Codewords (n = 3 bits, ensuring even parity)
We generate the codewords by adding a parity bit (the third bit) to ensure even parity:
1. 00 → 000 (parity bit = 0 to ensure even number of 1s)
2. 01 → 011 (parity bit = 1 to ensure even number of 1s)
3. 10 → 101 (parity bit = 1 to ensure even number of 1s)
4. 11 → 110 (parity bit = 0 to ensure even number of 1s)
Valid Codewords
• 000
• 011
• 101
• 110
Linear Property
• XOR (addition modulo-2) of two valid codewords results in another valid codeword.
For example:
• XOR of 011 and 101:
o 011 ⊕ 101 = 110 (which is a valid codeword)
Minimum Hamming Distance
The minimum Hamming distance is the smallest number of differing bits between any two
valid codewords. Here, the smallest difference is 2 bits (e.g., 000 and 011 differ in 2 bits). So,
the minimum Hamming distance is 2.
74

Parity-Check Code :

• Perhaps the most familiar error-detecting code is the parity-check code.


• This code is a linear block code.
• In this code, a k-bit dataword is changed to an n-bit codeword where n = k + 1.
• The extra bit, called the parity bit, is selected to make the total number of 1s in the
codeword even.
Simple parity-check code C(5, 4) :

Encoder and decoder for simple parity-check code :


75

Let us look at some transmission scenarios. Assume the sender sends the dataword 1011.
The codeword created from this dataword is 10111, which is sent to the receiver. We
examine five cases:
1. No error occurs; the received codeword is 10111. The syndrome is 0. The dataword
1011 is created.
2. One single-bit error changes a1. The received codeword is 10011. The syndrome is 1.
No dataword is created.
3. One single-bit error changes r0. The received codeword is 10110. The syndrome is 1.
No dataword is created. Note that although none of the dataword bits are corrupted,
no dataword is created because the code is not sophisticated enough to show the
position of the corrupted bit.
4. An error changes r0 and a second error changes a3. The received codeword is 00110.
The syndrome is 0. The dataword 0011 is created at the receiver. Note that here the
dataword is wrongly created due to the syndrome value. The simple parity-check
decoder cannot detect an even number of errors. The errors cancel each other out
and give the syndrome a value of 0.
5. Three bits—a3, a2, and a1—are changed by errors. The received codeword is 01011.
The syndrome is 1. The dataword is not created. This shows that the simple parity
check, guaranteed to detect one single error, can also find any odd number of errors.
6. A parity-check code can detect an odd number of errors.

A parity-check code ensures that the total number of 1s in a codeword is even. If an odd
number of errors (like 1, 3, or 5 bits) occur, this will change the number of 1s to odd, and
the receiver can detect the error.
Example:
• Original codeword: 1011 → Parity bit added: 10111 (even number of 1s).
• If one bit flips (e.g., 10101), the number of 1s becomes odd. The receiver detects this
error.
This is how parity-check codes detect odd-numbered errors.
7. parity check cannot reliably detect an even number of errors.
76

Error Scenarios:
1. Single-bit Error:
o Received Data: 11011010
o Count of 1s: 5 (odd)
o Parity Check: Fails (error detected)
2. Two-bit Error:
o Received Data: 11100010
o Count of 1s: 4 (even)
o Parity Check: Passes (error not detected)
3. Three-bit Error:
o Received Data: 11101011
o Count of 1s: 6 (even)
o Parity Check: Passes (error detected if originally odd parity)
Cyclic Codes :
• Cyclic codes are special linear block codes with one extra property.
• In a cyclic code, if a codeword is cyclically shifted (rotated), the result is another
codeword.
• For example, if 1011000 is a codeword and we cyclically left-shift, then 0110001 is
also a codeword.
• We can create cyclic codes to correct errors.
• In this section, we simply discuss a subset of cyclic codes called the cyclic
redundancy check (CRC), which is used in networks such as LANs and WANs.
77

CRC encoder and decoder :

This diagram represents Cyclic Redundancy Check (CRC), a method used in


networking to detect errors in transmitted data.
• Sender Side (Encoder):
o The sender has a dataword (represented as a3 a2 a1 a0), which is the original
data to be transmitted.
o The dataword is input into a generator along with a divisor (d3 d2 d1 d0), a
shared value between the sender and receiver.
o The generator calculates a remainder (r2 r1 r0) using the dataword and
divisor.
o The dataword and remainder are combined to form a codeword (a3 a2 a1 a0
r2 r1 r0), which is transmitted.
• Transmission:
o The codeword is sent over an unreliable transmission medium, which may
introduce errors.
• Receiver Side (Decoder):
o The receiver receives the codeword (b3 b2 b1 b0 q2 q1 q0), which may or
may not have errors.
o A checker uses the same shared divisor to calculate a syndrome (s2 s1 s0).
o The decision logic checks if the syndrome is zero. If it is, the data is error-free
and the dataword is accepted. If not, the data is discarded.
In short, this process ensures that any transmission errors can be detected by the
receiver, providing reliable communication despite potential data corruption.
78

Cyclic Redundancy Check (CRC) - Error Detection and Correction


Introduction to CRC:
• Cyclic Redundancy Check (CRC): A method used for error detection in data
communication.
• Key Features:
o Detects odd number of errors, single-bit errors, and even double-bit errors.
o Capable of detecting burst errors up to the length of the polynomial degree.
o Widely used in real-life applications for checking errors.
How CRC Works:
• Polynomial Representation:
o Data (message) is represented as a polynomial, and CRC involves dividing this
data by a generator polynomial (divisor).
o The degree of the polynomial determines the length of the burst error it can
detect.
Steps in CRC Calculation:
1. Identify the Dividend:
o The message (data) can be given directly in binary or polynomial form.
2. Determine the Divisor (Generator Polynomial):
o The divisor can be given in polynomial form (e.g., x4+x3+1x^4 + x^3 +
1x4+x3+1).
o Convert this polynomial to binary by identifying coefficients:
▪ x4x^4x4 has a coefficient of 1, x3x^3x3 has a coefficient of 1, x2x^2x2
is absent (coefficient 0), and so on.
▪ Example: x4+x3+1x^4 + x^3 + 1x4+x3+1 becomes 11001 in binary.
3. Appending Redundant Bits:
o Redundant Bits (r): Number of zeros appended is equal to the highest degree
of the polynomial.
o Example: If the degree is 4, append four 0s to the message.
4. Binary Division Using XOR:
o Perform binary division of the message (after appending zeros) by the divisor
using XOR operation.
o XOR Operation:
79

▪ 0⊕0=0
▪ 1⊕1=0
▪ 0⊕1=1
▪ 1⊕0=1
o Remainder (CRC bits): The remainder after division is the CRC, which is
appended to the original data.
5. Transmission of Data:
o The final codeword sent to the receiver includes the original message and the
CRC bits.
o Example: If the message is 10 bits and CRC is 4 bits, the total transmitted data
is 14 bits.
Error Detection at the Receiver:
• Re-checking with Divisor:
o The receiver divides the received codeword by the same divisor.
o If the remainder is 0, there is no error.
o If the remainder is non-zero, an error is detected.
Efficiency:
• Efficiency Calculation:
o Efficiency =
Number of data bitsTotal bits transmitted×100%\frac{\text{Number of data
bits}}{\text{Total bits transmitted}} \times
100\%Total bits transmittedNumber of data bits×100%
o Example: If 10 data bits and 4 CRC bits are sent, efficiency =
1014×100%\frac{10}{14} \times 100\% 1410×100%.
Important Tips for CRC:
• Always start binary division with the leading 1.
• If the divisor is given directly in binary, append (number of bits in divisor - 1) zeros to
the message.
• Focus on the remainder as it forms the CRC bits, not the quotient.
80

Division in the CRC decoder for two cases:

Checksum :
A checksum detects errors in data transmission by performing calculations on data blocks
to ensure the received data matches the sent data.
Approach:
• Sender: Break the message into blocks, sum them, perform ones' complement,
generate the checksum, and send it with the message.
• Receiver: Sum the received blocks and checksum. If the result is all ones, data is
error-free; otherwise, it's rejected.
Example: Break message into 4 blocks, sum them, apply ones' complement for checksum,
and verify at the receiver.
Performance: Detects errors effectively but may fail if errors cancel each other out.
Two DLC Protocols :

• HDLC
• Point-to-Point.
81

HDLC :
High-level Data Link Control (HDLC) is a bit-oriented protocol for communication over point-
to-point and multipoint links. It implements the stop-and-wait protocol.
Three Transfer Modes in HDLC (Simple Explanation):
1. Normal Response Mode (NRM):
o There is one main station (primary) and several secondary stations.
o The main station sends commands, and the secondary stations can only reply.
o Used for both one-to-one (point-to-point) and one-to-many (multipoint)
connections.

Normal response mode :

2. Asynchronous Balanced Mode (ABM):


o Both stations are equal and can send commands or respond.
o Commonly used today.
o Used for one-to-one connections.

3. Asynchronous Response Mode (ARM):


o Similar to NRM, but here secondary stations can start communication
without waiting for the main station's command.
o This mode is less commonly used.
82

HDLC frames :

Extra(
Flag Field:
• Contains the synchronization pattern 01111110.
• Marks the start and end of a frame.
Address Field:
• Contains the address of the secondary station.
• When the primary station sends, it includes the destination address.
• When the secondary station sends, it includes the source address.
• Can be 1 byte or more, depending on network requirements.
Control Field:
• Used for flow and error control.
• Length: 1 or 2 bytes.
Information Field:
• Contains user data from the network layer or management information.
• Length varies depending on the network.
FCS Field:
• Error detection field (Frame Check Sequence).
• Contains a 2- or 4-byte CRC for error checking.
)
Types of HDLC Frames:
1. I-Frame (Information Frame):
o If the first bit of the Control Field is '0', it is an I-Frame (used for transmitting
data).
2. S-Frame (Supervisory Frame):
83

o If the first two bits of the Control Field are '10', it is an S-Frame (handles error
control and flow control).
3. U-Frame (Unnumbered Frame):
o If the first two bits of the Control Field are '11', it is a U-Frame (used for link
management tasks).

Control field format for the different frame types :

Point-to-Point Protocol (PPP) :


One of the most common protocols for point-to-point access is the point-to-point
protocol.

• PPP is a byte-oriented protocol used in the Data Link Layer.


• Primarily used in WAN communications, especially for Internet links between
routers.
• It supports multiprotocol data transmission between two directly connected
devices (e.g., routers).
• Handles high-speed and heavy-load broadband communications.
PPP frame format

• Flag: Marks the start and end of the frame (8 bits, pattern: 01111110).
• Address Field: Set to broadcast (all ones, 8 bits).
• Control Field: Constant value (11000000, 8 bits).
• Protocol Field: Indicates the type of data in the payload (8 or 16 bits).
• Payload: Contains data from the network layer (up to 1500 bytes, negotiable).
84

Transition phases :

Multiplexing in PPP :

Multilink PPP :
85

Media Access Protocols :


Data link control is divided into two groups: data link control and media access
control.

Medium Access Control (MAC) Protocols:


• These protocols belong to the Data Link Layer in the OSI model and are specifically
part of the MAC sublayer (as opposed to the LLC sublayer which handles error
control, flow control, etc.).
• Medium Access Control (MAC) focuses on managing access to the shared
communication medium, especially when multiple devices (stations) share the same
link (e.g., in a LAN with bus topology).
Categories of Medium Access Control Protocols:
1. Random Access Protocols:
o Stations have equal priority, can send data at any time, and there is no
predefined turn.
o Common random access protocols:
▪ Aloha (Pure and Slotted Aloha): Focus on vulnerable time and
throughput (fixed formulas used in numericals).
▪ CSMA (Carrier Sense Multiple Access): Most important for exams like
GATE and UGC-NET.
▪ CSMA/CD (Collision Detection) and CSMA/CA (Collision Avoidance):
CD detects collisions, and CA tries to prevent them.

2. Controlled Access Protocols:


Control is exerted to avoid collisions, and stations are given explicit turns to
transmit data.
86

o Two types:
▪ Polling: A controller decides which station can send data at a given
time.
▪ Token Passing: A token circulates among stations, and only the station
holding the token can transmit.
3. Channelization Protocols:
o Medium is divided into separate channels for each station.
o Types include:
▪ FDMA (Frequency Division Multiple Access): Each station uses a
separate frequency band.
▪ TDMA (Time Division Multiple Access): Time is divided into slots, and
each station transmits during its assigned slot.
Carrier Sense Multiple Access (CSMA) :
Carrier sense multiple access (CSMA) requires that each station first listen to the
medium (or check the state of the medium) before sending.
In other words, CSMA is based on the principle “sense before transmit” or “listen
before talk.”
Space and time model of a collision in CSMA :

Vulnerable time in CSMA :

• The vulnerable time for CSMA is the propagation time Tp.


• This is the time needed for a signal to propagate from one end of the medium
to the other.
• When a station sends a frame and any other station tries to send a frame
during this time, a collision will result.
87

Persistence methods:
1-Persistent CSMA:

• The 1-persistent method is simple and straightforward.

• Behavior: Continuously senses the channel. If the channel is idle, it immediately


transmits data.

• Issue: High chance of collisions, especially if multiple nodes detect an idle channel at
the same time.

• Behavior of 1-persistent method :

Flow Diagram of 1- persistent method :

Non(0)-Persistent CSMA:
• Process: A station senses the line before sending a frame.
• Idle Line: If the line is idle, the station sends the frame immediately.
• Busy Line: If the line is busy, the station waits for a random amount of time before
sensing the line again.
• Collision Reduction: The method reduces collisions as it's unlikely that multiple
stations will wait the same random time and retry sending together.
88

• Drawback: It decreases network efficiency since the medium may remain idle while
stations with frames wait to send.
• Advantages: Fewer collisions compared to 1-Persistent, but might experience delays
if the channel becomes idle before the waiting period ends.
• Behavior of Non-persistent method :

Flow Diagram of Non-persistent method :

P-Persistent CSMA:
• Usage: Applied when the channel is divided into time slots with duration equal to or
greater than the maximum propagation time.
• Advantages: Combines benefits of both non-persistent and 1-persistent methods.
• Collision Reduction: Reduces chances of collisions while stations attempt to send
data.
• Efficiency: Improves network efficiency compared to other methods.
89

Behavior of three persistence methods :

p-Persistent Method Steps:


1. Line Check: The station senses the line for idleness.
2. Probability of Sending:
o With probability p, the station sends its frame.
o With probability q = 1 − p, the station waits for the next time slot.
3. Line Recheck:
o If the line remains idle, repeat from step 1.
o If the line becomes busy, the station treats it like a collision and follows the
backoff procedure.
Flow Diagram of p-persistent method :
90

Flow diagram for three persistence methods:

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


• Collision Detection: CSMA/CD enhances the basic CSMA by handling collisions when
they occur.
• Monitoring After Sending: After a station sends a frame, it monitors the medium to
check if the transmission was successful.
• Action After Collision: If a collision is detected, the station stops sending and waits
before retransmitting the frame.
• Retransmission: The station resends the frame after a random backoff time to avoid
another collision.
Collision of the first bits in CSMA/CD :
91

Collision and abortion in CSMA/CD :

Minimum Frame Size in CSMA/CD:


• Frame Size Restriction: There must be a minimum frame size to ensure that collisions
can be detected during transmission.
• Collision Detection Requirement: The sending station needs to detect any collision
before the entire frame is sent, allowing it to abort the transmission.
• No Copy After Transmission: Once the entire frame is sent, the station no longer
monitors for collisions and does not keep a copy of the frame.
• Formula: The frame transmission time TfrT_{fr}Tfr must be at least twice the
maximum propagation time TpT_{p}Tp, i.e., Tfr=2×TpT_{fr} = 2 \times T_{p}Tfr=2×Tp.
92

Example :
A network using CSMA/CD has a bandwidth of 10 Mbps. If the maximum propagation time
(including the delays in the devices and ignoring the time needed to send a jamming signal,
as we see later) is 25.6 μs, what is the minimum size of the frame?
Solution
The minimum frame transmission time is Tfr = 2 × Tp = 51.2 μs. This means, in the worst case,
a station needs to transmit for a period of 51.2 μs to detect the collision. The minimum size
of the frame is 10 Mbps × 51.2 μs = 512 bits or 64 bytes. This is actually the minimum size of
the frame for Standard Ethernet, as we will see later in the chapter.

Flow diagram for the CSMA/CD :

Energy level during transmission, idleness, or collision :


93

CSMA/CA :
Carrier sense multiple access with collision avoidance (CSMA/CA) was invented for
wireless networks.
Controlled Access:
• Definition: Stations coordinate with each other to determine which one has the right
to send data.
• Authorization: A station must be authorized by others before it can send data.
• Methods: Three controlled-access methods are used to manage this process.

Reservation Method:
• Definition: Stations must make a reservation before sending data.
• Time Division: Time is divided into intervals.
• Reservation Frame: Each interval starts with a reservation frame.
• Data Frames: Data frames are sent after the reservation frame within the same
interval.

Reservation access method :

Polling Method:
• Topology: Involves a primary station and secondary stations.
• Data Exchange: All communications are routed through the primary device, even if
the destination is another secondary device.
• Control: The primary device controls the link and decides which secondary device
can use the channel at any given time.
• Operation: Secondary devices follow the instructions of the primary device for
accessing the channel.
94

Select and poll functions in polling-access method :

Token Passing Method:


• Network Organization: Stations are arranged in a logical ring.
• Predecessor and Successor: Each station has a predecessor (the station before it in
the ring) and a successor (the station after it in the ring).
• Token: A special token circulates around the ring. Only the station holding the token
can send data.
• Control: The token ensures that only one station can transmit at a time, preventing
collisions.
Logical ring and physical topology in token-passing access method :
95

Link-Layer Addressing:
• IP Addresses Limitation: IP addresses alone can't direct a datagram through the
network.
• Role of IP Addresses: Define the source and destination endpoints.
• Need for Link-Layer Addressing: Necessary to specify which physical links (or
network segments) the packet should traverse to reach its destination.

IP addresses and link-layer addresses in a small internet :

Three Types of Addresses :


Some link-layer protocols define three types of addresses:

• Unicast
• Multicast
• Broadcast

Unicast Address:
• Definition: A unique address assigned to each host or interface for one-to-one
communication.
• Format in Ethernet:
o Length: 48 bits (6 bytes).
o Representation: 12 hexadecimal digits separated by colons.
96

o Example: A2:34:45:11:92:F1.

• The least significant bit of the most significant byte (first byte) should be 0. For the
address A2:34:45:11:92:F1, convert the first byte A2 to binary:
• A2 in hexadecimal is 10100010 in binary.
• The least significant bit of 10100010 is 0 .
Multicast Address
• Definition: A multicast address is used for one-to-many communication, allowing
data to be sent from one source to multiple destinations simultaneously.
• Example: In Ethernet, multicast addresses have a specific pattern in their
hexadecimal representation. For example, 01:00:5E:7F:12:34 is a multicast address.
• Identification: To determine if an address is a multicast address:
o In Ethernet, the least significant bit of the first byte of the address should be
set to 1. This bit indicates that the address is a multicast address.
o For instance, in the example 01:00:5E:7F:12:34, the first byte is 01, where the
least significant bit is 1, confirming it's a multicast address.
Broadcast Address
A broadcast address is used for one-to-all communication, meaning it targets all devices
on a network. In Ethernet, a broadcast address is a specific type of address where all bits
are set to 1.
Example of a Broadcast Address:
• FF:FF:FF:FF:FF:FF
How to Determine if an Address is a Broadcast Address:
1. Examine the Address:
o A broadcast address in Ethernet will have all bits set to 1 in its 48-bit address.
In hexadecimal notation, this appears as FF:FF:FF:FF:FF:FF.
2. Characteristics:
o All bytes: Each byte in the address is FF (255 in decimal), which corresponds
to all 1s in binary.
Example:
• Address: FF:FF:FF:FF:FF:FF
• Binary Representation:
11111111:11111111:11111111:11111111:11111111:11111111
Determining Broadcast Address:
97

• Address Pattern: All hexadecimal digits are F, indicating all bits are set to 1.
• Usage: It sends messages to all devices on the local network segment.
So, FF:FF:FF:FF:FF:FF is a broadcast address used for sending messages to every device
on the network.
Address Resolution Protocol (ARP) :
• Purpose: ARP is used to find the link-layer address (MAC address) corresponding to a
given IP address.
• Function: When a node has a packet to send and knows the IP address of the
destination, it uses ARP to determine the destination's MAC address.
• Process:
1. Request: The node sends out an ARP request on the local network asking
"Who has this IP address? Please send me your MAC address."
2. Response: The node with the matching IP address replies with its MAC
address.
• Role: ARP operates at the boundary between the network layer and the link layer,
helping to map IP addresses to MAC addresses.

You might also like