Computer Networking Unit 2

Download as pdf or txt
Download as pdf or txt
You are on page 1of 53

Data link Layer Protocol

Unit 2
Cont..
Simplest Protocol
• Simplest protocol is unidirectional,
• There is no acknowledgment (ACK).
• Also, as there is no data loss in the transmission, there is no need for
data re-transmission.
Cont..
• Flow Chart for Simplest Protocol

•There is no error and flow control


mechanism.
•The DLL at the receiving end
immediately removes the frame
header and transfers the data to
the subsequent layer.
Cont..
• Stop and wait protocol Flow Flow Chart for Stop
and wait Protocol

Rule 1: Sender sends one data packet at a time.


Rule 2: Sender sends the next packet only when it
receives the acknowledgment of the previous packet.
Noisy Channel
Cont..
1. Stop and Wait ARQ (Automatic Repeat Request)

• 2 States:
• Ready state
• Blocking State
• Sending Node: Receives from
network layer save a copy and
there will be a timer
i) If timeout --> resends
ii) Corrupted ack --> Discards
iii) Error free ack --> Stops the timer

• Receiving Node:
i) Error free frame --> Deliver
ii)Corrupted frame --> Discards
• Receiver Node
• Flow Chart for Stop and wait
ARQ Protocol
Cont..
2. Go-Back-N Automatic Repeat Request
• Step 1 − In this protocol we can send several frames before receiving
acknowledgements.
• Step 2 − we keep a copy of these frames until the acknowledgment
arrives.
• Step 3 − Frames from a sending station are numbered sequentially.
However, we need to include the sequence number of each frame in
the header; we need to set a limit.
• Step 4 − If the header of the frame allows m bits for the sequence
number, the sequence numbers range from 0 to 2m-1. We can also
repeat the sequence numbers.
Example
• For m = 2, the range of sequence numbers is: 0 to 3, i.e.
0,1,2,3, 0,1,2,3,…
Cont..

= Sliding Window

Window Size = 3
• Problem − Consider a binary
signal sent over 4 KHZ wide
channel, find out the
maximum data rate for
noiseless and a noisy channel
whose signal to noise ratio is
20dB.
Cont..
Selective Repeat ARQ
• Selective repeat protocol, also called Selective Repeat ARQ
(Automatic Repeat reQuest), is a data link layer protocol that
uses sliding window method for reliable delivery of data
frames.
• Here, only the error frame or lost frames are retransmitted,
while the good frames are received and buffered.
Cont..
Explanation
• Step 1 − Frame 0 sends from sender to receiver and set timer.
• Step 2 − Without waiting for acknowledgement from the receiver
another frame, Frame1 is sent by sender by setting the timer for it.
• Step 3 − In the same way frame2 is also sent to the receiver by setting
the timer without waiting for previous acknowledgement.
• Step 4 − Whenever sender receives the ACK0 from receiver, within the
frame 0 timer then it is closed and sent to the next frame, frame 3.
• Step 5 − whenever the sender receives the ACK1 from the receiver,
within the frame 1 timer then it is closed and sent to the next frame,
frame 4.
• Step 6 − If the sender doesn’t receive the ACK2 from the receiver
within the time slot, it declares timeout for frame 2 and resends the
frame 2 again, because it thought the frame2 may be lost or damaged.
Cont..
High-level Data Link Control (HDLC)
• High-level Data Link Control (HDLC) is a group of
communication protocols of the data link layer for transmitting
data between network points or nodes.
• It is a bit - oriented protocol
• Transfer Modes
• Normal Response Mode (NRM)
• Asynchronous Balanced Mode (ABM)

•Normal Response Mode (NRM) − Here, two


types of stations are there, a primary station
that send commands and secondary station
that can respond to received commands. It is
used for both point - to - point and multipoint
communications.
Cont..
• Asynchronous Balanced Mode (ABM) − Here, the
configuration is balanced, i.e. each station can both send
commands and respond to commands. It is used for only point
- to - point communications.
Cont..
HDLC Frame
• HDLC is a bit - oriented protocol where each frame contains up to six
fields. The structure varies according to the type of frame. The fields of a
HDLC frame are −
• Flag − It is an 8-bit sequence that marks the beginning and the end of the
frame. The bit pattern of the flag is 01111110.
• Address − It contains the address of the receiver. If the frame is sent by
the primary station, it contains the address(es) of the secondary station(s).
If it is sent by the secondary station, it contains the address of the primary
station. The address field may be from 1 byte to several bytes.
• Control − It is 1 or 2 bytes containing flow and error control information.
• Payload − This carries the data from the network layer. Its length may
vary from one network to another.
• FCS − It is a 2 byte or 4 bytes frame check sequence for error detection.
The standard code used is CRC (cyclic redundancy code)
Cont..
Types of HDLC Frames
• There are three types of HDLC frames. The type of frame is
determined by the control field of the frame −
• I-frame − I-frames or Information frames carry user data from
the network layer. They also include flow and error control
information that is piggybacked on user data. The first bit of
control field of I-frame is 0.
Cont..
• S-frame − S-frames or Supervisory frames do not contain
information field. They are used for flow and error control
when piggybacking is not required. The first two bits of control
field of S-frame is 10.

