SlideShare a Scribd company logo
1 of 18
1
Data Link Layer
Prepared by
Hassanein Alwan Malik
2018
University Of Technology Iraq
Master of Science
2
Introduction.
In this chapter we will study the design principles for the second layer in our
model, the data link layer. This study deals with algorithms for achieving
reliable, efficient communication of whole units of information called frames
(rather than individual bits, as in the physical layer) between two adjacent
machines. By adjacent, we mean that the two machines are connected by a
communication channel that acts conceptually like a wire (e.g., a coaxial
cable, telephone line, orwireless channel). The essential property ofa channel
that makes it ‘‘wire-like’’ is that the bits are delivered in exactly the same
order in which they are sent.
3.1 DATA LINK LAYER DESIGN ISSUES
The data link layer uses the services of the physical layer to send and receive
bits over communication channels. It has a number of functions, including:
1. Providing a well-defined service interface to the network layer.
2. Dealing with transmission errors.
3. Regulating the flow of data so that slow receivers are not swamped by fast
senders.
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 Figure below
3
3.1.1 Services Provided to the Network Layer
Principal Service Function of the data link layer is to transfer the data from
the network layer on the source machine to the network layer on the
destination machine.
Process in the network layer that hands some bits to the data link layer for
transmission,
Job of data link layer is to transmit the bits to the destination machine so they
can be handed over to the network layer there
4
The actual services that are offered vary from protocol to protocol. Three
reasonable possibilities that we will consider in turn are:
1. Unacknowledged connectionless service.
2. Acknowledged connectionless service.
3. Acknowledged connection-oriented service.
1- Unacknowledged connectionless service.
Consists of having the source machine send independent frames to the
destination machine without having the destination machine acknowledge
them. Ethernet is a good example of a data link layer that provides this
class of service. If a frame is lost due to noise on the line, no attempt is
made to detect the loss or recover from it in the data link layer. This class
of service is appropriate when the error rate is very low, so recovery is left
to higher layers.
2- Acknowledged connectionless service.
There are still no logical connections used, but each frame sent is individually
acknowledged. In this way, the sender knows whether a frame has arrived
correctly or been lost. If it has not arrived within a specified time interval, it
can be sent again. This service is useful over unreliable channels, such as
wireless systems. 802.11 (Wi-Fi) is a good example of this class of service
3- Acknowledged connection-oriented service.
With this service, the sourceand 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.
5
3.1.2 Framing
• To provide service to the network layer, the data link layer must use
the service provided to it by the physical layer.
• If the channel is noisy, as it is for most wireless and some wired links,
the physical layer will add some redundancy to its signals to reduce
the bit error rate to a tolerable level
• The bit stream received by the data link layer is not guaranteed to be
error free.
• Some bits may have different values and the number of bits received
may be less than, equal to, or more than the number of bits
transmitted. It is up to the data link layer to detect and, if necessary,
correct errors.
• The usual approachis for the data link layer to break up the bit
stream into discrete frames, compute a short token called a checksum
for each frame, and include the checksumin the frame when it is
transmitted.
Method Breaking up the bit stream into frames
• 1. Byte count.
• 2. Flag bytes with byte stuffing.
• 3. Flag bits with bit stuffing.
• 4. Physical layer coding violations.
6
1. Byte count
The first framing method uses a field in the header to specify the number of
characters in the frame. When the data link layer at the destination sees the
character count, it knows how many characters follow and hence where the
end of the frame is. This technique is shown in Fig for four frames of sizes 5,
5, 8, and 8 characters, respectively.
7
2. Flag bytes with byte stuffing.
The second framing method each frame start and end with
special bytes called a flag byte, is used as both the starting
and ending delimiter. This byte is shown in Fig. below as
FLAG.
The sender’s data link layer insert a special escape byte (ESC) The
data link layer on the receiving end removes the escapebytes before
giving the data to the network layer. This technique is called byte
stuffing.
8
3. Flag bits with bit stuffing
When the receiver sees five consecutive incoming 1 bits,
followed by a 0 bit , it automatically destuffs (i.e., deletes)
the 0 bit , If the user data contain the flag pattern, 01111110,
this flag is transmitted as 011111010 but stored in the
receiver’s memory as 01111110.Figure 3-5 gives an example
of bit stuffing.
9
3-1-3 Error Control
Having solved the problem of marking the start and end of each frame, we
come to the next problem: how to make sure all frames are eventually
delivered to the network layer at the destination and in the proper order.
The usual way to ensure reliable delivery is to provide the sender with some
feedback aboutwhat is happening at the other end of the line. Typically, the
protocolcalls for the receiver to send back special control frames bearing
positive or negative acknowledgements aboutthe 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.
3.1.4 Flow Control
• Important Design issue for the cases when the sender is running on a
fast powerful computer and receiver is running on a slow low-end
machine.
• Two approaches:
• 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.
• 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.
10
3.2 ERROR DETECTION AND CORRECTION
• Network designers have developed two basic strategies to deal with
errors:
1. Include enough redundant information to enable the receiver to
deduce what the transmitted data must have been.
Error correcting codes.
2. Include only enough redundancy to allow the receiver to deduce
that an error has occurred (but not which error).
Error detecting codes.
• On channels that are highly reliable, such as fiber, it is cheaper to use
an error-detecting code
• However, on channels such as wireless links that make many errors, it
is better to add redundancy to each block so that the receiver is able to
figure out what the originally transmitted block was
Error-Correcting Codes:
We will examine four different error-correcting codes:
1. Hamming codes.
2. Binary convolutional codes.
3. Reed-Solomoncodes.
4. Low-Density Parity Check codes.
11
1- Hamming Code
Hamming codeis used for error correction and detection. In Hamming
codes the bits of the codeword are numbered consecutively, starting
with bit 1 at the left end, bit 2 to its immediate right, and so on. The bits
that are powers of 2 (1, 2, 4, 8, 16, etc.) are parity bits. The rest (3, 5, 6,
7, 9, etc.) are filled up with the n data bits.
Example: Find the parity bits ofthe following codeword using hamming code:
11000100
Solution:
N = number of bites
K= number of bites added
2k ≥ n+k
Range of data bites Number of K
2 – 4 3
5 – 11 4
12 – 26 5
1 2 3 4 5 6 7 8 9 10 11 12
P1 P2 1 P4 1 0 0 P8 0 1 0 0
P1=XOR = {11000}
P1 = 0
P2 =XOR = {10010}
12
P2 = 0
P4 = XOR = {1000}
P4 = 1
P8 = XOR = {0100}
P8 = 1
1 2 3 4 5 6 7 8 9 10 11 12
0 0 1 1 1 0 0 1 0 1 0 0
CODWORD = 001110010100
Prove: -
All values of C should be zero
C1 = 011000 = 0
C2 = 010010 = 0
C4 = 11000 = 0
C8 = 10100 = 0
13
2- Convolutional code.
Not a block code
There is no natural message size or encoding boundary as in
a block code.
The output depends on the current and previous input bits.
Encoder has memory.
The number of previous bits on which the output depends is
called the constraint length of the code.
They are deployed as part of the
 GSM mobile phone system
