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

Chapter 5- Data Link Control

Uploaded by

payeja1730
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views

Chapter 5- Data Link Control

Uploaded by

payeja1730
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 19

Chapter 5: Data Link Control

DLC (data link control) is the service provided by the Data Link layer defined in the open System
Interconnection (OSI) model for network communication. The Data Link layer is responsible for providing
reliable data transfer across one physical link (or telecommunications path) within the network.

Data link layer is divided into two sub layers:


• Data Link Control (LLC) Layer: The uppers sub-layer is responsible for data link control i.e.
flow and error control.
• Media Access Control (MAC) Layer: The lower sub-layer is responsible for resolving access to
theshared media.

High-level Data Link Control (HDLC)


High-level Data Link Control (HDLC) İs a group of communication protocols of the data link
layer for transmitting data between network points or nodes. Since it is a data link protocol, data is
organized intoframes. A frame is transmitted via the network to the destination that verifies its successful
arrival. It is a bit-oriented protocol that is applicable for both point-to-point and multipoint
communications.
Transfer Modes
HDLC Supports two types of transfer modes, normal response mode and asynchronous balanced mode.
1. Normal Response Mode (NRM)
In NRM there are two types of stations, a primary station that sends commands and a secondary station
that can respond to received commands. It is used for both point-to-point and multipoint
communications.
2. Asynchronous Balanced Mode (ABM)
In ABM 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.

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 an HDLC frame are –
 Flag- It is an 8-bit sequence that marks the beginning and the end of the frame. The bit patternof
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.
 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)

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 the control field of the l-
frame is 0.
• S-frame – S-frames or Supervisory frames do not contain an information field. They are used for flow
and error control when piggybacking is not required. The first two bits of the control field of the S-frame
are 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 the control field of the
U-frame are 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
multi-protocol data between two directly connected (point-to-point) computers. Protocol It is a byte-
oriented that is widely used in broadband communications having heavy loads and high speeds. Since it
is a data link layer protocol, data is transmitted in frames. It is also known as RFC 1661.
Services Provided by PPP
The main services provided by Point – to – Point Protocol are
• Defining the frame format of the data to be transmitted.
• Defining the procedure of establishing link between two points and exchange of data.
• Stating the method of encapsulation of network layer data in the frame.
• Stating authentication rules of the communicating devices.
• Providing an address for network communication.
• Providing connections over multiple links.
• Supporting a variety of network layer protocols by providing a r range of services.
Components of PPP
Point- to – Point Protocol is a layered protocol having three components –
• Encapsulation Component – It encapsulates the datagram so that it can be transmitted over the
specified physical layer
• Link control Protocol (LCP)- t is responsible for establishing, configuring, testing, maintaining,
andterminating links for transmission. It also imparts negotiation for the set up of options and use
of features by the two endpoints of the links.
• Authentication Protocols (AP) – These protocols authenticate endpoints for use of services. The two
authentication protocols of PPP are-
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.

PPP Frame
PPP is a byte-oriented protocol where each field of the frame is composed of one or more bytes. Thefields
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 s set to 11111111 in case of broadcast. C to .
 Control – 1 byte set to a constant value of 11000000.
 Protocol – 1 or 2 bytes that define the type of data contained in the payload field.
 Payload- This carries the data from the network layer. The maximum length of the payload field is 1500
bytes. However, this may 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)
Byte Stuffing in PPP Frame - Byte stuffing is used in the PPP payload field whenever the flag sequence
appears in the message so that the receiver does not consider it as the end of the frame The escape byte,
01111101, is stuffed before every byte that contains the same byte as the flag byte or the escape
byte. The receiver on receiving the message removes the escape byte before passing it onto the network
layer.

Multiple Access Protocol


When nodes or stations are connected and use a common link, called a multipoint or broadcast link,
we need a multiple-access protocol to coordinate access to the link. The problem of controlling access to
the medium is similar to the rules of speaking in an assembly. The procedures guarantee that the right to
speak is upheld and ensure that two people do not speak at the same time, do not interrupt each other, do
not monopolize the discussion, and so on. The situation is similar for multipoint networks. Many formal
protocols have been devised to handle access to a shared link. Multiple access protocols are a set of
protocols operating in the Medium Access Control sublayer (MAC sublayer) of the Open Systems
Interconnection (0SI) model. These protocols allow several nodes or users to access a shared network
channel.
If the channel is dedicated, we do not need the lower sub-layer. The figure shows these two sub-layers in
the data link layer.

Several data streams originating from several nodes are transferred through the multi-point transmission
channel.

The objectives of multiple access protocols are


 Optimization of transmission time
 Minimization of collisions
 Avoidance of cross talks
Categories of MAC

Media Access Control (MAC)


