Module II
Module II
Data Link
Layer
Contents
The Data link layer:
Design issues of DLL
Error detection and correction
Elementary data link protocols
Sliding window protocols
The principal service is transferring data from the network layer on the source
machine to the network layer on the destination machine.
@ src m/c is an entity(a process), in the NL that sends bits to the DL for
transmission to the dest.
The DL offer various services:
1. Unacknowledged connectionless service: No logical connection b/w src & dst,
Lost pkt no recovery.
2. Acknowledged connectionless service(Wifi). No logical connection, Timer, Used
in Unreliable channel.
3. Acknowledged connection-oriented service. Connection setup before transfer-3
phase
2. Framing:
(Way for a sender to transmit set of bits that are meaningful to receiver)
If the sender receives a positive ack ,it knows the frame has
arrived safely.
On the other hand, a negative ack means that something has
gone wrong and the frame must be transmitted again.
But certain frames can go missing due to the introduction of
noise in the signal.
If ack lost, Timer event, Duplication of pkt, Sequence no.
4.Flow Control(FC)
Sender should send the data at the same speed as the receiver is
capable of receiving. Otherwise receiver will loose couple of
frames.
1. Parity
2. Checksum
3. Cyclic Redundancy Checks (CRCs)
PARITY METHOD
(Single bit error)
Now an error will be detected, since the no. of ones received are
ODD
------------------------------------------------------------------------------
Ex 4. Transmitted data : 10011010->4
Received data : 01011010 ->4
The received data is wrong even though the no. of ones are EVEN.
Since two bits are inverted error can’t be detected.
CHECKSUM
Invert
The structure of encoder and decoder
Cyclic Redundancy Checks (CRCs)
Error Correction
Hamming Distance: The number of differences
between the corresponding bits (same size) of
two words, d(x, y).
It can be found using XOR operation on the two
words and counting the number of 1s in the
result.
Ex: d(000, 011) is 2 because 000 011 is 011 (two
1s).
Ex: d(10101, 11110) is 3 because 10101 11110 is
01011 (three 1s).
Hamming Code: Single Bit Error
Even Parity
Elementary Data Link Protocols
Protocols in DLL perform : framing, error
control and flow control.
Framing is the process of dividing bit - streams
from physical layer into data frames(few hundred to
a few thousand bytes).
Unrestricted Simplex Protocol
Following assumptions are made
Data transmission is simplex i.e. transmitted in one direction
only.
Both transmitting and receiving network layers are ready.
Processing time is ignored.
Infinite buffer space is available.
An error free channel.
U L/R .008
sender = = = 0.00027
RTT + L / R 30.008
Practically data is transmitted in both directions. This can be achieved by full duplex
transmission. ‘forward(data) ‘ and ‘reverse(ack)’ channel. In both cases, the reverse channel is
almost wasted. To overcome this problem a technique called piggy backing is used.
Pipelining: increased utilization
sender receiver
first packet bit transmitted, t = 0
last bit transmitted, t = L / R
U 3L / R .0024
sender = = = 0.00081
RTT + L / R 30.008
Go-Back-N(GBN)
(Reliable transmission)
otherwise:
ignore
Selective repeat in action
sender window (N=4) sender receiver
012345678 send pkt0
012345678 send pkt1
send pkt2 receive pkt0, send ack0
012345678
send pkt3 Xloss receive pkt1, send ack1
012345678
(wait)
receive pkt3, buffer,
012345678 rcv ack0, send pkt4 send ack3
012345678 rcv ack1, send pkt5 receive pkt4, buffer,
send ack4
record ack3 arrived receive pkt5, buffer,
send ack5
pkt 2 timeout
012345678 send pkt2
012345678 record ack4 arrived
012345678 rcv pkt2; deliver pkt2,
record ack5 arrived
012345678 pkt3, pkt4, pkt5; send ack2
Guard bands
Assumptions for Dynamic Channel Allocation
Cellular
Performance/Throughput
Slotted ALOHA
1972, Robert
Time is divided into timeslots.
Sending of data allowed only at the beginning of the slot “discrete”
Throughput:
Throughput VS offered traffic for ALOHA system
Carrier Sense Multiple Access(CSMA)
Idea: Stations listen for a carrier(Idle or Busy).
Propagation Delay: It should be less.
(not continuously)
Broadcast msg
2. Token Passing
It allows stations to transmit frames in
a predefined order.
It circulate a small message(token),
among stations, granting permission to
send frames.
Frames are transmitted in the direction
of the token, circulating around the
ring.
After sending a frame, each station
must wait for all stations to send the
token and frames in one cycle.
1. Token Ring (IEEE 802.5) popular in the 1980s as an
alternative to classic Ethernet.
2. FDDI (Fiber Distributed Data Interface) in the 1990s,
a faster token ring, was surpassed by switched
Ethernet.
3. RPR (Resilient Packet Ring) defined as IEEE 802.17 in
the 2000s for metropolitan area rings used by ISPs.
3.Binary Countdown Protocol
Bit map does not scale well to network for more stations.
To avoid conflict uses arbitration rule: As soon as station sees that a
higher-order bit position ->0 in its address, has been overwritten
with a 1,gives up.
Channel efficiency
d/(d + log N), where
d is the address
length and N is the
number of stations.
3. Binary Countdown Protocol
A more efficient alternative to the basic bit-map
protocol and token passing for networks with many
stations.
A B C D E F G H I J
0001 0010 0011 0100 0101 0110 0111 1000 1001 1010