CN Unit-3 Material Part-2
CN Unit-3 Material Part-2
UNIT-3 (Part-2)
DATA LINK LAYER Protocols
Syllabus:
Elementary Data Link Layer protocols: simplex protocol, Simplex stop and wait, Simplex protocol for Noisy Channel.
Sliding window protocol: One bit, Go back N, Selective repeat-Stop and wait protocol, Data link layer in HDLC:
configuration and transfer modes, frames, control field, point to point protocol (PPP): framing transition phase,
multiplexing, multi-link PPP.
Prtocols:
A protocol is a set of rules and guidelines for communicating data. Rules are defined for each step
and process during communication between two or more computers. Networks have to follow
these rules to successfully transmit data.
The data link layer can combine framing, flow control, and error control to achieve the delivery of
data from one node to another.
The protocols are normally implemented in software by using one of the common programming
languages.
1|P ag e
COMPUTER NETWORKS DATA LINK LAYER
Flow diagram:
Bellow figure shows an example of communication using this protocol. It is very simple.
The sender sends a sequence of frames without even thinking about the receiver. To send three
frames, three events occur at the sender site and three events at the receiver site.
Note that the data frames are shown by tilted boxes; the height of the box defines the transmission
time difference between the first bit and the last bit in the frame.
2|P ag e
COMPUTER NETWORKS DATA LINK LAYER
Stop-and-wait protocol:
In stop-and-wait protocol
Flow diagram:
Bellow figure shows an example of communication using this protocol. It is still very simple. The sender sends
one frame and waits for feedback from the receiver. When the ACK arrives, the sender sends the next frame.
Note that sending two frames in the protocol involves the sender in four events and the receiver in two
events.
3|P ag e
COMPUTER NETWORKS DATA LINK LAYER
Noisy-Channel Protocols:
Although the Stop-and-Wait Protocol gives us an idea of how to add flow control to its predecessor,
noiseless channels are nonexistent. We discuss three protocols in this section that use error control.
Stop-and-Wait ARQ (Automatic Repeat Request)
Go-Back-N ARQ
Selective Repeat ARQ
4|P ag e
COMPUTER NETWORKS DATA LINK LAYER
5|P ag e
COMPUTER NETWORKS DATA LINK LAYER
0, 1,2,3,4,5,6, 7,8,9, 10, 11, 12, 13, 14, 15,0, 1,2,3,4,5,6,7,8,9,10, 11, ...
In other words, the sequence numbers are modulo-2 m.
Sliding Window:
In this protocol (and the next Selective Repeat ARQ), the sliding window is an abstract concept that
defines the range of sequence numbers that is the concern of the sender and receiver.
In other words, the sender and receiver need to deal with only part of the possible sequence
numbers. The range which is the concern of the sender is called the send sliding window; the range
that is the concern of the receiver is called the receiver sliding window.
The send window is an imaginary box covering the sequence numbers of the data frames which can
be in transit.
In each window position, some of these sequence numbers define the frames that have been sent;
others define those that can be sent. The maximum size of the window is 2 m – 1. The size can be fixed
and set to the maximum value. The following figure shows a sliding window of size 15 (m =4).
Flow diagrams of Go Back N ARQ:
6|P ag e
COMPUTER NETWORKS DATA LINK LAYER
Note: Both Go-Back-N and Selective Repeat ARQ protocols are called as Sliding window protocols
7|P ag e
COMPUTER NETWORKS DATA LINK LAYER
Piggybacking:
A method to combine a data frame with ACK. Station A and B both have data to send.
Instead of sending separately, station A sends a data frame that includes an ACK. Station B does the
same thing.
Piggybacking saves bandwidth.
Figure: Piggybacking
8|P ag e
COMPUTER NETWORKS DATA LINK LAYER
Frames in HDLC:
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),
Unnumbered frames (U-frames). Each type of frame serves as an envelope for the transmission of a
different type of message.
I-frames are used to transport user data and control information relating to user data
(piggybacking).
S-frames are used only to transport control information.
U-frames are reserved for system management. Information carried by U-frames is intended for
managing the link itself.
Frame Format:
Each frame in HDLC may contain up to six fields, as shown in the following figure, a 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.
Fields
1. Flag field: The flag field of an HDLC frame is an 8-bit sequence with the bit pattern 01111110
that identifies both the beginning and the end of a frame and serves as a synchronization
pattern for the receiver.
2. Address field: The second field of an HDLC frame contains the address of the secondary station.
If a primary station created the frame, it contains a to address. If a secondary creates the frame,
it contains a from address. An address field can be 1 byte or several bytes long, depending on
the needs of the network. One byte can identify up to 128 stations (l bit is used for another
purpose). Larger networks require multiple-byte address fields. If the address field is only 1
byte, the last bit is always a 1. If the address is more than 1 byte, all bytes but the last one will
end with 0; only the last will end with 1. Ending each intermediate byte with 0 indicates to the
receiver that there are more address bytes to come.
9|P ag e
COMPUTER NETWORKS DATA LINK LAYER
3. Control field: The control field is a 1- or 2-byte segment of the frame used for flow and error
control. The interpretation of bits in this field depends on the frame type. We discuss this field
later and describe its format for each frame type.
4. 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.
5. FCS field: The frame check sequence (FCS) is the HDLC error detection field. It can contain either
a 2- or 4-byte ITU-T CRC.
Control field:
Control field in HDLC determines the type of frame and its functionality. The following diagram
shows control fields for 3 different types of frames.
__________________________________________________________________________
Point-to-Point protocol:
Although HDLC is a general protocol that can be used for both point-to-point and multipoint
configurations, one of the most common protocols for point-to-point access is the Point-to-Point
Protocol (PPP). PPP is a byte-oriented protocol.
Services of PPP:
Framing in PPP:
PPP is a byte-oriented protocol, the frame format of PPP is as follows
11 | P a g e
COMPUTER NETWORKS DATA LINK LAYER
12 | P a g e
COMPUTER NETWORKS DATA LINK LAYER
13 | P a g e
COMPUTER NETWORKS DATA LINK LAYER
Multiplexing in PPP:
14 | P a g e
COMPUTER NETWORKS DATA LINK LAYER
Figure: PAP
Figure: CHAP
15 | P a g e
COMPUTER NETWORKS DATA LINK LAYER