Chap 11

advertisement
Chapter 11
Data Link
Control
(DLC)
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Chapter 11: Outline
111.1 DLC SERVICES
111.2 DATA-LINK LAYER PROTOCOLS
111.3 HDLC
111.4 PPP
11-1 DLC SERVICES
The data link control (DLC) deals with procedures
for communication between two
adjacent nodes.
11.3
11-1 DLC SERVICES
Data link control functions include
Framing,
● Flow control, and
● Error control
●
11.4
11.1 Framing (encapsulation)
The data-link layer packs bits into frames so that each
frame is distinguishable from another frame.
.
11.5
11.1 Framing
The 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.
11.6
11.1 Framing
Framing in the data-link layer separates a message by
encapsulating a sender address and a destination
address into a header.
11.7
11.1 Framing
Framing in the data-link layer separates a message by
encapsulating a sender address and a destination
address into a header.
11.8
11.1 Framing
Framing techniques include
Character oriented framing (8 bit characters)
● Bit oriented framing
●
11.9
11.1 Framing
Frames may have a particular bit pattern between
frames to help identify the start and end of a frame.
This kind of special bit pattern is referred to as a
“flag”
11.10
Figure 11.1: A frame in a character-oriented protocol
11.11
11.1 Framing
Problem: the flag bit pattern could appear in the data
portion of the frame.
The problem is solved by stuffing (inserting) a special
byte pattern known as an Escape-character into the
data.
11.12
Figure 11.2: Byte stuffing and unstuffing
11.13
Figure 11.3: A frame in a bit-oriented protocol
11.14
Bit Stuffing

Bit oriented frames face the same issue as
byte-oriented frames – the flag pattern
can appear in the data.

This is resolved by bit stuffing.
Bit Stuffing

A zero bit is inserted after 5-consecutive
one-bits.
Figure 111.4: Bit stuffing and unstuffing
11.17
11.2 Flow and Error Control
Flow control and error control were introduced in
Chapter 9
The data-link layer handles flow control and error
control.
11.18
Figure 111.5: Flow control at the data link layer
11.19
Example 111.1
Example of flow control:
A single memory slot is used to hold information for the
receiver node at the data-link layer.
●
When this single slot is empty, the data-link layer sends a
request to the sender-node to send the next frame.
●
11.20
11-2 DATA-LINK LAYER PROTOCOLS
Traditionally four protocols have been defined for
the data-link layer to deal with flow and error
control:
1.Simple,
2.Stop-and-Wait,
3.Go-Back-N, and
4.Selective-Repeat.
11.21
11-2 DATA-LINK LAYER PROTOCOLS
1. Simple
2.Stop-and-Wait
The first two protocols are common at the data-link
layer, the last two are no longer used.
11.22
Figure 11.6: (Optional slide) Finite State Machine Diagram
11.23
11.2.1 Simple Protocol
Our first protocol is a simple protocol with neither
flow nor error control.
Assume that the receiver can immediately handle any
frame it receives. (The receiver can never be
overwhelmed with incoming frames. )
11.24
Figure 11.7: Simple protocol (no flow control)
11.25
Figure 11.8: Finite State Machine for the simple protocol (event,
action)
11.26
Example 11.2
Figure 11.9 shows an example of communication using
the Simple Protocol.
The sender sends frames one after another without even
thinking about the receiver (no error or flow control).
11.27
Figure 11.9: Flow diagram for Example 111.2
11.28
111.2.2 Stop-and-Wait Protocol
The Stop-and-Wait protocol uses both flow and error
control.
The sender sends one frame at a time and waits for an
acknowledgment before sending the next one.
Corrupted frames are detected with a CRC to each
data frame.
11.29
Figure 11.10: Stop-and-wait Protocol
11.30
Figure 11.11: FSM for the stop-and-wait protocol (events & actions)
11.31
Example 11.3
Figure 11.12 shows an example. The first frame is sent
and acknowledged. The second frame is sent, but lost.
After time-out, it is resent. The third frame is sent and
acknowledged, but the acknowledgment is lost. The frame
is resent. However, there is a problem with this scheme.
The network layer at the receiver site receives two copies of
the third packet, which is not right. In the next section, we
will see how we can correct this problem using sequence
numbers and acknowledgment numbers.
11.32
Figure 11.12: Flow diagram for Example 11.3
11.33
Example 11.4
Figure 11.13 shows how adding sequence numbers and
acknowledgment numbers can prevent duplicates.
1.The first frame is sent and acknowledged.
2.The second frame is sent, but lost. After time-out, it is
resent.
3.The third frame is sent and acknowledged, but the
acknowledgment is lost. The frame is resent.
11.34
Figure 11.13: Flow diagram for Example 11.4
11.35
11.2.3
The simple & stop-n-wait protocols are designed for
unidirectional half-duplex communication.
11.36
11.2.3 Piggybacking
More efficient two way communication can be
achieved by sending data back with each
acknowledgment. This is called piggybacking.
11.37
11-3 High-level Data Link Control
HDLC is a bit-oriented protocol for communication
over point-to-point and multipoint links.
HDLC implements the Stop-and-Wait protocol.
11.38
11-3 High-level Data Link Control
HDLC is the basis for other practical protocols such
as
X.25 (old protocol)
● Some wireless protocols
● Frame relay (becoming rare)
●
11.39
11.3.1 Transfer Modes
HDLC provides two common transfer modes that can
be used in different configurations:
normal response mode (NRM) and
● asynchronous balanced mode (ABM).
●
11.40
Normal Response Mode

