Ch11.data Link Control PDF
Ch11.data Link Control PDF
Data Link
Control (DLC)
293
294 PART III DATA-LINK LAYER
11.1.1 Framing
Data transmission in the physical layer means moving bits in the form of a signal from
the source to the destination. The physical layer provides bit synchronization to ensure
that the sender and receiver use the same bit durations and timing. We discussed the
physical layer in Part II of the book.
The data-link layer, on the other hand, 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. In addition, each envelope defines
the sender and receiver addresses, which is necessary since the postal system is a many-
to-many carrier facility.
Framing in the data-link layer separates a message from one source to a destination
by adding a sender address and a destination address. 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. One reason is that a frame can be very large, making 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 frame. When a message is divided into
smaller frames, a single-bit error affects only that small frame.
Frame Size
Frames can be of fixed or variable size. Infixed-size framing, there is no need for defin-
ing the boundaries of the frames; the size itself can be used as a delimiter. An example
of this type of framing is the ATM WAN, which uses frames of fixed size called cells.
We discuss ATM in Chapter 14.
Our main discussion in this chapter concerns variable-size framing, prevalent in
local-area networks. In variable-size framing, we need a way to define the end of one
frame and the beginning of the next. Historically, two approaches were used for this
purpose: a character-oriented approach and a bit-oriented approach.
Character-Oriented Framing
In character-oriented (or byte-oriented) framing, data to be carried are 8-bit characters
from a coding system such as ASCII (see Appendix A). The header, which normally
carries the source and destination addresses and other control information, and the
trailer, which carries error detection redundant bits, are also multiples of 8 bits. To
separate one frame from the next, an 8-bit (I-byte) flag is added at the beginning and the
end of a frame. The flag, composed of protocol-dependent special characters, signals the
CHAPTER 11 DATA LINK CONTROL (DLC) 295
start or end of a frame. Figure 11.1 shows the format of a frame in a character-oriented
protocol.
Character-oriented framing was popular when only text was exchanged by the
data-link layers. The flag could be selected to be any character not used for text com-
munication. Now, however, we send other types of information such as graphs, audio,
and video; any character used for the flag could also be part of the information. If this
happens, the receiver, when it encounters this pattern in the middle of the data, thinks it
has reached the end of the frame. To fix this problem, a byte-stuffing strategy was
added to character-oriented framing. In byte stuffing (or character stuffing), a special
byte is added to the data section of the frame when there is a character with the same
pattern as the flag. The data section is stuffed with an extra byte. This byte is usually
called the escape character (ESe) and has a predefined bit pattern. Whenever the
receiver encounters the ESe character, it removes it from the data section and treats the
next character as data, not as a delimiting flag. Figure 11.2 shows the situation.
Byte stuffing by the escape character allows the presence of the flag in the data
section of the frame, but it creates another problem. What happens if the text contains
one or more escape characters followed by a byte with the same pattern as the flag? The
296 PART III DATA-LINK LAYER
receiver removes the escape character, but keeps the next byte, which is incorrectly
interpreted as the end of the frame. To solve this problem, the escape characters that are
part of the text must also be marked by another escape character. In other words, if the
escape character is part of the text, an extra one is added to show that the second one is
part of the text.
Character-oriented protocols present another problem in data communications.
The universal coding systems in use today, such as Unicode, have 16-bit and 32-bit
characters that conflict with 8-bit characters. We can say that, in general, the tendency
is moving toward the bit-oriented protocols that we discuss next.
Bit-Oriented Framing
In bit-oriented framing, the data section of a frame is a sequence of bits to be interpreted by
the upper layer as text, graphic, audio, video, and so on. However, in addition to headers
(and possible trailers), we still need a delimiter to separate one frame from the other. Most
protocols use a special 8-bit pattern flag, 01111110, as the delimiter to define the begin-
ning and the end of the frame, as shown in Figure 11.3.
This flag can create the same type of problem we saw in the character-oriented
protocols. That is, if the flag pattern appears in the data, we need to somehow inform
the receiver that this is not the end of the frame. We do this by stuffing 1 single bit
(instead of 1 byte) to prevent the pattern from looking like a flag. The strategy is called
bit stuffing. In bit stuffing, if a 0 and five consecutive 1 bits are encountered, an extra
o is added. This extra stuffed bit is eventually removed from the data by the receiver.
Note that the extra bit is added after one 0 followed by five IS regardless of the value of
the next bit. This guarantees that the flag field sequence does not inadvertently appear
in the frame.
Bit stuffing is the process of adding one extra 0 whenever five consecutive Is follow a 0
in the data, so that the receiver does not mistake the pattern 0111110 for a flag.
Figure 11.4 shows bit stuffing at the sender and bit removal at the receiver. Note that
even if we have a 0 after five Is, we still stuff a O.The 0 will be removed by the receiver.
This means that if the flaglike pattern 01111110 appears in the data, it will change
to 011111010 (stuffed) and is not mistaken for a flag by the receiver. The real flag
01111110 is not stuffed by the sender and is recognized by the receiver.
CHAPTER J I DATA LINK CONTROL (DLC) 297
Frame sent
Header
Frame received
Header
Flow Control
Whenever an entity produces items and another entity consumes them, there should be
a balance between production and consumption rates. If the items are produced faster
than they can be consumed, the consumer can be overwhelmed and may need to discard
some items. If the items are produced more slowly than they can be consumed, the con-
sumer must wait, and the system becomes less efficient. Flow control is related to the
first issue. We need to prevent losing the data items at the consumer site.
In communication at the data-link layer, we are dealing with four entities: network
and data-link layers at the sending node and network and data-link layers at the receiv-
ing node. Although we can have a complex relationship with more than one producer
and consumer (as we will see in Chapter 23), we ignore the relationships between net-
works and data-link layers and concentrate on the relationship between two data-link
layers, as shown in Figure 11.S.
Flow control
298 PART III DATA-LINK LAYER
The figure shows that the data-link layer at the sending node tries to push frames
toward the data-link layer at the receiving node. If the receiving node cannot process
and deliver the packet to its network at the same rate that the frames arrive, it becomes
overwhelmed with frames. Flow control in this case can be feedback from the receiving
node to the sending node to stop or slow down pushing frames.
Buffers
Although flow control can be implemented in several ways, one of the solutions is nor-
mally to use two buffers; one at the sending data-link layer and the other at the receiv-
ing data-link layer. A buffer is a set of memory locations that can hold packets at the
sender and receiver. The flow control communication can occur by sending signals
from the consumer to the producer. When the buffer of the receiving data-link layer is
full, it informs the sending data-link layer to stop pushing frames.
Example 11.1
The above discussion requires that the consumers communicate with the producers on two
occasions: when the buffer is full and when there are vacancies. If the two parties use a buffer
with only one slot, the communication can be easier. Assume that each data-link layer uses one
single memory slot to hold a frame. When this single slot in the receiving data-link layer is
empty, it sends a note to the network layer to send the next frame.
Error Control
Since the underlying technology at the physical layer is not fully reliable, we need to
implement error control at the data- link layer to prevent the receiving node from deliver-
ing corrupted packets to its network layer. Error control at the data-link layer is normally
very simple and implemented using one of the following two methods. In both methods, a
CRC is added to the frame header by the sender and checked by the receiver.
o In the first method, if the frame is corrupted, it is silently discarded; if it is not cor-
rupted, the packet is delivered to the network layer. This method is used mostly in
wired LANs such as Ethernet.
o 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 con-
trol) to the sender.
Connectionless Protocol
In a connectionless protocol, frames are sent from one node to the next without any
relationship between the frames; each frame is independent. Note that the term connec-
tionless here does not mean that there is no physical connection (transmission medium)
between the nodes; it means that there is no connection between frames. The frames are
not numbered and there is no sense of ordering. Most of the data-link protocols for
LANs are connectionless protocols.
Connection-Oriented Protocol
In a connection-oriented protocol, a logical connection should first be established
between the two nodes (setup phase). After all frames that are somehow related to each
other are transmitted (transfer phase), the logical connection is terminated (teardown
phase). In this type of communication, the frames are numbered and sent in order. If
they are not received in order, the receiver needs to wait until all frames belonging to the
same set are received and then deliver them in order to the network layer. Connection-
oriented protocols are rare in wired LANs, but we can see them in some point-to-point
protocols, some wireless LANs, and some WANs.
Event 1
Note: Action I.
The colored Action 2.
arrow shows the
l I
---4
starting state.
State I ) l State II
J Event 2
Action 3.
t I t
Event 3
Network ~H Frame
L~ Network
Data-linkL~
__
~t~~===~;;;;;;;;;;L====4=~lL=!'I
Logical link _
Data-link
The data-link layer at the sender gets a packet from its network layer, makes a
frame out of it, and sends the frame. The data-link layer at the receiver receives a frame
from the link, extracts the packet from the frame, and delivers the packet to its network
layer. The data-link layers of the sender and receiver provide transmission services for
their network layers.
FSMs
The sender site should not send a frame until its network layer has a message to send.
The receiver site cannot deliver a message to its network layer until a frame arrives. We
can show these requirements using two FSMs. Each FSM has only one state, the ready
state. The sending machine remains in the ready state until a request comes from the
process in the network layer. When this event occurs, the sending machine encapsulates
the message in a frame and sends it to the receiving machine. The receiving machine
remains in the ready state until a frame arrives from the sending machine. When this
event occurs, the receiving machine decapsulates the message out of the frame and
delivers it to the process at the network layer. Figure 11.8 shows the FSMs for the sim-
ple protocol. We'll see more in Chapter 23, which uses this protocol.
CHAPTER 11 DATA LINK CONTROL (DLC) 301
I I
Start ~ Ready ). Start ~ Ready J'
Sending node Receiving node
Example 11.2
Figure 11.9 shows an example of communication using this protocol. It is very simple. The
sender sends frames one after another without even thinking about the receiver.
Sending node
I
I
I
Packet I
-+-L Frame
I
I
I
I
l Packet
I-------+-r--
l---------------~l--
Frame I
!~c.!'~t_ ~lI
I I I Packet I
.
I I • -~------~I
I I • I I
:
y
:
y
:
y
:
y
Time Time Time Time
acknowledgment arrives, the sender discards the copy and sends the next frame if it is
ready. Figure 11.10 shows the outline for the Stop-and-Wait protocol. Note that only
one frame and one acknowledgment can be in the channels at any time.
N'~"kl=~
Data-link
Sending node
_
Frame
CRC
-rCR:..t~
ACK
rdWO,k
Data-link
®Timer
FSMs
Figure 11.11 shows the FSMs for our primitive Stop-and- Wait protocol.
Sending node
(d'd
Start Error-free ACK arrived.
Corrupted ACK arrived.
Discard the ACK.
Stop the timer.
Discard the saved frame.
Receiving node
Sender States
The sender is initially in the ready state, but it can move between the ready and block-
ing state.
CHAPTER 11 DATA LINK CONTROL (DLC) 303
D Ready State. When the sender is in this state, it is only waiting for a packet from
the network layer. If a packet comes from the network layer, the 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.
D Blocking State. When the sender is in this state, three events can occur:
a. If a time-out occurs, the sender resends the saved copy of the frame and restarts
the timer.
b. If a corrupted ACK arrives, it is discarded.
c. If an error-free ACK arrives, the sender stops the timer and discards the saved
copy of the frame. It then moves to the ready state.
Receiver
The receiver is always in the ready state. Two events may occur:
a. If an error-free frame arrives, the message in the frame is delivered to the net-
work layer and an ACK is sent.
b. If a corrupted frame arrives, the frame is discarded.
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 acknowl-
edgment numbers.
Example 11.4
Figure 11.13 shows how adding sequence numbers and acknowledgment numbers can prevent
duplicates. 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.
Packet F
Legend -------~'1
••,~~1~~1~n~e----------~
.: Packet '
• Start the timer. 0.-__----~AC~K~----~~~:
o
o
Stop the timer.
t t t t
Time Time Time Time
11.2.3 Piggybacking
The two protocols we discussed in this section are designed for unidirectional commu-
nication, in which data is flowing only in one direction although the acknowledgment
may travel in the other direction. Protocols have been designed in the past to allow data
to flow in both directions. However, to make the communication more efficient, the
data in one direction is piggybacked with the acknowledgment in the other direction. In
other words, when node A is sending data to node B, Node A also acknowledges the
data received from node B. Because piggybacking makes communication at the data-
link layer more complicated, it is not a common practice. We discuss two-way commu-
nication and piggybacking in more detail in Chapter 23.
11.3 HDLC
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 protocol we
discussed earlier. Although this protocol is more a theoretical issue than practical, most
of the concept defined in this protocol is the basis for other practical protocols such as
PPP, which we discuss next, or the Ethernet protocol, which we discuss in wired LANs
(Chapter 13), or in wireless LANs (Chapter 15).
CHAPTER 11 DATA LINK CONTROL (DLC) 305
Legend ,
11.3.2 Framing
To provide the flexibility necessary to support all the options possible in the modes and
configurations just described, HDLC defines three types of frames: information frames
(I-frames}, supervisory frames (S-frames), and unnumbered frames (V-frames). Each type
of frame serves as an envelope for the transmission of a different type of message. 1-
frames are used to data-link user data and control information relating to user data (piggy-
backing). S-frames are used only to transport control information. U-frames are reserved
for system management. Information carried by U-frames is intended for managing the
306 PART III DATA-LINK LAYER
Primary Secondary
~
a. Point-to-point
T' liili"!!i!i!i'.
(l!L_p_ri_m_ary-----'====
Y
-~~-s-e-co-n-d-ar-y--~='
YSecondary
~~
b. Multipoint
~Command/response I
link itself. Each frame in HDLC may contain up to six fields, as shown in Figure 11.16: a
beginning flag field, an address field, a control field, an information field, a frame check
sequence (FCS) field, and an ending flag field. In multiple-frame transmissions, the end-
ing flag of one frame can serve as the beginning flag of the next frame.
User
information
III Flag I-frame
Let us now discuss the fields and their use in different frame types.
D Flag field. This field contains synchronization pattern 01111110, which identifies
both the beginning and the end of a frame.
D Address field. This field contains the address of the secondary station. If a primary
station created the frame, it contains a to address. If a secondary station creates the
frame, it contains afrom address. The address field can be one byte or several bytes
long, depending on the needs of the network.
CHAPTER 11 DATA LINK CONTROL (DLC) 307
o Controlfield. The control field is one or two bytes used for flow and error control.
The interpretation of bits are discussed later.
o Information field. The information field contains the user's data from the network
layer or management information. Its length can vary from one network to another.
o FCS field. The frame check sequence (FCS) is the HDLC error detection field. It
can contain either a 2- or 4-byte CRC.
The control field determines the type of frame and defines its functionality. So let
us discuss the format of this field in detail. The format is specific for the type of frame,
as shown in Figure 11.17.
0
1 1 I I I~FI I I I ~
N(S) N(R) Code N(R) Code Code
o Receive not ready (RNR). If the value of the code subfield is 10, it is an RNR S-
frame. This kind of frame is an RR frame with additional functions. It acknowl-
edges the receipt of a frame or group of frames, and it announces that the receiver
is busy and cannot receive more frames. It acts as a kind of congestion-control
mechanism by asking the sender to slow down. The value of N(R) is the acknowl-
edgment number.
o Reject (REJ). If the value of the code subfield is 01, it is an REJ S-frame. This is a
NAK frame, but not like the one used for Selective Repeat ARQ. It is a NAK that
can be used in Go-Back-N ARQ to improve the efficiency of the process by
informing the sender, before the sender timer expires, that the last frame is lost or
damaged. The value of N(R) is the negative acknowledgment number.
o Selective reject (SREJ). If the value of the code subfield is 11, it is an SREJ S-
frame. This is a NAK frame used in Selective Repeat ARQ. Note that the HDLC
Protocol uses the term selective reject instead of selective repeat. The value of
N(R) is the negative acknowledgment number.
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).
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.
CHAPTER 11 DATA LiNK CONTROL (DLC) 309
Node A NodeB
o I
o I
Data transfer
I
I
t y
Time Time
11.4.1 Services
The designers of PPP have included several services to make it suitable for a point-to-
point protocol, but have ignored some traditional services to make it simple.
U
,
, I-frame (data frame 0)
LJJD
, , I-frame (data frame 0) o
+
Time Time
,----1
,,
,
~ ...
-,,
,,
t t
Time Time
a. The case of no error b. The case with error
11.4.2 Framing
PPP uses a character-oriented (or byte-oriented) frame. Figure 11.20 shows the format
of a PPP frame. The description of each field follows:
o Flag. A PPP frame starts and ends with a l-byte flag with the bit pattern 01111110.
CHAPTER 11 DATA LINK CONTROL (DLC) 311
(OOOOOOllh
Protocol Payload _ Flag
o Address. The address field in this protocol is a constant value and set to 11111111
(broadcast address).
D Control. This field is set to the constant value 00000011 (imitating unnumbered
frames in HDLC). As we will discuss later, PPP does not provide any flow control.
Error control is also limited to error detection.
o Protocol. The protocol field defines what is being carried in the data field: either
user data or other information. This field is by default 2 bytes long, but the two
parties can agree to use only 1 byte.
o Payload field. This field carries either the user data or other information that we
will discuss shortly. The data field is a sequence of bytes with the default of a
maximum of 1500 bytes; but this can be changed during negotiation. The data field
is byte-stuffed if the flag byte pattern appears in this field. Because there is no field
defining the size of the data field, padding is needed if the size is less than the max-
imum default value or the maximum negotiated value.
D FCS. The frame check sequence (FCS) is simply a 2-byte or 4-byte standard CRe.
Byte Stuffing
Since PPP is a byte-oriented protocol, the flag in PPP is a byte that needs to be escaped
whenever it appears in the data section of the frame. The escape byte is 01111101,
which means that every time the flag like pattern appears in the data, this extra byte is
stuffed to tell the receiver that the next byte is not a flag. Obviously, the escape byte
itself should be stuffed with another escape byte.
Start~
Dead
Carrier
Carrier detected
dropped
Authentication failed
Terminate
Done
11.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. Three sets of
protocols are defined to make PPP powerful: the Link Control Protocol (LCP), two
Authentication Protocols (APs), and several Network Control Protocols (NCPs). At any
moment, a PPP packet can carry data from one of these protocols in its data field, as
shown in Figure 11.22. Note that there are one LCP, two APs, and several NCPs. Data
may also come from several different network layers.
Legend
LCP: Link control protocol
AP: Authentication protocol
NCP: Network control protocol
Protocol values:
LCP: OxC021
AP: OxC023 and OxC223
NCP: Ox8021 and .
Data: Ox0021 and .
CHAPTER 11 DATA LiNK CONTROL (DLC) 313
All LCP packets are carried in the payload field of the PPP frame with the protocol
field set to C021 in hexadecimal (see Figure 11.23).
2 Variable
Address Control
The code field defines the type of LCP packet. There are 11 types of packets, as
shown in Table 11.1.
OxOl Configure-request Contains the list of proposed options and their values
Ox02 Configure-ack Accepts all options proposed
Ox03 Configure-nak Announces that some options are not acceptable
Ox04 Configure-reject Announces that some options are not recognized
OxOS Termi nate-request Request to shut down the line
Ox06 Terminate-ack Accept the shutdown request
Ox07 Code-reject Announces an unknown code
Ox08 Protocol-reject Announces an unknown protocol
Ox09 Echo-request A type of hello message to check if the other end is alive
OxOA Echo-reply The response to the echo-request message
OxOB Discard-request A request to discard the packet
There are three categories of packets. The first category, comprising the first
four packet types, is used for link configuration during the establish phase. The
second category, comprising packet types 5 and 6, is used for link termination dur-
ing the termination phase. The last five packets are used for link monitoring and
debugging.
The ID field holds a value that matches a request with a reply. One endpoint inserts
a value in this field, which will be copied into the reply packet. The length field defines
the length of the entire LCP packet. The information field contains information, such as
options, needed for some LCP packets.
There are many options that can be negotiated between the two endpoints. Options
are inserted in the information field of the configuration packets. In this case, the
314 PART III DATA-LINK LAYER
information field is divided into three fields: option type, option length, and option
data. We list some of the most common options in Table 11.2.
Table 11.2 Common options
Option Default
Maximum receive unit (payload field size) 1500
Authentication protocol None
Protocol field compression Off
Address and control field compression Off
Authentication Protocols
Authentication plays a very important role in PPP because PPP is designed for use over
dial-up links where verification of user identity is necessary. Authentication means val-
idating the identity of a user who needs to access a set of resources. PPP has created
two protocols for authentication: Password Authentication Protocol and Challenge
Handshake Authentication Protocol. Note that these protocols are used during the
authentication phase.
PAP
The Password Authentication Protocol (PAP) is a simple authentication procedure
with a two-step process:
a. The user who wants to access a system sends an authentication identification
(usually the user name) and a password.
b. The system checks the validity of the identification and password and either
accepts or denies connection.
Figure 11.24 shows the three types of packets used by PAP and how they are actually
exchanged. When a PPP frame is carrying any PAP packets, the value of the protocol
field is OxC023. The three PAP packets are authenticate-request, authenticate-ack, and
authenticate-nak. The first packet is used by the user to send the user name and pass-
word. The second is used by the system to allow access. The third is used by the system
to deny access.
CHAP
The Challenge Handshake Authentication Protocol (CHAP) is a three-way hand-
shaking authentication protocol that provides greater security than PAP. In this method,
the password is kept secret; it is never sent online.
a. The system sends the user a challenge packet containing a challenge value, usu-
ally a few bytes.
b. The user applies a predefined function that takes the challenge value and the
user's own password and creates a result. The user sends the result in the
response packet to the system.
c. The system does the same. It applies the same function to the password of the
user (known to the system) and the challenge value to create a result. If the
CHAPTER 11 DATA LiNK CONTROL (DLC) 315
System
User
Authenticate-request
Authenticate-ack or authenticate-nak
1------------------------------------------------------------,
I I 2 1 Variable 1 Variable :
I
I
result created is the same as the result sent in the response packet, access is
granted; otherwise, it is denied. CHAP is more secure than PAP, especially if
the system continuously changes the challenge value. Even if the intruder learns
the challenge value and the result, the password is still secret. Figure 11.25
shows the packets and how they are used.
System
User
Challenge
CHAP packets are encapsulated in the PPP frame with the protocol value C223 in
hexadecimal. There are four CHAP packets: challenge, response, success, and failure.
The first packet is used by the system to send the challenge value. The second is used by
the user to return the result of the calculation. The third is used by the system to allow
access to the system. The fourth is used by the system to deny access to the system.
IPCP
One NCP protocol is the Internet Protocol Control Protocol (IPCP). This protocol
configures the link used to carry IP packets in the Internet. IPCP is especially of interest
to us. The format of an IPCP packet is shown in Figure 11.26. Note that the value of the
protocol field in hexadecimal is 8021.
Payload I
(and padding)
Other Protocols
There are other NCP protocols for other network-layer protocols. The OSI Network
Layer Control Protocol has a protocol field value of 8023; the Xerox NS IDP Control
Protocol has a protocol field value of 8025; and so on.
Payload
(and padding)
Multilink PPP
PPP was originally designed for a single-channel point-to-point physical link. The
availability of multiple channels in a single point-to-point link motivated the develop-
ment of Multilink PPP. In this case, a logical PPP frame is divided into several actual
PPP frames. A segment of the logical frame is carried in the payload of an actual PPP
frame, as shown in Figure 11.28. To show that the actual PPP frame is carrying a frag-
ment of a logical PPP frame, the protocol field is set to (003dh6' This new development
adds complexity. For example, a sequence number needs to be added to the actual PPP
frame to show a fragment's position in the logical frame.
Example 11.7
Let us go through the phases followed by a network layer packet as it is transmitted through a
PPP connection. Figure 11.29 shows the steps. For simplicity, we assume unidirectional move-
ment of data from the user site to the system site (such as sending an e-rnail through an ISP).
System
User
,
,
:J
, •...
~
:]"'""
:
,
I Z
,
I
I
I
I
I
Data Transfer
,
I
o I
''§ I
·s"l::
" I
~ :
r-------------------~~
I
I
I
t t
Time Time
The first two frames show link establishment. We have chosen two options (not shown in the
figure): using PAP for authentication and suppressing the address control fields. Frames 3 and 4
are for authentication. Frames 5 and 6 establish the network layer connection using IPCP.
The next several frames show that some IP packets are encapsulated in the PPP frame. The
system (receiver) may have been running several network layer protocols, but it knows that the
incoming data must be delivered to the IP protocol because the NCP protocol used before the data
transfer was IPCP.
CHAPTER 11 DATA LINK CONTROL (DLC) 319
After data transfer, the user then terminates the data-link connection, which is acknowl-
edged by the system. Of course the user or the system could have chosen to terminate the
network-layerIPCP and keep the data-link layer running if it wanted to run another NCP protocol.
Books
Several books discuss link-layer issues. Among them we recommend [Ham 80], [Zar 02],
[Ror 96], [Tan 03], [GW 04], [For 03], [KMK 04], [Sta 04], [Kes 02], [PD 03],
[Kei 02], [Spu 00], [KCK 98], [Sau 98], [Izz 00], [Per 00], and [WV 00].
11.5.3 Summary
Data link control deals with the design and procedures for communication between two
adjacent nodes: node-to-node communication. Framing in the data-link layer separates
one packet from another. In fixed-size framing, there is no need for defining the boundar-
ies of frames; in variable-size framing, we need a delimiter (flag) to define the boundary
of two frames. Variable-size framing uses two categories of protocols: byte-oriented (or
character-oriented) and bit-oriented. In a byte-oriented protocol, the data section of a
frame is a sequence of bytes; in a bit-oriented protocol, the data section of a frame is a
sequence of bits. In byte-oriented protocols, we use byte stuffing; in bit-oriented
protocols, we use bit stuffing.
Another duty of DLC is flow and error control. At the data-link layer, flow control
means creating a balance between the frames sent by a node and the frames that can be
handled by the next node. Error control at the data-link layer is normally implemented
very simply. Corrupted frames are silently discarded; uncorrupted frames are accepted
with or without sending acknowledgments to the sender.
A DLC protocol can be either connectionless or connection-oriented. In a connec-
tionless protocol, frames are sent from one node to the next without any relationship
between the frames; each frame is independent. In a connection-oriented protocol, a logi-
cal connection should first be established between the two nodes before sending the data
frames. After all related frames are transmitted, the logical connection is terminated.
320 PART III DATA-LINK LAYER
11.6.2 Questions
Qll-l. DefineJraming and give the reason it is needed.
Qll-2. Define piggybacking and its benefit.
Qll-3. In PPP, we normally talk about user and system instead of sending and receiv-
ing nodes; explain the reason.
Qll-4. Explain why flags are needed when we use variable-size frames.
Qll-5. In Figure 1l.9, we show the packet path as a horizontal line, but the frame
path as a diagonal line. Can you explain the reason?
Qll-6. Compare Figure 1l.6 and Figure 1l.2l. If both are FSMs, why are there no
event/action pairs in the second?
Qll-7. In Figure 1l.11, do the ready and blocking states use the same timer? Explain.
Qll-8. In Figure 11.12, explain why we need a timer at the sending site, but none at
the receiving site.
Qll-9. In a bit-oriented protocol, should we first unstuff the extra bits and then
remove the flags or reverse the process?
Qll-IO. In a byte-oriented protocol, should we first unstuff the extra bytes and then
remove the flags or reverse the process?
Qf l-Ll, Compare and contrast byte-stuffing and bit-stuffing.
CHAPTER 11 DATA LiNK CONTROL (DLC) 321
Ql1-12. In Figure 11.20, explain why we need only one address field. Explain why the
address is set to the predefined value of (11111111 h.
Qll-13. In Example 11.4 (Figure 11.13) how many frames are in transit at the same
time?
Qll-14. Compare and contrast byte-oriented and bit-oriented protocols.
Qll-15. Compare the flag byte and the escape byte in PPP. Are they the same?
Explain.
Qll-16. In the traditional Ethernet protocol (Chapter 13), the frames are sent with the
CRe. If the frame is corrupted, the receiving node just discards it. Is this an
example of a Simple Protocol or the Stop-and-Wait Protocol? Explain.
Qll-17. In the Stop-and-Wait Protocol, assume that the sender has only one slot in
which to keep the frame to send or the copy of the sent frame. What happens if
the network layer delivers a packet to the data-link layer at this moment?
Qll-18. Compare and contrast flow control and error control.
Qll-19. In Figure 11.16, which frame type can be used for acknowledgment?
Qll-20. Compare and contrast HDLC with PPP.
Qll-21. Assume a new character-oriented protocol is using the 16-bit Unicode as the
character set. What should the size of the flag be in this protocol?
Qll-22. Explain why there is no need for CRC in the Simple Protocol.
Qll-23. Does the duplex communication in Figure 11.10 necessarily mean we need
two separate media between the two nodes? Explain.
Qll-24. In Example 11.3 (Figure 11.12) how many frames are in transit at the same
time?
11.6.3 Problems
Pl l-L Assume PPP is in the established phase; show payload encapsulated in the
frame.
Pll-2. Using the following specifications, draw a finite state machine with three
states (I, II, and III), six events, and four actions:
a. If the machine is in state I, two events can occur. If event 1 occurs, the
machine moves to state III. If event 3 occurs, the machine performs actions
2 and 4 and moves to state II.
b. If the machine is in state II, two events can occur. If event 4 occurs, the
machine remains in state II. If event 6 occurs, the machine performs actions
1 and 2 and moves to state III.
c. If the machine is in state III, three events can occur. If event 2 occurs, the
machine remains in state III. If event 6 occurs, the machine performs
actions 2, 3, 4, and 5 moves to state I. If event 4 occurs, the machine per-
forms actions 1 and 2 and moves to state I.
Pll-3. Redraw Figure 11.12 using the following scenario:
a. The first frame is sent and acknowledged.
b. The second frame is sent and acknowledged, but the acknowledgment is
lost.
322 PART III DATA-LINK LAYER
Pll-S. Byte-stuff the following frame payload in which E is the escape byte, F is the
flag byte, and D is a data byte other than an escape or a flag character.
Pl1-6. In Figure 11.11, show what happens in each of the following cases:
a. The receiver is in the ready state and a packet comes from the network
layer.
b. The receiver is in the ready state and a corrupted frame arrives.
c. The receiver is in the ready state and an acknowledgment arrives.
Pl1-7. In Figure 11.11, show what happens in each of the following cases:
a. The sender is at the ready state and an error-free ACK arrives.
b. The sender is at the blocking state and a time-out occurs.
c. The sender is at the ready state and a time-out occurs.
Pll-S. Redraw Figure 11.21 with the system not using authentication.
Pl1-9. Using the following specifications, draw a finite state machine with three
states (I, II, and III), five events, and six actions:
a. If the machine is in state I, two events can occur. If event 1 occurs, the
machine moves to state II. If event 2 occurs, the machine performs actions
1 and 2 and moves to state III.
b. If the machine is in state II, two events can occur. If event 3 occurs, the
machine remains in state II. If event 4 occurs, the machine moves to
state III.
c. If the machine is in state III, three events can occur. If event 2 occurs, the
machine remains in state III. If event 3 occurs, the machine performs
actions 1,2,4, and 5 moves to state II. If event 5 occurs, the machine per-
forms actions 1, 2, and 6 and moves to state I.
Pll-l0. Redraw Figure 11.2 using the following scenario:
a. Frame 0 is sent, but lost.
b. Frame 0 is resent and acknowledged.
c. Frame 1 is sent and acknowledged, but the acknowledgment is lost.
d. Frame 1 is resent and acknowledged.
Pll-11. Bit-stuff the following frame payload:
0001111100001111101000111111011110000111
CHAPTER 11 DATA LINK CONTROL (DLC) 323
Pll-12. Assume the only computer in the residence uses PPP to communicate with the
ISP. If the user sends 10 network-layer packets to ISP, how many frames are
exchanged in each of the following cases:
a. Using no authentication?
b. Using PAP for authentication?
c. Using CHAP for authentication?
Pll-13. Assume PPP is in the authentication phase, show payload exchanged between
the nodes if PPP is using
a. PAP
b. CHAP
Pll-14. Un stuff the following frame payload:
I 00011111000001011101110100111011111001101111
Pll-IS. Redraw Figure 11.11 using a variable to hold the one-bit sequence number
and a variable to hold the one-bit acknowledgment number.
Pll-16. Un stuff the following frame payload in which E is the escape byte, F is the
flag byte, and D is a data byte other than an escape or a flag character.