0% found this document useful (0 votes)
3 views71 pages

Session 4 - Data Link Layer

The document outlines the functions and responsibilities of the data link layer in computer networking, including framing, addressing, flow control, error control, and media access control. It explains how the data link layer ensures reliable communication between computers by managing data transmission and preventing errors. Additionally, it discusses media access control techniques, including contention and controlled access methods, and their impact on network performance.

Uploaded by

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

Session 4 - Data Link Layer

The document outlines the functions and responsibilities of the data link layer in computer networking, including framing, addressing, flow control, error control, and media access control. It explains how the data link layer ensures reliable communication between computers by managing data transmission and preventing errors. Additionally, it discusses media access control techniques, including contention and controlled access methods, and their impact on network performance.

Uploaded by

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

Slide 1.

ISD 358: COMPUTER


NETWORKING &
SECURITY
Lecturer: Kwame Owusu Kwateng
Supply Chain and Information Systems
KNUST School of Business - Kumasi
© 2020
Slide 1.2

DATALINK LAYER
Slide 1.3

Learning Objectives
3

At the end of this session students should be


able to:
 Understand the role of the data link layer

 Become familiar with two basic approaches to

controlling access to the media


 Become familiar with common sources of error

and their prevention


 Understand three common error detection and

correction methods
 Become familiar with some of the commonly

used data link protocols


Slide 1.4

Data Link Layer


4

 The data link layer is responsible for sending


and receiving messages to and from other
computers. Its job is to reliably move a
message from one computer over one circuit to
the next computer where the message needs to
go.
 It transforms the logical communication channel
provided by the physical layer into a reliable
channel by splitting the data into frames which
are subjected to error control and flow control
procedures.
Slide 1.5

Data Link Layer Functions


5

 Specific responsibilities of the data link


layer include;
 framing(or packetizing)
 addressing,
 flow control,
 error control, and
 Media access control.
Slide 1.6

Position of the data-link


6
layer
Slide 1.7

Data Link Layer Functions…


7 cont’d
 Framing or Packetizing: The data link layer
divides the stream of bits received from the network
layer into manageable data units called frames.
 Addressing: The data link layer adds a header to
the frame to define the addresses of the sender and
receiver of the frame.
 Flow Control: If the rate at which the data are
absorbed by the receiver is less than the rate at
which data are produced in the sender, the data link
layer imposes a flow control mechanism to avoid
overwhelming the receiver.
Slide 1.8

Data Link Layer Functions…


8
cont’d
 Error Control: The data link layer also adds
reliability to the physical layer by adding
mechanisms to detect and retransmit
damaged, duplicate, or lost frames.

 Media Access Control: When two or more


devices are connected to the same link, data
link layer protocols are necessary to
determine which device has control over the
link at any given time.
Slide 1.9

Data Link Layer Functions…


9
cont’d
 A data link protocol determines;
 how bit streams are grouped into manageable data units
(framing/packetizing)
 who can transmit at what time
(Media access control)
 where a message begins and ends
(addressing)
 how a receiver recognizes and corrects a transmission
error
(error control) and
 how fast data moves from sender to receiver
(flow control)
Slide 1.10

Data link layer duties


10
Components of the Data
Slide 1.11

11
Link Layer
Components of the Data
Slide 1.12

12
Link Layer
 The data link layer performs two main functions, and
therefore is often divided into two sublayers.
 The first sublayer is called the logical link control
[LLC] sublayer. It is;
 the data link layer’s connection to the network layer above it.
 At the sending computer, LLC sublayer takes the network
layer Protocol Data Unit (PDU)—usually an IP packet—and
surrounds it with a data link layer PDU—often an Ethernet
frame.
 At the receiving computer, the LLC sublayer software
removes the data link layer PDU and passes the message it
contains (usually an IP packet) to the network layer software.
Components of the Data
Slide 1.13

13
Link Layer
 The second sublayer is called the media
access control [MAC] sublayer.
 It controls the physical hardware.
 The MAC sublayer software at the sending
computer controls how and when the physical
layer converts bits into the physical symbols that
are sent down the circuit.
 At the receiving computer, the MAC sublayer
receives a stream of bits from the physical layer
and translates it into a coherent PDU, ensures that
no errors have occurred in transmission, and
passes the data link layer PDU to the LLC sublayer.
Slide 1.14

14

Data Link Layer


Functions
Slide 1.15

15

Framing & Addressing


Slide 1.16

Framing or Packetizing…
16
cont’d
 Data transmission in the physical layer means
moving bits in the form of a signal from the
source to the destination.
 The data link layer, on the other hand, packs bits
