1. Guided By Presented By
Mr. A. K. Khan Deepak Gupta (31320025)
Assistant Professor Ankur Adhyapak(31320032)
Dept. of Information Technology Medini Brahma(31320016)
Assam University , Silchar Suraj Prakash Maurya(31320020)
2013-4-6 www.i-world-tech.blogspot.in 1
3. Data Link Layer is the Second Layer in the OSI Model.
Data Link Layer Receives The Service From Physical Layer and
gives Service to the Network Layer.
It makes the physical layer appears error-free to the upper
layer (Network Layer).
The data Link Layer is responsible for the Moving frames from
one hop (node) to the next.
2013-4-6 www.i-world-tech.blogspot.in 3
8. Errors Caused by Signal Attenuation , Noise.
Receiver Detects Presence of Errors.
Possible Actions
Signal Sender For Re-Transmission.
Drops Frame.
Correct bit Errors if Possible and Continue.
2013-4-6 www.i-world-tech.blogspot.in 8
9. DDee
Errors Detection uses The Concept of redundancy, which
Means adding Extra bits at The End of Each Unit of data.
2013-4-6 www.i-world-tech.blogspot.in 9
10. Three Types of Redundancy Check are Common :
1. Parity Check
(A). Simple Parity Check
(B). Two Dimensional Parity Check
2. Cyclic Redundancy Check (CRC)
3. Check Sum.
2013-4-6 www.i-world-tech.blogspot.in 10
11. In This Technique , a Redundant bit, Called a Parity bit is
Added To The Every data Unit so That The Total Number of 1s
(including The Parity bit) in The Unit becomes Even (or Odd).
2013-4-6 www.i-world-tech.blogspot.in 11
12. Ex :
The data Unit 100100 becomes 110110
Then in both data Unit Number of 1 is even.
So we can conclude ,
1. simple parity check can detect All single bit errors.
2. It Can detect burst errors only if the total number of
errors in each data unit is odd.
2013-4-6 www.i-world-tech.blogspot.in 12
13. In This Method, First We Calculate The Parity bit For Each
Data Unit.
Ex : As in Figure We have Four Data Unit. Then We Calculate
The Parity bit For Each Column.
2013-4-6 www.i-world-tech.blogspot.in 13
15. But If--->
Sender Send
11001111 10111011 01110010 01010011 01010101
Suppose The Receiver Receive
01001101 00111001 01110010 01010011 01010101
Lets Check The Parity bits
01001101 00111001 01110010 01010011 01010101
So, if 2 bits in One Data Unit Damaged and 2 bits in Exactly The Same
Positions in Another data Unit are Also Damaged, The Checker Will
Not Detect an Error.
2013-4-6 www.i-world-tech.blogspot.in 15
16. The Third and Most Powerful Technique of Error Detection is
Cyclic Redundancy Check (CRC). It based on Binary Division.
2013-4-6 www.i-world-tech.blogspot.in 16
17. The Divisor of Size n is Predefined and Agreed Upon The both
Sender and Receiver.
Then , The Size of Redundant bits Should be n-1.
Ex : Sender
2013-4-6 www.i-world-tech.blogspot.in 17
19. The Last Error Detection Method , We Discuss here is Called
The Checksum.
The checksum is Used in The Internet by Several Protocols
Although not at The Data Link Layer.
Like The Others it is Also based on Redundancy.
Traditionally, The Internet has been Using a 16-bit Checksum.
2013-4-6 www.i-world-tech.blogspot.in 19
20. The Sender Calculates The Checksum by Following These Steps….
Sender Side :
1. The message is divided into 16-bit words.
2. The value of the checksum word is set to 0.
3. All words including the checksum are added using
One’s Complement addition.
4. The Sum is Complemented and becomes The Checksum.
5. The Checksum is Sent With The Data.
2013-4-6 www.i-world-tech.blogspot.in 20
21. The Receiver Uses The Following Steps For Error Detection.
Receiver site
1. The Message (including Checksum) is Divided into
16-bit Words.
2. All Words are Added Using One’s Complement Addition.
3. The Sum is Complemented and becomes The New
Checksum.
4. If The Value of Checksum is 0, The Message is
Accepted ; Otherwise, it is Rejected.
2013-4-6 www.i-world-tech.blogspot.in 21
22. Ex : here We Use 4 bit Checksum.
Suppose We have To Send The Set of Data (7, 11, 12, 0, 6)
2013-4-6 www.i-world-tech.blogspot.in 22
23. Two methods
1. Error correction by Retransmission
2. Forward error correction (FEC)
2013-4-6 www.i-world-tech.blogspot.in 23
24. It Allows The Receiver To inform The Sender of Any Frame Lost
or Damaged in Transmission.
Coordinates The Re-Transmission of Those Frames by The
Sender. This Process is Called Automatic Repeat Request (ARQ).
For This We Use Three Common Flow Control Mechanisms :
1. Stop-and-Wait ARQ
2. Go-back-N ARQ
3. Selective-Repeat ARQ
2013-4-6 www.i-world-tech.blogspot.in 24
25. Receiver Can Use an Error Correcting Code , Which Automatically
Correct Certain Errors.
Hamming Code :
Single bit Error
Burst bit Error
Hamming Code is Mainly Used To Solve Single bit Error.
We Can Solve Burst bit Error Using The Concept of Single
bit Error.
2013-4-6 www.i-world-tech.blogspot.in 25
26. Single bit Error
Receiver Reads a 1 bit as a 0 or 0 bit as a 1.
To Correct This Error, The Receiver Simply Reverses The Value
of The Altered bit. To do so We Must Know Which bit is in error.
To Calculate The Number of Redundant bit r To Correct an data
bit of Length m we Must Know The Relationship between r and
m.
So, if Data bit is m and Redundant bit is r, Then
We have To Satisfy The Relation
2^r >= m+r+1
2013-4-6 www.i-world-tech.blogspot.in 26
27. Ex : If The Value of m is 7, The Relation will Satisfy if The Minimum
Value of r is 4. 2^4 = 16 > 7+4+1
2013-4-6 www.i-world-tech.blogspot.in 27
28. If The Number of Data bit is 7, Then The Position of Redundant
bits Are :
2^0=1 2^1=2
2^2=4 2^3=8
2013-4-6 www.i-world-tech.blogspot.in 28
32. Burst Error Correction
Hamming Code Cannot Correct a burst Error Directly.
it is Possible To Rearrange The Data and Then Apply The code.
Instead of Sending All the bits in The data Unit Together, we can organize
N units in a column.
Send The First bits of Each Followed by The Second bit of each, and so
on.
In This Way, if a burst Error of M bit Occurs (M<N), Then The Error does
not Corrupt M bit of Single Unit, it Corrupt Only 1 bit of Unit.
Then We Can Correct it Using Hamming Code Scheme.
2013-4-6 www.i-world-tech.blogspot.in 32
35. Four Levels of Addressing
Physical Logical Port Specific
Addresses Addresses Addresses Addresses
Data Link Layer Network layer Transport Layer Application Layer
2013-4-6 www.i-world-tech.blogspot.in 35
36. Physical Address is Also Known As Link Address.
It is the Address of a node as defined by its LAN or WAN.
It is Included in The Frame used by the Data Link Layer.
It is The Lowest Level Address.
The Size and Format of These Address vary , depending
on The Network.
2013-4-6 www.i-world-tech.blogspot.in 36
37. Ethernet uses a 6-byte (48 bits) Physical Address That is
Imprinted on The Network Interface card (NIC) .
Ex :
Most LAN Use a 48-bit (6 byte) Physical Address Written as 12
hexadecimal digits , Every byte (2 hexadecimal digits) is
Separated by a Colon , As Shown below..
07:01:02:01:2C:4B
A 6 byte (12 hexadecimal digits ) Physical Address.
2013-4-6 www.i-world-tech.blogspot.in 37
40. When nodes or stations are connected and use a common link , called a
multipoint or broadcast link , we need a multiple-access protocol to coordinate
access to the link.
TAXANOMY OF MULTIPLE-ACCESS PROTOCOLS
2013-4-6 www.i-world-tech.blogspot.in 40
41. In random access or contention method , no station is superior to another
station and none is assigned the control over another.
At each instance a station that has a data to send uses a procedure
defined by the protocol to make a decision on whether or not to send . The
decision depends on the state of the medium (idle or busy ).
Two features give this method its name:
there is no scheduled time for a station to transmit (i.e random access)
No rules specify which station should travel next(i.e called contention
method)
2013-4-6 www.i-world-tech.blogspot.in 41
42. Earliest random access protocol developed in early
1970.
It was designed for radio wireless Lan.
The medium was shared between stations .
When a station sends the data , another
station may do at the same time .
The data from the two stations collide and become
garbled.
2013-4-6 www.i-world-tech.blogspot.in 42
43. The original ALOHA protocol is called pure ALOHA .
Each stations sends a frame when ever it has a frame to send .
Since there is only one channel to share , the is a possibility of
collisions between frames from different stations .
FRAMES IN Pure ALOHA NETWORK
2013-4-6 www.i-world-tech.blogspot.in 43
44. Procedure for pure aloha protocol
2013-4-6 www.i-world-tech.blogspot.in 44
45. VULNERABLE TIME : is the time in which there is a possibility of
collision.
fig:- Vulnerable time in pure ALOHA protocol
2013-4-6 www.i-world-tech.blogspot.in 45
46. THROUGHTPUT :- is the average number of successful
transmission.
o FOR pure ALOHA
S=G*e-2G
where G is the average number of frames generated by the
system .
2013-4-6 www.i-world-tech.blogspot.in 46
47. In slotted ALOHA we divide the time into slots of Tfr s and
force the stations to send only one at the beginning of the time slot.
2013-4-6 www.i-world-tech.blogspot.in 47
48. VULNERABLE TIME :- is now reduced to one half i.e T fr
Fig :- Vulnerable time for slotted ALOHA protocol .
2013-4-6 www.i-world-tech.blogspot.in 48
49. Throughput :- the average number of successful transmission
for slotted ALOHA is
S=G*e-G
The maximum number throughput Smax =0.368 when G=1.
2013-4-6 www.i-world-tech.blogspot.in 49
50. CSMA requires that each station first lisens to the medium
before sending .
The possibility of collision still exist because of propagation delay
; when a station sends a frame, it still takes time for the first bit to
reach every station and for every station to sense it.
2013-4-6 www.i-world-tech.blogspot.in 50
51. Vulnerable time :- for CSMA is the propagation time Tp .
2013-4-6 www.i-world-tech.blogspot.in 51
52. Persistence methods :- tells what a station should do if
the channel is idle .
3 types of persistence methods
1-persistent
non persistent
p-persistent
2013-4-6 www.i-world-tech.blogspot.in 52
54. CSMA/CD augments the algorithm to handle the collision .Here a station
monitors the medium after it sends a frame to see if the transmission was
successful . If so the station is finished . If however there is a collision , the frame
is send again .
2013-4-6 www.i-world-tech.blogspot.in 54
56. In wired network the received signal has almost the same energy as the sent
signal because the length of the cable is short or there are repeaters that amplify
the energy between the sende and the receiver . This means that in a collision
, the detected energy almost doubles .
Collisions are avoided through the use of CSMA/CA’s three strategies :-
The interframe space (IFS)
The contention window
acknowwledgements
2013-4-6 www.i-world-tech.blogspot.in 56
58. In controlled access , the stations consult one another to find
which station has the right to send .
3 popular controlled access methods are :
1. reservation
2. Polling
3. Token passing
2013-4-6 www.i-world-tech.blogspot.in 58
59. In reservation method , a station needs to make a reservation before sending
the data .In each interval , a reservation frame precedes the data frame in that
interval.
If there are N stations in the system , the are exactly N reservation minis lots
in the reservation frame . Each minis lot belong to a station . When a station
needs to send a data frame , it makes a reservation in its own minis lot.
2013-4-6 www.i-world-tech.blogspot.in 59
60. Polling works with topologies in which one device is
designated as a primary station and the other devices are
secondary stations.
All data exchanges must be made through the primary device
even when the ultimate destination is a secondary device.
The primary device controls the link.
The secondary devices follow its instructions.
2013-4-6 www.i-world-tech.blogspot.in 60
61. Select Function
The select function is used whenever the primary device has something to
send.
Remember that the primary controls the link. If the primary is neither sending
nor receiving data, it knows the link is available.
Poll Function
The poll function is used by the primary device to solicit transmissions from the
secondary devices.
When the primary is ready to receive data, it must ask (poll) each
device in turn if it has anything to send.
2013-4-6 www.i-world-tech.blogspot.in 61
63. Logical Ring:
In a token-passing network, stations do not have to be
physically connected in a ring. the ring can be a logical one.
2013-4-6 www.i-world-tech.blogspot.in 63
64. In the token-passing method, the stations in a network are
organized in a logical ring.
In other words, for each station, there is a predecessor and a
successor.
The predecessor is the station which is logically before the
station in the ring;
the successor is the station which is after the station in the
ring.
2013-4-6 www.i-world-tech.blogspot.in 64
66. The transmitted bit stream by the physical layer is not
guaranteed to be error free.
It is up to the data-link layer to detect, and if necessary, to
correct errors.
The data-link layer breaks 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.
2013-4-6 www.i-world-tech.blogspot.in 66
67. Frames Are The Small data Units Created By Data Link
Layer And The Process Of Creating Frames By The Data
Link Layer Is Known As Framing.
The easiest way to achieve framing is to insert time gaps
between frames.
Networks rarely make any guarantees about timing.
2013-4-6 www.i-world-tech.blogspot.in 67
68. 1. Character Count.
2. Starting & Ending Characters With Character Stuffing.
3. Starting & ending Flags With Bit Stuffing.
4. Physical Layer Coding Violation.
2013-4-6 www.i-world-tech.blogspot.in 68
69. This Method Specifies The Number Of Characters That Are
Present In particular Frame.
This Information Is specified By using a Special Field In the
Header Frame.
The problem with Character count algorithm is that the
count can be distorted by a transmission error.
2013-4-6 www.i-world-tech.blogspot.in 69
70. In this Method Frame Starts & End With a special Character
That Mark The Beginning & End Of Frame.
Each character Begins With the ASCII Character Sequence DLE
STX (data link Escape Start Of Text ) And End With ASCII Character
Sequence DLE ETX (data link escape End Of text)
2013-4-6 www.i-world-tech.blogspot.in 70
72. In this Method , Each Begins & Ends With a Special Bit pattern
01111110 Called Flags.
There for Each frame starts With 01111110& also Ends with
01111110.
The Main Problem arises in this Method When The Flag byte
01111110 Appear as data.
This Problem Is Handled By technique called Bit stuffing That
Is similar To character stuffing.
2013-4-6 www.i-world-tech.blogspot.in 72
74. This Framing Method Is Used only In those network In which
Encoding On The Physical Medium Contain some Redundancy.
Some LANs Encode Each Bit Of Data By using two Physical Bit
i.e. Manchester coding is Used.
In this method Bit 1 Is encoded into high-low(10) Pair And Bit 0
Is Encoded Into low-high(01)pair shown in figure.
2013-4-6 www.i-world-tech.blogspot.in 74
76. FDMA - Large room divided up into small rooms. Each pair of
people takes turns speaking.
TDMA – Large room divided up into small rooms. Three pairs of
people per room, however, each pair gets 20 seconds to speak.
CDMA – No small rooms. Everyone is speaking in different
languages. If voice volume is minimized, the number of people
is maximized.
2013-4-6 www.i-world-tech.blogspot.in 76
78. Flexible bit rate
No frequency guard band required
No need for precise narrowband filters
Easy for mobile or base stations to initiate and execute hands
off
Extended battery life
TDMA installations offer savings in base station
equipment, space and maintenance
The most cost-effective technology for upgrading a current
analog system to digital
2013-4-6 www.i-world-tech.blogspot.in 78
79. Requires network-wide timing synchronization
Requires signal processing fro matched filtering and
correlation detection
Demands high peak power on uplink in transient mode
Multipath distortion
2013-4-6 www.i-world-tech.blogspot.in 79
80. Number of FDMA Channels
In the U.S. each cellular carrier is allocated 416 channels where:
2013-4-6 www.i-world-tech.blogspot.in 80
81. If channel is not in use, it sits idle
Channel bandwidth is relatively narrow (30kHz)
Simple algorithmically, and from a hardware standpoint
Fairly efficient when the number of stations is small and
the traffic is uniformly constant
Capacity increase can be obtained by reducing the
information bit rate and using efficient digital code
No need for network timing
No restriction regarding the type of baseband or type of
modulation
2013-4-6 www.i-world-tech.blogspot.in 81
82. The presence of guard bands
Requires right RF filtering to minimize adjacent channel
interference
Maximum bit rate per channel is fixed
Small inhibiting flexibility in bit rate capability
Does not differ significantly from analog system
2013-4-6 www.i-world-tech.blogspot.in 82
84. Many users of CDMA use the same frequency, TDD or FDD may
be used
Multipath fading may be substantially reduced because of
large signal bandwidth
No absolute limit on the number of users
Easy addition of more users
Impossible for hackers to decipher the code sent
Better signal quality
No sense of handoff when changing cells
2013-4-6 www.i-world-tech.blogspot.in 84
85. As the number of users increases, the overall quality of
service decreases
Self-jamming
Near- Far- problem arises
2013-4-6 www.i-world-tech.blogspot.in 85
87. Flow control refers to a set of procedures (protocols)
used to restrict the amount of data that the sender can
send before waiting for acknowledgment.
It is one of the most important duties of the data
link layer.
2013-4-6 www.i-world-tech.blogspot.in 87
88. Now let us see how the data link layer can combine
framing, flow control, and error control by using protocols to
achieve the delivery of data from one node to another.
We divide the discussion of protocols as follows -
2013-4-6 www.i-world-tech.blogspot.in 88
89. All the protocols we discuss are unidirectional.
Although special frames, called acknowledgment (ACK)
and negative acknowledgment(NAK) can flow in the opposite
direction for flow and error control purposes, data flow in only
one direction.
2013-4-6 www.i-world-tech.blogspot.in 89
90. An ideal channel in which no frames are
lost, duplicated, or corrupted.
We introduce two protocols for this type of channel.
1. Simplest Protocol
2. Stop-and-wait
2013-4-6 www.i-world-tech.blogspot.in 90
91. We assume that the receiver can immediately handle any
frame it receives with a processing time that is small
enough to be negligible.
The data link layer of the receiver immediately removes
the header from the frame and hands the data packet to its
network layer, which can also accept the packet
immediately.
2013-4-6 www.i-world-tech.blogspot.in 91
94. The sender sends one frame, stops until it receives confirmation
from the receiver (okay to go ahead), and then sends the next frame.
2013-4-6 www.i-world-tech.blogspot.in 94
98. Although the Stop-and-Wait Protocol gives us an idea of
how to add flow control to its predecessor, noiseless channels
are nonexistent.
We discuss three protocols in this section that use error
control.
1. Stop-and-Wait Automatic Repeat Request
2. Go-Back-N Automatic Repeat Request
3. Selective Repeat Automatic Repeat Request
2013-4-6 www.i-world-tech.blogspot.in 98
99. Adds a simple error control mechanism to the Stop-and-Wait
Protocol.
When the frame arrives at the receiver site, it is checked and if
it is corrupted, it is silently discarded. The detection of errors
in this protocol is manifested by the silence of the receiver.
The corrupted and lost frames need to be resent in this
protocol.
2013-4-6 www.i-world-tech.blogspot.in 99
100. To identify a frame we number the frames.
Error correction in Stop-and-Wait ARQ is done by
keeping a copy of the sent frame and retransmitting of the
frame when the timer expires.
The ACK frame for this protocol has a sequence number
field.
2013-4-6 www.i-world-tech.blogspot.in 100
101. Sequence number
In Stop-and-Wait ARQ, we use sequence numbers to number the
frames. The sequence numbers are based on modulo-2 arithmetic.
Acknowledgement number
In Stop-and-Wait ARQ, the acknowledgment number always
announces in modulo-2 arithmetic the sequence number of the next
frame expected.
2013-4-6 www.i-world-tech.blogspot.in 101
106. In this protocol we can send several frames before receiving
acknowledgments; we keep a copy of these frames until the
acknowledgments arrive.
Sequence number
In the Go-Back-N Protocol, the sequence numbers are
modulo 2 raise to the power m, where m is the size of the
sequence number field in bits.
2013-4-6 www.i-world-tech.blogspot.in 106
107. Sliding Window
In this protocol, the sliding window is an abstract concept that defines the range
of sequence numbers that is the concern of the sender and receiver.
The range which is the concern of the sender is called the send sliding window;
the range that is the concern of the receiver is called the receive sliding window.
2013-4-6 www.i-world-tech.blogspot.in 107
108. Sliding Window
The send window is an abstract concept defining an imaginary box of size 2m-
1 with three variables: Sf, Sn and Ssize.
The send window can slide one or more slots when a valid acknowledgment
arrives.
2013-4-6 www.i-world-tech.blogspot.in 108
109. Sliding Window
The receive window is an abstract concept defining an imaginary box of size
1 with one single variable Rn• The window slides when a correct frame has
arrived; sliding occurs one slot at a time.
2013-4-6 www.i-world-tech.blogspot.in 109
114. This protocol does not resend N frames when just one frame is damaged.
It is more efficient for noisy links, but the processing at the receiver is
more complex.
Windows
The send window maximum size can be 2 raise to the power (m-1)
2013-4-6 www.i-world-tech.blogspot.in 114
115. The size of the receive window is the same as the size of the send
window (2m- I ).
The Selective Repeat Protocol allows as many frames as the size of the
receive window to arrive out of order and be kept until there is a set of in-
order frames to be delivered to the network layer.
2013-4-6 www.i-world-tech.blogspot.in 115
121. Data Link Layer makes the physical layer appears error-free to the
upper layer (Network Layer).
The data Link Layer is responsible for the Moving frames from
one hop (node) to the next.
The data Link Layer adds reliability to the physical layer by
adding mechanisms to detect and retransmit or lost frames.
it also uses a mechanism to recognize duplicate frames.
Ethernet uses a 6-byte (48 bits) Physical Address That is
Imprinted on The Network Interface card (NIC) .
2013-4-6 www.i-world-tech.blogspot.in 121
122. When nodes or stations are connected and use a common link
, called a multipoint or broadcast link , we need a multiple-access
protocol to coordinate access to the link.
The data-link layer breaks the bit stream up into discrete frames
and compute the checksum for each frame.
Flow control refers to a set of procedures (protocols) used to
restrict the amount of data that the sender can send before waiting
for acknowledgment.
Although the Stop-and-Wait Protocol gives us an idea of how to
add flow control to its predecessor, noiseless channels are
nonexistent.
2013-4-6 www.i-world-tech.blogspot.in 122
123. Data Communication and Networking Fourth Edition
Behrouz A. Forouzan and Sophia Chung Fegan
Computer Network 4th Edition
By Tanenbaum
www.wikipedia.com
www.google.com
2013-4-6 www.i-world-tech.blogspot.in 123