Chapter 5
Chapter 5
DATA COMMUNICATION
(CC-2103)
Flow Control:
It is a set of procedures that tells the sender how much data it can
transmit before the data overwhelms the receiver.
The receiving device has limited speed and limited memory to
store the data. Therefore, the receiving device must be able to
inform the sending device to stop the transmission temporarily
before the limits are reached.
It requires a buffer, a block of memory for storing the information
until they are processed.
Data Link Layer
3
Flow Control:
Two methods have been developed to control the flow of data:
Stop-and-wait
Sliding window
Data Link Layer
4
Stop-and-wait
In the Stop-and-wait method, the sender waits for an acknowledgment after
every frame it sends.
When an acknowledgment is received, then only the next frame is sent. The
process of alternately sending and waiting of a frame continues until the
sender transmits the EOT (End of transmission) frame.
Advantage of Stop-and-wait
The Stop-and-wait method is simple as each frame is checked and acknowledged
before the next frame is sent.
Disadvantage of Stop-and-wait
Stop-and-wait technique is inefficient to use as each frame must travel across all the
way to the receiver acknowledgment travels all the way before the next frame is sent.
Each frame sent and received uses the entire time needed to traverse the link.
Data Link Layer
5
Data Link Layer
6
Stop-and-wait ARQ
Stop-and-wait ARQ is a technique used to retransmit the data in case of
damaged or lost frames.
This technique works on the principle that the sender will not transmit
the next frame until it receives the acknowledgement of the last
transmitted frame.
Data Link Layer
7
Stop-and-wait
Data Link Layer
9
Stop-and-wait ARQ
Two possibilities of retransmission:
• Damaged Frame: When the receiver receives a damaged frame, i.e., the
frame contains an error, then it returns the NAK frame.
• Lost Frame: Sender is equipped with the timer and starts when the frame
is transmitted.
Data Link Layer
10
Sender Window
• At the beginning of a transmission, the sender window contains n-1
frames, and when they are sent out, the left boundary moves inward
shrinking the size of the window.
• Once the ACK has arrived, then the sender window expands to the
number which will be equal to the number of frames acknowledged by
ACK.
Data Link Layer
13
Receiver Window
• At the beginning of transmission, the receiver window does not contain n
frames, but it contains n-1 spaces for frames.
• When the new frame arrives, the size of the window shrinks.
• The receiver window does not represent the number of frames received,
but it represents the number of frames that can be received before an
ACK is sent.
• Once the acknowledgement is sent, the receiver window expands by the
number equal to the number of frames acknowledged.
Data Link Layer
14
Receiver Window
Data Link Layer
15
Transfer Modes
HDLC supports two types of transfer modes, normal response
mode, and asynchronous balanced mode.
Normal Response Mode (NRM) − Here, two types of stations are
there, a primary station that send commands and a secondary
station that can respond to received commands. It is used for both
point-to-point and multipoint communications.
Data Link Layer
21
Transfer Modes
Data Link Layer
22
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 −
Data Link Layer
24
HDLC Frame
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)
Data Link Layer
25
Multiplexing:
Multiplexing is a technique used to combine and send multiple data
streams over a single medium.
The process of combining the data streams is known as multiplexing
and the hardware used for multiplexing is known as a multiplexer.
Multiplexing is achieved by using a device called Multiplexer (MUX)
that combines n input lines to generate a single output line.
Multiplexing follows many-to-one, i.e., n input lines and one output
line.
Demultiplexing is achieved by using a device called Demultiplexer
(DEMUX) available at the receiving end. DEMUX separates a signal
into its component signals (one input and n outputs). Therefore, we
can say that demultiplexing follows the one-to-many approach.
Data Link Layer
26
Concept of Multiplexing:
Data Link Layer
27
Multiplexing Techniques:
Data Link Layer
28
Advantages Of FDM:
FDM is used for analog signals.
FDM process is very simple and easy to modulation.
Disadvantages Of FDM:
FDM technique is used only when low-speed channels are required.
It suffers from the problem of crosstalk.
Synchronous TDM
• A Synchronous TDM is a technique in which time slot is preassigned to every
device.
• In Synchronous TDM, each device is given some time slot irrespective of the
fact that the device contains the data or not.
• If the device does not have any data, then the slot will remain empty.
• In Synchronous TDM, signals are sent in the form of frames. Time slots are
organized in the form of frames. If a device does not have data for a particular
time slot, then the empty slot will be transmitted.
• The most popular Synchronous TDM are T-1 multiplexing, ISDN multiplexing,
and SONET multiplexing.
• If there are n devices, then there are n slots.
Data Link Layer
39
Synchronous TDM
Data Link Layer
40
Asynchronous TDM
An asynchronous TDM is also known as Statistical TDM.
An asynchronous TDM is a technique in which time slots are not fixed as
in the case of Synchronous TDM.
Time slots are allocated to only those devices which have the data to
send.
An asynchronous TDM technique dynamically allocates the time slots to
the devices.
In Asynchronous TDM, each slot contains an address part that identifies
the source of the data.
Data Link Layer
41
Asynchronous TDM
Data Link Layer
42
Spread Spectrum
Spread spectrum is a technique used for wireless communications in
telecommunication and radio communication.
Spread Spectrum is a technique in which the transmitted signals of
specific frequencies are varied slightly to obtain greater bandwidth as
compared to initial bandwidth.
Now, spread spectrum technology is widely used in radio signal
transmission because it can easily reduce noise and other signal issues.
Data Link Layer
43
Multiple Access
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 protocols is required to reduce the collision
and avoid crosstalk between the channels.
Data Link Layer
50
Multiple Access
Data Link Layer
51
CSMA
CSMA/CD
CSMA/CA
Data Link Layer
53
Pure Aloha
In pure Aloha, when each station transmits data to a channel without checking
whether the channel is idle or not, the chances of collision may occur, and the
data frame can be lost.
When any station transmits the data frame to a channel, the pure Aloha waits
for the receiver's acknowledgment.
If it does not acknowledge the receiver end within the specified time, the
station waits for a random amount of time, called the backoff time (Tb).
And the station may assume the frame has been lost or destroyed. Therefore,
it retransmits the frame until all the data are successfully transmitted to the
receiver.
Data Link Layer
56
Pure Aloha
Data Link Layer
57
Slotted Aloha
The slotted Aloha is designed to overcome the pure Aloha's efficiency because
pure Aloha has a very high possibility of frame hitting.
In slotted Aloha, the shared channel is divided into a fixed time interval
called slots.
So that, if a station wants to send a frame to a shared channel, the frame can
only be sent at the beginning of the slot, and only one frame is allowed to be
sent to each slot.
And if the stations are unable to send data to the beginning of the slot, the
station will have to wait until the beginning of the slot for the next time.
The possibility of a collision remains when trying to send a frame at the
beginning of two or more station time slot.
Data Link Layer
58
Slotted Aloha
Data Link Layer
59
CSMA/ CD
It is a carrier sense multiple access/ collision detection network
protocol to transmit data frames.
The CSMA/CD protocol works with a medium access control layer.
Therefore, it first senses the shared channel before broadcasting the
frames, and if the channel is idle, it transmits a frame to check whether
the transmission was successful.
If the frame is successfully received, the station sends another frame. If
any collision is detected in the CSMA/CD, the station sends a jam/ stop
signal to the shared channel to terminate data transmission. After that, it
waits for a random time before sending a frame to a channel.
Data Link Layer
64
CSMA/ CA
It is a carrier sense multiple access/collision avoidance network protocol for
carrier transmission of data frames.
It is a protocol that works with a medium access control layer. When a data
frame is sent to a channel, it receives an acknowledgment to check whether
the channel is clear.
If the station receives only a single (own) acknowledgment, that means the
data frame has been successfully transmitted to the receiver.
But if it gets two signals, a collision of the frame occurs in the shared channel.
It detects the collision of the frame when a sender receives an
acknowledgment signal.
Data Link Layer
65
Channelization Protocols
It is a channelization protocol that allows the total usable bandwidth in a
shared channel to be shared across multiple stations based on their
time, distance and codes.
It can access all the stations at the same time to send the data frames to
the channel.
Data Link Layer
66
CDMA
The code division multiple access (CDMA) is a channel access method.
In CDMA, all stations can simultaneously send the data over the same
channel.
It means that it allows each station to always transmit the data frames
with full frequency on the shared channel.
Data Link Layer
67
CDMA
Data Link Layer
68
CDMA
1. Let us assume that we have four stations 1, 2, 3 and 4 that are connected to
same channel. The data from station 1 are d1, from station 2 are d2 and so on.
2. The code assigned to the first station is C1, to the second is C2 and so on.
3. These assigned codes have two properties:
(a) If we multiply each code by another, we get O.
(b) If we multiply each code by itself, we get 4. (No. of stations).
4. When these four stations are sending data on the same channel, station 1
multiplies its data by its code i.e. d1.c1}, station 2 multiplies its data by its code
i.e. d2 .C2 and so on.
Data Link Layer
69
CDMA
5.Any station that wants to receive data from one of the other three
stations multiplies the data on a channel by the code of the sender.
Example: Suppose station 1 and 2 are talking to each other. Station 2
wants to hear what station 1 is saying. It multiples the data on the
channel by CI (the code of station 1).
6. Because (C1. C1) is 4, but (C2. C1), (C3. C1), and (C4. C1) are all
zeroes, station 2 divides the result by 4 to get the data from station 1.
data = (dl . C1+ d2 . C2+ d3. C3+ d4. C4) • C1
= d1. C1 . C1+ d2 . C2. C1+ d3 . C3. C1 + d4 . C4. C1= 4 x d1
Data Link Layer
70
CDMA
It does not require the division of bandwidth on a shared channel based on
time slots.
If multiple stations send data to a channel simultaneously, their data frames
are separated by a unique code sequence.
Each station has a different unique code for transmitting the data over a
shared channel.
For example, there are multiple users in a room that are continuously
speaking. Data is received by the users if only two-person interact with each
other using the same language. Similarly, in the network, if different stations
communicate with each other simultaneously with different code languages.
Data Link Layer
71
What is Ethernet?
Ethernet is a type of communication protocol that is created in 1973 by
Robert Metcalfe and others, which connects computers on a network
over a wired connection.
It is a widely used LAN protocol.
It connects computers within the local area network and wide area
network.
Numerous devices like printers and laptops can be connected by LAN
and WAN within buildings, homes, and even small neighborhoods.
Data Link Layer
72
What is Ethernet?
It offers a simple user interface that helps to connect various devices
easily, such as switches, routers, and computers.
A local area network (LAN) can be created with the help of a single
router and a few Ethernet cables, which enable communication between
all linked devices.
This is because an Ethernet port is included in your laptop in which one
end of a cable is plugged in and connect the other to a router.
Data Link Layer
73
For instance, the computer will only have the potential to forward and
receive data at 10 Mbps if you attach a computer with a 10BASE-T NIC
to a 100BASE-T network.
Also, the maximum data transfer rate will be 100 Mbps if you have
a Gigabit Ethernet router and use it to connect the device.
Data Link Layer
77
References
W. Stallings, Data and Computer Communications, (10e), Pearson Education, 2014.
B. A. Forouzan, Data Communications & Networking, (5e), McGraw Hill, 2013.
D. P. Bertsekas, R. G. Gallager, Data Networks, (2e), Prentice Hall of India, 2011.
A. S. Tenenbaum, Computer Networks, (5e), Prentice Hall of India, 2008.
L. L. Peterson, B. S. Davie, Computer Networks: A Systems Approach, (5e), Morgan Kaufmann
Publishers, 2011.