• U-frame − U-frames or Un-numbered frames are used for


myriad miscellaneous functions, like link management. It may
contain an information field, if required. The first two bits of
control field of U-frame is 11.
Point to Point Protocol (PPP)
• Point - to - Point Protocol (PPP) is a communication protocol of
the data link layer that is used to transmit multiprotocol data
between two directly connected (point-to-point) computers.
• It is a byte - oriented protocol that is widely used in broadband
communications having heavy loads and high speeds.
• No flow control
Services Provided by PPP
•Stating authentication rules of the
•Defining the frame format of the data
communicating devices.
to be transmitted.
•Providing address for network
•Defining the procedure of establishing
communication.
link between two points and exchange
•Providing connections over multiple
of data.
links.
•Stating the method of encapsulation of
network layer data in the frame.
Cont..
Components of PPP
• Link Control Protocol (LCP) − It is responsible for establishing,
configuring, testing, maintaining and terminating links for
transmission.
• Authentication Protocols (AP) − These protocols authenticate
endpoints for use of services.
• Password Authentication Protocol (PAP)
• Challenge Handshake Authentication Protocol (CHAP)
• Network Control Protocols (NCPs) − These protocols are used for
negotiating the parameters and facilities for the network layer.
Some of the NCPs of PPP are
• Internet Protocol Control Protocol (IPCP)
• OSI Network Layer Control Protocol (OSINLCP)
• Internetwork Packet Exchange Control Protocol (IPXCP)
• IPv6 Control Protocol (IPV6CP)
Cont..
PPP Frame
• PPP is a byte - oriented protocol where each field of the frame is
composed of one or more bytes. The fields of a PPP frame are −
• Flag − 1 byte that marks the beginning and the end of the frame. The bit
pattern of the flag is 01111110.
• Address − 1 byte which is set to 11111111 in case of broadcast.
• Control − 1 byte set to a constant value of 11000000.
• Protocol − 1 or 2 bytes that define, It can either be user information or other
information.
• Payload − This carries the data from the network layer. The maximum
length of the payload field is 1500 bytes. This can also be negotiated
between the endpoints of communication.
• FCS − It is a 2 byte or 4 bytes frame check sequence for error detection.
The standard code used is CRC (cyclic redundancy code)
Cont..
• Transition Phases in the PPP Protocol

Failed
Medium Access Control (MAC)
• A media access control is a network data transfer policy that
determines how data is transmitted between two computer terminals
through a network cable.
• The Data Link Layer is responsible for transmission of data between
two nodes. Its main functions are-

• DLC is responsible for reliable transmission of


message over transmission channel by using • MAR/MAC are required to decrease
techniques like framing, error control and collision and avoid crosstalk.
flow control. • Multiple nodes
• Point to point
Cont..
• Carrier-sense multiple access (CSMA)
• Carrier-sense multiple access with collision
detection (CSMA/CD)
• Carrier-sense multiple access with collision
avoidance (CSMA/CA)
• Frequency Division Multiple Access (FDMA)
• Time-division multiple access (TDMA)
• Code-division multiple access (CDMA)
ALOHA
Aloha is a Random-Access Protocol
• In this protocol, all the station has the equal priority to send the data over
a channel.
• Here, one or more stations cannot depend on another station nor any
station control another station.
• Depending on the channel's state (idle or busy), each station transmits the
data frame.
• However, if more than one station sends the data over a channel, there
may be a collision or data conflict.
• Due to the collision, the data frame packets may be lost or changed. And
hence, it does not receive by the receiver end.
Cont..
• Pure ALOHA
Cont..
Cont..
• Slotted ALOHA
Cont..
Carrier Sense Multiple Access (CSMA)

• To minimize the chance of collision and, therefore, increase the


