0% found this document useful (0 votes)
22 views92 pages

Data Link Control

Uploaded by

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

Data Link Control

Uploaded by

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

Chapter 11

Data Link Control

11.1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Why Data Link Control?

The data link layer is the connection between a user workstation and the network.

For example, it is the connection between:


• your laptop and a wireless LAN
• your workstation and a wired LAN
• your computer at home and your ISP
• DePaul university and its ISP
• a business and …

How does the data get from this workstation on the desk here to a server in, say, New York?

11.2
11-1 FRAMING

The data link layer needs to pack bits into frames, so that each frame is distinguishable from

another. Our postal system practices a type of framing. The simple act of inserting a letter into

an envelope separates one piece of information from another; the envelope serves as the

delimiter.

Topics discussed in this section:

Fixed-Size Framing

Variable-Size Framing

11.3
Figure 11.1 A frame in a character-oriented protocol

11.4
Figure 11.2 Byte stuffing and unstuffing

11.5
Figure 11.3 A frame in a bit-oriented protocol

Bit stuffing is the process of adding one extra 0 whenever

five consecutive 1s follow a 0 in the data, so that the receiver

does not mistake the pattern 0111110 for a flag.

11.6
Figure 11.4 Bit stuffing and unstuffing

11.7
11-2 FLOW AND ERROR CONTROL

The most important responsibilities of the data link layer are flow control and error control.

Collectively, these functions are known as data link control.

Topics discussed in this section:

Flow Control

Error Control

11.8
Note

Flow control refers to a set of procedures used to restrict the amount of

data

that the sender can send before

waiting for acknowledgment.

11.9
Note

Error control in the data link layer is based on automatic repeat

request, which is the retransmission of data.

11.10
Error Control

Once an error is detected, what is the receiver going to do?

1. Do nothing

2. Return an error message to the transmitter

3. Fix the error with no further help from the transmitter

11.11
Error Control - Do Nothing

Seems like a strange way to control errors but some lower layer protocols such as frame relay perform this

type of error control.

For example, if frame relay detects an error, it simply tosses the frame. No message is returned.

Frame relay assumes a higher protocol (such as TCP/IP) will detect the tossed frame and ask for

retransmission

11.12
Error Control - Return an Error Message

Once an error is detected, an error message is returned to the transmitter

Two basic forms:

Stop-and-wait error control

Sliding window error control

11.13
Stop-and-Wait Error Control

Stop-and-wait is the simplest of the error control protocols.

A transmitter sends a frame then stops and waits for an acknowledgment.

If a positive acknowledgment (ACK) is received, the next frame is sent.

If a negative acknowledgment (NAK) is received, the same frame is transmitted again.

11.14
11.15
Stop and Wait Link
Utilization

11.16
Stop and Wait Link
Utilization

11.17
Stop and Wait Link
Utilization Example
 Consider a WAN using ATM, 2 stations
1000 km apart, ATM frame size = 424 bits,
standard data rate = 155.52 Mbps
 Frame Transmission Time (L/R)
=424/155.52 x 106 = 2.7 x 10-6 seconds
 Assume optical link:
 Propagation Time (D/V) = 106 m / 3 x 108
m/sec
 = 0.33 x 10-2 seconds

11.18
Stop and Wait Link
Utilization Example
 Thus, a = 0.33 x 10-2 / 2.7 x 10-6 =
1222
 U = 1/(1+2a) = 1/(1+2x1222) =
0.0004 ouch!
 Another example: A LAN
 V = 2 x 108 m/s
 L = 1000 bits
 R = 10 Mbps
11.19
 D = 0.1 km = 100 m
Stop and Wait Link
Utilization Example
 Thus, a = (D/V) / (L/R) = 0.005

 U = 1/(1+2a) = 0.99 No ouch!

11.20
Sliding Window Error Control

These techniques assume that multiple frames are in transmission at one time

A sliding window protocol allows the transmitter to send up to the window size frames before receiving any

acknowledgments.

When a receiver does acknowledge receipt, the returned ACK contains the number of the frame expected

next.

11.21
11.22
Sliding Window Error Control

Older sliding window protocols numbered each frame or packet that was transmitted

More modern sliding window protocols number each byte within a frame

Let’s look at an example in which the packets are numbered:

11.23
11.24
This example shows each byte numbered

11.25
Sliding Window Error Control

Notice that an ACK is not always sent after each frame is received. It is more efficient to wait for a few

received frames before returning an ACK.

How long should you wait until you return an ACK?

11.26
Sliding Window Error Control

Using TCP/IP, there are some basic rules concerning ACKs

Rule 1: If a receiver just received data and wants to send its own data, piggyback an ACK along with that

data

Rule 2: If a receiver has no data to return and has just ACKed the last packet, receiver waits 500 ms for

another packet. If while waiting, another packet arrives, send the ACK immediately

