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

Data Communication - 9th Lecture

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

Data Communication - 9th Lecture

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

11/22/2023

DATA COMMUNICATION DATA COMMUNICATION

✓ Framing:
▰ Course Title: Data Communication Framing in the data link layer separates a message from one source to a
▰ Course Code: CSE-3525 destination, or from other messages to other destinations, by adding a sender
▰ Credit Hours: 3 address and a destination address.
▰ Textbooks: 1. Data Communications AND Networking - 5th Edition The destination address defines where the packet is to go; the sender address helps
by Behrouz A. Forouzan the recipient acknowledge the receipt.
2. Computer Networks - 5th Edition by A. Tanenbaum When a message is carried in one very large frame, even a single-bit error would
require the retransmission of the whole message. When a message is divided into
smaller frames, a single-bit error affects only that small frame.
Conducted by: Engr. Muinul Islam a) Fixed-Size Framing:
In fixed-size framing, there is no need for defining the boundaries of the frames;
the size itself can be used as a delimiter. An example of this type of framing is
the ATM wide-area network, which uses frames of fixed size called cells.

1 2

DATA COMMUNICATION DATA COMMUNICATION

✓ Framing (Contd.): ✓ Flow and Error Control (Contd.):


b) Variable-Size Framing: a) Flow Control (Contd.):
In variable-size framing, we need a way to define the end of the frame and the Any receiving device has a limited speed at which it can process incoming data
beginning of the next. Historically, two approaches were used for this purpose: and a limited amount of memory in which to store incoming data. The receiving
(i) A character-oriented approach and (ii) A bit-oriented approach device must be able to inform the sending device before those limits are
reached and to request that the transmitting device send fewer frames or stop
✓ Flow and Error Control:
temporarily.
The most important responsibilities of the data link layer are flow control and error
control. Collectively, these functions are known as data link control. Incoming data must be checked and processed before they can be used.
a) Flow Control: Flow control can be implemented by using two buffers; one at the sending
Flow control is a set of procedures that tells the sender how much data it can data-link layer and the other at the receiving data-link layer. A buffer is a set
transmit before it must wait for an acknowledgment from the receiver. of memory locations that can hold packets at the sender and receiver.

3 4

1
11/22/2023

DATA COMMUNICATION DATA COMMUNICATION

✓ Flow and Error Control (Contd.): ✓ Flow and Error Control (Contd.):
a) Flow Control (Contd.): b) Error Control :
The flow control communication can occur by sending signals from the Error control at the data-link layer is normally very simple and implemented
consumer to the producer. When the buffer of the receiving data-link layer is using one of the following two methods. In both methods, a CRC is added to
full, it informs the sending data-link layer to stop pushing frames. the frame header by the sender and checked by the receiver.
❑ 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.
Fig. Flow control at the data-link layer

5 6

DATA COMMUNICATION DATA COMMUNICATION

✓ Flow and Error Control (Contd.): ✓ Stop-and-Wait Protocol (Contd.):


When a frame arrives at the receiver site, it is checked. If its CRC is incorrect, the
c) Combination of Flow and Error Control :
frame is corrupted and silently discarded. The silence of the receiver is a signal for
Flow and error control can be combined. In a simple situation, the
the sender that a frame was either corrupted or lost. Every time the sender sends a
acknowledgment that is sent for flow control can also be used for error control
frame, it starts a timer.
to tell the sender the packet has arrived uncorrupted.
If an acknowledgment arrives before the timer expires, the timer is stopped and the
A frame that carries an acknowledgment is normally called an ACK to
sender sends the next frame (if it has one to send). If the timer expires, the sender
distinguish it from the data frame.
resends the previous frame, assuming that the frame was either lost or corrupted.
✓ Stop-and-Wait Protocol: This means that the sender needs to keep a copy of the frame until its
Stop-and-Wait protocol uses both flow and error control. In this protocol, the sender acknowledgment arrives. When the corresponding acknowledgment arrives, the
sends one frame at a time and waits for an acknowledgment before sending the sender discards the copy and sends the next frame if it is ready. Figure 11.10
next one. To detect corrupted frames, a CRC is needed to be added to each data shows the outline for the Stop-and-Wait protocol.
frame.
Only one frame and one acknowledgment can be in the channels at any time.

7 8

2
11/22/2023

DATA COMMUNICATION DATA COMMUNICATION

✓ Stop-and-Wait Protocol (Contd.): ✓ Stop-and-Wait Protocol (Contd.):

Figure-1 Stop-and-Wait protocol

Figure FSM for the Stop-and-Wait protocol protocol

9 10

DATA COMMUNICATION DATA COMMUNICATION

✓ Stop-and-Wait Protocol (Contd.): ✓ Stop-and-Wait Protocol (Contd.):


❖ Sender States: ❖ Sender States (Contd.):
The sender is initially in the ready state, but it can move between the ready and
blocking state. ❑ Blocking State(Contd.).

❑ Ready State: b) If a corrupted ACK arrives, it is discarded.


Ready State. When the sender is in this state, it is only waiting for a packet c) If an error-free ACK arrives, the sender stops the timer and discards the
from the network layer. If a packet comes from the network layer, the saved copy of the frame. It then moves to the ready state.
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. ❖ Receiver:
The receiver is always in the ready state. Two events may occur:
❑ Blocking State.
When the sender is in this state, three events can occur: a) If an error-free frame arrives, the message in the frame is delivered to the
network layer and an ACK is sent.
a) If a time-out occurs, the sender resends the saved copy of the frame and
restarts the timer. b) If a corrupted frame arrives, the frame is discarded

