CNC Unit-1
CNC Unit-1
UNIT-II
16 Hours
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 :
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.
• 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
• 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
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.
• 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
• Physical Topology: Refers to the physical layout of a network, including how devices
and links are arranged.
• Types of Topologies:
• Mesh Topology:
HUB
• 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."
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
• 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.
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:
• Packet-Switched Network:
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
• 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.
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
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
1. Physical layer:
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 :
Source-to-destination delivery :
3) Transport layer :
• 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
4. Session 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
• 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
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.
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
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
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
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.
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
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
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.
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.
C = B . log 2 (1 + SNR)
AND
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.
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
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
DIGITAL 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: 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.
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
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
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.
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.
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.
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:
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
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
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.
(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.
• 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:
Approaches:
Character-Oriented Framing:
65
• To solve this, a byte-stuffing technique was introduced, where extra bytes are added
to differentiate between data and the actual flag.
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:
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.
Example:
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 :
Frame Format:
• Beginning Sequence: 8 bits (e.g., 01111110)
• Header: 16 bits
• Body: Variable length
• Ending Sequence: 8 bits (same as beginning sequence)
• 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.
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 :
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.
Coding:
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
Example:Let us assume that k = 2 and n = 3. Table 3.1 shows the list of datawords and
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
• 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:
• 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 :
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
▪ 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
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.
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).
• 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
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 :
Persistence methods:
1-Persistent CSMA:
• Issue: High chance of collisions, especially if multiple nodes detect an idle channel at
the same time.
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 :
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
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.
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.
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
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.
• 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.