CNS Unit 2
CNS Unit 2
• Most reliable,
• Guaranteed service –
• Each frame sent is indeed received
• Each frame is received exactly once
• Frames are received in order
• Special care has to be taken to ensure this in
connectionless services
Now let us see how the data link layer can combine
framing, flow control, and error control to achieve
the delivery of data from one node to another. The
protocols are normally implemented in software by
using one of the common programming languages.
To make our discussions language-free, we have
written in pseudocode a version of each protocol that
concentrates mostly on the procedure instead of
delving into the details of language rules.
(continued)
Unit2 - Data Link Layer 40
Algorithm Sender-site algorithm for Stop-and-Wait ARQ (continued)
(continued)
Unit2 - Data Link Layer 57
Algorithm Go-Back-N sender algorithm (continued)
(continued)
• Burst error :-
- It means that two or more bits in the data unit
has changed.
0 changed to 1
0 0 0 0 1 0 1 0 Received
0 1 0 1 1 1 0 1 0 1 0 0 0 0 1 1
Received
Unit2 - Data Link Layer 87
ERROR DETECTION
1100001 Data
Checking function
1100001 | 1 Even – parity
Is total number
generator
of 1s even ?
Receiver 1 VRC
Sender
• Example :
LRC 10101010
Disadvantage :
-> If two bits in one data units are damaged and two
bits in exactly same position in another data unit
are also damaged , the LRC checker will not detect
the error.
Calculation of the
polynomial code checksum.
N bits
N+1 bits
REMAINDER CRC
Zero accept
N bits
Nonzero reject
Receiver Sender
Unit2 - Data Link Layer 119
Divisor
The divisor is determined according to the algebraic
polynomial.
for e.g. A polynomial is
X^7 + x^5 + x^2 + x + 1
generation of divisor from polynomial
X^7 + X^5 + X^2 + X + 1
1 0 1 0 0 1 1 1
0110
0000
1100
1101
0Link
Unit2 - Data 0 1 Layer 122
111101
1101
100100 0 0 1
1101
The CRC checker at receiver
1000
end :
1101
1010
1101
1110
1101
0110
0000
1101
1101
Unit2 - Data
0Link
0 0 Layer 123
ERROR CORRECTION
d d d r d d d r d r r
11 10 9 8 7 6 5 4 3 2 1
Redundancy Bits
Adding r1 1 0 0 1 1 0 1 1
Adding r2 1 0 0 1 1 0 1 0 1
Adding r4 1 0 0 1 1 0 0 1 0 1
Adding r8 1 0 0 1 1 1 0 0 1 0 1
11 10 9 8 7 6 5 4 3 2 1
Hamming Code : 1 0 0 1 1 1 0 0 1 0 1
Unit2 - Data Link Layer 130
1 0 0 1 1 1 0 0 1 0 1
Sent
Error
1 0 0 1 0 1 0 0 1 0 1
Received
1 0 0 1 0 1 0 0 1 0 1
11 10 9 8 7 6 5 4 3 2 1
1 0 0 1 0 1 0 0 1 0 1
11 10 9 8 7 6 5 4 3 2 1
1 0 0 1 0 1 0 0 1 0 1
11 10 9 8 7 6 5 4 3 2 1
12.185
CSMA
• It is a carrier sense multiple access based on media access
protocol to sense the traffic on a channel (idle or busy)
before transmitting the data.
• It means that if the channel is idle, the station can send data
to the channel. Otherwise, it must wait until the channel
becomes idle. Hence, it reduces the chances of a collision on
a transmission medium.
• Types:
• 1-persistent
• If channel is idle, a frame is transmitted
• If channel is busy, the channel is continuously checked
• Non-persistent
• If channel is idle, a frame is transmitted
• If channel is busy, a random time is waited before channel is sensed again
• p-persistent (slotted channel only)
• If channel is idle a frame is transmitted with probability p
• If channel is busy, next slot is sensed again
C
(0, 2 - 1)
C++
• IEEE 802.15
• IEEE 802.16.
207
IEEE 802.3 MAC Frame
IEEE 802.3 MAC: Ethernet
209
IEEE 802.3 Physical Layer
(a) transceivers
(b)
T connectors flaky
210
Fast Ethernet
100baseT4 100baseT 100baseFX
Twisted pair category 3 Twisted pair category 5 Optical fiber multimode
Medium
UTPTable IEEE 802.3 100 Mbps Ethernet medium alternatives
4 pairs UTP two pairs Two strands
Max. Segment
100 m 100 m 2 km
Length
Topology Star Star Star
211
Gigabit Ethernet
1000baseSX 1000baseLX 1000baseCX 1000baseT
Optical fiber Optical fiber Twisted pair
Shielded category 5
Medium multimode single mode
copper cable
Two strands
Table Twomedium
6.3 IEEE 802.3 1 Gbps Fast Ethernet strands
alternatives UTP
Max. Segment
550 m 5 km 25 m 100 m
Length
Topology Star Star Star Star
212
10 Gigabit Ethernet
10GbaseSR 10GBaseLR 10GbaseEW 10GbaseLX4
Two optical Two optical fibers Two optical fibers Two optical fibers
fibers Single-mode at Single-mode at multimode/single-
Multimode at Table 6.51310 nm
IEEE 802.3 1550 nm
10 Gbps Ethernet medium alternatives mode with four
Medium
850 nm 64B66B SONET wavelengths at 1310
64B66B code compatibility nm band
8B10B code
Max.
Segment 300 m 10 km 40 km 300 m – 10 km
Length
213
Typical Ethernet Deployment
Server farm
Ethernet
Ethernet Ethernet Server
Server switch
switch Server switch
Hub
Hub Hub
10 Mbps links
10 Mbps links 10 Mbps links
Department B Department C
Department A
214
IEEE 802.11
• WIFI
Wi-Fi - 802.11
219
IEEE 802.11 Mac Frame
• WiMax
IEEE 802.16
• Security sublayer
IEEE 802.16 Services