Session 4 - Data Link Layer
Session 4 - Data Link Layer
DATALINK LAYER
Slide 1.3
Learning Objectives
3
correction methods
Become familiar with some of the commonly
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
15
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
19
Contention:
Transmit whenever the circuit is free
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
Controlled Access:
Access Requests:
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
Controlled Access:
Polling
Polling
4 - 27
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
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
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)
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
Relative Performance
34
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
36
Flow Control
Slide 1.37
Flow Control
37
Flow Control…cont’d
38
Flow Control…cont’d
39
Flow Control…cont’d
40
Flow Control…cont’d
41
44
Error Control
Slide 1.45
Error Control
45
Sources of Errors
4 - 46
Types of Errors
48
Single-Bit Errors
49
Burst Errors
50
Parity Checking
55
Parity Checking
4 - 56
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
Checksum
62
Checksum…Example 1
63
Checksum…Example 2
64
Error Correction
65
Stop-and-Wait ARQ
68
Sender Receiver
Sends the packet,
then waits to hear
from receiver. Sends
acknowledgement
Sends the
next packet
Sends negative
acknowledgement
Resends the
packet again
Continuous ARQ
70
Continuous ARQ
4 - 71
Sender sends packets
continuously without
waiting for receiver to
acknowledge
Notice that
acknowledgments now
identify the packet
being acknowledged.