�data-link layer protocols

BESmrt 15,680 views 49 slides May 01, 2017
Slide 1
Slide 1 of 49
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33
Slide 34
34
Slide 35
35
Slide 36
36
Slide 37
37
Slide 38
38
Slide 39
39
Slide 40
40
Slide 41
41
Slide 42
42
Slide 43
43
Slide 44
44
Slide 45
45
Slide 46
46
Slide 47
47
Slide 48
48
Slide 49
49

About This Presentation

�data-link layer protocols


Slide Content

Kamar Khateeb
Abdul Rehman
Raja Mohsin
Umer Raza Rao

Chapter 11
Data Link
Control
(DLC)

Chapter 11: Outline
11.1.1 11.1.1 DLC SERVICESDLC SERVICES
11.1.2 11.1.2 DATA-LINK LAYER PROTOCOLSDATA-LINK LAYER PROTOCOLS
11.1.3 11.1.3 HDLCHDLC
11.1.4 11.1.4 PPPPPP

11.4
11-1 DLC SERVICES11-1 DLC SERVICES
The data link control (DLC) deals with procedures
for communication between two
adjacent nodes.

11.5
11-1 DLC SERVICES11-1 DLC SERVICES
Data link control functions include
● Framing,
● Flow control, and
● Error control

11.6
11.1 Framing (encapsulation)11.1 Framing (encapsulation)
The data-link layer packs bits into frames so that each
frame is distinguishable from another frame.
.

11.7
11.1 Framing11.1 Framing
The postal system practices a type of framing. The
simple act of inserting a letter into an envelope
separates one piece of information from another; the
envelope serves as the delimiter.

11.8
11.1 Framing11.1 Framing

Framing in the data-link layer separates a message by
encapsulating a sender address and a destination
address into a header.

11.9
11.1 Framing11.1 Framing

Framing in the data-link layer separates a message by
encapsulating a sender address and a destination
address into a header.

11.10
11.1 Framing11.1 Framing

Framing techniques include
● Character oriented framing (8 bit characters)
● Bit oriented framing

11.11
11.1 Framing11.1 Framing

Frames may have a particular bit pattern between
frames to help identify the start and end of a frame.
This kind of special bit pattern is referred to as a
“flag”

11.12
Figure 11.1: A frame in a character-oriented protocol

11.13
11.1 Framing11.1 Framing

Problem: the flag bit pattern could appear in the data
portion of the frame.
The problem is solved by stuffing (inserting) a special
byte pattern known as an Escape-character into the
data.

11.14
Figure 11.2: Byte stuffing and unstuffing

11.15
Figure 11.3: A frame in a bit-oriented protocol

Bit Stuffing
Bit oriented frames face the same issue as byte-oriented frames
– the flag pattern can appear in the data.
This is resolved by bit stuffing.

Bit Stuffing
A zero bit is inserted after 5-consecutive one-bits.

11.18
Figure 111.4: Bit stuffing and unstuffing

11.19
11.2 Flow and Error Control11.2 Flow and Error Control
The data-link layer handles flow control and error
control.

11.20
Figure 111.5: Flow control at the data link layer

11.21
11.2 Flow and Error Control11.2 Flow and Error Control
Error Control involves two methods:
In the first method, if the frame is corrupted, it is
silently discarded; if it is not corrupted, the packet is
delivered to the network layer. This method is used
mostly in wired LANs such as Ethernet.
In the second method, if the frame is corrupted, it is
silently discarded; if it is not corrupted, an
acknowledgment is sent (for the purpose of both flow
and error control) to the sender.

Example of flow control:
● A single memory slot is used to hold information for the
receiver node at the data-link layer.
● When this single slot is empty, the data-link layer sends
a request to the sender-node to send the next frame.
Example 111.1
11.22

DATA-LINK LAYER PROTOCOLS
Traditionally four protocols have been defined for the data-link layer
to deal with flow and error control: Simple, Stop-and-Wait, Go-Back-
N, and Selective-Repeat.
 Although the first two protocols still are used at the data-link layer,
the last two have disappeared.
We therefore briefly discuss the first two protocols in this chapter, in
which we need to understand some wired and wireless LANs.
The behavior of a data-link-layer protocol can be better shown as

DATA-LINK LAYER PROTOCOLS
Finite State Machine (FSM)
An FSM is thought of as a machine with a finite number of states.
The machine is always in one of the states until an event occurs.
Each event is associated with two reactions: defining the list
(possibly empty) of actions to be performed and determining the
next state (which can be the same as the current state).
 One of the states must be defined as the initial state, the state in
which the machine starts when it turns on. In Figure 11.6, we show
an example of a machine using FSM.
 We have used rounded-corner rectangles to show states, colored
text to show events, and regular black text to show actions.

Simple Protocol
Simple Protocol
Our first protocol is a simple protocol with neither flow
nor error control. We assume that
the receiver can immediately handle any frame it receives. In
other words, the receiver
can never be overwhelmed with incoming frames. Figure
11.7 shows the layout for this
protocol.