11 12

3
11/22/2023

DATA COMMUNICATION DATA COMMUNICATION

✓ High-level Data Link Control (HDLC): ✓ High-level Data Link Control (HDLC) (Contd.):
High-level Data Link Control (HDLC) is a bit-oriented protocol for communication
over point-to-point and multipoint links. It implements the Stop-and-Wait
❖ Configurations and Transfer Modes (Contd.):
protocol. (a) Normal Response Mode (NRM) (Contd.)
The NRM is used for both point-to-point and multipoint links, as shown in
❖ Configurations and Transfer Modes:
Fig 1.
HDLC provides two common transfer modes that can be used in different
configurations:
(a) Normal Response Mode (NRM)
(b) Asynchronous Balanced Mode (ABM)
(a) Normal Response Mode (NRM)
In normal response mode (NRM), the station configuration is unbalanced.
We have one primary station and multiple secondary stations. A primary
station can send commands; a secondary station can only respond. Fig 1. Normal response mode

13 14

DATA COMMUNICATION DATA COMMUNICATION

✓ High-level Data Link Control (HDLC) (Contd.): ✓ High-level Data Link Control (HDLC) (Contd.):
❖ Configurations and Transfer Modes (Contd.): ❖ Framing:
HDLC defines three types of frames:
(b) Asynchronous Balanced Mode (ABM)
In ABM, the configuration is balanced. The link is point-to-point, and each (a) Information frames (I-frames) [used to data-link user data]
station can function as a primary and a secondary (acting as peers), as (b) supervisory frames (S-frames), and [used only to transport control
shown in Fig 2. This is the common mode today. information]
(c) unnumbered frames (U-frames). [reserved for system management]

Fig 2 Asynchronous balanced mode


Fig. HDLC frames

15 16

4
11/22/2023

DATA COMMUNICATION DATA COMMUNICATION

✓ High-level Data Link Control (HDLC) (Contd.): ✓ Point-to-Point Protocol (PPP):


One of the most common protocols for point-to-point access is the Point-to-Point
❖ Framing (Contd.):
Protocol (PPP).
The fields and their use in different frame types:
(a) Flag field: This field contains synchronization pattern which identifies both the
❖ Services:
The designers of PPP have included several services to make it suitable for a
beginning and the end of a frame.
point-to point protocol, but have ignored some traditional services to make it
(b) Address field: This field contains the address of the secondary station. If a
simple.
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 ❑ Services Provided by PPP:
several bytes long, depending on the needs of the network.
➢ PPP defines the format of the frame to be exchanged between devices.
(c) Control field: The control field is one or two bytes used for flow and error control.
➢ It defines how two devices can negotiate the establishment of the link
(d) Information field: The information field contains the user’s data from the network
and the exchange of data.
layer or management information.
➢ Authentication is also provided in the protocol
(e) Information field: The frame check sequence (FCS) is the HDLC error detection
➢ It provides network address configuration.
field. It can contain either a 2- or 4-byte CRC.

17 18

DATA COMMUNICATION DATA COMMUNICATION

✓ Point-to-Point Protocol (PPP) (Contd.): ✓ Point-to-Point Protocol (PPP) (Contd.):

❖ Services (Contd.): ❖ Framing (Contd.):

❑ Services not Provided by PPP: ❑ Protocol.


The protocol field defines what is being carried in the data field. This field is
➢ PPP does not provide flow control. by default 2 bytes long.
➢ PPP does not provide a sophisticated addressing mechanism to handle
frames in a multipoint configuration.
❖ Framing:
PPP uses a character-oriented (or byte-oriented) frame. The description of each Figure. PPP frame format
field follows: ❑ Payload field.
❑ Address. The address field in this protocol is a constant value and set to This field carries either the user data or other information. The data field is
11111111 (broadcast address). a sequence of bytes with the default of a maximum of 1500 bytes.
❑ Control. This field is set to the constant value 00000011 (imitating ❑ FCS. The frame check sequence (FCS) is simply a 2-byte or 4-byte
unnumbered frames in HDLC). standard CRC.

19 20

5
11/22/2023

DATA COMMUNICATION DATA COMMUNICATION

✓ Automatic repeat request (ARQ): ✓ Automatic repeat request (ARQ) (Contd.):


Automatic repeat request (ARQ), also known as automatic repeat query, is an error-
control method for data transmission that uses acknowledgements (messages sent ❑ Usage.
by the receiver indicating that it has correctly received a message) and timeouts to ARQ is appropriate ARQ systems were widely used on shortwave radio to ensure
achieve reliable data transmission over an unreliable communication channel. reliable delivery of data such as for telegrams. These systems came in forms
called ARQ-E and ARQ-M, which also included the ability to multiplex two or four
❑ Communication channel. ARQ is appropriate if the communication channel has channels.
varying or unknown capacity. If the sender does not receive an acknowledgment
before the timeout, it re-transmits the message until it receives an
acknowledgment or exceeds a predefined number of retransmissions.
❑ Protocol: ARQ protocols include stop-and-wait, Stop-and-wait ARQ, Go_Back-N
ARQ, and selective repeat ARQ.
❑ All three protocols usually use some form of sliding window protocol to help the
sender determine which packets need to be retransmitted.

21 22

COMPUTER ARCHITECTURE

Thanks
23

You might also like