Rule 3: If a receiver has no data to return and has just ACKed the last packet, receiver waits 500 ms. No

packet, send ACK

11.27
11.28
Sliding Window Error Control

What happens when a packet is lost?

As shown in the next slide, if a frame is lost, the following frame will be “out of sequence”. The receiver

will hold the out of sequence bytes in a buffer and request the sender to retransmit the missing frame.

11.29
11.30
Sliding Window Error Control

What happens when an ACK is lost?

As shown in the next slide, if an ACK is lost, the sender will wait for the ACK to arrive and eventually

time-out. When the time-out occurs, the sender will resend the last frame.

11.31
11.32
Sliding Window Performance

 U = 1 if W >= 2a + 1 where W =
window size
 Thus, Utilization = 1 (100%) where
ACK for frame 1 reaches A before A
has exhausted its window
 U = W / (2a+1) if W < 2a + 1 (A’s
window closes)

11.33
Sliding Window Performance

 Example: What is U for a 1000-bit frame


on a 1 Mbps satellite link with 270 ms
delay with a window size of 127?
 a = Prop/Tran = .270 sec/(1000/1000000)
 a = 270
 2a + 1 = 541
 Is W < 2a + 1? Yes, so U = W / (2a + 1)
 U = 127 / 541 = 0.23

11.34
High Level Data Link Control

11.35
HDLC Station Types

11.36
HDLC Link Configurations

11.37
HDLC Transfer Modes (1)

11.38
HDLC Transfer Modes (2)

11.39
HDLC Transfer Modes (3)

11.40
Frame Structure

11.41
Frame Structure Diagram

11.42
HDLC frame types

11.43
Address Field
 Identifies secondary station that sent or
will receive frame
 Usually 8 bits long
 May be extended to multiples of 7 bits
 LSB of each octet indicates that it is the last
octet (1) or not (0)
 All ones (11111111) is broadcast

11.44
Control Field

11.45
Control Field Diagram

11.46
HDLC Commands and
Responses
Supervisory

Receive Ready (RR) - positive acknowledgment

Receive Not Ready (RNR)

Reject (REJ)

Selective Reject (SREJ)

Unnumbered

Set normal response/extended mode (SNRM/SNRME)

Set asynchronous response/extended mode (SARM/SARME)

Set asynchronous balanced/extended mode (SABM/SABME)

Set initialization mode (SIM)

Disconnect (DISC)

Unnumbered ack (UA)

Disconnected mode (DM)

Request disconnect (RD)

Request initialization mode (RIM)

Unnumbered information (UI)

Unnumbered poll (UP)

Reset (RSET)

Exchange identification (XID)

Test (TEST)

Frame reject (FRMR)


11.47
U-frame control field in HDLC

11.48
Poll/Final Bit

11.49
Information Field

11.50
Frame Check Sequence
Field

11.51
HDLC Operation

11.52
Examples of Operation (1)

11.53
Examples of Operation (2)

11.54
Figure 11.29 Example of connection and disconnection

11.55
Example 11.10

Figure 11.30 shows an exchange using piggybacking. Node A begins the exchange of information

with an

I-frame numbered 0 followed by another I-frame numbered 1. Node B piggybacks its

acknowledgment of both frames onto an I-frame of its own. Node B’s first

I-frame is also numbered 0 [N(S) field] and contains a 2 in its N(R) field, acknowledging the receipt

of A’s frames 1 and 0 and indicating that it expects frame 2 to arrive next. Node B transmits its

second and third I-frames (numbered 1 and 2) before accepting further frames from node A.

11.56
Example 11.10 (continued)

Its N(R) information, therefore, has not changed: B frames 1 and 2 indicate that node B is still

expecting A’s frame 2 to arrive next. Node A has sent all its data. Therefore, it cannot piggyback an

acknowledgment onto an I-frame and sends an S-frame instead. The RR code indicates that A is

still ready to receive. The number 3 in the N(R) field tells B that frames 0, 1, and 2 have all been

accepted and that A is now expecting frame number 3.

11.57
Figure 11.30 Example of piggybacking without error

11.58
Example 11.11

Figure 11.31 shows an exchange in which a frame is lost. Node B sends three data frames (0, 1, and

2), but frame 1 is lost. When node A receives frame 2, it discards it and sends a REJ frame for

frame 1. Note that the protocol being used is Go-Back-N with the special use of an REJ frame as a

NAK frame. The NAK frame does two things here: It confirms the receipt of frame 0 and declares

that frame 1 and any following frames must be resent. Node B, after receiving the REJ frame,

resends frames 1 and 2. Node A acknowledges the receipt by sending an RR frame (ACK) with

acknowledgment number 3.

11.59
Figure 11.31 Example of piggybacking with error

11.60
Other DLC Protocols
(LAPB,LAPD)
 Link Access Procedure, Balanced (LAPB)
 Part of X.25 (ITU-T)
 Subset of HDLC - ABM
 Point to point link between system and packet
