VND Openxmlformats-Officedocument Wordprocessingml Document&rendition 1-1
VND Openxmlformats-Officedocument Wordprocessingml Document&rendition 1-1
To accomplish these goals, the data link layer takes the packets
it gets from the network layer and encapsulates them into
frames for transmission. Each frame contains a frame header, a
payload field for holding the packet, and a frame trailer, as
illustrated in Fig. 3-1.
Services Provided to the Network Layer
The function of the data link layer is to provide services to the
network layer.
The principal service is transferring data from the network layer
on the source machine to the network layer on the destination
machine.
The data link layer can be designed to offer various services.
The actual services offered can vary from system to system.
Three reasonable possibilities that are commonly provided are
1. Unacknowledged connectionless service.
2. Acknowledged connectionless service.
3. Acknowledged connection-oriented service
the most sophisticated service the data link layer can provide to
the network layer is connection-oriented service. With this
service, the source and destination machines establish a
connection before any data are transferred. Each frame sent
over the connection is numbered, and the data link layer
guarantees that each frame sent is indeed received.
Furthermore, it guarantees that each frame is received exactly
once and that all frames are received in the right order. With
connectionless service, in contrast, it is conceivable that a lost
acknowledgement causes a packet to be sent several times and
thus received several times. Connection-oriented service, in
contrast, provides the network layer processes with the
equivalent of a reliable bit stream
Framing
To provide service to the network layer, the data link layer
must use the service provided to it by the physical layer. What
the physical layer does is accept a raw bit stream and attempt
to deliver it to the destination. This bit stream is not
guaranteed to be error free. The number of bits received may
be less than, equal to, or more than 140 the number of bits
transmitted, and they may have different values. It is up to the
data link layer to detect and, if necessary, correct errors. The
usual approach is for the data link layer to break the bit stream
up into discrete frames and compute the checksum for each
frame. When a frame arrives at the destination, the checksum
is recomputed. If the newly-computed checksum is different
from the one contained in the frame, the data link layer knows
that an error has occurred and takes steps to deal with it (e.g.,
discarding the bad frame and possibly also sending back an
error report).
Error Control
Suppose that the sender just kept outputting frames without
regard to whether they were arriving properly. This might be
fine for unacknowledged connectionless service, but would
most certainly not be fine for reliable, connection-oriented
service.
The usual way to ensure reliable delivery is to provide the
sender with some feedback about what is happening at the
other end of the line. Typically, the protocol calls for the
receiver to send back special control frames bearing positive or
negative acknowledgements about the incoming frames. If the
sender receives a positive acknowledgement about a frame, it
knows the frame has arrived safely. On the other hand, a
negative acknowledgement means that something has gone
wrong, and the frame must be transmitted again.
An additional complication comes from the possibility that
hardware troubles may cause a frame to vanish completely
(e.g., in a noise burst). In this case, the receiver will not react at
all.
This possibility is dealt with by introducing timers into the data
link layer. When the sender transmits a frame, it generally also
starts a timer. The timer is set to expire after an interval long
enough for the frame to reach the destination, be processed
there, and have the acknowledgement propagate back to the
sender. Normally, the frame will be correctly received and the
acknowledgement will get back before the timer runs out, in
which case the timer will be canceled.
However, if either the frame or the acknowledgement is lost,
the timer will go off, alerting the sender to a potential problem.
The obvious solution is to just transmit the frame again.
Flow Control
Another important design issue that occurs in the data link
layer (and higher layers as well) is what to do with a sender that
systematically wants to transmit frames faster than the receiver
can accept them. This situation can easily occur when the
sender is running on a fast (or lightly loaded) computer and the
receiver is running on a slow (or heavily loaded) machine. The
sender keeps pumping the frames out at a high rate until the
receiver is completely swamped. Even if the transmission is
error free, at a certain point the receiver will simply be unable
to handle the frames as they arrive and will start to lose some.
Two approaches are commonly used. In the first one, feedback-
based flow control, the receiver sends back information to the
sender giving it permission to send more data or at least telling
the sender how the receiver is doing. In the second one, rate-
based flow control, the protocol has a built-in mechanism that
limits the rate at which senders may transmit data, without
using feedback from the receiver.
Error Correction
Error Correction codes are used to detect and correct the errors when data is
transmitted from the sender to the receiver.
o Backward error correction: Once the error is discovered, the receiver requests
the sender to retransmit the entire data unit.
o Forward error correction: In this case, the receiver uses the error-correcting
code which automatically corrects the errors.
Error correction code :
Hamming code :
Error Detection :
Polynomial checksum.
Noiseless Channel
Selective repeat.
Simplest Protocol
Go – Back – N ARQ
Go – Back – N ARQ provides for sending multiple frames
before receiving the acknowledgment for the first frame. It
uses the concept of sliding window, and so is also called
sliding window protocol. The frames are sequentially
numbered and a finite number of frames are sent. If the
acknowledgment of a frame is not received within the
time period, all frames starting from that frame are
retransmitted.
Selective Repeat ARQ
This protocol also provides for sending multiple frames
before receiving the acknowledgment for the first frame.
However, here only the erroneous or lost frames are
retransmitted, while the good frames are received and
buffered.