Data Link Layer: Error
Data Link Layer: Error
Error
Whenever bits flow from one point to another, they are subject to unpredictable
changes because of interference. This interference can change the shape of the
signal. In a single-bit error, a 0 is changed to a 1 or a 1 to a O. In a burst error,
multiple bits are changed.
Single-Bit Error
The term single-bit error means that only 1 bit of a given data unit (such as a byte,
character, or packet) is changed from 1 to 0 or from 0 to 1.
Burst Error
The term burst error means that 2 or more bits in the data unit have changed
from 1 to 0 or from 0 to 1.
Redundancy
SEND WINDOW
The send window is an imaginary box covering the sequence numbers of the data
frames which can be in transit. In each window position, some of these sequence
numbers define the frames that have been sent; others define those that can be
sent. The maximum size of the window is 2m – 1.
The window at any time divides the possible sequence numbers into four regions.
The first region, from the far left to the left wall of the window, defines the
sequence numbers belonging to frames that are already acknowledged.
The second region, colored in Figure 11.12a, defines the range of sequence
numbers belonging to the frames that are sent and have an unknown status. The
sender needs to wait to find out if these frames have been received or were lost.
We call these outstanding frames.
The third range, white in the figure, defines the range of sequence numbers
for frames that can be sent; however, the corresponding data packets have not
yet been received from the network layer.
Finally, the fourth region defines sequence numbers that cannot be used until the
window slides, as we see next.
The window itself is an abstraction; three variables define its size and location at
any time. We call these variables Sf(send window, the first outstanding frame), Sn
(send window, the next frame to be sent), and Ssize (send window, size). The
variable Sf defines the sequence number of the first (oldest) outstanding frame.
The variable Sn holds the sequence number that will be assigned to the next
frame to be sent. Finally, the variable Ssize defines the size of the window, which
is fixed in our protocol.
Figure 11.12b shows how a send window can slide one or more slots to the right
when an acknowledgment arrives from the other end.
RECEIVE WINDOW
The receive window makes sure that the correct data frames are received and
that the correct acknowledgments are sent. The size of the receive window is
always I. The receiver is always looking for the arrival of a specific frame. Any
frame arriving out of order is discarded and needs to be resent.
We need only one variable Rn (receive window, next frame expected) to define
this abstraction. The sequence numbers to the left of the window belong to the
frames already received and acknowledged; the sequence numbers to the right of
this window define the frames that cannot be received. Any received frame with a
sequence number in these two regions is discarded. Only a frame with a sequence
number matching the value of Rn is accepted and acknowledged. The receive
window also slides, but only one slot at a time. When a correct frame is received
(and a frame is received only one at a time), the window slides.
Data Link Control Protocol
Character-oriented: in case of slower data rate links: use Idle RQ (for example,
modems using Kermit and X-modem).
Bit-oriented mode: in case of higher rate link involving long physical separations
(for example, radio-based satellite links, circuits through private multiplexer
networks use HDLC, alternative continuous RQ protocol).
HDLC
HDLC provides two common transfer modes that can be used in different
configurations: normal response mode (NRM) and asynchronous balanced mode
(ABM).
FRAMES IN HDLC
Each type of frame serves as an envelope for the transmission of a different type
of message.
I-frames are used to transport user data and control information relating to user
data (piggybacking).
Let us now discuss the fields and their use in different frame types.
o Flag field. The flag field of an HDLC frame is an 8-bit sequence with the bit
pattern 01111110 that identifies both the beginning and the end of a frame and
serves as a synchronization pattern for the receiver.
o Address field. The second field of an HDLC frame contains the address of the
secondary station. If a primary station created the frame, it contains a “to”
address. If a secondary creates the frame, it contains a “from” address. An
address field can be 1 byte or several bytes long, depending on the needs of the
network. One byte can identify up to 128 stations (l bit is used for another
purpose).
o Control field. The control field is a 1- or 2-byte segment of the frame used for
flow and error control. The interpretation of bits in this field depends on the
frame type. We discuss this field later and describe its format for each frame type.
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.
Itcan contain either a 2- or 4-byte ITU-T CRC.
POINT-TO-POINT PROTOCOL
One of the most common protocols for point-to-point access is the Point-to-Point
Protocol (PPP). Today, millions of Internet users who need to connect their home
computers to the server of an Internet service provider use PPP. The majority of
these users have a traditional modem; they are connected to the Internet through
a telephone line, which provides the services of the physical layer.
2. PPP defines how two devices can negotiate the establishment of the link and the
exchange of data.
3. PPP defines how network layer data are encapsulated in the data link frame.
5. PPP provides multiple network layer services supporting a variety of network layer
protocols.
7. PPP provides network address configuration. This is particularly useful when a home
user needs a temporary network address to connect to the Internet.
On the other hand, to keep PPP simple, several services are missing:
I. PPP does not provide flow control. A sender can send several frames one after
another with no concern about overwhelming the receiver.
2. PPP has a very simple mechanism for error control. A CRC field is used to detect
errors. If the frame is corrupted, it is silently discarded; the upper-layer protocol
needs to take care of the problem. Lack of error control and sequence numbering
may cause a packet to be received out of order.
Framing in PPP
Flag. A PPP frame starts and ends with a I-byte flag with the bit pattern
01111110.Although this pattern is the same as that used in HDLC, there is a big
difference.PPP is a byte-oriented protocol; HDLC is a bit-oriented protocol. The
flag is treated as a byte, as we will explain later.
o Address. The address field in this protocol is a constant value and set to
11111111(broadcast address). During negotiation (discussed later), the two
parties may agree to omit this byte.
o Control. This field is set to the constant value 11000000 (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. We discuss this field in detail shortly. This field is by default 2 bytes
long, but the two parties can agree to use only I 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.
o FCS. The frame check sequence (FCS) is simply a 2-byte or 4-byte standard CRe.
Authentication Protocols
2. The system checks the validity of the identification and password and either
accepts or denies connection.
1. The system sends the user a challenge packet containing a challenge value,
usually a few bytes.
2. 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.
3. 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 result
created is the same as the result sent in the response packet, access is granted;
otherwise, it is denied.
Error Detection and Correction
Types of Errors
Whenever bits flow from one point to another, they are subject to unpredictable
changes because of interference. This interference can change the shape of the
signal. In a single-bit error, a 0 is changed to a 1 or a 1 to a O.
Single-Bit Error
The term single-bit error means that only 1 bit of a given data unit (such as a byte,
character, or packet) is changed from 1 to 0 or from 0 to 1.
Burst Error
The term burst error means that 2 or more bits in the data unit have changed
from 1 to 0 or from 0 to 1.