Unit II Lower Layers
Unit II Lower Layers
Dhavale
Assistant Professor,
Department of Science & Computer Science, MIT ACSC, Alandi(D), Maharashtra, India
CS242 : Computer Networks - I
Course Objectives
Course Outcomes
3. Analyze the requirements for a given organizational structure and select the
most appropriate networking architecture and technologies
COURSE CONTENTS
2. Design issues of Data Link Layer, Services - Framing, flow control, error control, congestion control, Link layer addressing
3. Framing Methods - Character Count, Flag bytes with Byte Stuffing, Flags bits with Bit Stuffing, Physical Layer Coding
Violations
4. The Channel allocation problem, Static and dynamic allocation, Media Access Methods - Taxonomy of multiple-access
protocols
5. Switching and TCP/IP layers, Types - circuit switching, packet switching and message switching
6. Wired LANs - Standard Ethernet characteristics, Addressing, Access method, implementation, Fast and Gigabit Ethernet
7. Wireless LANs - Architectural comparison, Characteristics, Access control, IEEE 802.11 architecture, Physical layer, MAC
• Bandwidth
• Bandwidth in Hertz
• Bandwidth in bits per second
• Throughput
• Latency ( Delay)
Latency = propagation time + transmission time + queuing time +
processing delay
• Jitter - different packets of data encounter different delays
Latency
Latency = propagation time + transmission time + queuing time +
processing delay
• Propagation time - measures the time required for a bit to travel from
the source to the destination
Propagation time = Distance/Propagation speed
• Transmission Time - time between the first bit leaving the sender and
the last bit arriving at the receiver
Transmission time = Message size/Bandwidth
• Queuing Time - the time needed for each intermediate device to hold
the message before it can be processed
• Processing Delay
Bandwidth-Delay product
• The bandwidth-delay product defines the number of bits that can fill the link.
Bandwidth-Delay product
• The bandwidth-delay product defines the number of bits that can fill the link.
5
5
Formulas to remember
The power of a signal is 10 mW and the power of the
noise is 1 μW; what are the values of SNR and SNRdB ?
Calculate values of SNR and SNRdB for a noiseless
channel.
The value of SNRdB is 0dB calculate SNR.
The value of SNRdB is 20dB calculate SNR.
What is the channel capacity of noiseless channel is
bandwidth is 3500 Hz and there are 2 signal levels.
What is the channel capacity of noiseless channel is
bandwidth is 1000 Hz and there are 8 signal levels.
We need to send data at 280 Kbps over a noiseless
channel with bandwidth of 20 KHz. How many signal
levels do we use.
A telephone line with bandwidth 3000 Hz is used for
data communication with SNR 3162. For this channel
calculate the capacity.
The signal to noise ratio is 36 dB and channel
bandwidth is 2MHz, calculate channel capacity.
Calculate maximum bit rate using Shannon’s Theorem
for a channel having bandwidth 31000 Hz and S/N ratio
20 dB.
Calculate maximum bit rate for a channel having
bandwidth 1800 Hz if
1) S/ N ratio is 0 dB
2) S/ N ratio is 20 dB.
A network with bandwidth of 10 Mbps can pass only an
average of 12,000 frames per minute with each frame
carrying an average of 10,000 bits. What is the throughput
of this network?
What is the propagation time if the distance between the
two points is 12,000 km? Assume the propagation speed
to be 2.4 × 108 m/s in cable.
What are the propagation time and the transmission time
for a 2.5-kbyte message (an e-mail) if the bandwidth of the
network is 1 Gbps? Assume that the distance between the
sender and the receiver is 12,000 km and that light travels
at 2.4 × 108 m/s.
What are the propagation time and the transmission time
for a 5-Mbyte message (an image) if the bandwidth of the
network is 1 Mbps? Assume that the distance between the
sender and the receiver is 12,000 km and that light travels
at 2.4 × 108 m/s.
Bandwidth-Delay product
• The bandwidth-delay product defines the number of bits that can fill the link.
Bandwidth-Delay product
• The bandwidth-delay product defines the number of bits that can fill the link.
Functions of Datalink layer
• Framing Framing
• Error Control
• Flow Control • Character count
• Flag byte with byte
• Access Control stuffing
• Starting and ending
flags with bit stuffing
• Physical layer coding
violations
Framing
• Frames are the units of digital transmission, particularly in computer networks and
telecommunications.
• Frames are comparable to the packets of energy called photons in the case of light
energy. Frame is continuously used in Time Division Multiplexin
• Framing is a function of the data link layer. It provides a way for a sender to
transmit a set of bits that are meaningful to the receiver.
Functions of Datalink layer
• Framing
• Error Control Error Control
• Flow Control • Cyclic redundancy
• Access Control check
• Hamming code
Error Control
Data-link layer uses the techniques of error control simply to ensure and confirm that all the data
frames or packets, i.e. bit streams of data, are transmitted or transferred from sender to receiver with
certain accuracy.
• Error Detection :
• Error detection, as the name suggests, simply means detection or identification of errors.
• These errors may occur due to noise or any other impairments during transmission from transmitter
to the receiver, in communication system.
• Error Correction :
• Error correction, as the name suggests, simply means correction or solving or fixing of errors.
Flow Control
Flow control is a technique that allows two stations working at different
speeds to communicate with each other.
It is a set of measures taken to regulate the amount of data that a sender sends
so that a fast sender does not overwhelm a slow receiver.
In data link layer, flow control restricts the number of frames the sender can
send before it waits for an acknowledgment from the receiver.
Approaches of Flow Control
Approaches of Flow Control
Feedback based Flow Control
Once the receiver receives the frame, it sends an acknowledgment frame back
to the sender.
receiver is ready to accept the next frame. So it sender the next frame in
queue.
Sliding Window Flow Control Techniques in Data Link Layer
This protocol improves the efficiency of stop and wait protocol by allowing
multiple frames to be transmitted before receiving an acknowledgment.
Both the sender and the receiver has finite sized buffers called windows.
The sender and the receiver agrees upon the number of frames to be sent
based upon the buffer size.
Sliding Window Flow Control Techniques in Data Link Layer
• Framing
• Error Control Flow Control
• Flow Control • Stop and wait
• Access Control • Simplex for noisy
channel
• Sliding window
• Go back-N
Congestion Control
Congestion control is a crucial concept in computer networks.
It refers to the methods used to prevent network overload and ensure smooth data
flow.
When too much data is sent through the network at once, it can cause delays and
data loss.
Congestion control techniques help manage the traffic, so all users can enjoy a
stable and efficient network connection.
These techniques are essential for maintaining the performance and reliability of
modern networks.
What is Congestion?
Congestion in a computer network happens when there is too much data being sent at
the same time, causing the network to slow down.
Just like traffic congestion on a busy road, network congestion leads to delays and
sometimes data loss.
When the network can’t handle all the incoming data, it gets “clogged,” making it
difficult for information to travel smoothly from one place to another.
Effects of Congestion in Computer Network
• Improved Network Stability: Congestion control helps keep the network stable by
preventing it from getting overloaded. It manages the flow of data so the network doesn’t
crash or fail due to too much traffic.
• Reduced Latency and Packet Loss: Without congestion control, data transmission can
slow down, causing delays and data loss.
• Enhanced Throughput: By avoiding congestion, the network can use its resources more
effectively. This means more data can be sent in a shorter time.
• Fairness in Resource Allocation: Congestion control ensures that network resources are
shared fairly among users. No single user or application can take up all the bandwidth,
allowing everyone to have a fair share.
Effects of Congestion in Computer Network
• Better User Experience:
When data flows smoothly and quickly, users have a better experience. Websites,
online services, and applications work more reliably and without annoying delays.
Without congestion control, a sudden spike in data traffic can overwhelm the
network, causing severe congestion and making it almost unusable.
Congestion control helps prevent this by managing traffic efficiently and avoiding
such critical breakdowns.
Congestion Control
Functions of Datalink layer
• Framing
• Error Control Access Control
• Flow Control • Random access
• Access Control • Controlled Access
• Channelization
Services provided by datalink layer
Since a link is controlled at the data-link layer, the addresses need to belong to
the data-link layer
LINK-LAYER ADDRESSING
When a datagram passes from the network layer to the data-link layer,the
datagram will be encapsulated in a frame and two data-link addresses are
added to the frame header.
These two addresses are changed every time the frame moves from one link to
another.
Framing Methods
Framing is function of Data Link Layer that is used to separate message from
source or sender to destination or receiver or simply from all other messages
to all other destinations just by adding sender address and destination address.
It includes complete and full addressing, protocols that are essential, and
information under control.
Physical layers only just accept and transfer stream of bits without any regard
to meaning or structure.
Character count method ensures data link layer at the receiver or destination
about total number of characters that follow, and about where the frame
ends.
Character Count
The disadvantage also of using this method i.e., if anyhow character count is
disturbed or distorted by an error occurring during transmission, then
destination or receiver might lose synchronization.
Byte stuffing is a technique that uses an escape character to mark bytes that
are similar to the flag byte
Flag Bytes with Byte Stuffing
In this method a flag byte, is used as both the starting and ending of a frame.
See in the figure below.
Two consecutive flag bytes indicate the end of one frame and the start of the
next frame.
If the receiver ever loses synchronization it can just search for two flag bytes
to find the end of the current frame and the start of the next frame.
Flag byte with byte stuffing
Bit stuffing helps the receiver detect the boundaries between frames
• In the OSI model, the data link layer divides the data received from the physical layer into data
frames.
• In such cases, it’s very difficult to detect the end and beginning of a frame.
• Hence bit stuffing is used to mark the end and beginning of the frames during variable-length
data frame transfer.
Start and end Flag with bit stuffing
Now the question is how can a frame be transmitted, so the receiver can
recognize the start and end frame?
Physical Layer Coding Violations
Encoding violation is method that is used only for network in which encoding
on physical medium includes some sort of redundancy
There are user’s quantity may vary every time the process takes place.
If there are N number of users and channel is divided into N equal-sized sub
channels, Each user is assigned one portion.
If the number of users are small and don’t vary at times, then Frequency
Division Multiplexing can be used as it is a simple and efficient channel
bandwidth allocating technique.
Channel Allocation Methods
Channel allocation methods can be divided by two schemes:
• if there are N users, the frequency channel is divided into N equal sized portions
(bandwidth), each user being assigned one portion.
• since each user has a private frequency band, there is no interference between
users.
• T(FDM) = N*T(1/U(C/N)-L/N)
Where
• C=Capacity of channel
• Instead channels are allotted to users dynamically as needed, from a central pool.
• This allocation scheme optimises bandwidth usage and results is faster transmissions.
• Centralised Allocation
• Distributed Allocation
Centralized Allocation
• How can the station determine the success and failure of transmission?
• Love, peace, and compassion: Aloha can also mean love, peace,
and compassion.
• Pity and grief: Aloha can also mean pity and grief.
• Way of life: Aloha is more than just a greeting, it's a way of life.
ALOHA Random Access Protocol
• ALOHA is a random access protocol and it is designed for accessing
shared medium.
• In this, multiple stations can transmit data at the same time, hence lead
to collision and data being garbled.
• Pure ALOHA
• Slotted ALOHA
Pure ALOHA
• Pure ALOHA allows the stations to transmit whenever they have data to be sent.
• If acknowledgement doesn't come in allotted time then station waits for random
amount of time, which is called as back off time.
• Since different stations wait for different amount of time, the probability of further
collision decreases.
• Whenever two frames try to occupy the channel at the same time, there will be
collision and both the frames will be garbled.
• The throughput of pure ALOHA can be maximized using uniform frame size.
Slotted ALOHA
• It was developed to just to improve the efficiency of pure ALOHA, as
the chances of collision in pure ALOHA are high.
• The time of shared channel is divided in to discrete time intervals
called slots.
• Sending of data is allowed only at the beginning of the slots.
• If a station misses out the allowed time, it must wait for the next slot.
This reduces the probability of collision.
CSMA Protocol
• Carrier Sense Protocol
• To minimize the chance of collision and enhance the performance of
channel, CSMA protocol is used.
• CSMA works on the principle ‘Sense before transmit’.
• Carrier busy : transmission is
taking place
• Carrier Idle : No transmission is
taking place
• The possibility of collision still exist
Because of propagation delay time,
A station sense the medium and find it idle, because first bit sent by
another station is not yet received.
CSMA/CD
• If two stations sense the channel to be idle and begin transmitting
simultaneously, the both will detect the collision immediately.
• The stations consult one another to find which station has the right to
send
• A station cannot send unless it has been authorized by other stations
• There are three popular controlled-access methods
Drawbacks
• This protocol introduces a polling delay, i.e. time required by node to
notify that, it is ready to transmit.
• If the master node fails, the entire channel becomes inoperative.
Controlled access protocols
Reservation
Polling
Token Passing
Token Passing
• A station is authorized to send the data, when it receives a special frame
called token.
• In this method there is no master node.
• A small, special purpose frame known as a token is exchanged among the
nodes in some fixed order.
• When a node receives the token, it holds token, if it has some frames to
transmit, otherwise it immediately forwards the token to the next node.
• If a node have a frames to transmit, when it receives the token, it sends
up maximum no of frames and then forwards the token to the next node.
• It is decentralized protocol and
highly efficient but it has some
disadvantages.
• The failure of one node can crash
the entire channel.
• If node accidently neglects the
release of token, then some
recovery process must be
established to get it back in to
circulation.
CHANNELIZATION
CHANNELIZATION
• A multiple access method in which the available bandwidth of a link is
shared in time, frequency or through code, between different stations
• Each station is allocated a time slot during which it can send data.
• Recent advances in electronic technology have finally made its implementation possible.
• CDMA differs from FDMA because only one channel occupies the entire bandwidth of the link.
• It differs from TDMA because all stations can send data simultaneously; there is no timesharing.
• CDMA is based on coding theory. Each station is assigned a code, which is a sequence of numbers called
chips, as shown in the following figure. The codes are for the previous example.
• Let us assume we have four stations 1, 2, 3, and 4 connected to the same
channel. The data from station 1 are d1 , from station 2 are d2, and so on. The
code assigned to the first station is c1, to the second is c2, and so on. We
assume that the assigned codes have two properties
• If we multiply each code by another, we get 0.
• If we multiply each code by itself, we get 4 (the number of stations).
• Station 1 multiplies its data by its code to get d1.c1, Station 2 multiplies its data
by its code to get d2.c2 and so on.
• The data that go on the channel are the sum of all these term. Any station that
wants to receive data from one of the other three, multiplies the data on the
channel by the code of the sender.
• For example, suppose stations 1 and 2 are talking to each other. Station 2 wants
to get, what station 1 is sending. It multiplies the data on the channel by c1, the
code of station 1.
• data =(d1.c1+d2.c2+d3.c3+d4.c4).c1
• = c1. d1. c1+ c1. d2. c2+ c1. d3. c3+ c1. d4. c4= 4d1