switching network node
 Link Access Procedure, D-Channel
 ISDN (ITU-D)
 ABM
 Always 7-bit sequence numbers (no 3-bit)
 16 bit address field contains two sub-
addresses

One for device and one for user (next layer up)
11.61
Other DLC Protocols (LLC)

11.62
Other DLC Protocols
(Frame Relay) (1)
 Streamlined capability over high
speed packet witched networks
 Used in place of X.25
 Uses Link Access Procedure for
Frame-Mode Bearer Services (LAPF)
 Two protocols
 Control - similar to HDLC
 Core - subset of control
11.63
Other DLC Protocols
(Frame Relay) (2)
 ABM
 7-bit sequence numbers
 16 bit CRC
 2, 3 or 4 octet address field
 Data link connection identifier (DLCI)
 Identifies logical connection
 More on frame relay later

11.64
Other DLC Protocols (ATM)

11.65
Data Communications

Point-to-Point Protocol (PPP)

66
McGraw-Hill
© The McGraw-Hill Companies, Inc., 2000
Basics of PPP
 Used on point-to-point links such
as modem dialup, DSL, and cable
modem
 SLIP (serial line Internet protocol)
was first but could only support IP
and only static IP address
assignment
 PPP solves both above problems
11.67
PPP States
 Idle state – link is not being used
 Establishing state – one endpoint
starts a dialog; options are
exchanged between endpoints;
several packets may be exchanged
 Authenticating state – optional,
two sides agree to authenticate
(described later)
11.68
PPP States
 Networking state – primary state,
exchange of user control and data
packets can now be performed
 Terminate state – one side wishes
to tear down connection; several
packets exchanged (housekeeping)
 (See figure next slide)

11.69
Figure 12-2

Transition States

11.70
PPP Layers
 PPP has only two layers – physical
and data link
 Physical layer is not defined – it is
whatever the user uses
 Data link layer looks like HDLC,
except address field = 11111111
(broadcast), control field =
11000000 (a HDLC U-frame)
11.71
Figure 12-1

PPP Frames

11.72
PPP Layers
 The Data field carries the packets
from one of three other protocols -
Link Control Protocol,
authentication protocols, and
Network Control Protocol, all
described shortly

11.73
12.3 Protocol stack

11.74
Link Control Protocol (LCP)
 Responsible for establishing,
maintaining, configuring,
terminating link, and negotiation
 All LCP packets are carried in
payload field of PPP frame – PPP
field Protocol = hex C021

11.75
Figure 15-5

LCP Packet Encapsulated in a Frame

11.76
Table 12.1 LCP packets and their codes

Code Packet Type Description

Configure- Contains the list of proposed options and their


0116 request values
0216 Configure-ack Accepts all options proposed
0316 Configure-nak Announces that some options are not acceptable
0416 Configure-reject Announces that some options are not recognized
Terminate-
0516 request
Requests to shut down the line

0616 Terminate-ack Accepts the shut down request


0716 Code-reject Announces an unknown code
0816 Protocol-reject Announces an unknown protocol
A type of hello message to check if the other end is
0916 Echo-request
alive
0A16 Echo-reply The response to the echo-request message
0B16
11.77 Discard-request A request to discard the packet
Table 12.2 Common options

Option Default

Maximum receive unit 1500

Authentication protocol None

Protocol field compression Off


Address and control field
Off
compression

11.78
Authentication
 Potentially important since this is
dial-up communication
 Two possible protocols for
authentication:
 Password Authentication Protocol (PAP
 Challenge Handshake Authentication
Protocol (CHAP)

11.79
Authentication – PAP
 Two-step process
 User sends ID and password
 System verifies
 PAP packets are encapsulate in a
PPP frame
 There are 3 types of PAP packets
(see the next two slides)

11.80
Figure 12-5

PAP

11.81
Figure 12-6

PAP Packets

11.82
Authentication – CHAP
 Three-way handshake
 System sends a challenge packet
 User applies a predefined function
that takes the challenge value and
the user’s own password and creates
a result
 System does the same; then
compares its result to user’s result

11.83
Figure 12-7

CHAP

11.84
Figure 12-8

CHAP Packets

11.85
IPCP (An NCP Protocol)
 Now that a link has been
established and optional security
has been established, we need to
establish a network layer
connection
 IPCP, or Internetwork Protocol
Control Protocol, is an NCP
(Network Control Protocol)

11.86
IPCP
 Seven packet types:
 Configure-request (01)
 Configure-ACK (02)
 Configure-NAK (03)
 Configure-reject (04)
 Terminate-request (05)
 Terminate-ACK (06)
 Code-reject (07)

11.87
Figure 12-9

IPCP Packet Encapsulated in PPP Frame

11.88
12.10 An example

11.89
An Example

11.90
Review Questions

11.91
Review Questions

11.92

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