When a sender and receiver have a dedicated link to transmit data packets, the data link control is
enough to handle the channel. Suppose there is no dedicated path to communicate or transfer the data
between two devices. In that case, multiple stations access the channel and simultaneously transmit the
data over the channel. It may create collision and cross-talk. Hence, the multiple access protocol is
required to reduce the collision and avoid crosstalk between the channels.
Random Access Protocols
In random access or contention methods, no station is superior to another station and none is assigned
control over another. No station permits or does not permit, another station to send. At each instance,a
station that has data to send uses a procedure defined by the protocol to decide on whether or not o
send. This decision depends on the state of the medium (idle or busy). In other words, each station can
transmit when it desires on the condition that it follows the predefined procedure, including the testing of
the state of the medium. Two features give this method its name.
• First, there is no scheduled time for a station to transmit. Transmission is random among the stations.
That is why these methods are called random access.
• Second, no rules specify which station should send next. Stations compete with one another access the
medium. That is why these methods are also called contention methods.
The task that are performed in random access protocols are:
When can the station access the medium?
What can the station do if the medium is busy?
How can the station determine the success or failure of the transmission?
What can the station do if there is an access conflict?

ALOHA
ALOHA, the earliest random access method was developed at the University of Hawai in early 1970. It
was designed for radio (wireless) LAN, but it can be used on any shared medium. There are potential
collisions in this arrangement. The medium is shared between the stations. When a station sends data,
another station may attempt to do so at the same time. The data from the two stations collide and become
garbled. There are two variations of the ALOHA protocol:

1. Pure ALOHA
The original ALOHA protocol is called pure ALOHA. This is a simple, but elegant protocol. The idea is
that each station sends a frame whenever it has a frame to send. However, since there is only one channel
toshare, there is the possibility of collision between frames from different stations.

The pure ALOHA protocol relies on acknowledgments from the receiver. When a station sends a frame, it
expects the receiver to send an acknowledgment. If the acknowledgment does not arrive after a time- out
period, the station assumes that the frame (or the acknowledgment) has been destroyed and
resends the frame, A collision involves two or more stations. If all these stations try resend their frames
after the time-out, the frames will collide again. Pure ALOHA dictates that when the time-out period
passes, each station waits a random amount of time before resending its frame. The randomness will help
avoid more collisions. We call this time the back-off time T(B)
Vulnerable time: Vulnerable time is the Length of time, in which there is a possibility of collision. We
assume that the stations send fixed-length frames with each frame taking T(fr) s to send.

Pure ALOHA vulnerable time = 2 x T(fr)


2. Slotted ALOHA
Slotted ALOHA was invented to improve the efficiency of pure ALOHA. In slotted ALOHA we divide the
time into slots of T(fr) s(time to send each fixed size frame) and force the station to send only at the
beginning of the time slot.

Because a station is allowed to send only at the beginning of the synchronized time slot, if a station
misses this moment, it must wait until the beginning of the next time slot. This means that the station
which started at the beginning of this slot has already finished sending its frame. But, still there is the
possibility of collision if two stations try to send at the beginning of the same time slot. However, the
vvuerable time is now reduced to one-half, equal to Tfr.

Slotted ALOHA vulnerable time = T(fr)


Carrier Sense Multiple Access (CSMA)
To minimize the chance of collision and, therefore, increase the performance, the CSMA method
was developed. The chance of collision can be reduced if a station senses the medium before trying to use
it. Carrier sense multiple access (CSMA) requires that each station first listen to the medium (or check the
state of the medium) before sending. CSMA can reduce the possibility of collision, but it cannot
eliminate it.
Vulnerable time:
The vulnerable time for CSMA is the propagation time Tp. This is the time needed for a signal to
propagate from one end of the medium to the other. When a station sends a frame, and any other station
tries to send a frame during this time, a collision will result. But if the first bit of the frame reaches the
end of the medium, every station will already have heard the bit and will refrain from sending.
Persistence Methods:
What should a station do if the channel is busy? What should a station do if the channel is idle? Three
methods have been devised to answer these questions:
 1-persistent method
 Non-persistent method
 p-persistent method.
1- Persistent: The 1-persistent method is simple and straightforward. In this method, after the station
finds the line idle, it sends its frame immediately (with probability 1). This method has the highest
chance of collision because two or more stations may find the line idle and send their frames
immediately.
Non-persistent: In the non-persistent method, a station that has a frame to send senses the line. If the
line is idle, it sends immediately. If the line is not idle, it waits a random amount of time and then senses
the line again. The non-persistent approach reduces the chance of collision because it is unlikely that two or
more stations will wait the same amount of time and retry to send simultaneously. However, this
method reduces the efficiency of the network because the medium remains idle when there may bestations
with frames to send.

P-Persistent: The p-persistent method is used if the channel has time slots with a slot duration equal to
or greater than the maximum propagation time. The p-persistent approach combines the advantages of the
other two strategies.