into frames, so that each frame is distinguishable
from another. (analogy of the postal system)
 Framing in the data link layer separates a
message from one source to a destination, or
from other messages to other destinations, by
adding a sender address and a destination
address.
Slide 1.17

Framing or Packetizing…
17
cont’d
 The destination address defines where the
packet is to go; the sender address helps the
recipient acknowledge the receipt.
 Although the whole message could be packed in one
frame, that is not normally done. When a frame is
too large, it makes flow and error control very
inefficient. 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.
Slide 1.18

Addressing
18

 This is done by the data link layer as part


of the framing process where destination
and sender addresses are attached to
frames.
Slide 1.19

19

Media Access Control


Slide 1.20

Media Access Control


20

 Media access control refers to the need to


control when computers transmit.
 Not necessary with point-to-point full-duplex

configurations because there are only two


computers on the circuit and full duplex
permits either computer to transmit at any
time.
 Media access control becomes important when;
1. Several computers share the same
communication circuit, such as a point-to-point
configuration with a half-duplex configuration
that requires computers to take turns, or
Slide 1.21

Media Access Control…cont’d


21

2. a multipoint configuration in which several


computers share the same circuit.
 Here, it is critical to ensure that no two computers
attempt to transmit data at the same time—but if
they do, there must be a way to recover from the
problem.
 There are two fundamental approaches to
media
access control:
1. Contention and
2. Controlled Access.
Slide 1.22

Media Access Control…cont’d


22

Contention:
 Transmit whenever the circuit is free

 Collision occurs when more than one


computer transmitting at the same time
 Need to determine which computer is
allowed to transmit first after the collision
 Used commonly in Ethernet LANs
Slide 1.23

Media Access Control…cont’d


23

Controlled Access:
Most wireless LANS use controlled access. In this
case, the wireless access point controls the circuit
and determines which clients can transmit at what
time. There are two commonly used controlled access
techniques: access requests and polling.
 Access Requests:
 With the access request technique, client computers
that want to transmit send a request to transmit to the
device that is controlling the circuit (e.g., the wireless
access point). The controlling device grants permission
for one computer at a time to transmit.
Slide 1.24

Media Access Control…cont’d


24

Controlled Access:
 Access Requests:

 When one computer has permission to transmit, all


other computers wait until that computer has
finished, and then, if they have something to
transmit, they use a contention technique to send an
access request.
 The controlling circuit (the wireless access
point) can choose to transmit whenever it likes.
 Major access control method
 X-ON/X-OFF
Slide 1.25

X-ON / X-OFF
4 - 25

A B
An older
Request to Transmit
controlled
access X-ON not busy
protocol transmitting data
data
Pausing
(periodically done)
X-OFF busy
X-ON
not busy
transmitting data
Still used between a data
computer and a printer
Still used on some half duplex circuits, but it is fading
Copyright 2005 John Wiley & Sons, Inc
Slide 1.26

Media Access Control…cont’d


26

Controlled Access:
 Polling

 This is the process of sending a signal to a client


computer that gives it permission to transmit.
 With polling, the clients store all messages that need
to be transmitted.
 Periodically, the controlling device (e.g., a wireless
access point) polls the client to see if it has data to
send. If the client has data to send, it does so. If the
client has no data to send, it responds negatively,
and the controller asks another client if it has data to
send.
Slide 1.27

Polling
4 - 27

 Process of transmitting to a server by a


client only if asked and/or permitted
 Client stores the info to be transmitted
 Server (periodically) polls the client if it has data to
send
 Client, if it has any, sends the data
 If no data to send, client responds negatively, and
server asks the next client
 Types of polling
 Roll call polling
 Hub polling (also called token passing)
Copyright 2005 John Wiley & Sons, Inc
Slide 1.28

Media Access Control…cont’d


28

 Roll-call polling:
 the controller/server works consecutively
through a list of clients, first polling client 1,
then client 2, and so on, until all are polled.
 Roll-call polling can be modified to select
clients in priority so that some get polled
more often than others. For example, one
could increase the priority of client 1 by using
a polling sequence such as 1, 2, 3, 1, 4, 5, 1,
6, 7, 1, 8, 9.
Slide 1.29

Media Access Control…cont’d


29

 Roll-call polling:
 Typically, roll-call polling involves some waiting
because the controller has to poll a client and then
wait for a response.
 The response might be an incoming message that was
waiting to be sent, a negative response indicating nothing
is to be sent, or the full“time-out period” may expire
because the client is temporarily out of service (e.g., it is
malfunctioning or the user has turned it off).
 Usually, a timer “times out” the client after waiting