Almost never used


The primary node has control of
communication
The secondary nodes must get approval from
the primary mode before sending data.
Figure 11.14: Normal response mode (IBM X.25)
11.42
Asynchronous Balanced Mode

Each node acts as a peer (both nodes can
send and receive)
Figure 11.15: Asynchronous balanced mode (frame relay)
11.44
11.3.2 HDLC Framing
HDLC defines three types of frames:
1. I-frames, information frames,
2. S-frames, supervisory frames, and
3. U-frames, unnumbered frames.
11.45
HDLC Frame

Frames have up to 6 fields





Stop, end flags
Address
Control (figure 11.17)
Data
The FCS section is the frame check sequence,
used for error detetion.
Figure 11.16: Schematic of the HDLC frames
11.47
Control Field


The control field is used for flow control
and error control.
P/F means either Pole or the frame is final.
Figure 11.17: Control field format for the different frame types
11.49
Example 11.5
Figure 11.18 shows how U-frames can be used for
connection establishment and connection release. Node A
asks for a connection with a set asynchronous balanced
mode (SABM) frame; node B gives a positive response
with an unnumbered acknowledgment (UA) frame. After
these
two exchanges, data can be transferred between the two
nodes (not shown in the figure). After data transfer, node A
sends a DISC (disconnect) frame to release the
connection; it is confirmed by node B responding with a
UA (unnumbered acknowledgment).
11.50
Figure 111.18: Example of connection and disconnection
11.51
Example 11.6
Figure 11.19 shows two exchanges using piggybacking.
The first is the case where no error has occurred; the
second is the case where an error has occurred and some
frames are discarded.
11.52
Figure 111.19: Example of piggybacking with and without error
11.53
11-4 PPP
A common protocol for point-to-point access is the
Point-to-Point Protocol (PPP).
11.54
11-4 PPP
Many broadband Internet users use PPP,
DSL is an example.
11.55
111.4.1 Services
The designers of PPP have included several services
to make it suitable for various applications
11.56
111.4.2 Framing
PPP uses a character-oriented (or byte-oriented)
frame. Figure 111.20 shows the format of a PPP
frame.
11.57
Figure 111.20: PPP frame format
11.58
11.4.3 PPP
Payload field has a default maximum of 1500 bytes.
11.59
111.4.3 Transition Phases
A PPP connection goes through phases which can be
shown in a transition phase diagram (see Figure
111.21).
11.60
Figure 111.21: Transition phases
11.61
111.4.4 Multiplexing
Although PPP is a link-layer protocol, it uses another
set of protocols to establish the link, authenticate the
parties involved, and carry the network-layer data.
11.62
111.4.4 Multiplexing
Three sets of protocols are defined to make PPP
powerful:
1.the Link Control Protocol (LCP),
2.two Authentication Protocols (APs), and
3.several Network Control Protocols (NCPs).
Skip to last slide
11.63
Figure 111.22: Multiplexing in PPP
11.64
Figure 111.23: LCP packet encapsulated in a frame
11.65
Table 111.1: LCP Packets
11.66
Table 111.2: Common options
11.67
Figure 111.24: PAP packets encapsulated in a PPP frame
11.68
Figure 111.25: CHAP packets encapsulated in a PPP frame
11.69
Figure 111.26: IPCP packet encapsulated in PPP frame
11.70
Table 111.3: Code values for IPCP Packets
11.71
Figure 111.27: IP datagram encapsulated in a PPP frame
11.72
Figure 111.28: Multilink PPP
11.73
Example 111.7
Let us go through the phases followed by a network layer
packet as it is transmitted through a PPP connection.
Figure 111.29 shows the steps. For simplicity, we assume
unidirectional movement of data from the user site to the
system site (such as sending an e-mail through an ISP).
11.74
Figure 111.29: An example
11.75
Download