It reduces the chance of collision and improves efficiency. In this method, after the station finds the line
idle it follows these steps:
1. With probability p, the station sends its frame.
2. With probability q = 1 – p, the station waits for the beginning of the next time slot and checks
the line again.
a. If the line is idle, it goes to step 1.
b. If the line is busy, it acts as though a collision has occurred and uses the back off procedure.

Carrier Sense Multiple Access with Collision Detection (CSMA/CD)


The CSMA method does not specify the procedure following a collision. Carrier sense multiple
access with collision detection (CSMA/CD) augments the algorithm to handle the collision.
In this method, a station monitors the medium after it sends a frame to see if the transmission was
successful. If so, the station is finished. If, however, there is a collision, the frame is sent again.

• The first difference is the addition of the persistence process. We need to sense the channel before we
start sending the frame by using one of the persistence processes we discussed previously (non-
persistent, I-persistent, or p-persistent).
• The second difference is the frame transmission. In ALOHA, we first transmit the entire frame and then
wait for an acknowledgment. In CSMA/CD, transmission and collision detection is a continuous process.
We constantly monitor in order to detect one of two conditions: either transmission is finished or a
collision is detected. Either event stops transmission.
• The third difference is the sending of a short jamming signal that enforces the collision in case other
stations have not yet sensed the collision.

Energy Level:

We can say that the level of energy in a channel can have three values: zero, normal, and abnormal. At
the zero level, the channel is idle. At the normal level, a station has successfully captured the channel
and is sending its frame. At the abnormal level, there is a collision and the level of the energy is twice
the normal level. A station that has a frame to send or is sending a frame needs to monitor the energy
level to determine if the channel is idle, busy, or in collision mode.
Throughput

The throughput of CSMA/CD is greater than that of pure or slotted ALOHA. The maximum throughput
occurs at a different value of G and is based on the persistence method and the value of p in the p-
persistent approach. For 1-persistent method the maximum throughput is around 50 percent when G
=1. For non-persistent method, the maximum throughput can go up to 90 percent when G is between 3 and
8.

Carrier Sense Multiple Access with Collision Avoidance (CSMA/CA)


Carrier Sense Multiple Access with Collision Avoidance (CSMA/CA) is a network protocol for carrier
transmission that operates in the Medium Access Control (MAC) layer. In contrast to CSMA/CD (Carrier
Sense Multiple Access/Collision Detection) which deals with collisions after their occurrence, CSMAL
CAprevents collisions before their occurrence.
The algorithm of CSMA/CA is:
When a frame is ready, the transmitting station checks whether the channel is idle or bye
If the channel is busy, the station waits until the channel becomes idle.
If the channel is idle, the station waits for an Inter-frame gap (1FG) amount of time and & sends
the frame.
After sending the frame, it sets a timer.
The station then waits for acknowledgment from the receiver. If it receives the acknowledgment
before the expiry of the timer, it marks a successful transmission.
Otherwise, it waits for a back-off time period and restarts the algorithm.
Advantages of CMSA/CA
CMSA/CA prevents collision.
Due to acknowledgements, data is not lost unnecessarily.
It avoids wasteful transmission.
It is very much suited for wireless transmissions.

Disadvantages of CSMA/CA
The algorithm calls for long waiting times.
It has high power consumption.

Controlled Access Protocols


In controlled access, 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. The three popular controlled-access methods
I. Reservation
II. Polling
III. Token passing

Reservation
In the reservation method, a station needs to make a reservation before sending data. Time is divided into
intervals. In each interval, a reservation frame precedes the data frames sent in that interval.
If there are N stations in the system, there are exactly N reservation mini-slots in the reservation frame.
Each mini-slot belongs to a station. When a station needs to send a data frame, it makes a reservation in its
own mini-slot. The stations that have made reservations can send their data frames after the reservation
frame. The following figure shows a situation with five stations and a five mini-slot reservation frame. In
the first interval, only stations 1, 3, and 4 have made reservations. In the second interval, only station 1
has made a reservation.

Polling
Polling works with topologies in which one device is designated as a primary station and the other
devices are secondary stations. All data exchanges must be made through the primary device even when
the ultimate destination is a secondary device. The primary device controls the link; the secondary
devices follow its instructions. It is up to the primary device to determine which device is allowed to use
the channel at a given time. The primary device, therefore, is always the initiator of a session.
If the primary wants to receive data, it asks the secondary’s if they have anything to send, this is called
poll function. If the primary wants to send data, it tells the secondary to get ready to receive; this is
called select function.
Select:
The select function is used whenever the primary device has something to send. If it has something to
send, the primary device sends it. It has to know whether the target device is prepared to receive or not. So
the primary must alert the secondary to the upcoming transmission and wait for an acknowledgment of the
secondary's ready status. Before sending data, the primary creates and transmits a select (SEL) frame, one
field of which includes the address of the intended secondary.
Polling:
Polling works with topologies in which one device is designated as a primary station and the
other devices are secondary stations. All data exchanges must be made through the primary
device even when the ultimate destination is a secondary device.