3- Reed-Solomon codes.
Like Hamming codes, Reed-Solomon codes are linear block codes, and they
are often systematic too.
Reed-Solomon codes are block-based error correcting codes with a wide
range of applications in digital communications and storage. Reed-Solomon
codes are used to correct errors in many systems including:
 Storage devices (including tape, Compact Disk, DVD, barcodes, etc)
 Wireless or mobile communications (including cellular telephones,
microwave links, etc)
 Satellite communications
 Digital television / DVB
 High-speed modems such as ADSL, xDSL, etc.
14
 LDPC (Low-Density Parity Check) code.
LDPC codes are linear block codes, In an LDPC code, each output bit
is formed from only a fraction of the input bits. This leads to a matrix
representation of the codethat has a low density of 1s, hence the name
for the code. The received code words are decoded with an
approximation algorithm that iteratively improves on a best fit of the
received data to a legal codeword. This corrects errors.
1.2.2 Error-Detecting Codes
Error-correcting codes are widely used on wireless links, which are
notoriously noisy and error prone when compared to optical fibers. Without
error-correcting codes.
The following three error detecting codes will be discussed in this section:
1. Parity bit.
2. Checksums.
3. Cyclic Redundancy Checks (CRCs).
1- A parity bit
A bit that is added to a group of source bits to ensure that the number of set
bits (i.e., bits with value 1) in the outcome is even or odd. It is a very simple
scheme that can be used to detect single or any other odd number (i.e., three,
five, etc.) of errors in the output. An even number of flipped bits will make
the parity bit appear correct even though the data is erroneous.
• For example, when 1011010 is sent in even parity, a bit is added to the
end to make it 10110100. With odd parity 1011010 becomes
10110101.
15
2- A checksum of a message is
The word ‘‘checksum’’is often used to mean a group of check bits
associated with a message.
The checksum is usually placed at the end of the message, as the
complement of the sum function.
One example of a checksum is the 16-bit Internet checksum used on
all Internet packets as part of the IP protocol
3- A cyclic redundancy check (CRC)
Also known as a polynomial code. Polynomial codes are based upon
treating bit strings as representations of polynomials with coefficients
of 0 and 1 only.
Polynomial arithmetic: It does not have carries for addition or borrows
for subtraction. Both addition and subtraction are identical to
exclusive OR. For example:
3.3ELEMENTARY DATA LINK PROTOCOLS
Work only in one direction (simplex)
1- Utopian Simplex Protocol
Data are transmitted in one direction only. Both the transmitting and
receiving network layers are always ready. Processing time can be ignored.
Infinite buffer spaceis available. And best of all, the communication
channel between the data link layers never damages orloses frames
16
2- Simplex Stop-and-Wait Protocolfor an Error-Free Channel
 The communication channel is still assumed to be error free,
 The data traffic is still simplex.
 The sender sends adata block and waits, until an acknowledgement from