several seconds without getting a response. If some
sort of fail-safe time-out is not used, the circuit poll
might lock up indefinitely on an out-of-service client.
Slide 1.30

Roll Call Polling


4 - 30

Clients
Check each client
(consecutively and D
periodically) to see if C
it wants to transmit :
A, B, C, D, E, A, B, … E
B

Server A
Clients can also be
prioritized so that they are  Involves waiting: Poll and wait
polled more frequently: for a response
A, B, A, C, A, D,  Needs a timer to prevent lock-
A, E, A, B, .. up (by client not answering)

Copyright 2005 John Wiley & Sons, Inc


Slide 1.31

Media Access Control…cont’d


31

 Hub polling (often called token


passing)
 With hub polling, one device starts the poll
and passes it to the next computer on the
multipoint circuit, which sends its message
and passes the poll to the next.
 That computer then passes the poll to the
next, and so on, until it reaches the first
computer, which restarts the process again.
Slide 1.32

Hub Polling (Token Passing)


4 - 32

One computer E
starts the poll: D
• sends message A
(if any) then token C
• passes the B
token on to the
next computer
Continues in sequence until
the token reaches the first
computer, which starts the
polling cycle all over again
Copyright 2005 John Wiley & Sons, Inc
Slide 1.33

Relative Performance
33
 Which media access control approach is best: controlled
access or contention?
 The key consideration is throughput—which approach will
permit the most amount of user data to be transmitted
through the network.
 In general, contention approaches work better than

controlled approaches for small networks that have low


usage. In this case, each computer can transmit when
necessary, without waiting for permission.
 Because usage is low, there is little chance of a collision .

 In contrast, computers in a controlled access environment


must wait for permission, so even if no other computer
needs to transmit, they must wait for the poll.
Slide 1.34

Relative Performance
34

 In high-volume networks, many computers want to


transmit, and the probability of a collision using
contention is high. Collisions waste circuit capacity during
the collision and require both computers to retransmit
later.
 Controlled access prevents collisions and makes more
efficient use of the circuit
 The key to selecting the best access control technique is
to find the crossover point between controlled and
contention.
 Most experts believe that the crossover point is often
around 20 computers (lower for busy computers, higher
for less-busy computers).
Slide 1.35

Relative Performance
4 - 35
Depends on network conditions When volume
is high,
performance
Work better for deteriorates
networks with high (too many
traffic volumes collisions)

Cross-over
Network more
point:
efficiently used
Work better for About 20
smaller networks computers
with low usage

Copyright 2005 John Wiley & Sons, Inc


Slide 1.36

36

Flow Control
Slide 1.37

Flow Control
37

 The various stations in a network may operate at


different speeds. One of the tasks of the data link
layer is to ensure that slow devices are not swamped
with data from fast devices.
 Flow control refers to the regulating of the rate of data
flow from one device to another so that the receiver
has enough time to consume the data in its receive
buffer, before it overflows.
 Flow control coordinates the amount of data that can
be sent before receiving an acknowledgment and is
one of the most important duties of the data link layer.
Slide 1.38

Flow Control…cont’d
38

 Flow control is a set of procedures that tells the sender


how much data it can transmit before it must wait for
an acknowledgment from the receiver.
 This is to ensure that the flow of data does not
overwhelm the receiver.
 Any receiving device has a limited speed at which it can
process incoming data and a limited amount of memory in
which to store incoming data.
 The receiving 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
temporarily.
Slide 1.39

Flow Control…cont’d
39

 Incoming data must be checked and processed


before they can be used.
 The rate of such processing is often slower
than the rate of transmission. For this reason,
each receiving device has a block of memory,
called a buffer, reserved for storing incoming
data until they are processed.
 If the buffer begins to fill up, the receiver must
be able to tell the sender to halt transmission
until it is once again able to receive.
Slide 1.40

Flow Control…cont’d
40

 In character-oriented protocols, flow


control is usually based on two control
characters: XON and XOFF.
 When the receiver senses that it can no longer
accept incoming data, it sends an XOFF
character to the transmitter, which causes the
latter to stop transmitting. Once the receiver
has consumed enough of the data in its receive
buffer so that it can receive more, it sends an
XON character to the transmitter, causing it to
resume transmission.
Slide 1.41

Flow Control…cont’d
41

 In bit-oriented protocols, flow control is


handled through the use of ACK frames.
 According to this protocol the transmitter
will have to receive an ACK frame before
transmitting the next frame.
 When necessary, the receiver can withhold