performance.
• Principle of CSMA:"Sense before transmit"
• Carrier busy-Transmission is taking place
• Carrier idle-No transmission currently taken place
Types of CSMA:
• 1-persistent
• Non-persistent
• P-persistent
• O- Persistent
Cont..
• CSMA Types and Access Modes
• 1-Persistent: In the 1-Persistent mode of CSMA that defines each
node, first sense the shared channel and if the channel is idle, it
immediately sends the data. Else it must wait and keep track of the
status of the channel to be idle and broadcast the frame
unconditionally as soon as the channel is idle.
• Non-Persistent: It is the access mode of CSMA that defines before
transmitting the data, each node must sense the channel, and if the
channel is inactive, it immediately sends the data. Otherwise, the
station must wait for a random time (not continuously), and when the
channel is found to be idle, it transmits the frames.
Cont..
• P-Persistent: It is the combination of 1-Persistent and Non-persistent
modes. The P-Persistent mode defines that each node senses the
channel, and if the channel is inactive, it sends a frame with
a P probability. If the data is not transmitted, it waits for a (q = 1-p
probability) random time and resumes the frame with the next time
slot.

• O- Persistent: It is an O-persistent method that defines the


superiority of the station before the transmission of the frame on the
shared channel. If it is found that the channel is inactive, each station
waits for its turn to retransmit the data.
CSMA/CD (Collision Detection)
• CSMA/CD is a media access control method that was widely used in
Early Ethernet technology(It is used in 802.3 Ethernet network
cable)/LANs when there used to be shared Bus Topology and each
node ( Computers) were connected By Coaxial Cables.
• CSMA/CD is one such technique where different stations that follow
this protocol agree on some terms and collision detection measures
for effective transmission.
• This protocol decides which station will transmit when so that data
reaches the destination without corruption.
Cont..
• How CSMA/CD works?
• Step 1: Check if the sender is ready for transmitting data packets.
• Step 2: Check if the transmission link is idle?
• keep on checking….
• Sender sends dummy data on the link
• Step 3: Transmit the data & check for collisions.
• CSMA/CD does not use an ‘acknowledgment’ system.
• It checks for successful and unsuccessful transmissions through collision
signals.
• Step 4: If no collision was detected in propagation, the sender
completes its frame transmission and resets the counters.
Maximum
15
retransmit
can do
CSMA/CA (Collision Avoidance)
• It means that it is a network protocol that uses to avoid a collision
rather than allowing it to occur.
• Collisions are avoided using 3 CSMA/CA strategies IFS
means
-Inter-frame space wait for
period
-Contention Window of time
-Acknowledgement
• CSMA/CA Flow Diagram
Reservation
• Whenever we travel from a train or an airplane, the first thing we do
is to reserve our seats, similarly here a station must make a
reservation first before transmitting any data-frames.
• This reservation in Computer Network timeline consists of two kinds
of periods:
1.Reservation interval of a fixed time duration
2.Data transmission period of variable frames
Polling
Cont..
2 function of polling
• 1.Poll function: if the primary wants to receive data, it asks the
secondaries if they have anything to send
• 2. Select function: If the primary wants to send data, it tells the
secondary to get ready to receive
We calculate the efficiency of this method in terms of time for polling &
time required for transmission of data.
• Tpoll = time for polling
• Tt = time required for transmission of data
• So, efficiency = Tt / (Tt + Tpoll)
Cont.. if primary station wants to send data to the secondary stations,
it sends a select message, and if the secondary station accepts
the request from the primary station, then it sends back an
acknowledgement and then primary station transmits the data
Poll function and in return receives an acknowledgement.

Select function
Token Passing

(when ever station holding token it can send the data)


Cont..
The nodes which hold the token
can send the data

The token circulation around the table (or a


network ring) is in a predefined order.
Cont..
• Performance of Token Passing
Frequency Division Multiple Access (FDMA)
• FDMA is a type of channelization protocol.
• In this bandwidth is divided into various frequency bands.
• Each station is allocated with band to send data and that band is
reserved for particular station for all the time
Frequency Band sending data

Station 1
unused frequency bands are called
as guard bands

Station 2

Station 3
Time Division Multiple Access (TDMA)
• TDMA is the channelization protocol in which bandwidth of channel is
divided into various stations on the time basis.
• There is a time slot given to each station, the station can transmit
data during that time slot

Each station must aware of


its beginning of time slot and
the location of the time slot.
Gap between 2 time slot is Guard time
Code Division Multiple Access (CDMA)
• In CDMA, all the stations can transmit
data simultaneously.
• It allows each station to transmit data
over the entire frequency all the time.
• Multiple simultaneous transmissions
are separated by unique code
sequence.
• Each user is assigned with a unique
code sequence.
4 stations marked as 1, 2, 3 and 4.
Data assigned with respective stations as d1, d2, d3 and d4
Code assigned with respective stations as c1, c2, c3 and c4.

You might also like