the receiver arrives or a timeout is reached.
 Incorrect blocks are repeated, otherwise the next block is sent.
 Disadvantage: large waiting periods between the transmissions of single
blocks. Thus much transmission capacity is wasted.
1- A Simplex Stop-and-Wait Protocol for an Error-Nosie
Channel
1- Communication channel makes errors
2- Frames may be damaged or lost completely
3- If frame is damaged, receiver detects errors
4- The main difference between this protocols forsimple stop-and-wait is
that the receiver knows which seqnum to expect and sender known which
seqnum to send.
2- SLIDING WINDOW PROTOCOLS
In the previous protocols, dataframes were transmitted in one direction
only.
In mostpractical situations, there is a need to transmit data in both directions
1- Must be able to transmit data in both directions, one way of
achieving full-duplex data transmit ion is to run two instances , each using a
separate link, each link comprised of :
 Forward channel (for data).
 Reverse channel (for acknowledgement)
2- same link fordata in bothdirections, and the reverse channelhas the same
capacity as the forward channel
3- sending and receiving windows do not have to be the same size,
windows can be fixed size or dynamically growing and shrinking
17
Sliding window protocols:
1- One-Bit sliding Window Protocol
This protocol has buffer size of one bit, so only possibility for sender and
receiver to send and receive packet is only 0 and 1. This protocol includes
Sequence, Acknowledge, and Packet number
2- A Protocol Using Go Back N
The sending-window size enables the sender to send multiple frames without
receiving the acknowledgement of the previous ones. The receiving-window
enables the receiver to receive multiple frames and acknowledge them. The
receiver keeps track of incoming frame’s sequence number
When the sender sends all the frames in window, it checks up to what
sequence number it has received positive acknowledgement. If all frames are
positively acknowledged, the sender sends next set of frames. If sender finds
that it has not receive any ACK for a particular frame, it retransmits all the
frames after which it does not receive any positive ACK, So the protocol
called Go back N.
18
3- A Protocol Using Selective Repeat
Protocolusing Go back N is good when the errors are rare, but if the line is
poor, it wastes a lot of bandwidth on retransmitted frames. So to provide
reliability, Selective repeat protocol was introduced. In this protocol The
receiver has a buffer reserved for each sequence number within its fixed
window.as we can see in the figure (b) if the 2nd packet comes with error than
the receiver will acceptthe 3rd packet but it sends NAK of2 to the sender and
buffer the 3rd packet. Receiver do the same thing in 4th and 5th packet. When
the senderreceiver the NAK of2nd packet it immediately send the 2nd packet
to the receiver. After receiving the 2nd packet, receiver send the ACK of 5th
one as saying that it received up to 5 packet. So there is no need to resend 3rd
, 4th and 5th packet again, they are buffered in the receiver side.
Whenever a frame arrives, its sequence number is checked by the function to
see if it falls within the window, if so and if it has not already been received,
it is accepted and stored. This action is taken whether it is not expected by the
network layer.

More Related Content

What's hot

IEEE standards 802.3.&802.11
IEEE standards 802.3.&802.11IEEE standards 802.3.&802.11
IEEE standards 802.3.&802.11Keshav Maheshwari
 
Chapter 11: Data Link Control
Chapter 11: Data Link ControlChapter 11: Data Link Control
Chapter 11: Data Link ControlJeoffnaRuth
 
Lecture 7 8 ad hoc wireless media access protocols
Lecture 7 8 ad hoc wireless media access protocolsLecture 7 8 ad hoc wireless media access protocols
Lecture 7 8 ad hoc wireless media access protocolsChandra Meena
 
Wireless Network Architecture
Wireless Network ArchitectureWireless Network Architecture
Wireless Network ArchitecturePawandeep Singh
 
Computer Networks Unit 2 UNIT II DATA-LINK LAYER & MEDIA ACCESS
Computer Networks Unit 2 UNIT II DATA-LINK LAYER & MEDIA ACCESSComputer Networks Unit 2 UNIT II DATA-LINK LAYER & MEDIA ACCESS
Computer Networks Unit 2 UNIT II DATA-LINK LAYER & MEDIA ACCESSDr. SELVAGANESAN S
 
The Data Link Layer
The Data Link LayerThe Data Link Layer
The Data Link Layerrobbbminson
 