an ACK frame which will prevent the
transmitter from transmitting new frames.
Slide 1.42

Flow control using ACK…


Stop and Wait
 Source transmits frame
 Destination receives frame and replies
with acknowledgement
 Source waits for ACK before sending
next frame
 Destination can stop flow by not send
ACK
 Works well for a few large frames
11.1 Normal operation
Slide 1.44

44

Error Control
Slide 1.45

Error Control
45

 Data communication requires at least two


devices working together, one to send and the
other to receive. Even such a basic
arrangement requires a great deal of
coordination for an intelligible exchange to
occur.

 The most important responsibilities of the data


link layer are flow control and error control.
Collectively, these functions are known as data
link control.
Slide 1.46

Sources of Errors
4 - 46

 Line noise and distortion – major cause


 More likely on electrical media
 Undesirable electrical signal
 Introduced by equipment and natural disturbances
 Degrades performance of a communication circuit
 Noise manifests itself as extra bits, missing bits, or
bits that have been “flipped” (i.e., changed from 1
to 0 or vice versa).
 White noise or Gaussian noise (the familiar
background hiss or static on radios and telephones)
is caused by the thermal agitation of electrons.
Slide 1.47

Sources of Errors and


47
Prevention
Slide 1.48

Types of Errors
48

 Data can be corrupted during transmission.


For reliable communication, errors must be
detected and corrected.
 Any time data are transmitted from one node

to the next, they can become corrupted in


passage. Many factors can alter one or more
bits of a message
 There are two types of errors;

 Single-Bit Error and


 Burst Error
Slide 1.49

Single-Bit Errors
49

 In a single-bit error, only one bit in


the data unit has changed.
Slide 1.50

Burst Errors
50

 A burst error means that 2 or more bits in the


data unit have changed.
 The length of the burst is measured from the
first corrupted bit to the last corrupted bit.
Some bits in between may not have been
corrupted.
Slide 1.51

Error Detection through


51
Redundancy
 The central concept in detecting or correcting
errors is redundancy. To be able to detect or
correct errors, we need to send some extra bits
with our data.
 These redundant bits are added by the sender
and removed by the receiver. Their presence
allows the receiver to detect or correct
corrupted bits.
Error detection uses the concept of redundancy,
which means adding extra bits for detecting
errors at the destination.
Slide 1.52

Error Detection through


52
Redundancy
Slide 1.53

Error Control & Detection


53
 Error control involves both error detection and error
correction. It allows the receiver to inform the sender of any
frames lost or damaged in transmission and coordinates the
retransmission of those frames by the sender.
 The most important role of the data link layer is to provide
error-free transmission. To do this, it uses an error checking
scheme to detect errors, and overcomes them by
retransmitting corrupted frames.
 There are many different error detection methods that have
been devised.
 Three of the most popular methods are;
 parity checking
 Checksum
Detection methods
Slide 1.55

Parity Checking
55

 Parity checking is a simple error detection method


used with character oriented protocols. One bit in
every character bit sequence is reserved for
parity.
 This bit is set by the transmitter to 0 or 1 so that
the total number of 1 bits in the character is
always even (in case of even parity checking) or
always odd (in case of odd parity checking). The
receiver checks the parity bit of each character to
see if it is as expected. The next slide illustrates
the method for an even parity checking scheme.
Slide 1.56

Parity Checking
4 - 56

 One of the oldest and simplest methods of error


correction
 In parity check, a parity bit is added to every data unit
so that the total number of 1s is even or odd.
 Even parity: number of 1’s remains even
 Odd parity: number of 1’s remains odd
 Receiving end recalculates parity bit
 If one bit has been transmitted in error the received parity bit
will differ from the one sent
 Simple, but doesn’t catch all errors
 If two (or an even number of) bits have been transmitted in
error at the same time, the parity check appears to be
correct
 Detects about 50% of errors
Slide 1.57

57
Example 1
Suppose the sender wants to send the word world. In
ASCII the five characters are coded as
1110111 1101111 1110010 1101100
1100100
The following shows the actual bits sent
11101110 11011110 11100100 11011000 11001001
Example 2
Now suppose the word world in Example 1 is received by
the receiver without being corrupted in transmission.
11101110 11011110 11100100 11011000
11001001
The receiver counts the 1s in each character and comes up
with even numbers (6, 6, 4, 4, 4). The data are accepted.
Example 3
Now suppose the word world in Example 1 is corrupted
during transmission.
11111110 11011110 11101100 11011000
11001001
The receiver counts the 1s in each character and comes up
with even and odd numbers (7, 6, 5, 4, 4). The receiver
knows that the data are corrupted, discards them, and asks
for retransmission.
Slide 1.61