3. Token Passing:
In the token-passing method, the stations in a network are organized in a logical ring. In other words, for
each station, there is a predecessor and a successor.
 The predecessor is the station which is logically before the station in the ring;
 The successor is the station which is after the station in the ring.
 The current station is the one that is accessing the channel now.
The right to this access has been passed from the predecessor to the current station. The right will be
passed to the successor when the current station has no more data to send.
Token management is needed for this access method. Stations must be limited in the time they can have
possession of the token. The token must be monitored to ensure it has not been lost or destroyed. For
example, if a station that is holding the token fails, the token will disappear from the network. Another
function of token management is to assign priorities to the stations and to the types of data being
transmitted. And finally, token management is needed to make low- priority stations release the token to
high priority stations.
Logical Ring:
In a token-passing network, stations do not have to be physically connected in a ring; the ring can be a
logical one. The following figure show four different physical topologies that can create a logical ring.
Physical Ring:

In the physical ring topology, when a station sends the token to


its successor, the token cannot be seen by other stations; the
successor is the next one in line. This means that the token does
not have to have the address of the next successor. The problem
with this topology is that if one of the links-the medium between
two adjacent stations fails, the whole system fails.
Dual Ring:

The dual ring topology uses a second (auxiliary) ring which


operates in the reverse direction compared with the main ring. The
second ring is for emergencies only. If one of the links in the main
ring fails, the system automatically combines the two rings to form
a temporary ring. After the failed link is restored, the auxiliary
ring becomes idle again.

Bus Ring:

In the bus ring topology, also called a token bus, the stations are
connected to a single cable called a bus. They, however, make a
logical ring, because each station knows the address of its
successor (and also predecessor for token management
purposes). When a station has finished sending its data, it
releases the token and inserts the address of its successor in
the token. Only the station with the address matching the
destination address of the token gets the token to access the
shared media. The Token Bus LAN, standardized by IEEE,
uses this topology.

Star Ring:

In a star ring topology, the physical topology is a star. There is a hub,


however, that acts as the connector. The wiring inside the hub makes
the ring; the stations are connected to this ring through the two wire
connections. This topology makes the network less prone to failure
because if a link goes down, it will be bypassed by the hub and the
rest of the stations can operate. Also adding and removing stations
from the ring is easier. This topology is still used in the Token Ring
LAN designed by IBM.
Random Access Protocol Controlled Access Protocol

Only that station can transmit the data which is Only one station can transmit the data frames at a
approved by all other stations in that network. time.

The transmission is based on the availability of the Collision-free transmission through the
transmission channel communication channel

Channel bandwidth is used to alert the station Channel bandwidth carries explicit information that
during collision allows stations to schedule the transmission
Collision are more Collision are less

Random access protocols are Controlled access protocols are


 ALOHA  Reservation
 CSMA  Polling
 CSMA/CD  Token passing

Unordered access Ordered access

This are simple This are complicated

Channelization
Channelization is a multiple-access method in which the available bandwidth of a link is shared in time,
frequency, or through code, between different stations. The three channelization protocols are FDMA,
TDMA, and CDMA.
The Frequency-Division Multiple Access (FDMA):

In frequency-division multiple access (FDMA), the available bandwidth is divided into frequency
bands. Each station is allocated a band to send its data. In other words, each band is reserved for a
specific station, and it belongs to the station all the time. Each station also uses a bandpass filter to
confine thetransmitter frequencies. To prevent station interferences, the allocated bands are separated
from one another by small guard bands.
Time-Division Multiple Access (TDMA):

In time-division multiple access (TDMA), the stations share the bandwidth of the channel in time. Each
station is allocated a time slot during which it can send data. Each station transmits its data in is
assigned time slot.

Code-Division Multiple Access (CDMA):

CDMA simply means communication with different codes. 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.
There are two properties for codes
Ci*Cj=0 for all I != J, i.e.. If we multiply each code by another code, we get 0.
Ci*Ci=n where, n is the number of stations. i.e.. If we multiply each by code by itself.
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
hear what station 1 is saying. It multiplies the data on the channel by c1 the code of station1. Because
(c1.c1) is 4, but (c2 . c1), (c3. c1), and (c4 .c1) are all 0s, station 2 divides the result by 4 to get the data
from station1.
Data=[(d1.c1+d2.c2+d3.c3+d4.c4).c1]/4
=[d1.c1.c1+d2.c2.c1+d3.c3.c1+d4.c4.c1]
=[4xd1+0+0+0]/4
= d1
Comparison between FDMA, TDMA and CDMA

You might also like