Computer Network - Network Layer
Computer Network - Network LayerComputer Network - Network Layer
Computer Network - Network LayerManoj Kumar
 
W-LAN (Wireless Local Area Network)
W-LAN (Wireless Local Area Network)W-LAN (Wireless Local Area Network)
W-LAN (Wireless Local Area Network)Parvesh Taneja
 
Switching Concepts presentation
Switching Concepts presentationSwitching Concepts presentation
Switching Concepts presentationzameer Abbas
 
ISSUES IN AD HOC WIRELESS NETWORKS
ISSUES IN  AD HOC WIRELESS  NETWORKS ISSUES IN  AD HOC WIRELESS  NETWORKS
ISSUES IN AD HOC WIRELESS NETWORKS Dushhyant Kumar
 

What's hot (20)

IEEE standards 802.3.&802.11
IEEE standards 802.3.&802.11IEEE standards 802.3.&802.11
IEEE standards 802.3.&802.11
 
Chapter 11: Data Link Control
Chapter 11: Data Link ControlChapter 11: Data Link Control
Chapter 11: Data Link Control
 
Lecture 7 8 ad hoc wireless media access protocols
Lecture 7 8 ad hoc wireless media access protocolsLecture 7 8 ad hoc wireless media access protocols
Lecture 7 8 ad hoc wireless media access protocols
 
Wireless Network Architecture
Wireless Network ArchitectureWireless Network Architecture
Wireless Network Architecture
 
X.25
X.25X.25
X.25
 
Computer Networks Unit 2 UNIT II DATA-LINK LAYER & MEDIA ACCESS
Computer Networks Unit 2 UNIT II DATA-LINK LAYER & MEDIA ACCESSComputer Networks Unit 2 UNIT II DATA-LINK LAYER & MEDIA ACCESS
Computer Networks Unit 2 UNIT II DATA-LINK LAYER & MEDIA ACCESS
 
Data link layer
Data link layer Data link layer
Data link layer
 
Frame relay
Frame relayFrame relay
Frame relay
 
The Data Link Layer
The Data Link LayerThe Data Link Layer
The Data Link Layer
 
X.25 protocol
X.25 protocolX.25 protocol
X.25 protocol
 
Point to-point protocol (ppp)
Point to-point protocol (ppp)Point to-point protocol (ppp)
Point to-point protocol (ppp)
 
computer network OSI layer
computer network OSI layercomputer network OSI layer
computer network OSI layer
 
Mobile IP
Mobile IPMobile IP
Mobile IP
 
Computer Network - Network Layer
Computer Network - Network LayerComputer Network - Network Layer
Computer Network - Network Layer
 
W-LAN (Wireless Local Area Network)
W-LAN (Wireless Local Area Network)W-LAN (Wireless Local Area Network)
W-LAN (Wireless Local Area Network)
 
Switching Concepts presentation
Switching Concepts presentationSwitching Concepts presentation
Switching Concepts presentation
 
Data Link Layer
Data Link LayerData Link Layer
Data Link Layer
 
IEEE 802.11
IEEE 802.11IEEE 802.11
IEEE 802.11
 
ISSUES IN AD HOC WIRELESS NETWORKS
ISSUES IN  AD HOC WIRELESS  NETWORKS ISSUES IN  AD HOC WIRELESS  NETWORKS
ISSUES IN AD HOC WIRELESS NETWORKS
 
Network Layer
Network LayerNetwork Layer
Network Layer
 

Similar to Data link layer

U2CH1Data Link Layerxxxxxxxxxxxxxxxxx.pptx
U2CH1Data Link Layerxxxxxxxxxxxxxxxxx.pptxU2CH1Data Link Layerxxxxxxxxxxxxxxxxx.pptx
U2CH1Data Link Layerxxxxxxxxxxxxxxxxx.pptxk2w9psdb96
 
CN R16 -UNIT-3.pdf
CN R16 -UNIT-3.pdfCN R16 -UNIT-3.pdf
CN R16 -UNIT-3.pdfJoshuaeeda1
 
datalinklayermukesh-150130061041-conversion-gate01.pptx
datalinklayermukesh-150130061041-conversion-gate01.pptxdatalinklayermukesh-150130061041-conversion-gate01.pptx
datalinklayermukesh-150130061041-conversion-gate01.pptxlathass5
 
Jaimin chp-3 - data-link layer- 2011 batch
Jaimin   chp-3 - data-link layer- 2011 batchJaimin   chp-3 - data-link layer- 2011 batch
Jaimin chp-3 - data-link layer- 2011 batchJaimin Jani
 
data link layer - Chapter 3
data link layer - Chapter 3data link layer - Chapter 3
data link layer - Chapter 3SakthiVinoth78
 
