2. Physical & Data Link Layer: Ethernet- Physical Layer and Data link layer switching:
Learning bridges- spanning tree bridges, repeaters, hubs, bridges, switches, routers,
and gateways. Data Link Layer - Design issues, Error Detection & Correction, Data
Link Layer Protocols, Sliding window protocols.
4. 13-1 IEEE STANDARDS
In 1985,,,, the Computer Society of the IEEE started a
project, called Project 802, to set standards to enable
intercommunication among equipment from a variety
of manufacturers. Project 802 is a way of specifying
functions of the physical layer and the data link layer
of major LAN protocols.
Topics discussed in this section:
Data Link Layer
Physical Layer
13.4
6. 13-2 STANDARD ETHERNET
The original Ethernet was created in 1976 at Xeroxās
Palo Alto Research Center (PARC). Since then, it has
gone through four generations.. We briefly discuss the
Standard (or traditional) Ethernet in this section.
13.6
Topics discussed in this section:
MAC Sublayer
Physical Layer
13. 13-4 FAST ETHERNET
Fast Ethernet was designed to compete with LAN
protocols such as FDDI or Fiber Channel. IEEE
created Fast Ethernet under th nam 80 .. u.. Fast
Ethernet is backward-compatible with Standard
Ethernet, but it can transmit data 10 times faster at a
rate of 100 Mbps.
Topics discussed in this section:
MAC Sublayer
Physical Layer
16. 13-5 GIGABIT ETHERNET
The need for an even higher data rate resulted in the
design of the Gigabit Ethernet protocol (1000 Mbps).
The IEEE committee calls the standard 802..3z..
Topics discussed in this section:
MAC Sublayer
Physical Layer
Ten-Gigabit Ethernet
17. Note
In the full-duplex mode of Gigabit
Ethernet, there is no collision;
the maximum length of the cable is
determined by the signal attenuation
in the cable.
25. 2
5
Topics
ā¢ Data link layer design issues
ā¢ Error detection and correction
ā¢ Elementary data link protocols
ā¢ Sliding window protocols
ā¢ Example data link protocols
ā¢ HDLC
ā¢ LAP
....
::-
27. Data Link layer
design issues
ā¢ Services provided to the network
layer
ā¢ Framing
ā¢ Error control
ā¢ Flow control
28. 2
8
Datalink layerdesign
issues
ā¢ Functions of data link layer
ā¢ Providing a well-defined service
interface to the network layer
ā¢ Determining how the bits of the physical
layer are grouped into frames
ā¢ Dealing with transmission errors
ā¢ Regulating the flow of frames so that
slow receivers are not swamped by fast
senders
29. Header Payload field Trailer Header Payload field Trailer
Datalinklayer design
2
9
issues
Relationship between packets and frames
Sending machine
Packet
Frame
Receiving machine
Packet
30. Services provided the
network layer
ā¢ Main service to be provided is to transfer data from
network layer on the sending machine to the network
layer on the destination machine.
a) virtual communication b) actual communication
Host 1 Host 2 Host 1 Host 2
Virtual
data path
Actua1
data path
7
31. 3
1
Types services provided Ā°
ā¢ Three reasonable possibilities for data link
services:
1.Unacknowledged connectionless
service
2. Acknowledged connectionless service
3. Acknowledged connection-oriented
service
32. 3
2
Unacknowledged
connectionless service
1. Source sends independent frames to the
destination without the destination
acknowledging them.
2. No connection is established or released
3. If a frame is lost due to noise on the line, no
attempt is made to recover it.
4. Appropriate when the error rate is very low
s. Appropriate for real-time traffic, such as speech,
in which late data are worse than bad data
6. Mostly LANs use this.
33. 3
3
Acknowledged
connectionless service
ā¢ Next step to improve reliability
ā¢ No connections used but for each frame
received, the receiver sends an
acknowledgement.
ā¢ If frame is not received within specified time,
the sender will retransmit it.
ā¢ Suitable for communication over unreliable
channels, such as wireless systems
34. Acknowledged nection
oriented service
3
4
ā¢ The source and the destination establish a
connection before data transfer.
ā¢ Each frame sent is numbered
ā¢ The data link layer guarantees that each frame sent
is indeed received.
ā¢ It also guarantees that each frame is received
exactly once and all frames are received in the right
order.
ā¢ Connection-oriented service provides the network
layer with the equivalent of a reliable bit stream.
35. 3
5
.
nn
Acknowledged co ection
oriented service
ā¢ The data transfer takes place by following
three phases:
ā¢ Connection establishment
ā¢ One or more frames actually transmitted
ā¢ Connection is released.
36. Example of WAN subnet consisting of
routers connected by point-to-point leased
lines
3
6
ā¢ Fig. placement of the data link protocol
Router
Data link
layer process
Frames Packets
process
Transmission
line to a router
Data link
37. ....
3
7
Framing ..
ā¢ The data link uses the services provided by the
physical layer.
ā¢ The physical layer will not be perfect. 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.
38. Framing
3
8
ā¢ Breaking the bit stream into frames is called
framing. One way is to insert time gaps
between frames.
ā¢ But practically this technique does not work
satisfactorily, because networks generally do
not make any guarantees about timing.
ā¢ So following methods are used:
1. Character count.
2. Starting and ending characters, with character
stuffing.
3. Starting and ending flags, with bit stuffing.
4. Physical layer coding violations.
39. 3
9
....
jj:Ā°
Character count
ā¢ In this method, a field in the header is used to
specify the number of characters in the frame.
ā¢ This number helps the receiver to know the number
of characters in the frame following this count.
ā¢ Disadvantage:
ā¢ An error can change the character count
ā¢ If the wrong character count is received then the
receiver will get out of synchronization and will be
unable to locate the stai1of next frame.
ā¢ This method is rarely used in practice.
40. 5 1 2 3 4 7 6 7 8 9 8 0 1 2 3 4 5 6 8 7 8 9 0 1 2 3
4
0
5 1 2 3 4 5 6 7 8 9 8 0 1 2 3 4 5 6 8 7 8 9 0 1 2 3
Character
count
Character count One character
(a)
Frame 1
5 characters
Frame 2
5 characters
Error
Frame 3
8characters
Frame 4
8 characters
Without error
(b)
Frame 1 Frame 2
(Wrong)
Now a
character count
With one error
41. Starting and ending character with
character stuffing
4
1
ā¢ Here starting character is used before the start of each
frame and an end character is used at the end of each
frame.
ā¢ Flag byte FLAG. is used as starting and ending delimiter
ā¢ Two consecutive flag bytes indicate the end of one frame
and start of the next one.
ā¢ Problem in case of programs or floating point numbers.
ā¢ Solution is to use escape sequence (ESC) before flag.
ā¢ The data link layer at the receiving side removes the
ESC byte before sending to the network layer
+ Known as byte or character stuffing
42. Starting and ending character
4
2
with character stuffing h ā,c e
FLAG Heade r
Original characters
FLAG
ESC
ESC FLAG
ESC ESC
Payload field
(a)
(b)
After stuffing
ESC FLAG
ESC ESC
Trailer FLAG
ESC ESC ESC FLAG
ESC ESC ESC ESC
43. Disadvantages of character
stuffing
4
3
ā¢ A major disadvantage of using this framing
method is that it is closely tied to 8-bit
characters in general and the ASCII
character code in particular.
ā¢ We need a technique to allow arbitrary sized
characters.
44. ā¢ This technique allows the frames to contain arbi rary
number of bits and codes.
ā¢ At the beginning and end of each frame , a specific
bit pattern 01111110 called flag byte is transmitted.
ā¢ Since there are six consecutive 1s in this byte, a
technique called bit stuffing is used.
ā¢ Whenever the sender data link layer detects the
presence of 5 consecutive 1s in the data, it
automatically stuffs a 0 bit in the outgoing bit
stream.
ā¢ De-stuffing is done at the receiving end.
21
45. Bit stuffing
4
5
(a) Original data (b) the data as they appear on the line
(c) the data as they are stored in the receivers memory after de-stuffing
Flags (01111110) at the beginning and e
0 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 0
(b) 0 1 1 0 1 1 1 1 1 0 1 1 1 1 1 0 1 1 1 1 1 0 1 0 0 1 0
Stuffed bits
(c) 0 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 0
Bit-oriented framing with bit stullii g
46. 4
6
Physical layer coding
violations
))):
Ā°Tāāā
ā¢ This method of framing is only applicable o
networks in which the encoding on the
physical medium contains some redundancy.
ā¢ For example, some LANs encode 1 bit of
data by using 2 physical bits.
ā¢ Normally, a 1 bit is a high-low pair and a 0 bit
is a low-high pair.
ā¢ The combinations high-high and low-low are
not used for data and they can be used as
frame boundaries.
47. ....
Error control jt:ā
4
7
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.
Data Frame
Sender
Acknowledgement(ACK)
Or negative
Acknowledgement (NAK)
Receiver
48. 4
8
....
Error control jt:ā
An additional complication comes from the
possibility that hardware troubles may cause a
frame to vanish completely. In this case, the
receiver will not react at all.
This possibility is dealt with by introducing
timers into the data link layer.
50. 5
0
....
jt:ā
Error control
ā¢ However, when frames may be transmitte
multiple times there is a danger that the
receiver will accept the same frame two or
more times, and pass it to the network layer
more than once.
x To prevent this from happening, it is generally
necessary to assign sequence numbers to
outgoing frames, so that the receiver can
distinguish retransmissions from originals.
51. 5
1
....
Flow control jt:ā
ā¢ What to do with a sender that systematical y
wants to transmit frames faster than the
receiver can accept them?
ā¢ The usual solution is to introduce flow control
to throttle the sender into sending no faster
than the receiver can handle the traffic.
ā¢ This throttling generally requires some kind ol
a feedback mechanism, so the sender can be
made aware of whether or not the receiver is
able to keep up.
52. 5
2
..
y.
:ā
.
Flow control
ā¢ Various flow control schemes are there, b I
most of them use the same basic principle.
ā¢ The protocol contains well-defined rules
about when a sender may transmit the next
frame.
x These rules often prohibit frames from being
sent until the receiver has granted permission,
either implicitly or explicitly.
ā¢ Two techniques are there:
ā¢ Stop and wait flow control
ā¢ Sliding window flow control
55. 32
Error detection and .
.
.
)::
,
correction ^
T
"
ā
ā¢ Transmission errors are going to be a fact of
life for many years to come. (in local loop, in
wireless communications)
ā¢ As a result of the physical processes that
generate them, errors on some media (e.g.,
radio) tend to come in bursts rather than
singly.
ā¢ Disadvantage: They are much harder to
detect and correct than isolated errors.
57. 34
ā¹Ā»
.
ā.
...
Types of error
ā¢ Single bit error: only one bit gets corrupt d.
Common in parallel transmission.
Ā» Multiple bit errors: more than one bits get
corrupted
ā¢ Bursf error: more than one bit gets
corrupted at the same place or at once. Very
common in serial transmission of data.
Occurs when the duration of noise is greater
than the duration of one bit.
58. ā¢ Single bit error:
Sent
ā¢ Multiple bit error:
Sent
Two errors
Received
Received
60. .
Error detection tech ues
6
0
ā¢ Use of redundancy: additional bits are addedto facilitate
detection and correction of errors.
ā¢ x Popular techniques:
ā¢ Simple parity check
ā¢ Two-dimensional parity check
ā¢ Checksum
ā¢ Cyclic redundancy check
61. 6
1
....
*'ā
Simple parity check
ā¢ The simplest and most popular error
detection technique
ā¢ Appends a parity bit to the end of the data
Ā« Even parity: means the number of 1ās in the
given word including parity bit should be
even (2,4,6...)
ā¢ Odd Rarity: means the number of 1ās in the
given word including parity bit should be odd
(1,3,5...)
62.
63.
64.
65. 6
5
ā¹Ā»
. .
Performance of simple parity ))ā¢ā¹
check ā
ā
ā¢ Simple parity check can detect all single bit
errors.
ā¢ It can also detect burst errors if the number of
bits in error is odd.
ā¢ The technique is not foolproof against burst
errors that inverts more than one bits. If an
even number of bits are inverted due to error,
the error is not detected.
ā¢ It cannot correct errors.
66. 6
6
. . . ā¢
ā¹ā¢
Ā»
ā¢Ā°
Two dimensional parity check tt'ā
ā¢ Performance can be improved by using two
dimensional parity check, which organizes the
block of bits in the form of a table
ā¢ Parity check bits are calculated for each row
which is equivalent to a simple parity check bit
ā¢ Parity check bits are also calculated for all
columns
ā¢ Both are sent along with the data
ā¢ At the receiving end these are compared with
the parity bits calculated on the receiving data
68. LRC and VRC
ā¢ Two sets of parity bits are generated known as:
ā¢ Longitudinal redundancy check (LRC)
ā¢ Vertical redundancy check (VRC)
69. Vertical Redundancy Check (VRC)
ā¢ Vertical Redundancy Check is also known as Parity Check. In
this method, a redundant bit also called parity bit is added to
each data unit. This method includes even parity and odd parity.
Even parity means the total number of 1s in data is to be
even and odd parity means the total number of 1s in data is
to be odd.
ā¢ Example ā If the source wants to transmit data unit 1100111
using even parity to the destination. The source will have to pass
through Even Parity Generator.
71. LRC (Longitudinal redundancy check)
ā¢ In this error detection method, a block of bits are organized in a table
(of rows and columns).
ā¢ For example, instead of sending block of 32 bits, first it is organized
into four rows and eight columns.
ā¢ Then parity bits for each column is calculated and new row of eight
parity bits is formed.
ā¢ These eight parity bits are appended to original data before
transmission
72.
73. 7
3
....
*'ā
Performance
ā¢ Extra overhead is traded for better error
detection capability
x Two-dimensional parity check significantly
improves error detection capability compared
to simple parity check
ā¢ It can detect many burst errors but not all
ā¢ It cannot correct the errors
74. Checksum
7
4
ā¢ At the senders end:
ā¢ The data is divided into k
segments each of m bits.
ā¢ The segments are added
using one's complement
arithmetic to get the sum
ā¢ The sum is complemented
to get the checksum
ā¢ The checksum segment is
sent along with the data
segments
75. ā¢ At the receiver's end:
x All received segments
are added using one's
complement arithmetic
to get the sum
ā¢ The sum is
complemented
ā¢ If the result is zero the
received data is
accepted otherwise
discarded 7
5
,
10110011
10101011
10 Q1111
76.
77.
78. ā¢ The checksum detects all errors involving an
odd number of bits
x It also detects most errors involving even
number of bits
7
8
79. Cyclic redundancy check
7
9
ā¢ One of the most powerful and commonly used
detecting codes
ā¢ Basic approach:
ā¢ Given a m-bit block of bit sequence, the sender
generates an n-bit sequence known as frame check
sequence (FCS), so that the resulting frame,
consisting of m+n bits, is exactly divisible by some
predetermined number
ā¢ The receiver divides the incoming frame by that
number and, if there is no remainder, assumes there
was no error
85. 8
5
Polynomials ā¹Ā».
jt:
ā¢ AII the variables can be expressed as polynomials Ć“f
a dummy variable X.
ā¢ P= 11001 => X^4 +X^3+ X^1
ā¢ CRC process can be expressed as X^nM(X)/P(X) =
Q(X) + R(X) / P(X)
ā¢ Commonly used divisor polynomials are:
ā¢ CRC-12= X^12 + X^11 + Xā3 + Xā2 + X + 1
ā¢ CRC-16= X^16 + X^15 + Xā2 + 1
ā¢ CRC-CCITT X^16 + X^12 + X^5 + 1
ā¢ CRCā32 = X^32 + X^26 + X^23 + X^22 + X^16 +
X^12 + X^11 + X^10 + X^8 + X^7 + X^5 + X^4 + X^2
+ X + 1
86. ā¢ Can detect all single bit errors
ā¢ Can detect all double bit errors (three 1ās)
ā¢ Can detect any odd number of errors (X+1)
ā¢ Can detect all burst errors of less than the
degree of the polynomial
ā¢ Detects most of the larger burst errors with a
high probability
x For example CRC-12 detects 99.97% of
errors with a length 12 or more
87. .
ā¹.
Ā»
.ā¹
.
8
7
....:,
*ā
Error correction
ā¢ Backward error correction:
ā¢ When an error is detected in a frame, the
sender is asked to retransmit the data/frame.
This approach is known as Automatic Repeat
Request (ARQ) technique.
Ā« Forward error correction:
ā¢ Use more redundancy in the transmitted data
to not only detect but correct error in the
received data.
88. Error correcting codes
8
8
Codeword: an n-bit unit containing data and check ts
is called as n-bit codeword
m data bits
n=m+r
There are 2" possible codewords and 2f
" possible data messages.
Hamming distance between codewords:
min d(C ,C2)=number of (same bit position) bits which differ
d(10010010,00010001)ā3
If two codewords are a hamming distance d apart, it will
require d single-bit errors to convert one into the other.
r check bits
89. ā¢ Hamming distance: the number of differences
in the corresponding bits
x The minimum Hamming distance is the
smallest Hamming distance between all
possible pairs in a set of words
8
9
90. .
ā¹.
Ā»
.ā¹
.
9
0
....:,
*ā
Error correction
Ā« Reouirement for error detection.ā¢ A code is an error
detecting code if and only if minimum distance
between any two code words is two
Ā« Re uirement for error correction: For a code to be
error correcting the minimum distance between any
two code words must be more than two
ā¢ Number of additional bits should be such that it can
point to the position of the bit in error. If k is the
number of additional bits, the condition is 2^k> m+
k+1
91. HAMMING code
ā¢ Basic Approach
ā¢ To each group of m information k parity bits are
added to form m+k bit code
ā¢ Location of each of the m+k digits is assigned a
decimal value
ā¢ The k parity bits are placed in 1,2 ...2^k-1 positions.
ā¢ K parity checks are performed on selected digits of
each codeword
ā¢ At the receiving end the parity bits are recalculated.
The decimal value of the k parity bits provides the bit
position in error, if any.
9
1
96. i o|o i i i o o i o i i o o i o i o o i o i
Si.ngle-bi.t error ā¢ā¢
Ā°ā¢
Sent Received
Error
97. 1 1
1 0 1 0 1 0 II 1 1
1 1
I
64
I I I
11 10 9 8 7 6 5 4 3 2 I
I I
I I lt) 9 S 7 6 5 4 3 2 I
1 0 II 1 0 1 il 1
1 1 0 1
I I I I
I I
1. .. 9 8 7 6 5 4 3 2 1
1 ā¹āŗ ā¹āŗ i o i o o i ā¹i i
Error
Detection
11 10 9 8 7 6 5 4 3 2 l
The bit in position 7
is in error.
101. 1
0
1
. . ā¹Ā»
An Unrestricted Simplex ))ā¢ā¹
protocol
ā¢ This is the simplest possible protocol
ā¢ Has no flow control and no error control
ā¢ Unidirectional protocol in which frames travel from
sender to receiver
ā¢ Assumption is noiseless channel
ā¢ It is assumed that the network layer of the sender
and the receiver are always ready.
ā¢ It is also assumed that the processing time can be
ignored and infinite buffer space is available
ā¢ This protocol is also known as āutopiaā
102. An Unrestri
ā¢cted Sā¢
implex
protocol
1
0
2
ā¹
tt
Ā»
:ā¢
.
Ā°
ā¢ This protocol consists of two distinct procedures
namely a sender and a receiver.
ā¢ The sender runs in the data link layer of the sender
machine and receiver runs in the data link layer of
the receiver machine
ā¢ The sender site cannot send a frame until its
network layer has a data packet to send.
ā¢ No sequence numbers and no acknowledgments
are used.
ā¢ Both procedures are constantly running because
they don't know when the corresponding events will
occur
103.
104.
105. Physical Send frame
Request from.
Renat forever
Data frames
Data link
Recri {tqyg Physical
Repeat forever
TOO
107. Receiver site algorithm for the
simplex protocol
// lepeat forever
#d1II0Ā£$Y
en1tJĀ” // /lee9 vntil an erat 0
C
C
c
r
//&Iixec datatoaĀ«tvoct laye
109. . . ā¹Ā»
A simplex Stop and Wait
protocol
)))ā¢Ā°
ā
ā
ā¢ Assumption is noiseless channel and
communication is unidirectional
ā¢ Flow control is added to previous protocol
ā¢ In this protocol, a small dummy frame is sent
back from the receiver to the transmitter to
indicate that it can send the next frame.
ā¢ Here the sender sends one frame, stops until it
receives confirmation from the receiver and then
sends the next frame.
ā¢ Hence the name stop and wait.
73
110. Design of stOp and wait
Protocol
duta tārainc
data link
111.
112.
113. lO
11
//Repeat zorev
//Allow the first frame to go
hile(true)
aosend = t cue
WaitForEvent( j / Sleep until an event
occur
if(Brent(RequestToSend) AND cansezd)
77 send the data 5zawe
/lean:not aend unt11 ACs arrive
WaitForEvent(); // Sleep until aE event occura
iI(Evest(ArrivalWotification) /f An ASK bas arrived
Sender site algorithm for the
Stop and wait protoCol
114. Receiver site algorithm for the
Stop and wait protoCol
//Repeat forever
faitf0r9vect I) i // Sleep utit ac evect occur(
if lavent l7irri*alNotificationl} //Onta frase drrires
Recetve7ā¹ae() ;
Deliver(data),
fecdPrael);
//BJJverdatatonetwDr2faye,
116. Sā¢
implex Protocol for Noā¢
isy ā¹
)
Ā»
ā¢
.ā¢āŗ
Channel
Assumption
ā¢ Frames may be damaged or lost completely
ā¢ In this protocol, the sender waits for positive
acknowledgement before advancing to the next data
item
ā¢ So it is called as PAR (positive acknowledgement with
retransmission) or Automatic Repeat Request (ARQ)
ā¢ Due to retransmission there is always a possibility of
duplication of frames at the receiver.
ā¢ To avoid this, sender puts a sequence number in the
header of each frame it sends.
ā¢ The operation can be divided into two modes:
ā¢1. Normal operatione
2.Time out
78
117. ASiITIp[ix ProtocOl fOr NoiSy Channei t;tt
Get date
Receive tend
frame frame
:Repe.it forever
ā¢ā¢ā¢ ' 0 ā¢ā¢ā¢
ackN o
Receis'er
Del iver
data
Receive Sentl
frame tiame.
Repeat forex-cr
Physical
119. ā¢ In all practical situations, the transmission of
data needs to be bi-directional (full duplex)
ā¢ One way of achieving full duplex
transmission is to have separate channels for
forward and reverse data transfer
ā¢ But this will waste the bandwidth of reverse
channel almost entirely
ā¢ A better solution would be to use each
channel (forward and reverse) to transmit
frames both ways, with both channels having
the same capacity
1
1
9
120. ā.
ā¢ Let A and B be the users.
ā¢ When a frame is carrying data from A to B, it can
also carry control information about arrived or lost
frames from B; and vice-versa.
ā¢ This technique where outgoing acknowledgement is
delayed temporarily is called as piggybacking.
ā¢ Advantage: better use of available bandwidth
ā¢ Disadvantage: additional complexity
ā¢ If data link layer waits too long before transmitting
acknowledgement, then retransmission of frame
would take place
1
2
0
121. Back-N ARO
Design of Piggybacking
Scud
N et wOrk l9elis'er 'ei
Re ei vc
fāra
tend
fĀ°rame
Receive
ackNn
xegMo
Send
deliver Gct Nelw nrk
ā
ā
. - -.ā.ā.āāāā
ā ā ā ' : : ā : : ā
ā
ā
ā
-:
Receive SenU
fcamo frame
Data link
Php sical
122.
123. Sliding Window
ā¢ Sliding window is an abstract concept that define
the range of sequence numbers that is the conc
of the sender and receiver
ā¢ The sender maintains a set of sequence numbers
corresponding to frames it is permitted to send.
ā¢ These frames are said to fall within the sending
window.
ā¢ Similarly, the receiver also maintains a receiving
window corresponding to the set of frames it is
permitted to accept.
ā¢ The sender's window and the receiver's window
need not have the same lower and upper limits, or
even have the same size.
124. Sliding Window
ā¢ In some protocols they are fixed in size, but in
others they can grow or shrink as frames are sent
and received.
ā¢ The sequence numbers within the sender's window
represent frames sent but as yet not acknowledged.
ā¢ Whenever a new packet arrives from the network
layer, it is given the next higher sequence number,
and the upper edge of the window is advanced by
one.
ā¢ When an acknowledgement comes in, the lower
edge is advanced by one. In this way the window
continuously maintains a list of unacknowledged
frames.
125. Sliding window
ā¢ Since frames currently within the sender's wind
may ultimately be lost or damaged in transmit, t
sender must keep all these frames in its memory for
possible retransmission.
ā¢ Thus if the maximum window size is n, the senders
need n buffers to hold the unacknowledged frames.
ā¢ If the window ever grows to its maximum size, the
sending data link layer must forcibly shut off the
network layer until another buffer becomes free.
ā¢ The receiving data link layer's window corresponds
to the frames it may accept. Any frame falling
outside the window is discarded without comment.
126. Slidiā¢ng wi
ā¢ndow ā¹
)Ā»
ā¢ā¢ā¹
āŗ
ā¢ When a frame whose sequence number i equal to the lower edge o
the window is received, it is passed to the network layer, an
acknowledgement is generated, and the window is rotated by one
ā¢ xFig. sliding window
ā¢Window
ā¢6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5
127. r $ e n
Sender window
ā> Direction Direction
This wall moves to the
ht frame by frame,
frame is sent.
This wall moves to the right,
the size of several frames
at a time, when an
ACK is received.
Sender sliding window
Recelver wlndow
128. Receiver slid window
Recelver wlndow
Direction Direction
This wall moves to the
rlght, frame byĀ°f ame,
when a frame
is received.
This wall moves to the right,
the slze of several frames at
a time, when an
ACK 1s sent.
130. ā¢ A One-bit sliding window protocol (Stop and
Wait ARQ)
x A protocol using Go Back N (Go-Back-N
ARQ)
ā¢ A protocol using Selective Repeat (Selective
Repeat Request)
131. . . . . ā¢
ā¢
ā¢
One bit slidi window )))ā¢Ā°
protocol (Stop and Wait ARQ) *ā ā
ā
ā¢ One bit protocol because the maximum window size
is n=1.
ā¢ Operation is based on ARQ
ā¢ Transmitter sends one frame of data and waits for
an acknowledgement from the receiver
ā¢ If it receives a positive acknowledgement (ACK) it
transmits the next frame.
ā¢ If it receives a negative acknowledgement (NACK) it
retransmits the same frame.
132. ))ā¢ā¹
retransmission ā¢.
ā¢ The transmitter stores the copy of last frame
transmitted until it receives an
acknowledgement for those frames.
ā¢ Data frame is numbered 0 and ACK frame as 1
ā¢ If an error occurs while transmission, receiver
sends a NAK back for retransmission of the
corrupted frame.
ā¢ A timer is there for lost ACK and NACK frames
133. ā¹Ā»
When is retransmission
required???
ā¢ If the received frame is damaged
)))ā¢
Ā°
ā
ā
ā¢ If the transmitted frame is lost
ā¢ If the acknowledgement from the receiver is
lost
137. ā¢ Advantages:
ā¢ Simplicity
ā¢ Requires minimum buffer size
ā¢ Disadvantages:
ā¢ Very inefficient. At any time only one frame
is in transition
x The sender will have to wait at least one
round trip time before sending next frame
138. ā¹Ā»ā¹
ā¹āŗā¹.
Go-Back-N Protocol (Go-Back-NAR ):'
ā¢ Based on sliding window protocol
ā¢ Most commonly used
ā¢ A sending station may send a series of
frames sequentially up to a maximum number
ā¢ The number of unacknowledged frames is
determined by window size, using the sliding
window flow control technique
ā¢ In case of no error, the destination will
acknowledge incoming frames as usual
139. ā¢ If the destination detects error in a frame, or it
receives a frame out of order, it sends a NAK
for that frame
ā¢ The destination will discard the frame in error
and all frames succeeding that frame in error
ā¢ The source station on receiving the NAK,
must retransmit the frame in error plus all
succeeding frames.
143. ā¢ It transmits all the frames if one frame is
damaged or lost
x It transmits frames continuously as long as it
does not receive the ACK or NACK signals
ā¢ Error can be introduced if NAK is lost
144. ā¹Ā»
. ....
Selective Repeat ARQ
ā¢ In this method only the damaged or lost
frame is retransmitted.
ā¢ The receiver can do the sorting of data
frames and is also able to store frames
t::.
received after a NAK has been sent until the
damaged frame has been replaced
ā¢ The transmitter must contain a searching
mechanism that allows it to find and select
only the requested frame for retransmission
146. ā¹Ā»
. ....
Selective Repeat ARQ
ā¢ Transmitter does not wait for the ACK signal for
transmitting the next code.
t::.
ā¢ It transmits the code continuously till it receives the
NAK signal from the receiver.
ā¢ On reception of the NAK signal, the transmitter will
retransmit only that frame 2 and continue with the
sequence 6, 7
ā¢ The frames 6,7 received by the receiver are not
discarded by the receiver.
ā¢ The receiver receives the retransmitted frames in
between the regular frames.
ā¢ Therefore receiver will have to maintain the frames
sequentially.
149. Ā»
level data link )))ā¢Ā°
DLC Hig
control
ā¢ Bit oriented protocol for communication over
point to point and point to multipoint links.
x It implements ARQ mechanisms
ā¢ HDLC provides two common transfer mode:
ā¢ Normal response mode (NRM)
Ā» Asynchronous balanced mode (ABM)
150. ā¹Ā»
.
i::Ā°
Normal response mode (NRM) :ā¢
ā¢ The station configuration is unbalanced
ā¢ One primary station and multiple secondary
stations
ā¢ Aprimary station can send commands; a
secondary station can only respond
152. .
ā¹.
Ā»
..
.
....:,
Asynchronous Balanced Mode
ā¢ In this the configuration is balanced
ā¢ Link is balanced and each station can
function as a primary and a secondary
Balanced
Combined
omnian
iā¢esponse
Combined
iā¢esponse
153. +
....
..
,
...
ā¢..
āāŗ
.
DLC Frames
Ā» Information frames (I-frames): transport
user data and control information
ā
ā¢ Supervisory frames (S-frames): transport
control information
Ā« Unnumbered frames (U-frames): used for
system management
155. Field
s
use """?Fentify beginning and end of frame
ā¢ field: 8-bit sequence with bit pattern 011111
ā¢ Address field: contains address of secondary
station. I primary station created the frame contains
to if secondary created the frame, it contains from
address. Address field can be 1 byte or several
bytes long. 1 byte identifies 128 stations (1bit used
for some purpose)
ā¢ Control field: 1 or 2 byte segment used for error
control and flow control
Ā« Information field: contains user data or
management information. Length varies for different
networks
Ā« FCS field: HDLC error correction field. It can
contain 2 or 4 byte ITU-T CRC.
156. ā¹Ā»
.
,
...
ā¢.
,.
DLC address field ā
Flag Adā¹lress Control Information FCS Flag
The address is one byte
or a multiple of bytes.
One-byte address
Multi-byte address
157. 0
ā¢ Determines the type of frame and defines it
functionality
Flag Address Information FCS Flag
I-Frā¹ime
NtS) N(Rāŗ P/F Poll/final bit
N(S) Sequence number of
frame sent
N(R) Sequence number of
next frame expected
Code Code for supervisory
or unnumbered frame
S-fārā¹ime
U- Fi ante
Code N( R)
Code Code
158. ā¹Ā»
. ....
Control field for I-frames
ā¢ First bit 0 denotes that it is I-frame
::ā¢.
ā
ā
ā¢ 3 bits of N(S) denotes that it is sequence
number. 0 to 7 sequence numbers possible
ā¢ Last 3 bits of N(R) denote acknowledgement
number
ā¢ P/F bit called poll-final bit
ā¢ Poll- means frame sent from primary to
secondary
ā¢ Final āmeans frame is sent from secondary
to primary
160. 1
6
0
.
ā¹.
Ā»
..
.
,.ā¢,
Control field for S-frames ā
ā¢ Used for error and flow control when
piggybacking is impossible or inappropriate
ā¢ 10 bit indicates it is S-frame
ā¢ PF is poll-final bit
ā¢ N(R) denotes ACK no or NAK depending on
type of frame.
ā¢ 2 code bits define the type of S-frames:
161. ā¹Ā».
field for S-frames tā¢
ā¢ Receive Ready (RR) : if code field is 00, it is S
ā
frame. Denotes safe receipt of frame by receiver.
Here N(R) denotes ACK
ā¢ Receive Not ready (RNR): if code is 10 it is RNR. It
means frame is received safely but the receiver is
busy. Here N(R) is ACK no.
ā¢ Reiect (REV): if code field is 01, it is REJ Sāframe. It
is NAK frame used in Go-Back-N ARQ. N(R) is NAK
ā¢ Selective reiect (SREd): if code field is 11, it is
SREJ S-frame. It is NAK frame used in selective
repeat ARQ. N(R) here is NAK
162. ā¹Ā»
ā¢ ....
field for U-frames
ā¢ U-frames used to exchange session
ement and control information
between connected devices
ā¢ U-frame codes are divided into 2 sections:
ttā¢
ā¢ 2-bit prefix before PF bit and 3-bit suffix after
PF.
ā¢ These 5 bits together can be used to create
up to 32 different types of U-frames
163. U-frame control field
ā¬ā¬i
II 011
11 010
11 1
@
II 110
@ 110
& 010
II 1
0
1
10 @1
Coiāŗii/iz/id
Set normal response mode
SNRM extended
Disconnect mode
Unnumbered information
Request disconnect
Set initialization mode/
Request information mode
1IIIā
qāŗ
!
1:
IIIāŗ
){)t]
Unnumbered poll
Frame reject
164. SDLC Synchronous Data li
ā¢nk
control protocol
ā¹
)Ā»
ā¢ā¢ā¢
.
ā
ā
ā¢ Used by IBM
ā¢ Not a standard but is widely used
ā¢ Asubset of HDLC
ā¢ There are primary and secondary stations
defined for HDLC
KGF16 aa OT11410
165. . layer
.
the
in
sLIPa
n
dP
P
P
ā¹Ā»
The data link ))ā¢ā¹
.
i n t e r n e t
t. :
ā
PC
User's home
Client process
using TCP/IP
Internet provider's office
Modems
Dial-up
telephone line
Modem
TCP/IP connection
using SLIP or PPP
Router
process
166. The
1
6
6
ā¢ Used to connect the home computers to the server
of an ISP
ā¢ Most of the users have a traditional modem and
they are connected to the Internet through a
telephone line or cable TV
ā¢ PPP is used for controlling and managing the data
transfer
ā¢ Can operate over a full duplex point-to-point
transmission link, asynchronous links, bit
synchronous links or ADSL and SONET
ā¢ Character-oriented protocol
167. 1
6
7
ā¹Ā».
Services provided by PPP tt:
ā¢ Defines the format of the frames
ā¢ It defines how the link between two devices is
to be established and how the data exchange
should take place. Uses LCP (link control
protocol)
ā¢ Decides the encapsulation of network layer
into the data link frame. Uses NCP (network
control protocol)
ā¢ It defines the way in which the two devices
can authenticate each other
168. ā¹Ā»
1
6
8
Frame format of PPP .
i.
!:ā¢ā
ā.
Ā» Fla . the PPP always begin and end with flag
ā¢ Address: broadcast address. All 1s in the
frame indicate all stations can accept the
frame
ā¢ Control: denotes unnumbered frame,
indicates no flow control and error control
Bytes 1
Flag Address
01111110 111111
11
1 or2 Variable 2or 4
Conol
0000001i
Protocol Paytload Checksum
1
Flag
01111110
169. Ā» Protocol: tells the type of packet contain d
in payload. E.g. LCP, NCP, IP, OSI CLNP,
XNS
1
6
9
Ā» Payload field: variable length, up to
negotiated maximum. Default 1500 bytes.
Padding may follow payload field
Ā« Checksum: normally 2 bytes, but 4 bytes
can be used. Can use CCITT 16 or 32
generator polynomial
170. ā¹Ā»
1
7
0
....
Making a communication t::.
1. PC calls the provider's router by a mode
2. Use LCP packets to select PPP parameters
3. Use NCP to receive an IP address
4. Send and receive IP packets
5. Use NCP to tear down the network layer
connection and free up the IP address
6. Use LCP to shutdown the data link
connection
7. The computer tells the modem to hang up
172. 1
7
2
ā¹Ā»
.
Transition states of PPP :
Ā«:::
.'ā
ā¢ Dead: link is not used. No active carrier and line is
quiet
ā¢ Establish: when communication starts. User sends
configure request packet to negotiate options. If
successful goes into authenticating state. LCP
packets used
Ā« Authentication: user sends the authenticate
request packet
Ā« Network: NCP protocol is invoked to configure the
network layer
Ā« Ooen: exchange of user data and control packets
ā¢ Terminate: user sends terminate packet to
terminate the link
173. 1
7
3
ā¹Ā».
Link control protocol tt:
ā¢ LCP responsibilities:
ā¢ To establish links
ā¢ To maintain established links
ā¢ To configure the links
ā¢ Termination of the links
ā¢ It also provides negotiation mechanisms.
ā¢ When PPP is carrying LCP packet it is in the link
establishina state or in link terminating state and
user data is not carried in these states
ā¢ All LCP packets are carried in the payload field of
the PPP frame with protocol field set to C021 in
hexadecimal
175. ā¹Ā».
1
7
5
.
...
..
.:.
,
Types of LCP packets
ackets: first 4 used for link
configuration during establish phase
Ā« Link terminatin ackets: 5 and 6 used for
link termination during termination phase
ackets: last five used for
link monitoring and debugging
177. 0pi!āvn .Default
Maximum receive unit (payload field size) 15 0
Authentication protocol None
Protocol field compression Ofl
Address and control field compression Off
Common options
ā¢ Many options that can be negotiated betw en
two endpoints
ā¢ Options are inserted in the information field
ā¢ Information 1ield is divided into option type,
option length and option data
178. ā¹Ā»
.
Authentication protocols tt'ā
ā¢ PPP needs authentication because it is u ed
for dial-up links.
ā¢ Authentication is to validate the identity of a
user who needs to access the set of
resources.
ā¢ Two protocols created by PPP for
authentication are:
Ā» Password authentication Rā¢O^OcOI (PAP)
ā¢ Challenge handshake protocol (CHAP)
ā¢ These are used during authentication and no
user data is exchanged
140
179. Payload
(and padding)
Flag
PAP
āŗ PAP packetsencapsulated in a PPP tram
client
Accnā¢ granted ! g{8d
Authentic ate-request
Authonticatc-ack
Authenticate-nak Code: 3 Length
Mcssag llmzname
Code: I Length
UNIT name Password
length
Varsablc
PAP packet.s
180. CHAP
ā¢ CHAP packets encapsulated in a PPP fra
CHAP LhalleĀ»ge: H6ty" t@![āŗ
CHAP Response: Answer: 89it%-OkL
181. 1
8
1
ā¹Ā»
. ....
Link Access Protocol (LAP)
ā¢ LAP originates from IBM SDLC.
Ā« Later it was named as LAPB (LAR balanced:/|
t::.
ā¢ LAP is data link protocol for X.25
ā¢ LAPB is used to manage communication and packet
framing between data terminal equipment (DTE) and
the data circuit-terminating equipment (DCE)
devices in the X.25 protocol stack.
ā¢ LAPB is essentially HDLC in Asynchronous
Balanced Mode (ABM).
ā¢ LAPB sessions can be established by either the
DTE or DCE.
ā¢ Bit oriented
ā¢ LAPB makes sure that frames are error free and
properly sequenced.
182. ā¢ I-Frames :
1
8
2
*
ā¢ Carries data and control information.
ā¢ It includes sequencing, flow control, and error detection
and recovery. I-frames carry send and receive sequence
numbers.
ā¢ S-Frames :
e Carries control information.
ā¢ S-frame functions include requesting and suspending
transmissions, reporting on status, and acknowledging the
receipt of I-frames.
ā¢ U-Frames :
ā¢ carries control information.
ā¢ U-frame functions include link setup and disconnection, as
well as error reporting.
184. LAPB protocol operation
1
8
4
ā¢ In LAPB, since there is no master/slave relations
the sender uses the Poll bit to insist on an
immediate response.
ā¢ In the response frame this same bit becomes the
receivers Final bit.
ā¢ The receiver always turns on the Final bit in its
response to a command from the sender with the
Poll bit set.
ā¢ The P/F bit is generally used when either end
becomes unsure about proper frame sequencing
because of a possible missing acknowledgement,
and it is necessary to re-establish a point of
reference.
185. LAPF- Link Access Procedure/proto
for Frame Mode Services
1
8
5
ā¢ Defined in the ITU Q.922
ā¢ An enhanced LAPD (Q.921 with congestion control
capabilities
ā¢ Used for Frame Mode Services in the Frame Relay
network.
ā¢ The core functions of LAPF are:
ā¢ Frame delimiting, alignment, and flag transparency
ā¢ Virtual circuit multiplexing and de-multiplexing
Octet alignment: Integer number of octets before
zero-bit insertion
ā¢ Checking minimum and maximum frame sizes
ā¢ Error detection, Sequence and non-duplication
ā¢ Congestion control
186. Flag Address field Control elo Information F
C
S Flag
Protocol format
1
8
6