FSMs
The sender site should not send a frame until its network layer has a
message to send.
The receiver site cannot deliver a message to its network layer until a
frame arrives. We can show these requirements using two FSMs. Each FSM
has only one state, the ready
state.
The sending machine remains in the ready state until a request comes
from the process in the network layer.
When this event occurs, the sending machine encapsulates
the message in a frame and sends it to the receiving machine.
The receiving machine remains in the ready state until a frame arrives
from the sending machine.

Stop and wait:
Sender sends one data frame, waits for acknowledgement
(ACK) from receiver before proceeding to transmit next frame –
This simple flow control will break down if ACK gets lost or
errors occur sender may wait for ACK that never arrives

Sender States
The sender is initially in the ready state, but it can move between the ready and blocking state
.Ready State. When the sender is in this state, it is only waiting for a packet from the network layer.
If a packet comes from the network layer, the sender creates a frame, saves a copy of the frame,
starts the only timer and sends the frame. The sender then moves to the blocking state.
Blocking State. When the sender is in this state, three events can occur:
a. If a time-out occurs, the sender resends the saved copy of the frame and restarts the timer.
b. If a corrupted ACK arrives, it is discarded.
c. If an error-free ACK arrives, the sender stops the timer and discards the saved copy of the frame.
It then moves to the ready state.
Receiver
The receiver is always in the ready state. Two events may occur:
a. If an error-free frame arrives, the message in the frame is delivered to the network layer and an
ACK is sent.
b. If a corrupted frame arrives, the frame is discarded.

Piggybacking
Piggybacking
The two protocols we discussed in this section are designed for unidirectional
communication, in which data is flowing only in one direction although the
acknowledgment may travel in the other direction.
 Protocols have been designed in the past to allow data
to flow in both directions. However, to make the communication more
efficient, the data in one direction is piggybacked with the acknowledgment in
the other direction.

In other words, when node A is sending data to node B, Node A also
acknowledges the data received from node B. Because piggybacking makes
communication at the data link layer more complicated, it is not a common
practice.

WHAT IS HDLC….?
 High-level Data Link Control (HDLC) is a
bit- oriented protocol i.e use bits to stuff
flags occurring in data.
 HDLC was defined by ISO for use on both
point-to-point and multipoint data links.
 It supports full-duplex communication i.e
receive and transmit at the same time.

HDLC OVERVIEW
three types of stations
Primary
Secondary
Combined
 three types of data transfer mode
Normal Response mode
Asynchronous Response mode
Asynchronous Balanced mode
Thre types of frames
Unnumbered
information
Supervisory

HDLC , three types of stations
station

HDLC
The three stations are :
Primary station
Has the responsibility of controlling the operation of data flow .
Handles error recovery
Frames issued by the primary station are called commands.
Secondary station,
Operates under the control of the primary station.
Frames issued by a secondary station are called. responses
The primary station maintains a separate logical link with each secondary
station.
Combined station,
Acts as both as primary and secondary station.

UN-
BALANCE
D MODE
BALANCED
MODE

types of data transfer mode
Transfer
Modes

Normal Response Mode (NRM)
Secondary station can send ONLY when the primary station instruct it
to do so
 Two common configurations
- Point-to-Point link (one primary station and one secondary stat
- Multipoint link (the primary station maintain different sessions with different
Asynchronous Balanced Mode (ABM)
Mainly used in point-to-point links, for communication
between combined stations
Either stations can send data, control information and
commands
secondary stations

There are three different classes of frames used in
HDLC
Unnumbered frames, U-frames are reserved for system
management. Information carried by U-frames is intended for
managing the link itself..
Information frames, I frames are used to data-link user data
and control information relating to user data
Supervisory frames, which are used for error and flow
control purposes and hence contain send and receive
sequence numbers

Let us now discuss the fields and their use in different
frame types.


Flag field. This field contains synchronization pattern
01111110, which identifies
both the beginning and the end of a frame.


Address field. This field contains the address of the
secondary station. If a primary
station created the frame, it contains a to address. If a
secondary station creates the
frame, it contains a from address. The address field can
be one byte or several bytes
long, depending on the needs of the network

Control field. The control field is one or two bytes used for
flow and error control.
The interpretation of bits are discussed later.


Information field. The information field contains the
user’s data from the network
layer or management information. Its length can vary from
one network to another.


FCS field. The frame check sequence (FCS) is the HDLC
error detection field. It

There are four different supervisory frames
SS=00, Receiver Ready (RR), and N(R) ACKs all frames
received up to and including the one with sequence number
N(R) - 1
SS=10, Receiver Not Ready (RNR), and N(R) has the same
meaning as above
SS=01, Reject; all frames with sequence number N(R) or
higher are rejected, which in turns ACKs frames with
sequence number N(R) -1 or lower.
SS=11, Selective Reject; the receive rejects the frame with
sequence number N(R)

The unnumbered frames can be grouped into the
following categories:
Mode-setting commands and responses
Recovery commends and responses
Miscellaneous commands and responses