Chapter 2.1.1.pptx
Chapter 2.1.1.pptxChapter 2.1.1.pptx
Chapter 2.1.1.pptxbotAlert
 
Dcn ppt on data link layer
Dcn ppt on data link layerDcn ppt on data link layer
Dcn ppt on data link layerroma bora
 
Dcn ppt by roma
Dcn ppt by romaDcn ppt by roma
Dcn ppt by romaboraroma
 
Lecture 2 data link layer 1 v1
Lecture 2 data link layer 1 v1Lecture 2 data link layer 1 v1
Lecture 2 data link layer 1 v1Ronoh Kennedy
 
mod-3-cn-ppt (1).pdf bca bsc btech notes
mod-3-cn-ppt (1).pdf bca bsc btech notesmod-3-cn-ppt (1).pdf bca bsc btech notes
mod-3-cn-ppt (1).pdf bca bsc btech notesanandhakrishnankv
 
data link layer to print
data link layer to printdata link layer to print
data link layer to printBishalWosti1
 
Chapter 4 data link layer
Chapter 4 data link layerChapter 4 data link layer
Chapter 4 data link layerNaiyan Noor
 
unit2-210710110327.pdf
unit2-210710110327.pdfunit2-210710110327.pdf
unit2-210710110327.pdfssuser3aa461
 

Similar to Data link layer (20)

U2CH1Data Link Layerxxxxxxxxxxxxxxxxx.pptx
U2CH1Data Link Layerxxxxxxxxxxxxxxxxx.pptxU2CH1Data Link Layerxxxxxxxxxxxxxxxxx.pptx
U2CH1Data Link Layerxxxxxxxxxxxxxxxxx.pptx
 
CN R16 -UNIT-3.pdf
CN R16 -UNIT-3.pdfCN R16 -UNIT-3.pdf
CN R16 -UNIT-3.pdf
 
DLL
DLLDLL
DLL
 
Unit 2
Unit 2Unit 2
Unit 2
 
datalinklayermukesh-150130061041-conversion-gate01.pptx
datalinklayermukesh-150130061041-conversion-gate01.pptxdatalinklayermukesh-150130061041-conversion-gate01.pptx
datalinklayermukesh-150130061041-conversion-gate01.pptx
 
datalinklayermukesh
datalinklayermukeshdatalinklayermukesh
datalinklayermukesh
 
Jaimin chp-3 - data-link layer- 2011 batch
Jaimin   chp-3 - data-link layer- 2011 batchJaimin   chp-3 - data-link layer- 2011 batch
Jaimin chp-3 - data-link layer- 2011 batch
 
data link layer - Chapter 3
data link layer - Chapter 3data link layer - Chapter 3
data link layer - Chapter 3
 
Chapter 2.1.1.pptx
Chapter 2.1.1.pptxChapter 2.1.1.pptx
Chapter 2.1.1.pptx
 
Dcn ppt on data link layer
Dcn ppt on data link layerDcn ppt on data link layer
Dcn ppt on data link layer
 
Dcn ppt by roma
Dcn ppt by romaDcn ppt by roma
Dcn ppt by roma
 
Unit 2 ppt 3.ppt
Unit 2 ppt 3.pptUnit 2 ppt 3.ppt
Unit 2 ppt 3.ppt
 
III_UNIT.pptx
III_UNIT.pptxIII_UNIT.pptx
III_UNIT.pptx
 
III_UNIT.pptx
III_UNIT.pptxIII_UNIT.pptx
III_UNIT.pptx
 
Lecture 2 data link layer 1 v1
Lecture 2 data link layer 1 v1Lecture 2 data link layer 1 v1
Lecture 2 data link layer 1 v1
 
mod-3-cn-ppt (1).pdf bca bsc btech notes
mod-3-cn-ppt (1).pdf bca bsc btech notesmod-3-cn-ppt (1).pdf bca bsc btech notes
mod-3-cn-ppt (1).pdf bca bsc btech notes
 
data link layer to print
data link layer to printdata link layer to print
data link layer to print
 
Chapter 4 data link layer
Chapter 4 data link layerChapter 4 data link layer
Chapter 4 data link layer
 
unit2-210710110327.pdf
unit2-210710110327.pdfunit2-210710110327.pdf
unit2-210710110327.pdf
 
Unit 2 [autosaved]
Unit 2 [autosaved]Unit 2 [autosaved]
Unit 2 [autosaved]
 

More from Hassanein Alwan

More from Hassanein Alwan (9)

Feasibility study
Feasibility studyFeasibility study
Feasibility study
 
ARABIC TEXT MINING AND ROUGH SET THEORY FOR DECISION SUPPORT SYSTEM.
ARABIC TEXT MINING AND ROUGH SET THEORY FOR DECISION SUPPORT SYSTEM.ARABIC TEXT MINING AND ROUGH SET THEORY FOR DECISION SUPPORT SYSTEM.
ARABIC TEXT MINING AND ROUGH SET THEORY FOR DECISION SUPPORT SYSTEM.
 