Limitations of even parity error


61
checking
 Parity checking is effective in detecting an odd
number of bit errors in a character (single bit
errors represent the most common case).
 The limitation is that, if an even number of bits in a
character are corrupted then this will go unnoticed,
because the parity bit will seem correct.
 Simple parity check can detect all single-bit errors,
however it can detect burst errors only if the total
number of errors in each data unit is odd.
Slide 1.62

Checksum
62

 In checksum, the data to be transmitted is


sent in addition to the complement of it’s
sum.
 At the receiving end the individual data

elements are summed up and added to the


complement of the original sum. If there is no
error in transmission this should give a result
of zero.
 Detects close to 95 percent of the errors for

multiple-bit burst errors.


Slide 1.63

Checksum…Example 1
63

 Suppose our data is a list of five 4-bit numbers that we


want to send to a destination. In addition to sending
these numbers, we send the sum of the numbers. For
example, if the set of numbers is (7, 11, 12, 0, 6), we
send (7, 11, 12,0,6,36), where 36 is the sum of the
original numbers. The receiver adds the five numbers
and compares the result with the sum. If the two are
the same, the receiver assumes no error, accepts the
five numbers, and discards the sum. Otherwise, there
is an error somewhere and the data are not accepted.
 95% effective
Slide 1.64

Checksum…Example 2
64

 We can make the job of the receiver easier


if we send the negative (complement) of
the sum, called the checksum. In this case,
we send (7, 11, 12,0,6, -36).
 The receiver can add all the numbers
received (including the checksum). If the
result is 0, it assumes no error; otherwise,
there is an error.
Slide 1.65

Error Correction
65

 Once error has been detected, it must be


corrected. There are two kinds of correction
techniques;
 Retransmission (a.k.a, Backward error correction)
 Correction by retransmission of the data
 Receiver, when detecting an error, asks the sender to
retransmit the message
 Often called Automatic Repeat Request (ARQ)

 Forward Error Correction


 Receiving device can correct incoming messages itself
Slide 1.66

Error Correction via


66
retransmission
 The simplest, most effective, least expensive,
and most commonly used method for error
correction is retransmission.
 With retransmission, a receiver that detects an
error simply asks the sender to retransmit the
message until it is received without error.
 This is often called Automatic Repeat reQuest
(ARQ). There are two types of ARQ:
 stop-and-wait and
 continuous.
Slide 1.67

Automatic Repeat Request


4 - 67
(ARQ)
 Process of requesting that a data transmission be
resent
 Main ARQ protocols
 Stop and Wait ARQ (A half duplex technique)
 Sender sends a message and waits for acknowledgment,
then sends the next message
 Receiver receives the message and sends an
acknowledgement, then waits for the next message
 Continuous ARQ (A full duplex technique)
 Sender continues sending packets without waiting for the
receiver to acknowledge
 Receiver continues receiving messages without
acknowledging them right away
Slide 1.68

Stop-and-Wait ARQ
68

 With stop-and-wait ARQ, the sender stops and waits


for a response from the receiver after each data
packet.
 After receiving a packet, the receiver sends either an
acknowledgment (ACK), if the packet was received
without error, or a negative acknowledgment (NAK), if
the message contained an error.
 If it is an NAK, the sender resends the previous
message. If it is an ACK, the sender continues with the
next message.
 Stop-and-wait ARQ is by definition a half-duplex
transmission technique
Slide 1.69

Stop and Wait ARQ


4 - 69

Sender Receiver
Sends the packet,
then waits to hear
from receiver. Sends
acknowledgement
Sends the
next packet
Sends negative
acknowledgement
Resends the
packet again

Copyright 2005 John Wiley & Sons, Inc


Slide 1.70

Continuous ARQ
70

 With continuous ARQ, the sender does not wait for


an acknowledgment after sending a message; it
immediately sends the next one.
 Although the messages are being transmitted, the
sender examines the stream of returning
acknowledgments. If it receives an NAK, the
sender retransmits the needed messages.
 The packets that are retransmitted may be only
those containing an error or may be the first
packet with an error and all those that followed
it).
Slide 1.71

Continuous ARQ
4 - 71
Sender sends packets
continuously without
waiting for receiver to
acknowledge

Notice that
acknowledgments now
identify the packet
being acknowledged.

Receiver sends back


a NAK for a specific
packet to be resent.

Copyright 2005 John Wiley & Sons, Inc

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy