0% found this document useful (0 votes)
10 views

Data Link Control

The document discusses data link control services including framing, flow control, and error control. It describes character-oriented and bit-oriented framing methods and how they handle special character patterns. Flow control involves buffers and signals between nodes to prevent overflow. Error control uses CRC to detect errors and acknowledgments to control retransmission.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

Data Link Control

The document discusses data link control services including framing, flow control, and error control. It describes character-oriented and bit-oriented framing methods and how they handle special character patterns. Flow control involves buffers and signals between nodes to prevent overflow. Error control uses CRC to detect errors and acknowledgments to control retransmission.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 46

Data Link Control

➢ DLC Services,
➢ Data Link Layer Protocols,
➢ HDLC,
➢ Point to Point Protocol

1.1
1. DLC Services
➢ The data link control (DLC) deals with procedures for
communication between two adjacent nodes—node-to-node
communication—no matter whether the link is dedicated or
broadcast.
➢ Data link control functions include framing and flow and error
control.
➢ Framing-- how to organize the bits that are carried by the
physical layer.
➢ flow and error control.

1.2
1.1. Framing
➢ Data transmission in the physical layer means moving bits in the form of a
signal from the source to the destination.
➢ The physical layer provides bit synchronization to ensure that the sender
and receiver use the same bit durations and timing.
➢ The data-link layer, on the other hand, needs to pack bits into frames, so
that each frame is distinguishable from another. Our postal system practices
a type of framing.
➢ Framing in the data-link layer separates a message from one source to a
destination by adding a sender address and a destination address.
➢ The destination address defines where the packet is to go; the sender
address helps the recipient acknowledge the receipt.
➢ When a message is divided into smaller frames, a single-bit error affects
only that small frame.
1.3
Frame size
➢ Frames can be of fixed or variable size.
➢ In fixed-size framing, there is no need for defining the boundaries of the
frames; the size itself can be used as a delimiter.
Eg. ATM WAN, which uses frames of fixed size called cells
➢ variable-size framing, prevalent in local-area networks.
➢ In variable-size framing, we need a way to define the end of one frame and
the beginning of the next.
➢ Historically, two approaches were used for this purpose:
1. character-oriented approach 2. bit-oriented approach.

1.4
Character-Oriented Framing
➢ In character-oriented (or byte-oriented) framing, data to be carried are 8-bit
characters from a coding system such as ASCII.
➢ The header, which normally carries the source and destination addresses
and other control information, and the trailer, which carries error detection
redundant bits, are also multiples of 8 bits.
➢ To separate one frame from the next, an 8-bit (1-byte) flag is added at the
beginning and the end of a frame.
➢ The flag, composed of protocol-dependent special characters, signals the
start or end of a frame

1.5
Character-Oriented Framing
➢ Character-oriented framing was popular when only text was exchanged by
the data-link layers.
➢ The flag could be selected to be any character not used for text
communication.
➢ If we send other types of information such as graphs, audio, and video; any
character used for the flag could also be part of the information.
➢ If this happens, the receiver, when it encounters this pattern in the middle
of the data, thinks it has reached the end of the frame.
➢ To fix this problem, a byte-stuffing strategy was added to character-
oriented framing.
➢ In byte stuffing (or character stuffing), a special byte is added to the data
section of the frame when there is a character with the same pattern as the
flag.
1.6
Character-Oriented Framing

1.7
Bit-Oriented Framing
➢ In bit-oriented framing, the data section of a frame is a sequence of bits to
be interpreted by the upper layer as text, graphic, audio, video, and so on.
➢ However, in addition to headers (and possible trailers), we still need a
delimiter to separate one frame from the other.
➢ Most protocols use a special 8-bit pattern flag, 01111110, as the delimiter to
define the beginning and the end of the frame

1.8
Bit-Oriented Framing

1.9
Bit-Oriented Framing
➢ This flag can create the same type of problem we saw in the character-
oriented protocols.
➢ That is, if the flag pattern appears in the data, we need to somehow inform
the receiver that this is not the end of the frame.
➢ We do this by stuffing 1 single bit (instead of 1 byte) to prevent the pattern
from looking like a flag.
➢ The strategy is called bit stuffing.

Bit stuffing is the process of adding one extra 0 whenever five consecutive
1s follow a 0 in the data, so that the receiver does not mistake the pattern
0111110 for a flag.
1.10
1.2 Flow and Error Control
Flow Control:
➢ Whenever an entity produces items and another entity consumes them,
there should be a balance between production and consumption rates.
➢ If the items are produced faster than they can be consumed, the consumer
can be overwhelmed and may need to discard some items.
➢ If the items are produced more slowly than they can be consumed, the
consumer must wait, and the system becomes less efficient.
➢ Flow control is related to the first issue. We need to prevent losing the data
items at the consumer site.
➢ In communication at the data-link layer, we are dealing with four entities:
network and data-link layers at the sending node and network and data-link
layers at the receiving node.
1.11
Flow Control
➢ The data-link layer at the sending node tries to push frames toward the
data-link layer at the receiving node.
➢ If the receiving node cannot process and deliver the packet to its network at
the same rate that the frames arrive, it becomes overwhelmed with frames.
➢ Flow control in this case can be feedback from the receiving node to the
sending node to stop or slow down pushing frames.

1.12
Flow Control
➢ Although flow control can be implemented in several ways, one of the
solutions is normally to use two buffers; one at the sending data-link layer
and the other at the receiving data-link layer.
➢ A buffer is a set of memory locations that can hold packets at the sender
and receiver.
➢ The flow control communication can occur by sending signals from the
consumer to the producer.
➢ When the buffer of the receiving data-link layer is full, it informs the
sending data-link layer to stop pushing frames.

1.13
Error Control
➢ Since the underlying technology at the physical layer is not fully reliable,
we need to implement error control at the data-link layer to prevent the
receiving node from delivering corrupted packets to its network layer.
➢ Error control at the data-link layer is normally very simple and
implemented using one of the following two methods.
➢ In both methods, a CRC is added to the frame header by the sender and
checked by the receiver.
1. 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.
2. 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.
1.14
Combination of Flow and Error Control
➢ Flow and error control can be combined.
➢ In a simple situation, the acknowledgment that is sent for flow control can
also be used for error control to tell the sender the packet has arrived
uncorrupted.
➢ The lack of acknowledgment means that there is a problem in the sent
frame.
➢ A frame that carries an acknowledgment is normally called an ACK to
distinguish it from the data frame.

1.15
1.3 Connectionless and Connection-Oriented
Connectionless Protocol
➢ In a connectionless protocol, frames are sent from one node to the
next without any relationship between the frames; each frame is
independent.
➢ Most of the data-link protocols for LANs are connectionless
protocols.
Connection-Oriented Protocol
➢ In a connection-oriented protocol, a logical connection should
first be established between the two nodes (setup phase).
➢ After all frames that are somehow related to each other are
transmitted (transfer phase), the logical connection is terminated
(teardown phase). 1.16
DATA-LINK LAYER PROTOCOLS
➢ Traditionally four protocols have been defined for the data-link layer to
deal with flow and error control:
1. Simple,
2. Stop-and-Wait
3. Go-Back-N
4. Selective-Repeat

➢ The behavior of a data-link-layer protocol can be better shown as a finite


state machine (FSM).
➢ 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).
1.17
Connectionless and Connection-Oriented services as FSMs

1.18
Simple Protocol
➢ simple protocol with neither flow nor error control
➢ The data-link layers of the sender and receiver provide transmission
services for their network layers.
➢ 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.
➢ 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
➢ The receiving machine remains in the ready state until a frame arrives from
the sending machine.
1.19
Simple Protocol

1.20
Example

1.21
Stop-and-Wait Protocol
➢ Stop-and-Wait protocol, which uses both flow and error control

1.22
1.23
Stop-and-Wait Protocol
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.

1.24
Stop-and-Wait Protocol
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.
1.25
Piggybacking
➢ The two protocols simple and stop and wait protocols 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.
➢ To make the communication more efficient, the data in one direction is
piggybacked with the acknowledgment in the other direction.
➢ Because piggybacking makes communication at the datalink layer more
complicated, it is not a common practice

1.26
High-level Data Link Control (HDLC)
➢ HDLC is a bit-oriented protocol for communication over point-to-point and
multipoint links.
➢ It implements the Stop-and-Wait protocol.

1.27
Configurations and Transfer Modes

➢ HDLC provides two common transfer modes that can be used in different
configurations:
1. Normal response mode (NRM)
2. Asynchronous balanced mode (ABM).
➢ In NRM, the station configuration is unbalanced. It have one primary
station and multiple secondary stations.
➢ In ABM, the configuration is balanced. The link is point-to-point, and each
station can function as a primary and a secondary

1.28
1.29
Framing
➢ To provide the flexibility necessary to support all the options possible in
the modes and configurations.

➢ HDLC defines three types of frames: information frames (I-frames),


supervisory frames (S-frames), and unnumbered frames (U-frames).

➢ Each frame in HDLC may contain up to six fields, beginning flag field, an
address field, a control field, an information field, a frame check sequence
(FCS) field, and an ending flag field.

➢ In multiple-frame transmissions, the ending flag of one frame can serve as


the beginning flag of the next frame.

1.30
Framing

1.31
Framing
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.

1.32
Framing
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 can contain either a 2- or 4-byte CRC.

1.33
Control field
1. Control Field for I-Frames
2. Control Field for S-Frames
a) Receive Ready (RR)
b) Receive not Ready (RNR)
c) Reject (REJ)
d) Selective reject (SREJ)
3. Control Field for U-Frames

1.34
POINT-TO-POINT PROTOCOL (PPP)
➢ One of the most common protocols for point-to-point access is the Point-
to-Point Protocol (PPP).

1. Services
Services Provided by PPP
Services not Provided by PPP
2. Framing

1.35
POINT-TO-POINT PROTOCOL (PPP)
➢ Flag. A PPP frame starts and ends with a 1-byte flag with the bit pattern
01111110
➢ Address. The address field in this protocol is a constant value and set to 11111111
➢ Control. This field is set to the constant value 00000011 (imitating unnumbered
frames in HDLC). PPP does not provide any flow control. Error control is also
limited to error detection.
➢ Protocol. The protocol field defines what is being carried in the data field: either
user data or other information. This field is by default 2 bytes long, but the two
parties can agree to use only 1 byte.
➢ Payload field. This field carries either the user data or other. The data field is a
sequence of bytes with the default of a maximum of 1500 bytes. The data field is
byte-stuffed if the flag byte pattern appears in this field.
➢ FCS. The frame check sequence (FCS) is simply a 2-byte or 4-byte standard
CRC.
1.36
Transition Phases

1.37
Multiplexing

1.38
LCP packets

1.39
Authentication Protocols

1. Password Authentication Protocol (PAP) is a simple authentication procedure with a


two-step process:
a. The user who want to access a system sends an authentication identification & password.
b. The system checks the validity of the identification and password and either accepts or
denies connection.

2. Challenge Handshake Authentication Protocol (CHAP) is a three-way handshaking


authentication protocol that provides greater security than PAP.
a. The system sends the user a challenge packet containing a challenge value, usually
a few bytes.
b. The user applies a predefined function that takes the challenge value and the user’s own
password and creates a result. The user sends the result in the response packet to the
system.
c. The system does the same. It applies the same function to the password of the user
(known to the system) and the challenge value to create a result. If the
1.40
1.41
1.42
Network control Protocols

➢ PPP is a multiple-network-layer protocol. It can carry a network-layer data packet from


protocols defined by the Internet, OSI, Xerox, DECnet, AppleTalk, Novel.

IPCP
➢ One NCP protocol is the Internet Protocol Control Protocol (IPCP).
➢ This protocol configures the link used to carry IP packets in the Internet.

1.43
Network control Protocols

Other Protocols
➢ There are other NCP protocols for other network-layer protocols.
➢ The OSI Network Layer Control Protocol has a protocol field value of 8023; the Xerox
NS IDP Control Protocol has a protocol field value of 8025;

1.44
Data from the Network Layer

➢ After the network-layer configuration is completed by one of the NCP


protocols, the users can exchange data packets from the network layer.

1.45
Multilink PPP

➢ PPP was originally designed for a single-channel point-to-point physical link.


➢ The availability of multiple channels in a single point-to-point link motivated the
development of Multilink PPP.
➢ A segment of the logical frame is carried in the payload of an actual PPP frame

1.46

You might also like