Community Engagement
Community EngagementCommunity Engagement
Community Engagement
 
Data Management
Data ManagementData Management
Data Management
 
video comparison
video comparison video comparison
video comparison
 
Planning for contingencies
Planning for contingenciesPlanning for contingencies
Planning for contingencies
 
data replication
data replicationdata replication
data replication
 
deep learning
deep learningdeep learning
deep learning
 
Project Organizations
Project Organizations Project Organizations
Project Organizations
 

Recently uploaded

Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementmkooblal
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfphamnguyenenglishnb
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxChelloAnnAsuncion2
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 
Atmosphere science 7 quarter 4 .........
Atmosphere science 7 quarter 4 .........Atmosphere science 7 quarter 4 .........
Atmosphere science 7 quarter 4 .........LeaCamillePacle
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Celine George
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxEyham Joco
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfSpandanaRallapalli
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Jisc
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.arsicmarija21
 

Recently uploaded (20)

Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
Rapple "Scholarly Communications and the Sustainable Development Goals"
Rapple "Scholarly Communications and the Sustainable Development Goals"Rapple "Scholarly Communications and the Sustainable Development Goals"
Rapple "Scholarly Communications and the Sustainable Development Goals"
 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of management
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 
Atmosphere science 7 quarter 4 .........
Atmosphere science 7 quarter 4 .........Atmosphere science 7 quarter 4 .........
Atmosphere science 7 quarter 4 .........
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptx
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdf
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.
 

Data link layer

  • 1. 1 Data Link Layer Prepared by Hassanein Alwan Malik 2018 University Of Technology Iraq Master of Science
  • 2. 2 Introduction. In this chapter we will study the design principles for the second layer in our model, the data link layer. This study deals with algorithms for achieving reliable, efficient communication of whole units of information called frames (rather than individual bits, as in the physical layer) between two adjacent machines. By adjacent, we mean that the two machines are connected by a communication channel that acts conceptually like a wire (e.g., a coaxial cable, telephone line, orwireless channel). The essential property ofa channel that makes it ‘‘wire-like’’ is that the bits are delivered in exactly the same order in which they are sent. 3.1 DATA LINK LAYER DESIGN ISSUES The data link layer uses the services of the physical layer to send and receive bits over communication channels. It has a number of functions, including: 1. Providing a well-defined service interface to the network layer. 2. Dealing with transmission errors. 3. Regulating the flow of data so that slow receivers are not swamped by fast senders. 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 Figure below
  • 3. 3 3.1.1 Services Provided to the Network Layer Principal Service Function of the data link layer is to transfer the data from the network layer on the source machine to the network layer on the destination machine. Process in the network layer that hands some bits to the data link layer for transmission, Job of data link layer is to transmit the bits to the destination machine so they can be handed over to the network layer there
  • 4. 4 The actual services that are offered vary from protocol to protocol. Three reasonable possibilities that we will consider in turn are: 1. Unacknowledged connectionless service. 2. Acknowledged connectionless service. 3. Acknowledged connection-oriented service. 1- Unacknowledged connectionless service. Consists of having the source machine send independent frames to the destination machine without having the destination machine acknowledge them. Ethernet is a good example of a data link layer that provides this class of service. If a frame is lost due to noise on the line, no attempt is made to detect the loss or recover from it in the data link layer. This class of service is appropriate when the error rate is very low, so recovery is left to higher layers. 2- Acknowledged connectionless service. There are still no logical connections used, but each frame sent is individually acknowledged. In this way, the sender knows whether a frame has arrived correctly or been lost. If it has not arrived within a specified time interval, it can be sent again. This service is useful over unreliable channels, such as wireless systems. 802.11 (Wi-Fi) is a good example of this class of service 3- Acknowledged connection-oriented service. With this service, the sourceand 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.
  • 5. 5 3.1.2 Framing • To provide service to the network layer, the data link layer must use the service provided to it by the physical layer. • If the channel is noisy, as it is for most wireless and some wired links, the physical layer will add some redundancy to its signals to reduce the bit error rate to a tolerable level • The bit stream received by the data link layer is not guaranteed to be error free. • Some bits may have different values and the number of bits received may be less than, equal to, or more than the number of bits transmitted. It is up to the data link layer to detect and, if necessary, correct errors. • The usual approachis for the data link layer to break up the bit stream into discrete frames, compute a short token called a checksum for each frame, and include the checksumin the frame when it is transmitted. Method Breaking up the bit stream into frames • 1. Byte count. • 2. Flag bytes with byte stuffing. • 3. Flag bits with bit stuffing. • 4. Physical layer coding violations.
  • 6. 6 1. Byte count The first framing method uses a field in the header to specify the number of characters in the frame. When the data link layer at the destination sees the character count, it knows how many characters follow and hence where the end of the frame is. This technique is shown in Fig for four frames of sizes 5, 5, 8, and 8 characters, respectively.
  • 7. 7 2. Flag bytes with byte stuffing. The second framing method each frame start and end with special bytes called a flag byte, is used as both the starting and ending delimiter. This byte is shown in Fig. below as FLAG. The sender’s data link layer insert a special escape byte (ESC) The data link layer on the receiving end removes the escapebytes before giving the data to the network layer. This technique is called byte stuffing.
  • 8. 8 3. Flag bits with bit stuffing When the receiver sees five consecutive incoming 1 bits, followed by a 0 bit , it automatically destuffs (i.e., deletes) the 0 bit , If the user data contain the flag pattern, 01111110, this flag is transmitted as 011111010 but stored in the receiver’s memory as 01111110.Figure 3-5 gives an example of bit stuffing.
  • 9. 9 3-1-3 Error Control Having solved the problem of marking the start and end of each frame, we come to the next problem: how to make sure all frames are eventually delivered to the network layer at the destination and in the proper order. The usual way to ensure reliable delivery is to provide the sender with some feedback aboutwhat is happening at the other end of the line. Typically, the protocolcalls for the receiver to send back special control frames bearing positive or negative acknowledgements aboutthe 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. 3.1.4 Flow Control • Important Design issue for the cases when the sender is running on a fast powerful computer and receiver is running on a slow low-end machine. • Two approaches: • 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. • 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.
  • 10. 10 3.2 ERROR DETECTION AND CORRECTION • Network designers have developed two basic strategies to deal with errors: 1. Include enough redundant information to enable the receiver to deduce what the transmitted data must have been. Error correcting codes. 2. Include only enough redundancy to allow the receiver to deduce that an error has occurred (but not which error). Error detecting codes. • On channels that are highly reliable, such as fiber, it is cheaper to use an error-detecting code • However, on channels such as wireless links that make many errors, it is better to add redundancy to each block so that the receiver is able to figure out what the originally transmitted block was Error-Correcting Codes: We will examine four different error-correcting codes: 1. Hamming codes. 2. Binary convolutional codes. 3. Reed-Solomoncodes. 4. Low-Density Parity Check codes.
  • 11. 11 1- Hamming Code Hamming codeis used for error correction and detection. In Hamming codes the bits of the codeword are numbered consecutively, starting with bit 1 at the left end, bit 2 to its immediate right, and so on. The bits that are powers of 2 (1, 2, 4, 8, 16, etc.) are parity bits. The rest (3, 5, 6, 7, 9, etc.) are filled up with the n data bits. Example: Find the parity bits ofthe following codeword using hamming code: 11000100 Solution: N = number of bites K= number of bites added 2k ≥ n+k Range of data bites Number of K 2 – 4 3 5 – 11 4 12 – 26 5 1 2 3 4 5 6 7 8 9 10 11 12 P1 P2 1 P4 1 0 0 P8 0 1 0 0 P1=XOR = {11000} P1 = 0 P2 =XOR = {10010}
  • 12. 12 P2 = 0 P4 = XOR = {1000} P4 = 1 P8 = XOR = {0100} P8 = 1 1 2 3 4 5 6 7 8 9 10 11 12 0 0 1 1 1 0 0 1 0 1 0 0 CODWORD = 001110010100 Prove: - All values of C should be zero C1 = 011000 = 0 C2 = 010010 = 0 C4 = 11000 = 0 C8 = 10100 = 0
  • 13. 13 2- Convolutional code. Not a block code There is no natural message size or encoding boundary as in a block code. The output depends on the current and previous input bits. Encoder has memory. The number of previous bits on which the output depends is called the constraint length of the code. They are deployed as part of the  GSM mobile phone system 3- Reed-Solomon codes. Like Hamming codes, Reed-Solomon codes are linear block codes, and they are often systematic too. Reed-Solomon codes are block-based error correcting codes with a wide range of applications in digital communications and storage. Reed-Solomon codes are used to correct errors in many systems including:  Storage devices (including tape, Compact Disk, DVD, barcodes, etc)  Wireless or mobile communications (including cellular telephones, microwave links, etc)  Satellite communications  Digital television / DVB  High-speed modems such as ADSL, xDSL, etc.
  • 14. 14  LDPC (Low-Density Parity Check) code. LDPC codes are linear block codes, In an LDPC code, each output bit is formed from only a fraction of the input bits. This leads to a matrix representation of the codethat has a low density of 1s, hence the name for the code. The received code words are decoded with an approximation algorithm that iteratively improves on a best fit of the received data to a legal codeword. This corrects errors. 1.2.2 Error-Detecting Codes Error-correcting codes are widely used on wireless links, which are notoriously noisy and error prone when compared to optical fibers. Without error-correcting codes. The following three error detecting codes will be discussed in this section: 1. Parity bit. 2. Checksums. 3. Cyclic Redundancy Checks (CRCs). 1- A parity bit A bit that is added to a group of source bits to ensure that the number of set bits (i.e., bits with value 1) in the outcome is even or odd. It is a very simple scheme that can be used to detect single or any other odd number (i.e., three, five, etc.) of errors in the output. An even number of flipped bits will make the parity bit appear correct even though the data is erroneous. • For example, when 1011010 is sent in even parity, a bit is added to the end to make it 10110100. With odd parity 1011010 becomes 10110101.
  • 15. 15 2- A checksum of a message is The word ‘‘checksum’’is often used to mean a group of check bits associated with a message. The checksum is usually placed at the end of the message, as the complement of the sum function. One example of a checksum is the 16-bit Internet checksum used on all Internet packets as part of the IP protocol 3- A cyclic redundancy check (CRC) Also known as a polynomial code. Polynomial codes are based upon treating bit strings as representations of polynomials with coefficients of 0 and 1 only. Polynomial arithmetic: It does not have carries for addition or borrows for subtraction. Both addition and subtraction are identical to exclusive OR. For example: 3.3ELEMENTARY DATA LINK PROTOCOLS Work only in one direction (simplex) 1- Utopian Simplex Protocol Data are transmitted in one direction only. Both the transmitting and receiving network layers are always ready. Processing time can be ignored. Infinite buffer spaceis available. And best of all, the communication channel between the data link layers never damages orloses frames
  • 16. 16 2- Simplex Stop-and-Wait Protocolfor an Error-Free Channel  The communication channel is still assumed to be error free,  The data traffic is still simplex.  The sender sends adata block and waits, until an acknowledgement from the receiver arrives or a timeout is reached.  Incorrect blocks are repeated, otherwise the next block is sent.  Disadvantage: large waiting periods between the transmissions of single blocks. Thus much transmission capacity is wasted. 1- A Simplex Stop-and-Wait Protocol for an Error-Nosie Channel 1- Communication channel makes errors 2- Frames may be damaged or lost completely 3- If frame is damaged, receiver detects errors 4- The main difference between this protocols forsimple stop-and-wait is that the receiver knows which seqnum to expect and sender known which seqnum to send. 2- SLIDING WINDOW PROTOCOLS In the previous protocols, dataframes were transmitted in one direction only. In mostpractical situations, there is a need to transmit data in both directions 1- Must be able to transmit data in both directions, one way of achieving full-duplex data transmit ion is to run two instances , each using a separate link, each link comprised of :  Forward channel (for data).  Reverse channel (for acknowledgement) 2- same link fordata in bothdirections, and the reverse channelhas the same capacity as the forward channel 3- sending and receiving windows do not have to be the same size, windows can be fixed size or dynamically growing and shrinking
  • 17. 17 Sliding window protocols: 1- One-Bit sliding Window Protocol This protocol has buffer size of one bit, so only possibility for sender and receiver to send and receive packet is only 0 and 1. This protocol includes Sequence, Acknowledge, and Packet number 2- A Protocol Using Go Back N The sending-window size enables the sender to send multiple frames without receiving the acknowledgement of the previous ones. The receiving-window enables the receiver to receive multiple frames and acknowledge them. The receiver keeps track of incoming frame’s sequence number When the sender sends all the frames in window, it checks up to what sequence number it has received positive acknowledgement. If all frames are positively acknowledged, the sender sends next set of frames. If sender finds that it has not receive any ACK for a particular frame, it retransmits all the frames after which it does not receive any positive ACK, So the protocol called Go back N.
  • 18. 18 3- A Protocol Using Selective Repeat Protocolusing Go back N is good when the errors are rare, but if the line is poor, it wastes a lot of bandwidth on retransmitted frames. So to provide reliability, Selective repeat protocol was introduced. In this protocol The receiver has a buffer reserved for each sequence number within its fixed window.as we can see in the figure (b) if the 2nd packet comes with error than the receiver will acceptthe 3rd packet but it sends NAK of2 to the sender and buffer the 3rd packet. Receiver do the same thing in 4th and 5th packet. When the senderreceiver the NAK of2nd packet it immediately send the 2nd packet to the receiver. After receiving the 2nd packet, receiver send the ACK of 5th one as saying that it received up to 5 packet. So there is no need to resend 3rd , 4th and 5th packet again, they are buffered in the receiver side. Whenever a frame arrives, its sequence number is checked by the function to see if it falls within the window, if so and if it has not already been received, it is accepted and stored. This action is taken whether it is not expected by the network layer.