Unit 3 : Data Link Layer
Chandan Gupta Bhagat
https://chandanbhagat.com.np/me
Data Link Layer
 Function of Data Link Layer (DLL)
 Data Link Control: Framing, Flow and Error Control
 Error Detection and Correction
 High Level Data Link Control (HDLC) & Point-to-Point Protocol (PPP)
 Channel Allocation Problem
 Multiple Access:
 Random Access (ALOHA, CSMA, CSMA/CD, CSMA/CA)
 Controlled Access (Reservation, Polling, Token Passing)
 Channelization (FDMA, TDMA, CDMA)
 Wired LAN: Ethernet Standards and FDDI
 Wireless LAN: IEEE 802.11x and Bluetooth Standards
 Token Bus, Token Ring and Virtual LAN
Function of Data Link Layer (DLL)
Functions of Data Link Layer
 Providing a well-defined service interface to the network layer (framing)
 Dealing with transmission errors (error control)
 Regulating the flow of data so that slow receivers are not swamped by
fast senders (flow control)
Data Link Control: Framing, Flow and Error Control
Framing
 It needs to pack the bits into frames, so that each frame is distinguishable from one another
 Prepares a packet for the transport across the local media by encapsulating with a header and trailer to create
frames
 Data Link Layer frame includes
 Data: Packet from Network
 Header: Contains control information, such as Addressing and it is located at the beginning of the Packet Data Unit
 Trailer: Contains control information added to the end of PDU
Header Payload Trailer
Packet
Sending Machine
Header Payload Trailer
Packet
Receiving Machine
Frames
Parts of frames
 Frame Header: Contains the source and the destination addresses of the frame
 Payload Field: Contains the message to be delivered
 Trailer: Contains the error detection and error correction bits
 Flag: Marks the beginning and end of the frame
Flag Header Trailer Flag
Payload Field
MAC and LLC
 Logical Link Layer (LLC)
 Upper Sublayer of the DLL of OSI Model
 Acts as interface between the network layer and the MAC sublayer of DLL
 main purpose is to multiplex the protocols that may concurrently use the MAC layer (like IPv4, IPv6,...).
 It may also be used to retransmit error frames detected by MAC.
 Media Access Control
 On a network, the Network Interface Card (NIC) has an unique hardware address which identifies a computer or device.
 The physical address is utilized for the MAC sublayer addressing.
 Main purpose is framing and to direct those data frames across the network using some kind of addressing
 Handles Error Correction
MAC and LLC
LLC
Layer 3 protocol
Multiplexer / De-multiplexer
Logical Link Services
(Connectionless,
Connection-oriented)
MAC
Broadcast Media
Collision Resolution
Framing/De-framing
Frame header / frame trailer processing
Checksum computation/ Checksum
Verification
LLC
MAC
Physical Layer
LLC
MAC
Physical Layer
Network Layer Packets Network Layer Packets
Data Link Layer
Wired / Wireless Link
LLC
 Destination Service Access Point (DSAP):
 IEEE 802.2 header begins with 1 byte, which identifies the upper-layer processing
 Source Service Access Point (SSAP):
 Following the DSAP Address is the 1 byte address. which identifies the sending upper layer process
 Control:
 It employs 3 different formats depending on the type of LLC used
 Information (I) Frame: Carries upper-layer information and some control information.
 Supervisory (S) Frame: Provides control information. An S frame can request and suspend transmission, reports on status, and
acknowledge receipt of I frames.
 Unnumbered (U) Frame: Used for control purposes and is not sequenced. A U frame can be used to initialize secondaries.
Depending on the function of the U frame, its Control field is 1 or 2 bytes. Some U frames have an Information field.
 Data:
 Variable-length field bounded by the MAC format implemented.
DSAP SSAP Control Data
Figure: LLC Frame Format
MAC
 An error-detection technique used widely in today’s computer networks is based on cyclic redundancy check
(CRC) codes.
 CRC codes are also known as polynomial codes.
Control Header Source Address LLC Data CRC
Figure: MAC Frame Format
Destination Address
Framing
 In the physical layer, data transmission involves synchronised transmission of bits from the source to the destination. The data link
layer packs these bits into frames.
 Data-link layer takes the packets from the Network Layer and encapsulates them into frames. If the frame size becomes too large,
then the packet may be divided into small sized frames. Smaller sized frames makes flow control and error control more efficient.
 Then, it sends each frame bit-by-bit on the hardware. At receiver’s end, data link layer picks up signals from hardware and
assembles them into frames.
 Parts of a Frame
 Frame Header: It contains the source and the destination addresses of the frame.
 Payload field: It contains the message to be delivered.
 Trailer: It contains the error detection and error correction bits.
 Flag: It marks the beginning and end of the frame.
Types of Framing
 Fixed-sized Framing
 The size of the frame is fixed and so the frame length acts as delimiter of the frame.
 Consequently, it does not require additional boundary bits to identify the start and end of the frame.
 Example − ATM cells.
 Variable – Sized Framing
 The size of each frame to be transmitted may be different.
 Additional mechanisms are kept to mark the end of one frame and the beginning of the next frame.
 It is used in local area networks.
Variable Size Frame
Two ways to define frame delimiters in variable sized framing
 Length Field
 A length field is used that determines the size of the frame.
 It is used in Ethernet.
 End Delimiter:
 A pattern is used as a delimiter to determine the size of frame.
 If the pattern occurs in the message, then two approaches are used to avoid the situation
 Byte-Stuffing:
 A byte is stuffed in the message to differentiate from the delimiter.
 This is also called character-oriented framing.
 Bit-Stuffing:
 A pattern of bits of arbitrary length is stuffed in the message to differentiate from the delimiter.
 This is also called bit-oriented framing.
Byte Stuffing
Flag Header 
.. Flag
Trailer
Data from Upper layer
Variable Number of Characters
Byte Stuffing: process of adding 1 byte whenever there is a flag or escape characters in the text
Flag ESC
Flag Header ESC Flag ESC ESC Trailer Flag
Byte Stuffing
Sending Machine
Data Link Frame Sent
Flag ESC
Flag Header ESC Flag ESC ESC Trailer Flag
Byte Un-stuffing
Receiving Machine
Data Link Frame Received
Data From Network Layer
Data to Network Layer
In byte stuffing, a special byte called the escape character (ESC) is stuffed
before every byte in the message with the same pattern as the flag byte. If
the ESC sequence is found in the message byte, then another ESC byte is
stuffed before it.
Byte Stuffing
Flag Header Payload Field Flag
Trailer
A frame delimited by flag bytes
Flag
A B Flag
A B
ESC
Original Characters After Stuffing
ESC
A B ESC
A B
ESC
Flag
A B Flag
A B
ESC ESC ESC
ESC
ESC
A B ESC
A B
ESC ESC ESC
ESC
Four Examples of byte sequences before and after byte stuffing
Bit Stuffing
00011111111010100011111001
Flag Header 00111110111010100111110001 Trailer Flag
Bit Stuffing
Frame Sent
Bit Un-stuffing
Receiving Machine
Data Link Frame Received
Data From Network Layer
Data to Network Layer
In bit stuffing, we add one extra 0 whenever 5 consecutive 1’s follow a 0 in the
data
Flag Header 00111110111010100111110001 Trailer Flag
00011111111010100011111001
Receiving Machine
Bit Stuffing
0110111111100111110111111111100000
Input Stream
01101111101100111110011111011111000000
Stuffed Stream
0110111111100111110111111111100000
Unstuffed Stream
Stuffed bits
Flow Control
 Flow control coordinates the amount of the data that can be sent before receiving acknowledgement
 In most protocols, flow control is a set of procedures that tells the sender how much data it can transmit
before it must wait for an acknowledgement from the receiver
 When a data frame (Layer-2 data) is sent from one host to another over a single medium, it is required that the
sender and receiver should work at the same speed.
 Sender sends at a speed on which the receiver can process and accept the data.
 What if the speed (hardware/software) of the sender or receiver differs?
 If sender is sending too fast the receiver may be overloaded, (swamped) and data may be lost.
Flow Control
Protocols
For Noiseless Channel For Noisy Channel
Simplest
Stop-and-Wait
Stop-and-Wait ARQ
Go Back N ARQ
Selective Repeat ARQ
Flow Control
 Simplest
 Simplest Protocol is one that has no flow or error control
 It is a unidirectional protocol in which data frames are traveling in only one direction-from the sender to receiver.
 Can be assumed 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.
Flow Control
Sender Receiver
Time Time
Request
Request
Request
Arrival
Arrival
Arrival
Flow Control
 Flow control restricts the number of frames the sender can send before it waits for an acknowledgment from the receiver.
 Data link layer uses feedback-based flow control mechanisms. There are two main techniques
 Stop and wait:
 Send one frame at a time
 Sends a frame and waits for acknowledgement
 After the receiver receives the frame, it sends acknowledgement frame back to sender
 On receiving the acknowledgment frame, the sender understands that the receiver is ready to accept the next frame. So it sender
the next frame in queue.
 Sliding window:
 Send Several frame at a time
 Improves the efficiency of stop and wait protocol by allowing multiple frames to be transmitted before receiving acknowledgement
Flow Control: Stop and Wait
Sender
Network
Data Link
Physical
Get Data
Send Frame
Receiver
Network
Data Link
Physical
Deliver Data
Receive Frame
Data Frames
Request from network Layer
Algorithm for sender site
Event:
Repeat Forever
Notification from physical
layer
Algorithm for receiver site
Event:
Repeat Forever
Flow Control
Frame
Frame
ACK
ACK
Propagation
Delay
Transmission
Delay
Start Transmit End Transmit
Receiver
Sender
End of transmit of
ACK
Last Bit
Received
Last Bit of ACK
Received
‱ Advantages
‱ Simple and each frame is checked and
acknowledged
‱ Disadvantages
‱ Only one frame can be in transmission
at a time
‱ Inefficient, if the distance is long
between devices
‱ Reason is propagation delay is much
longer than the transmission delay
Flow Control: Sliding Window
 This protocol improves the efficiency of stop and wait protocol by allowing multiple frames to be transmitted
before receiving an acknowledgment.
 The working principle of this protocol can be described as follows
 Both the sender and the receiver has finite sized buffers called windows. The sender and the receiver agrees upon the
number of frames to be sent based upon the buffer size.
 The sender sends multiple frames in a sequence, without waiting for acknowledgment. When its sending window is
filled, it waits for acknowledgment. On receiving acknowledgment, it advances the window and transmits the next
frames, according to the number of acknowledgments received.
 Each frame has to be numbered in relation to the sliding window. For a window of size n, frames get a number
from 0 to n - 1.
Flow Control: Sliding Window
 For example, if n = 8, the frames are numbered 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1...so on. The size of
the window is (n -1) = 7.
 When the receiver sends an ACK containing the number 5, it means all frames upto number 4 have been
received.
 If the window size is sufficiently large the sender can continuously transmit packets:
 If W >= (2a+1), sender can transmit continuously. (Efficiency =1)
 If W < (2a+1), sender can transmit W frames every (2a+1) time units. (Efficiency = W/(1+2a) )
Error Control
 Data frame may be lost or may be corrupted
 Sender might be unaware of the loss of the data frame
 Both sender and receiver are quipped with some protocols which helps them to detect error
 Sender might retransmit or receiver may send request to resend the data-frame
Error Control
 Requirements for the error control mechanism
 Error detection: The sender and receiver, either both or any, must ascertain that there is some error in the transit.
 Positive ACK: When the receiver receives a correct frame, it should acknowledge it.
 Negative ACK: When the receiver receives a damaged frame or a duplicate frame, it sends a NACK back to the sender
and the sender must retransmit the correct frame.
 Retransmission: The sender maintains a clock and sets a timeout period. If an acknowledgement of a data-frame
previously transmitted does not arrive before the timeout, the sender retransmits the frame, thinking that the frame or
its acknowledgement is lost in transit.
Error Control
 3 types of technique to control the errors by Automatic Repeat Requests
 Stop and Wait ARQ
 Go-Back-N ARQ
 Selective Repeat ARQ
Stop and Wait ARQ
 The sender maintains a timeout counter.
 When a frame is sent, the sender starts the timeout counter.
 If acknowledgement of frame comes in time, the sender transmits the next frame in queue.
 If acknowledgement does not come in time, the sender assumes that either the frame or its
acknowledgement is lost in transit. Sender retransmits the frame and starts the timeout counter.
 If a negative acknowledgement is received, the sender retransmits the frame.
Stop and Wait ARQ
Sender
Timeout
Timeout
Timeout
Receiver
Go-Back-N ARQ
 Stop and wait ARQ mechanism does not utilize the resources at their best. When the acknowledgement is
received, the sender sits idle and does nothing. In Go-Back-N ARQ method, both sender and receiver maintain
a window
 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 received NACK or has not receive any ACK for a particular frame, it retransmits all the
frames after which it does not receive any positive ACK..
Go-Back-N ARQ
Sender
Set timer for 0
Receiver
ACK 0
X
Set timer for 1
Set timer for 2
Close timer for 0 and send 3
Close timer for 1 and send 4
Send all frames again
Selective Repeat ARQ
 In Go-back-N ARQ, it is assumed that the receiver does not have any buffer space for its window size and has
to process each frame as it comes. This enforces the sender to retransmit all the frames which are not
acknowledged
 In Selective-Repeat ARQ, the receiver while keeping track of sequence numbers, buffers the frames in memory
and sends NACK for only frame which is missing or damaged.The sender in this case, sends only packet for
which NACK is received
Selective Repeat ARQ
Sender
Set timer for 0
Receiver
ACK 0
X
Set timer for 1
Set timer for 2
Close timer for 0 and send 3
Close timer for 1 and send 4
Send frame 2 again
Error Detection and Correction
Error Detection
Many factors including line noise can alter
or wipe out one or more bits of a given
data unit. Reliable systems must have
mechanism for detecting and correcting
such errors. Error detection and correction
are implemented either at the data link
layer or the transport layer of the OSI
model.
Types of Errors
Single Bit
(Only one bit in the data
unit has changed)
Burst
(2 or more bit in the data
unit has changed) 0 0 0 0 1 0 1 0 0 0 0 0 0 0 1 0
O changed to 1
Single Bit Error
0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0
Burst Error
0 0 0 1 1 0 1 1 0 0 0 0 0 0 1 0
Corrupted Bits
Length of Burst Error
is 5
Sent
Received
When data is transmitted from one device to another device, the
system does not guarantee whether the data received by the
device is identical to the data transmitted by another device.
An Error is a situation when the message received at the receiver
end is not identical to the message transmitted.
Single Bit Error
 In the above figure, the message which is sent is corrupted as single-bit, i.e., 0 bit is changed to 1.
 The only one bit of a given data unit is changed from 1 to 0 or from 0 to 1.
 Single-Bit Error does not appear more likely in Serial Data Transmission. For example, Sender
sends the data at 10 Mbps, this means that the bit lasts only for 1’s and for a single-bit error to
occurred, a noise must be more than 1’s.
 Single-Bit Error mainly occurs in Parallel Data Transmission. For example, if eight wires are used to
send the eight bits of a byte, if one of the wire is noisy, then single-bit is corrupted per byte.
0 0 0 0 1 0 1 0 0 0 0 0 0 0 1 0
O changed to 1
Single Bit Error
Burst
 The two or more bits are changed from 0 to 1 or from 1 to 0 is known as Burst Error. The Burst
Error is determined from the first corrupted bit to the last corrupted bit.
 The duration of noise in Burst Error is more than the duration of noise in Single- Bit.
 Burst Errors are most likely to occur in Serial Data Transmission.
 The number of affected bits depends on the duration of the noise and data rate.
0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0
Burst Error
0 0 0 1 1 0 1 1 0 0 0 0 0 0 1 0
Corrupted Bits
Length of Burst Error
is 5
Sent
Received
Error Detection and Correction
 Single Parity Check
 Two-Dimensional Parity Check
 Checksum
 Cyclic Redundancy Check
Single Parity Check
 Single Parity checking is the simple mechanism and inexpensive to detect the errors.
 In this technique, a redundant bit is also known as a parity bit which is appended at the end
of the data unit so that the number of 1s becomes even.
 If the number of 1s bits is odd, then parity bit 1 is appended and if the number of 1s bits is even,
then parity bit 0 is appended at the end of the data unit.
 At the receiving end, the parity bit is calculated from the received data bits and compared with the
received parity bit.
 This technique generates the total number of 1s even, so it is known as even- parity checking.
‱ 1 is added to the block if it contains odd number of 1’s, and
‱ 0 is added if it contains even number of 1’s
Single Parity Check
‱ 1 is added to the block if it contains odd number of 1’s, and
‱ 0 is added if it contains even number of 1’s
Sender Receiver
Transmission Media
1011011
Compute Parity bit
1011011
Compute Parity bit
Good?
1 1011011 1
Yes
No
Accept Data
Reject Data
Single Parity Check
Drawbacks Of Single Parity Checking
 It can only detect single-bit errors which are very rare.
 If two bits are interchanged, then it cannot detect the errors.
‱ 1 is added to the block if it contains odd number of 1’s, and
‱ 0 is added if it contains even number of 1’s
0 0 0 0 1 0 1 0 0 0 1 0 0 0 1 0
Unable to Detect
Single Bit Error
Two-Dimensional Parity Check
 Performance can be improved by using Two-Dimensional Parity Check which organizes
the data in the form of a table.
 Parity check bits are computed for each row, which is equivalent to the single-parity check.
 In Two-Dimensional Parity check, a block of bits is divided into rows, and the redundant row of
bits is added to the whole block.
 At the receiving end, the parity bits are compared with the parity bits computed
from the received data.
Two-Dimensional Parity Check
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, then both are
sent along with the data. At the receiving
end these are compared with the parity
bits calculated on the received data.
1 0 0 0 0 1 0 0 1 1 1 0 0 0 1 0 0 0 1 0 0 1 0 0 1 0 0 0 0 1 0 0
1 0 0 0 0 1 0 0
1 1 1 0 0 0 1 0
0 0 1 0 0 1 0 0
1 0 0 0 0 1 0 0
1 1 0 0 0 1 1 0
0
0
0
0
1 0 0 0 0 1 0 0 0 1 1 1 0 0 0 1 0 0 0 0 1 0 0 1 0 0 0 1 0 0 0 0 1 0 0 0 1 1 0 0 0 1 1 0 0
0
Row Parities
Column Parities
Original Data
Data to be sent
‱ If two bits in one data unit are corrupted
and two bits exactly the same position in
another data unit are also corrupted, then
2D Parity checker will not be able to detect
the error.
‱ This technique cannot be used to detect
the 4-bit errors or more in some cases.
Drawbacks
Two-Dimensional Parity Check
1 0 0 0 0 1 0 0 1 1 1 0 0 0 1 0 0 0 1 0 0 1 0 0 1 0 0 0 0 1 0 0
1 0 0 0 0 1 0 0
1 1 1 0 0 0 1 0
0 0 1 0 0 1 0 0
1 0 0 0 0 1 0 0
1 1 0 0 0 1 1 0
0
0
0
0
1 0 0 0 0 1 0 0 0 1 1 1 0 0 0 1 0 0 0 0 1 0 0 1 0 0 0 1 0 0 0 0 1 0 0 0 1 1 0 0 0 1 1 0 0
0
Row Parities
Column Parities
Original Data
Data to be sent
Checksum
 In checksum error detection scheme, the data is divided into k segments each of m bits.
 In the sender’s end the segments are added using 1’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.
 At the receiver’s end, all received segments are added using 1’s complement arithmetic to get the
sum. The sum is complemented.
 If the result is zero, the received data is accepted; otherwise discarded.
Checksum
.
.
Section1 n bits
Section 2 n bits
Checksum All 0s
Section K n bits
Sum n bits
Complement n bits
Sender
Checksum
.
.
Section1 n bits
Section 2 n bits
Checksum All 0s
Section K n bits
Sum n bits
Complement n bits
Receiver
Result
Data + Checksum
Packet
n bits
If result = 0; Keep
Else Discard
Checksum
1 0 0 1 1 0 0 1 1 1 1 0 0 0 1 0 0 0 1 0 0 1 0 0 1 0 0 0 0 1 0 0
Original Data
1 2 3 4
1 0 0 1 1 0 0 1
1 1 1 0 0 0 1 0
0 1 1 1 1 0 1 1
1
0 1 1 1 1 1 0 0
0 0 1 0 0 1 0 0
1 0 1 0 0 0 0 0
1 0 0 0 0 1 0 0
0 0 1 0 0 1 0 0
1
0 0 1 0 0 1 0 1
1 1 0 1 1 0 1 0
1
1
1
2
3
4
Sum
Checksum
Sender
1 0 0 1 1 0 0 1
1 1 1 0 0 0 1 0
0 1 1 1 1 0 1 1
1
0 1 1 1 1 1 0 0
0 0 1 0 0 1 0 0
1 0 1 0 0 0 0 0
1 0 0 0 0 1 0 0
0 0 1 0 0 1 0 0
1
0 0 1 0 0 1 0 1
1 1 0 1 1 0 1 0
1
1
1
2
3
4
Sum
Checksum
Receiver
Conclusion: Accept Data
k=4, m=8
Cyclic Redundancy Check (CRC)
 CRC is a redundancy error technique used to determine the error.
 Following are the steps used in CRC for error detection:
 In CRC technique, a string of n 0s is appended to the data unit, and this n number is less than the number of bits in a
predetermined number, known as division which is n-1 bits.
 Secondly, the newly extended data is divided by a divisor using a process is known as binary division. The remainder
generated from this division is known as CRC remainder.
 Thirdly, the CRC remainder replaces the appended 0s at the end of the original data. This newly generated unit is sent to
the receiver.
 The receiver receives the data followed by the CRC remainder. The receiver will treat this whole unit as a single unit, and
it is divided by the same divisor that was used to find the CRC remainder.
 If the resultant of this division is zero which means that it has no error, and the data is accepted.
 If the resultant of this division is not zero which means that the data consists of an error. Therefore, the data is
discarded.
Cyclic Redundancy Check (CRC)
Sender
1 1 0 0 1
1 0 1
1 1 0
1 0 1
1 1 1
1 0 1
1 0
1 1
1 0 1
Divisor
Data Bits
Receiver
1 1 0 0 1 1 0
1 0 1
1 1 0
1 0 1
1 1 1
1 0 1
1 0 1
1 1 1
1 0 1
Divisor
Data Bits + CRC
1 0 1
0 0 0
No Error
Cyclic Redundancy Check (CRC)
Sender
1 0 1 0 0 0 0 0 0 0
1 0 0 1
0 0 1 1 0 0 0 0 0 0
1 0 0 1
0 1 0 1 0 0 0 0
1 0 0 1
0 0 1 1 0 0 0
1 0 0 1
1 0 0 1
0 1 0 1 0
1 0 0 1
0 0 1 1
Message to be transmitted
1 0 1 0 0 0 0 0 0 0
+ 0 1 1
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
1 0 1 0 0 0 0 0 1 1
1 0 1 0 0 0 0 0 1 1
1 0 0 1
0 0 1 1 0 0 0 0 1 1
1 0 0 1
0 1 0 1 0 0 1 1
1 0 0 1
0 0 1 1 0 1 1
1 0 0 1
1 0 0 1
0 1 0 0 1
1 0 0 1
0 0 0 0
Receiver
Zero means data is accepted
Original Message
@
@
@
@
@
@
@
@
@
@
@ => X-OR
Generator polynomial
x3+1
1.x3+0.x2+0.x1+1.x0
CRC Generator
1 0 0 1
Error Correction Techniques
 Error Correction Techniques
 Error Correction codes are used to detect and correct the errors when data is transmitted from the sender to
the receiver.
 Error Correction can be handled in two ways:
 Backward error correction: Once the error is discovered, the receiver requests the sender to retransmit the entire data
unit.
 Forward error correction: In this case, the receiver uses the error-correcting code which automatically corrects the
errors.
 A single additional bit can detect the error, but cannot correct it.
 For correcting the errors, one has to know the exact position of the error. For example, If we want to calculate a single-
bit error, the error correction code will determine which one of seven bits is in error. To achieve this, we have to add
some additional redundant bits.
Error Correcting Codes
 Along with detecting code, we have to pass the some data to figure out the original message from the corrupt
message that we received.
 Error correcting codes also deploys the same strategy as error-detecting codes but such codes also detect the
exact location of corrupt bits
 parity check has a simple way to detect errors along with a sophisticated mechanism to determine the corrupt
bit location. Once the corrupt bit is located, its value is reverted (from 0 to 1 or 1 to 0) to get the original
message
How to Detect and Correct the Errors?
 To detect and correct the errors, additional bits are added to the data bits at the time of transmission.
 The additional bits are called parity bits. They allow detection or correction of the errors.
 The data bits along with the parity bits form a code word.
Hamming Code
 Parity bits: The bit which is appended to the original data of binary bits so that the total number of 1s is even
or odd.
 Even parity: To check for even parity, if the total number of 1s is even, then the value of the parity bit is 0. If the
total number of 1s occurrences is odd, then the value of the parity bit is 1.
 Odd Parity: To check for odd parity, if the total number of 1s is even, then the value of parity bit is 1. If the total
number of 1s is odd, then the value of parity bit is 0.
Hamming Code : Algorithm (General)
 Write the bit positions starting from 1 in binary form (1, 10, 11, 100, etc).
 All the bit positions that are a power of 2 are marked as parity bits (1, 2, 4, 8, etc).
 All the other bit positions are marked as data bits.
 Each data bit is included in a unique set of parity bits, as determined its bit position in binary form.
 Parity bit 1 covers all the bits positions whose binary representation includes a 1 in the least significant position (1, 3, 5, 7, 9, 11, etc).
 Parity bit 2 covers all the bits positions whose binary representation includes a 1 in the second position from the least significant bit (2, 3, 6, 7, 10, 11, etc).
 Parity bit 4 covers all the bits positions whose binary representation includes a 1 in the third position from the least significant bit (4–7, 12–15, 20–23, etc).
 Parity bit 8 covers all the bits positions whose binary representation includes a 1 in the fourth position from the least significant bit bits (8–15, 24–31, 40–47, etc).
 In general, each parity bit covers all bits where the bitwise AND of the parity position and the bit position is non-zero.
 Since we check for even parity set a parity bit to 1 if the total number of ones in the positions it checks is odd.
 Set a parity bit to 0 if the total number of ones in the positions it checks is even. Determining the position of redundant bits, These
redundancy bits are placed at the positions which correspond to the power of 2
Hamming Code : Example
 Suppose the original data is 1010 which is to be sent.
 Total number of data bits 'd' = 4
 Number of redundant bits r :
 2r >= d+r+1
 2r>= 4+r+1
 Therefore, the value of r is 3 that satisfies the above relation.
 Total number of bits = d+r = 4+3 = 7;
Hamming Code : Example
 Determining the position of the redundant bits:
 The number of redundant bits is 3. The three bits are represented by r1, r2, r4. The position of the redundant
bits is calculated with corresponds to the raised power of 2. Therefore, their corresponding positions are 1, 21,
22.
 The position of r1 = 1 The position of r2 = 2 The position of r4 = 4
 Representation of Data on the addition of parity bits:
1 0 1 r4 0 r2 r1
7 6 5 4 3 2 1
Hamming Code : Example
 Determining r1 bit : The r1 bit is calculated by performing a parity check on the bit positions whose binary
representation includes 1 in the first position.
 We observe from the above figure that the bit positions that includes 1 in the first position are 1, 3, 5, 7. Now,
we perform the even-parity check at these bit positions. The total number of 1 at these bit positions
corresponding to r1 is even, therefore, the value of the r1 bit is 0.
1 0 1 r4 0 r2 r1
7 6 5 4 3 2 1
r1
Hamming Code : Example
 Determining r2 bit : The r2 bit is calculated by performing a parity check on the bit positions whose binary
representation includes 1 in the second position.
 We observe from the above figure that the bit positions that includes 1 in the second position are 2, 3, 6, 7.
Now, we perform the even-parity check at these bit positions. The total number of 1 at these bit positions
corresponding to r2 is odd, therefore, the value of the r2 bit is 1.
1 0 1 r4 0 r2 0
7 6 5 4 3 2 1
r2
Hamming Code : Example
 Determining r4 bit : The r4 bit is calculated by performing a parity check on the bit positions whose binary
representation includes 1 in the third position.
 We observe from the above figure that the bit positions that includes 1 in the third position are 4, 5, 6, 7. Now,
we perform the even-parity check at these bit positions. The total number of 1 at these bit positions
corresponding to r4 is even, therefore, the value of the r4 bit is 0.
1 0 1 r4 0 1 0
7 6 5 4 3 2 1
r4
1 0 1 0 0 1 0
7 6 5 4 3 2 1
Hamming Code : Example
 Suppose the 4th bit is changed from 0 to
1 at the receiving end, then parity bits
are recalculated.
 R1 bit
 The bit positions of the r1 bit are 1,3,5,7
 We observe from the above figure that the binary
representation of r1 is 1100. Now, we perform the even-
parity check, the total number of 1s appearing in the r1 bit
is an even number. Therefore, the value of r1 is 0.
1 0 1 0 0 1 0
7 6 5 4 3 2 1
1 0 1 1 0 1 0
7 6 5 4 3 2 1
r1
Hamming Code : Example
 R2 bit
 The bit positions of r2 bit are 2,3,6,7.
 We observe from the above figure that the binary
representation of r2 is 1001. Now, we perform the even-
parity check, the total number of 1s appearing in the r2 bit
is an even number. Therefore, the value of r2 is 0.
1 0 1 0 0 1 0
7 6 5 4 3 2 1
1 0 1 0 0 1 0
7 6 5 4 3 2 1
r2
Hamming Code : Example
 R4 bit
 The bit positions of r4 bit are 4,5,6,7.
 We observe from the above figure that the binary
representation of r4 is 1011. Now, we perform the even-parity
check, the total number of 1s appearing in the r4 bit is an
odd number. Therefore, the value of r4 is 1.
 The binary representation of redundant bits, i.e., r4r2r1 is 100,
and its corresponding decimal value is 4. Therefore, the error
occurs in a 4th bit position. The bit value must be changed
from 1 to 0 to correct the error.
1 0 1 0 0 1 0
7 6 5 4 3 2 1
1 0 1 1 0 1 0
7 6 5 4 3 2 1
r4
High Level Data Link Control (HDLC) & Point-to-Point
Protocol (PPP)
High-Level Data Link Control (HDLC)
 High-level Data Link Control (HDLC) is a group of communication protocols of the data link layer for
transmitting data between network points or nodes. Since it is a data link protocol, data is
organized into frames. A frame is transmitted via the network to the destination that verifies its
successful arrival.
 High-level Data Link Control (HDLC) is a bit-oriented protocol for communication over point-to-
point and multipoint links. It implements the ARQ mechanisms.
 HDLC provides two common transfer modes that can be used in different configurations:
 Normal Response Mode (NRM)
 Asynchronous Balanced Mode (ABM).
Normal Response Mode (NRM)
 Here, two types of stations are there, a primary station that send commands and secondary station
that can respond to received commands.
Command
Response
Primary
Secondary
Command
Response
Primary
Secondary Secondary
Response
a. Point-to-point
b. Multipoint
Asynchronous Balanced Mode (ABM)
 Here, the configuration is balanced, i.e. each station can both send commands and respond to
commands. It is used for only point - to - point communications
Command/Response
Command/Response
Stattion
Stattion
Point-to-point
HDLC Frame
Fields of a HDLC Frame
 Flag : It is an 8-bit sequence that marks the beginning and the end of the frame. The bit pattern of the
flag is 01111110.
 Address : It contains the address of the receiver. If the frame is sent by the primary station, it contains the
address(es) of the secondary station(s). If it is sent by the secondary station, it contains the address of the
primary station. The address field may be from 1 byte to several bytes.
 Control : It is 1 /2 bytes containing flow and error control information.
 Payload : This carries the data from the network layer. Its length may vary from one network to another.
 FCS : It is a 2 byte or 4 bytes frame check sequence for error detection. The standard code used is CRC
(cyclic redundancy code)
Flag Address Control Payload FCS Flag
1 byte 1 byte 1/2 byte variable 2 / 4 byte 1 byte
Types of HDLC Frame
 I – Frame
 S – Frame
 U – Frame
Flag Address Control User Information FCS Flag
Flag Address Control FCS Flag
Flag Address Control Management Information FCS Flag
I – Frame
 I-frames or Information frames carry user data from the network layer. They also include flow and
error control information that is piggybacked on user data. The first bit of control field of Iframe is
0.
Flag Address Control User Information FCS Flag
0 P/F
N(S) N(R)
Control Field (1 byte)
N(S) = sequence number of the frame
N(R) = sequence number of the frame expected in return in
two-way communication P/F= Poll/Final
When P/F =1 , it follow two case:
Poll when Frame is sent by a primary station to secondary (
address of receiver) Final when frame is send by secondary to
primary (address of sender)
S - Frame
 − S-frames or Supervisory frames do not contain information field. They are used for flow and error
control when piggybacking is not required. The first two bits of control field of S-frame is 10.
Flag Address Control FCS Flag
1 0 P/F
Code
N(R)
U - Frame
 U-frames or Un-numbered frames are used for myriad miscellaneous functions, like link
management. It may contain an information field, if required. The first two bits of control field of
Uframe is 11.
Flag Address Control Information FCS Flag
1 1 P/F
Code Code
Control Field (1 byte)
Code Command
00 RR Receive Ready
01 REJ Reject
10 RNR Receive Not Ready
11 SREJ Selective Reject
Point-to-Point Protocol
 Point - to - Point Protocol (PPP) is a communication protocol of the data link layer that is used to transmit
multiprotocol data between two directly connected (point-to-point) computers.
 It is a byte - oriented protocol that i s widely use d i n broadband communications having heavy loads and high
speeds.
 Since it is a data link layer protocol, data is transmitted in frames. It is also known as RFC 1661.
 One of the most common protocols for point-to-point access
 Many Internet users who need to connect their home computer to the server of an Internet service provider use
PPP
 A point-to-point link protocol is required to control and manage the transfer of data
Point-to-Point Protocol
 It defines / provides
 the format of the frame to be exchanged between devices
 how two devices negotiate the establishment of the link and the exchange of data
 how network layer data are encapsulated in the data link frame
 how two devices can authenticate each other
 multiple network layer services
 connection over multiple links
 Network address configuration
 But, several services are missing for simplicity
 no flow control, simple error control (detection and discard), no sophisticate addressing for multipoint
configuration
Point-to-Point Frame
 Flag − marks the beginning and the end of the frame. The bit pattern of the flag is 01111110.
 Address – it is set to 11111111 in case of broadcast.
 Control − set to a constant value of 11000000.( No need because PPP has no flow control and limited
error control)
 Protocol − 1 or 2 bytes that define the type of data contained in the payload field.
 Payload − This carries the data from the network layer. The maximum length of the payload field is 1500
bytes. However, this may be negotiated between the endpoints of communication.
 FCS − It is a 2 byte or 4 bytes frame check sequence for error detection. The standard code used is CRC
(cyclic redundancy code)
** PPP is a byte-oriented protocol using byte stuffing with the escape byte 01111101**
Flag Address Control Protocol FCS Flag
1 byte 1 byte 1/2 byte variable 2 / 4 byte 1 byte
Payload
1/2 bytes
Point-to-Point Transition State
Dead Establish
Terminate Authenticate
Open Network
Failed
Carrier Detected
Failed
Network Layer
Configuration
Done
Carrier Dropped
Options agreed
By both sides
Authentication
Successful
If authentication
Not needed
Components of PPP
Point - to - Point Protocol is a layered protocol having three components −
 Encapsulation Component : It encapsulates the datagram so that it can be transmitted over the specified
physical layer.
 Link Control Protocol (LCP) : It is responsible for establishing, configuring, testing, maintaining and
terminating l inks for t ransmission. I t also i mparts negotiation for set up of options and use of features
by the two endpoints of the links.
 Authentication Protocols (AP) : These protocols authenticate endpoints for use of services.
 The two authentication protocols of PPP are:
 Password Authentication Protocol (PAP)
 Challenge Handshake Authentication Protocol (CHAP)
Flag Address Control Protocol FCS Flag
1 byte 1 byte 1/2 byte variable 2 / 4 byte 1 byte
Payload
1/2 bytes
Network Control Protocols (NCPs)
 These protocols are used for negotiating the parameters and facilities for the network layer. For every
higher-layer protocol supported by PPP, one NCP is there. Some of the NCPs of PPP are:
 Internet Protocol Control Protocol (IPCP)
 OSI Network Layer Control Protocol (OSINLCP)
 Internetwork Packet Exchange Control Protocol (IPXCP)
 DECnet Phase IV Control Protocol (DNCP)
 NetBIOS Frames Control Protocol (NBFCP)
 IPv6 Control Protocol (IPV6CP)
Network Control Protocols (NCPs)
Data From Networking Protocols
NCP
IPCP
OSINLCP
IPXCP




AP
PAP
CHAP
LCP
Physical Layer Protocols
Network Layer
Data Link Layer
Physical Layer
Thank you
https://chandanbhagat.com.np/me

Unit 3 - Data Link Layer - Part A

  • 1.
    Unit 3 :Data Link Layer Chandan Gupta Bhagat https://chandanbhagat.com.np/me
  • 2.
    Data Link Layer Function of Data Link Layer (DLL)  Data Link Control: Framing, Flow and Error Control  Error Detection and Correction  High Level Data Link Control (HDLC) & Point-to-Point Protocol (PPP)  Channel Allocation Problem  Multiple Access:  Random Access (ALOHA, CSMA, CSMA/CD, CSMA/CA)  Controlled Access (Reservation, Polling, Token Passing)  Channelization (FDMA, TDMA, CDMA)  Wired LAN: Ethernet Standards and FDDI  Wireless LAN: IEEE 802.11x and Bluetooth Standards  Token Bus, Token Ring and Virtual LAN
  • 3.
    Function of DataLink Layer (DLL)
  • 4.
    Functions of DataLink Layer  Providing a well-defined service interface to the network layer (framing)  Dealing with transmission errors (error control)  Regulating the flow of data so that slow receivers are not swamped by fast senders (flow control)
  • 5.
    Data Link Control:Framing, Flow and Error Control
  • 6.
    Framing  It needsto pack the bits into frames, so that each frame is distinguishable from one another  Prepares a packet for the transport across the local media by encapsulating with a header and trailer to create frames  Data Link Layer frame includes  Data: Packet from Network  Header: Contains control information, such as Addressing and it is located at the beginning of the Packet Data Unit  Trailer: Contains control information added to the end of PDU Header Payload Trailer Packet Sending Machine Header Payload Trailer Packet Receiving Machine Frames
  • 7.
    Parts of frames Frame Header: Contains the source and the destination addresses of the frame  Payload Field: Contains the message to be delivered  Trailer: Contains the error detection and error correction bits  Flag: Marks the beginning and end of the frame Flag Header Trailer Flag Payload Field
  • 8.
    MAC and LLC Logical Link Layer (LLC)  Upper Sublayer of the DLL of OSI Model  Acts as interface between the network layer and the MAC sublayer of DLL  main purpose is to multiplex the protocols that may concurrently use the MAC layer (like IPv4, IPv6,...).  It may also be used to retransmit error frames detected by MAC.  Media Access Control  On a network, the Network Interface Card (NIC) has an unique hardware address which identifies a computer or device.  The physical address is utilized for the MAC sublayer addressing.  Main purpose is framing and to direct those data frames across the network using some kind of addressing  Handles Error Correction
  • 9.
    MAC and LLC LLC Layer3 protocol Multiplexer / De-multiplexer Logical Link Services (Connectionless, Connection-oriented) MAC Broadcast Media Collision Resolution Framing/De-framing Frame header / frame trailer processing Checksum computation/ Checksum Verification LLC MAC Physical Layer LLC MAC Physical Layer Network Layer Packets Network Layer Packets Data Link Layer Wired / Wireless Link
  • 10.
    LLC  Destination ServiceAccess Point (DSAP):  IEEE 802.2 header begins with 1 byte, which identifies the upper-layer processing  Source Service Access Point (SSAP):  Following the DSAP Address is the 1 byte address. which identifies the sending upper layer process  Control:  It employs 3 different formats depending on the type of LLC used  Information (I) Frame: Carries upper-layer information and some control information.  Supervisory (S) Frame: Provides control information. An S frame can request and suspend transmission, reports on status, and acknowledge receipt of I frames.  Unnumbered (U) Frame: Used for control purposes and is not sequenced. A U frame can be used to initialize secondaries. Depending on the function of the U frame, its Control field is 1 or 2 bytes. Some U frames have an Information field.  Data:  Variable-length field bounded by the MAC format implemented. DSAP SSAP Control Data Figure: LLC Frame Format
  • 11.
    MAC  An error-detectiontechnique used widely in today’s computer networks is based on cyclic redundancy check (CRC) codes.  CRC codes are also known as polynomial codes. Control Header Source Address LLC Data CRC Figure: MAC Frame Format Destination Address
  • 12.
    Framing  In thephysical layer, data transmission involves synchronised transmission of bits from the source to the destination. The data link layer packs these bits into frames.  Data-link layer takes the packets from the Network Layer and encapsulates them into frames. If the frame size becomes too large, then the packet may be divided into small sized frames. Smaller sized frames makes flow control and error control more efficient.  Then, it sends each frame bit-by-bit on the hardware. At receiver’s end, data link layer picks up signals from hardware and assembles them into frames.  Parts of a Frame  Frame Header: It contains the source and the destination addresses of the frame.  Payload field: It contains the message to be delivered.  Trailer: It contains the error detection and error correction bits.  Flag: It marks the beginning and end of the frame.
  • 13.
    Types of Framing Fixed-sized Framing  The size of the frame is fixed and so the frame length acts as delimiter of the frame.  Consequently, it does not require additional boundary bits to identify the start and end of the frame.  Example − ATM cells.  Variable – Sized Framing  The size of each frame to be transmitted may be different.  Additional mechanisms are kept to mark the end of one frame and the beginning of the next frame.  It is used in local area networks.
  • 14.
    Variable Size Frame Twoways to define frame delimiters in variable sized framing  Length Field  A length field is used that determines the size of the frame.  It is used in Ethernet.  End Delimiter:  A pattern is used as a delimiter to determine the size of frame.  If the pattern occurs in the message, then two approaches are used to avoid the situation  Byte-Stuffing:  A byte is stuffed in the message to differentiate from the delimiter.  This is also called character-oriented framing.  Bit-Stuffing:  A pattern of bits of arbitrary length is stuffed in the message to differentiate from the delimiter.  This is also called bit-oriented framing.
  • 15.
    Byte Stuffing Flag Header
.. Flag Trailer Data from Upper layer Variable Number of Characters Byte Stuffing: process of adding 1 byte whenever there is a flag or escape characters in the text Flag ESC Flag Header ESC Flag ESC ESC Trailer Flag Byte Stuffing Sending Machine Data Link Frame Sent Flag ESC Flag Header ESC Flag ESC ESC Trailer Flag Byte Un-stuffing Receiving Machine Data Link Frame Received Data From Network Layer Data to Network Layer In byte stuffing, a special byte called the escape character (ESC) is stuffed before every byte in the message with the same pattern as the flag byte. If the ESC sequence is found in the message byte, then another ESC byte is stuffed before it.
  • 16.
    Byte Stuffing Flag HeaderPayload Field Flag Trailer A frame delimited by flag bytes Flag A B Flag A B ESC Original Characters After Stuffing ESC A B ESC A B ESC Flag A B Flag A B ESC ESC ESC ESC ESC A B ESC A B ESC ESC ESC ESC Four Examples of byte sequences before and after byte stuffing
  • 17.
    Bit Stuffing 00011111111010100011111001 Flag Header00111110111010100111110001 Trailer Flag Bit Stuffing Frame Sent Bit Un-stuffing Receiving Machine Data Link Frame Received Data From Network Layer Data to Network Layer In bit stuffing, we add one extra 0 whenever 5 consecutive 1’s follow a 0 in the data Flag Header 00111110111010100111110001 Trailer Flag 00011111111010100011111001 Receiving Machine
  • 18.
    Bit Stuffing 0110111111100111110111111111100000 Input Stream 01101111101100111110011111011111000000 StuffedStream 0110111111100111110111111111100000 Unstuffed Stream Stuffed bits
  • 19.
    Flow Control  Flowcontrol coordinates the amount of the data that can be sent before receiving acknowledgement  In most protocols, flow control is a set of procedures that tells the sender how much data it can transmit before it must wait for an acknowledgement from the receiver  When a data frame (Layer-2 data) is sent from one host to another over a single medium, it is required that the sender and receiver should work at the same speed.  Sender sends at a speed on which the receiver can process and accept the data.  What if the speed (hardware/software) of the sender or receiver differs?  If sender is sending too fast the receiver may be overloaded, (swamped) and data may be lost.
  • 20.
    Flow Control Protocols For NoiselessChannel For Noisy Channel Simplest Stop-and-Wait Stop-and-Wait ARQ Go Back N ARQ Selective Repeat ARQ
  • 21.
    Flow Control  Simplest Simplest Protocol is one that has no flow or error control  It is a unidirectional protocol in which data frames are traveling in only one direction-from the sender to receiver.  Can be assumed 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.
  • 22.
    Flow Control Sender Receiver TimeTime Request Request Request Arrival Arrival Arrival
  • 23.
    Flow Control  Flowcontrol restricts the number of frames the sender can send before it waits for an acknowledgment from the receiver.  Data link layer uses feedback-based flow control mechanisms. There are two main techniques  Stop and wait:  Send one frame at a time  Sends a frame and waits for acknowledgement  After the receiver receives the frame, it sends acknowledgement frame back to sender  On receiving the acknowledgment frame, the sender understands that the receiver is ready to accept the next frame. So it sender the next frame in queue.  Sliding window:  Send Several frame at a time  Improves the efficiency of stop and wait protocol by allowing multiple frames to be transmitted before receiving acknowledgement
  • 24.
    Flow Control: Stopand Wait Sender Network Data Link Physical Get Data Send Frame Receiver Network Data Link Physical Deliver Data Receive Frame Data Frames Request from network Layer Algorithm for sender site Event: Repeat Forever Notification from physical layer Algorithm for receiver site Event: Repeat Forever
  • 25.
    Flow Control Frame Frame ACK ACK Propagation Delay Transmission Delay Start TransmitEnd Transmit Receiver Sender End of transmit of ACK Last Bit Received Last Bit of ACK Received ‱ Advantages ‱ Simple and each frame is checked and acknowledged ‱ Disadvantages ‱ Only one frame can be in transmission at a time ‱ Inefficient, if the distance is long between devices ‱ Reason is propagation delay is much longer than the transmission delay
  • 26.
    Flow Control: SlidingWindow  This protocol improves the efficiency of stop and wait protocol by allowing multiple frames to be transmitted before receiving an acknowledgment.  The working principle of this protocol can be described as follows  Both the sender and the receiver has finite sized buffers called windows. The sender and the receiver agrees upon the number of frames to be sent based upon the buffer size.  The sender sends multiple frames in a sequence, without waiting for acknowledgment. When its sending window is filled, it waits for acknowledgment. On receiving acknowledgment, it advances the window and transmits the next frames, according to the number of acknowledgments received.  Each frame has to be numbered in relation to the sliding window. For a window of size n, frames get a number from 0 to n - 1.
  • 27.
    Flow Control: SlidingWindow  For example, if n = 8, the frames are numbered 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1...so on. The size of the window is (n -1) = 7.  When the receiver sends an ACK containing the number 5, it means all frames upto number 4 have been received.  If the window size is sufficiently large the sender can continuously transmit packets:  If W >= (2a+1), sender can transmit continuously. (Efficiency =1)  If W < (2a+1), sender can transmit W frames every (2a+1) time units. (Efficiency = W/(1+2a) )
  • 28.
    Error Control  Dataframe may be lost or may be corrupted  Sender might be unaware of the loss of the data frame  Both sender and receiver are quipped with some protocols which helps them to detect error  Sender might retransmit or receiver may send request to resend the data-frame
  • 29.
    Error Control  Requirementsfor the error control mechanism  Error detection: The sender and receiver, either both or any, must ascertain that there is some error in the transit.  Positive ACK: When the receiver receives a correct frame, it should acknowledge it.  Negative ACK: When the receiver receives a damaged frame or a duplicate frame, it sends a NACK back to the sender and the sender must retransmit the correct frame.  Retransmission: The sender maintains a clock and sets a timeout period. If an acknowledgement of a data-frame previously transmitted does not arrive before the timeout, the sender retransmits the frame, thinking that the frame or its acknowledgement is lost in transit.
  • 30.
    Error Control  3types of technique to control the errors by Automatic Repeat Requests  Stop and Wait ARQ  Go-Back-N ARQ  Selective Repeat ARQ
  • 31.
    Stop and WaitARQ  The sender maintains a timeout counter.  When a frame is sent, the sender starts the timeout counter.  If acknowledgement of frame comes in time, the sender transmits the next frame in queue.  If acknowledgement does not come in time, the sender assumes that either the frame or its acknowledgement is lost in transit. Sender retransmits the frame and starts the timeout counter.  If a negative acknowledgement is received, the sender retransmits the frame.
  • 32.
    Stop and WaitARQ Sender Timeout Timeout Timeout Receiver
  • 33.
    Go-Back-N ARQ  Stopand wait ARQ mechanism does not utilize the resources at their best. When the acknowledgement is received, the sender sits idle and does nothing. In Go-Back-N ARQ method, both sender and receiver maintain a window  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 received NACK or has not receive any ACK for a particular frame, it retransmits all the frames after which it does not receive any positive ACK..
  • 34.
    Go-Back-N ARQ Sender Set timerfor 0 Receiver ACK 0 X Set timer for 1 Set timer for 2 Close timer for 0 and send 3 Close timer for 1 and send 4 Send all frames again
  • 35.
    Selective Repeat ARQ In Go-back-N ARQ, it is assumed that the receiver does not have any buffer space for its window size and has to process each frame as it comes. This enforces the sender to retransmit all the frames which are not acknowledged  In Selective-Repeat ARQ, the receiver while keeping track of sequence numbers, buffers the frames in memory and sends NACK for only frame which is missing or damaged.The sender in this case, sends only packet for which NACK is received
  • 36.
    Selective Repeat ARQ Sender Settimer for 0 Receiver ACK 0 X Set timer for 1 Set timer for 2 Close timer for 0 and send 3 Close timer for 1 and send 4 Send frame 2 again
  • 37.
  • 38.
    Error Detection Many factorsincluding line noise can alter or wipe out one or more bits of a given data unit. Reliable systems must have mechanism for detecting and correcting such errors. Error detection and correction are implemented either at the data link layer or the transport layer of the OSI model. Types of Errors Single Bit (Only one bit in the data unit has changed) Burst (2 or more bit in the data unit has changed) 0 0 0 0 1 0 1 0 0 0 0 0 0 0 1 0 O changed to 1 Single Bit Error 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 Burst Error 0 0 0 1 1 0 1 1 0 0 0 0 0 0 1 0 Corrupted Bits Length of Burst Error is 5 Sent Received When data is transmitted from one device to another device, the system does not guarantee whether the data received by the device is identical to the data transmitted by another device. An Error is a situation when the message received at the receiver end is not identical to the message transmitted.
  • 39.
    Single Bit Error In the above figure, the message which is sent is corrupted as single-bit, i.e., 0 bit is changed to 1.  The only one bit of a given data unit is changed from 1 to 0 or from 0 to 1.  Single-Bit Error does not appear more likely in Serial Data Transmission. For example, Sender sends the data at 10 Mbps, this means that the bit lasts only for 1’s and for a single-bit error to occurred, a noise must be more than 1’s.  Single-Bit Error mainly occurs in Parallel Data Transmission. For example, if eight wires are used to send the eight bits of a byte, if one of the wire is noisy, then single-bit is corrupted per byte. 0 0 0 0 1 0 1 0 0 0 0 0 0 0 1 0 O changed to 1 Single Bit Error
  • 40.
    Burst  The twoor more bits are changed from 0 to 1 or from 1 to 0 is known as Burst Error. The Burst Error is determined from the first corrupted bit to the last corrupted bit.  The duration of noise in Burst Error is more than the duration of noise in Single- Bit.  Burst Errors are most likely to occur in Serial Data Transmission.  The number of affected bits depends on the duration of the noise and data rate. 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 Burst Error 0 0 0 1 1 0 1 1 0 0 0 0 0 0 1 0 Corrupted Bits Length of Burst Error is 5 Sent Received
  • 41.
    Error Detection andCorrection  Single Parity Check  Two-Dimensional Parity Check  Checksum  Cyclic Redundancy Check
  • 42.
    Single Parity Check Single Parity checking is the simple mechanism and inexpensive to detect the errors.  In this technique, a redundant bit is also known as a parity bit which is appended at the end of the data unit so that the number of 1s becomes even.  If the number of 1s bits is odd, then parity bit 1 is appended and if the number of 1s bits is even, then parity bit 0 is appended at the end of the data unit.  At the receiving end, the parity bit is calculated from the received data bits and compared with the received parity bit.  This technique generates the total number of 1s even, so it is known as even- parity checking. ‱ 1 is added to the block if it contains odd number of 1’s, and ‱ 0 is added if it contains even number of 1’s
  • 43.
    Single Parity Check ‱1 is added to the block if it contains odd number of 1’s, and ‱ 0 is added if it contains even number of 1’s Sender Receiver Transmission Media 1011011 Compute Parity bit 1011011 Compute Parity bit Good? 1 1011011 1 Yes No Accept Data Reject Data
  • 44.
    Single Parity Check DrawbacksOf Single Parity Checking  It can only detect single-bit errors which are very rare.  If two bits are interchanged, then it cannot detect the errors. ‱ 1 is added to the block if it contains odd number of 1’s, and ‱ 0 is added if it contains even number of 1’s 0 0 0 0 1 0 1 0 0 0 1 0 0 0 1 0 Unable to Detect Single Bit Error
  • 45.
    Two-Dimensional Parity Check Performance can be improved by using Two-Dimensional Parity Check which organizes the data in the form of a table.  Parity check bits are computed for each row, which is equivalent to the single-parity check.  In Two-Dimensional Parity check, a block of bits is divided into rows, and the redundant row of bits is added to the whole block.  At the receiving end, the parity bits are compared with the parity bits computed from the received data.
  • 46.
    Two-Dimensional Parity Check Paritycheck bits are calculated for each row, which is equivalent to a simple parity check bit. Parity check bits are also calculated for all columns, then both are sent along with the data. At the receiving end these are compared with the parity bits calculated on the received data. 1 0 0 0 0 1 0 0 1 1 1 0 0 0 1 0 0 0 1 0 0 1 0 0 1 0 0 0 0 1 0 0 1 0 0 0 0 1 0 0 1 1 1 0 0 0 1 0 0 0 1 0 0 1 0 0 1 0 0 0 0 1 0 0 1 1 0 0 0 1 1 0 0 0 0 0 1 0 0 0 0 1 0 0 0 1 1 1 0 0 0 1 0 0 0 0 1 0 0 1 0 0 0 1 0 0 0 0 1 0 0 0 1 1 0 0 0 1 1 0 0 0 Row Parities Column Parities Original Data Data to be sent ‱ If two bits in one data unit are corrupted and two bits exactly the same position in another data unit are also corrupted, then 2D Parity checker will not be able to detect the error. ‱ This technique cannot be used to detect the 4-bit errors or more in some cases. Drawbacks
  • 47.
    Two-Dimensional Parity Check 10 0 0 0 1 0 0 1 1 1 0 0 0 1 0 0 0 1 0 0 1 0 0 1 0 0 0 0 1 0 0 1 0 0 0 0 1 0 0 1 1 1 0 0 0 1 0 0 0 1 0 0 1 0 0 1 0 0 0 0 1 0 0 1 1 0 0 0 1 1 0 0 0 0 0 1 0 0 0 0 1 0 0 0 1 1 1 0 0 0 1 0 0 0 0 1 0 0 1 0 0 0 1 0 0 0 0 1 0 0 0 1 1 0 0 0 1 1 0 0 0 Row Parities Column Parities Original Data Data to be sent
  • 48.
    Checksum  In checksumerror detection scheme, the data is divided into k segments each of m bits.  In the sender’s end the segments are added using 1’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.  At the receiver’s end, all received segments are added using 1’s complement arithmetic to get the sum. The sum is complemented.  If the result is zero, the received data is accepted; otherwise discarded.
  • 49.
    Checksum . . Section1 n bits Section2 n bits Checksum All 0s Section K n bits Sum n bits Complement n bits Sender Checksum . . Section1 n bits Section 2 n bits Checksum All 0s Section K n bits Sum n bits Complement n bits Receiver Result Data + Checksum Packet n bits If result = 0; Keep Else Discard
  • 50.
    Checksum 1 0 01 1 0 0 1 1 1 1 0 0 0 1 0 0 0 1 0 0 1 0 0 1 0 0 0 0 1 0 0 Original Data 1 2 3 4 1 0 0 1 1 0 0 1 1 1 1 0 0 0 1 0 0 1 1 1 1 0 1 1 1 0 1 1 1 1 1 0 0 0 0 1 0 0 1 0 0 1 0 1 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 1 1 1 0 1 1 0 1 0 1 1 1 2 3 4 Sum Checksum Sender 1 0 0 1 1 0 0 1 1 1 1 0 0 0 1 0 0 1 1 1 1 0 1 1 1 0 1 1 1 1 1 0 0 0 0 1 0 0 1 0 0 1 0 1 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 1 1 1 0 1 1 0 1 0 1 1 1 2 3 4 Sum Checksum Receiver Conclusion: Accept Data k=4, m=8
  • 51.
    Cyclic Redundancy Check(CRC)  CRC is a redundancy error technique used to determine the error.  Following are the steps used in CRC for error detection:  In CRC technique, a string of n 0s is appended to the data unit, and this n number is less than the number of bits in a predetermined number, known as division which is n-1 bits.  Secondly, the newly extended data is divided by a divisor using a process is known as binary division. The remainder generated from this division is known as CRC remainder.  Thirdly, the CRC remainder replaces the appended 0s at the end of the original data. This newly generated unit is sent to the receiver.  The receiver receives the data followed by the CRC remainder. The receiver will treat this whole unit as a single unit, and it is divided by the same divisor that was used to find the CRC remainder.  If the resultant of this division is zero which means that it has no error, and the data is accepted.  If the resultant of this division is not zero which means that the data consists of an error. Therefore, the data is discarded.
  • 52.
    Cyclic Redundancy Check(CRC) Sender 1 1 0 0 1 1 0 1 1 1 0 1 0 1 1 1 1 1 0 1 1 0 1 1 1 0 1 Divisor Data Bits Receiver 1 1 0 0 1 1 0 1 0 1 1 1 0 1 0 1 1 1 1 1 0 1 1 0 1 1 1 1 1 0 1 Divisor Data Bits + CRC 1 0 1 0 0 0 No Error
  • 53.
    Cyclic Redundancy Check(CRC) Sender 1 0 1 0 0 0 0 0 0 0 1 0 0 1 0 0 1 1 0 0 0 0 0 0 1 0 0 1 0 1 0 1 0 0 0 0 1 0 0 1 0 0 1 1 0 0 0 1 0 0 1 1 0 0 1 0 1 0 1 0 1 0 0 1 0 0 1 1 Message to be transmitted 1 0 1 0 0 0 0 0 0 0 + 0 1 1 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1 0 1 0 0 0 0 0 1 1 1 0 1 0 0 0 0 0 1 1 1 0 0 1 0 0 1 1 0 0 0 0 1 1 1 0 0 1 0 1 0 1 0 0 1 1 1 0 0 1 0 0 1 1 0 1 1 1 0 0 1 1 0 0 1 0 1 0 0 1 1 0 0 1 0 0 0 0 Receiver Zero means data is accepted Original Message @ @ @ @ @ @ @ @ @ @ @ => X-OR Generator polynomial x3+1 1.x3+0.x2+0.x1+1.x0 CRC Generator 1 0 0 1
  • 54.
    Error Correction Techniques Error Correction Techniques  Error Correction codes are used to detect and correct the errors when data is transmitted from the sender to the receiver.  Error Correction can be handled in two ways:  Backward error correction: Once the error is discovered, the receiver requests the sender to retransmit the entire data unit.  Forward error correction: In this case, the receiver uses the error-correcting code which automatically corrects the errors.  A single additional bit can detect the error, but cannot correct it.  For correcting the errors, one has to know the exact position of the error. For example, If we want to calculate a single- bit error, the error correction code will determine which one of seven bits is in error. To achieve this, we have to add some additional redundant bits.
  • 55.
    Error Correcting Codes Along with detecting code, we have to pass the some data to figure out the original message from the corrupt message that we received.  Error correcting codes also deploys the same strategy as error-detecting codes but such codes also detect the exact location of corrupt bits  parity check has a simple way to detect errors along with a sophisticated mechanism to determine the corrupt bit location. Once the corrupt bit is located, its value is reverted (from 0 to 1 or 1 to 0) to get the original message
  • 56.
    How to Detectand Correct the Errors?  To detect and correct the errors, additional bits are added to the data bits at the time of transmission.  The additional bits are called parity bits. They allow detection or correction of the errors.  The data bits along with the parity bits form a code word.
  • 57.
    Hamming Code  Paritybits: The bit which is appended to the original data of binary bits so that the total number of 1s is even or odd.  Even parity: To check for even parity, if the total number of 1s is even, then the value of the parity bit is 0. If the total number of 1s occurrences is odd, then the value of the parity bit is 1.  Odd Parity: To check for odd parity, if the total number of 1s is even, then the value of parity bit is 1. If the total number of 1s is odd, then the value of parity bit is 0.
  • 58.
    Hamming Code :Algorithm (General)  Write the bit positions starting from 1 in binary form (1, 10, 11, 100, etc).  All the bit positions that are a power of 2 are marked as parity bits (1, 2, 4, 8, etc).  All the other bit positions are marked as data bits.  Each data bit is included in a unique set of parity bits, as determined its bit position in binary form.  Parity bit 1 covers all the bits positions whose binary representation includes a 1 in the least significant position (1, 3, 5, 7, 9, 11, etc).  Parity bit 2 covers all the bits positions whose binary representation includes a 1 in the second position from the least significant bit (2, 3, 6, 7, 10, 11, etc).  Parity bit 4 covers all the bits positions whose binary representation includes a 1 in the third position from the least significant bit (4–7, 12–15, 20–23, etc).  Parity bit 8 covers all the bits positions whose binary representation includes a 1 in the fourth position from the least significant bit bits (8–15, 24–31, 40–47, etc).  In general, each parity bit covers all bits where the bitwise AND of the parity position and the bit position is non-zero.  Since we check for even parity set a parity bit to 1 if the total number of ones in the positions it checks is odd.  Set a parity bit to 0 if the total number of ones in the positions it checks is even. Determining the position of redundant bits, These redundancy bits are placed at the positions which correspond to the power of 2
  • 59.
    Hamming Code :Example  Suppose the original data is 1010 which is to be sent.  Total number of data bits 'd' = 4  Number of redundant bits r :  2r >= d+r+1  2r>= 4+r+1  Therefore, the value of r is 3 that satisfies the above relation.  Total number of bits = d+r = 4+3 = 7;
  • 60.
    Hamming Code :Example  Determining the position of the redundant bits:  The number of redundant bits is 3. The three bits are represented by r1, r2, r4. The position of the redundant bits is calculated with corresponds to the raised power of 2. Therefore, their corresponding positions are 1, 21, 22.  The position of r1 = 1 The position of r2 = 2 The position of r4 = 4  Representation of Data on the addition of parity bits: 1 0 1 r4 0 r2 r1 7 6 5 4 3 2 1
  • 61.
    Hamming Code :Example  Determining r1 bit : The r1 bit is calculated by performing a parity check on the bit positions whose binary representation includes 1 in the first position.  We observe from the above figure that the bit positions that includes 1 in the first position are 1, 3, 5, 7. Now, we perform the even-parity check at these bit positions. The total number of 1 at these bit positions corresponding to r1 is even, therefore, the value of the r1 bit is 0. 1 0 1 r4 0 r2 r1 7 6 5 4 3 2 1 r1
  • 62.
    Hamming Code :Example  Determining r2 bit : The r2 bit is calculated by performing a parity check on the bit positions whose binary representation includes 1 in the second position.  We observe from the above figure that the bit positions that includes 1 in the second position are 2, 3, 6, 7. Now, we perform the even-parity check at these bit positions. The total number of 1 at these bit positions corresponding to r2 is odd, therefore, the value of the r2 bit is 1. 1 0 1 r4 0 r2 0 7 6 5 4 3 2 1 r2
  • 63.
    Hamming Code :Example  Determining r4 bit : The r4 bit is calculated by performing a parity check on the bit positions whose binary representation includes 1 in the third position.  We observe from the above figure that the bit positions that includes 1 in the third position are 4, 5, 6, 7. Now, we perform the even-parity check at these bit positions. The total number of 1 at these bit positions corresponding to r4 is even, therefore, the value of the r4 bit is 0. 1 0 1 r4 0 1 0 7 6 5 4 3 2 1 r4 1 0 1 0 0 1 0 7 6 5 4 3 2 1
  • 64.
    Hamming Code :Example  Suppose the 4th bit is changed from 0 to 1 at the receiving end, then parity bits are recalculated.  R1 bit  The bit positions of the r1 bit are 1,3,5,7  We observe from the above figure that the binary representation of r1 is 1100. Now, we perform the even- parity check, the total number of 1s appearing in the r1 bit is an even number. Therefore, the value of r1 is 0. 1 0 1 0 0 1 0 7 6 5 4 3 2 1 1 0 1 1 0 1 0 7 6 5 4 3 2 1 r1
  • 65.
    Hamming Code :Example  R2 bit  The bit positions of r2 bit are 2,3,6,7.  We observe from the above figure that the binary representation of r2 is 1001. Now, we perform the even- parity check, the total number of 1s appearing in the r2 bit is an even number. Therefore, the value of r2 is 0. 1 0 1 0 0 1 0 7 6 5 4 3 2 1 1 0 1 0 0 1 0 7 6 5 4 3 2 1 r2
  • 66.
    Hamming Code :Example  R4 bit  The bit positions of r4 bit are 4,5,6,7.  We observe from the above figure that the binary representation of r4 is 1011. Now, we perform the even-parity check, the total number of 1s appearing in the r4 bit is an odd number. Therefore, the value of r4 is 1.  The binary representation of redundant bits, i.e., r4r2r1 is 100, and its corresponding decimal value is 4. Therefore, the error occurs in a 4th bit position. The bit value must be changed from 1 to 0 to correct the error. 1 0 1 0 0 1 0 7 6 5 4 3 2 1 1 0 1 1 0 1 0 7 6 5 4 3 2 1 r4
  • 67.
    High Level DataLink Control (HDLC) & Point-to-Point Protocol (PPP)
  • 68.
    High-Level Data LinkControl (HDLC)  High-level Data Link Control (HDLC) is a group of communication protocols of the data link layer for transmitting data between network points or nodes. Since it is a data link protocol, data is organized into frames. A frame is transmitted via the network to the destination that verifies its successful arrival.  High-level Data Link Control (HDLC) is a bit-oriented protocol for communication over point-to- point and multipoint links. It implements the ARQ mechanisms.  HDLC provides two common transfer modes that can be used in different configurations:  Normal Response Mode (NRM)  Asynchronous Balanced Mode (ABM).
  • 69.
    Normal Response Mode(NRM)  Here, two types of stations are there, a primary station that send commands and secondary station that can respond to received commands. Command Response Primary Secondary Command Response Primary Secondary Secondary Response a. Point-to-point b. Multipoint
  • 70.
    Asynchronous Balanced Mode(ABM)  Here, the configuration is balanced, i.e. each station can both send commands and respond to commands. It is used for only point - to - point communications Command/Response Command/Response Stattion Stattion Point-to-point
  • 71.
    HDLC Frame Fields ofa HDLC Frame  Flag : It is an 8-bit sequence that marks the beginning and the end of the frame. The bit pattern of the flag is 01111110.  Address : It contains the address of the receiver. If the frame is sent by the primary station, it contains the address(es) of the secondary station(s). If it is sent by the secondary station, it contains the address of the primary station. The address field may be from 1 byte to several bytes.  Control : It is 1 /2 bytes containing flow and error control information.  Payload : This carries the data from the network layer. Its length may vary from one network to another.  FCS : It is a 2 byte or 4 bytes frame check sequence for error detection. The standard code used is CRC (cyclic redundancy code) Flag Address Control Payload FCS Flag 1 byte 1 byte 1/2 byte variable 2 / 4 byte 1 byte
  • 72.
    Types of HDLCFrame  I – Frame  S – Frame  U – Frame Flag Address Control User Information FCS Flag Flag Address Control FCS Flag Flag Address Control Management Information FCS Flag
  • 73.
    I – Frame I-frames or Information frames carry user data from the network layer. They also include flow and error control information that is piggybacked on user data. The first bit of control field of Iframe is 0. Flag Address Control User Information FCS Flag 0 P/F N(S) N(R) Control Field (1 byte) N(S) = sequence number of the frame N(R) = sequence number of the frame expected in return in two-way communication P/F= Poll/Final When P/F =1 , it follow two case: Poll when Frame is sent by a primary station to secondary ( address of receiver) Final when frame is send by secondary to primary (address of sender)
  • 74.
    S - Frame − S-frames or Supervisory frames do not contain information field. They are used for flow and error control when piggybacking is not required. The first two bits of control field of S-frame is 10. Flag Address Control FCS Flag 1 0 P/F Code N(R)
  • 75.
    U - Frame U-frames or Un-numbered frames are used for myriad miscellaneous functions, like link management. It may contain an information field, if required. The first two bits of control field of Uframe is 11. Flag Address Control Information FCS Flag 1 1 P/F Code Code Control Field (1 byte) Code Command 00 RR Receive Ready 01 REJ Reject 10 RNR Receive Not Ready 11 SREJ Selective Reject
  • 76.
    Point-to-Point Protocol  Point- to - Point Protocol (PPP) is a communication protocol of the data link layer that is used to transmit multiprotocol data between two directly connected (point-to-point) computers.  It is a byte - oriented protocol that i s widely use d i n broadband communications having heavy loads and high speeds.  Since it is a data link layer protocol, data is transmitted in frames. It is also known as RFC 1661.  One of the most common protocols for point-to-point access  Many Internet users who need to connect their home computer to the server of an Internet service provider use PPP  A point-to-point link protocol is required to control and manage the transfer of data
  • 77.
    Point-to-Point Protocol  Itdefines / provides  the format of the frame to be exchanged between devices  how two devices negotiate the establishment of the link and the exchange of data  how network layer data are encapsulated in the data link frame  how two devices can authenticate each other  multiple network layer services  connection over multiple links  Network address configuration  But, several services are missing for simplicity  no flow control, simple error control (detection and discard), no sophisticate addressing for multipoint configuration
  • 78.
    Point-to-Point Frame  Flag− marks the beginning and the end of the frame. The bit pattern of the flag is 01111110.  Address – it is set to 11111111 in case of broadcast.  Control − set to a constant value of 11000000.( No need because PPP has no flow control and limited error control)  Protocol − 1 or 2 bytes that define the type of data contained in the payload field.  Payload − This carries the data from the network layer. The maximum length of the payload field is 1500 bytes. However, this may be negotiated between the endpoints of communication.  FCS − It is a 2 byte or 4 bytes frame check sequence for error detection. The standard code used is CRC (cyclic redundancy code) ** PPP is a byte-oriented protocol using byte stuffing with the escape byte 01111101** Flag Address Control Protocol FCS Flag 1 byte 1 byte 1/2 byte variable 2 / 4 byte 1 byte Payload 1/2 bytes
  • 79.
    Point-to-Point Transition State DeadEstablish Terminate Authenticate Open Network Failed Carrier Detected Failed Network Layer Configuration Done Carrier Dropped Options agreed By both sides Authentication Successful If authentication Not needed
  • 80.
    Components of PPP Point- to - Point Protocol is a layered protocol having three components −  Encapsulation Component : It encapsulates the datagram so that it can be transmitted over the specified physical layer.  Link Control Protocol (LCP) : It is responsible for establishing, configuring, testing, maintaining and terminating l inks for t ransmission. I t also i mparts negotiation for set up of options and use of features by the two endpoints of the links.  Authentication Protocols (AP) : These protocols authenticate endpoints for use of services.  The two authentication protocols of PPP are:  Password Authentication Protocol (PAP)  Challenge Handshake Authentication Protocol (CHAP) Flag Address Control Protocol FCS Flag 1 byte 1 byte 1/2 byte variable 2 / 4 byte 1 byte Payload 1/2 bytes
  • 81.
    Network Control Protocols(NCPs)  These protocols are used for negotiating the parameters and facilities for the network layer. For every higher-layer protocol supported by PPP, one NCP is there. Some of the NCPs of PPP are:  Internet Protocol Control Protocol (IPCP)  OSI Network Layer Control Protocol (OSINLCP)  Internetwork Packet Exchange Control Protocol (IPXCP)  DECnet Phase IV Control Protocol (DNCP)  NetBIOS Frames Control Protocol (NBFCP)  IPv6 Control Protocol (IPV6CP)
  • 82.
    Network Control Protocols(NCPs) Data From Networking Protocols NCP IPCP OSINLCP IPXCP 


 AP PAP CHAP LCP Physical Layer Protocols Network Layer Data Link Layer Physical Layer
  • 83.

Editor's Notes

  • #23 The following figure shows an example of communication using this protocol. It is very simple. The sender sends a sequence of frames without even thinking about the receiver. To send three frames, three events occur at the sender site and three events at the receiver site. Note that the data frames are shown by tilted boxes; the height of the box defines the transmission time difference between the first bit and the last bit in the frame.
  • #29 When data-frame is transmitted, there is a probability that data-frame may be lost in the transit, or it is received corrupted. In both cases, the receiver does not receive the correct data-frame and sender does not know anything about any loss. In such case, both sender and receiver are equipped with some protocols which helps them to detect transit errors such as loss of data-frame. Hence, either the sender retransmits the data-frame or the receiver may request to resend the previous data-frame.
  • #30 When data-frame is transmitted, there is a probability that data-frame may be lost in the transit, or it is received corrupted. In both cases, the receiver does not receive the correct data-frame and sender does not know anything about any loss. In such case, both sender and receiver are equipped with some protocols which helps them to detect transit errors such as loss of data-frame. Hence, either the sender retransmits the data-frame or the receiver may request to resend the previous data-frame.
  • #31 When data-frame is transmitted, there is a probability that data-frame may be lost in the transit, or it is received corrupted. In both cases, the receiver does not receive the correct data-frame and sender does not know anything about any loss. In such case, both sender and receiver are equipped with some protocols which helps them to detect transit errors such as loss of data-frame. Hence, either the sender retransmits the data-frame or the receiver may request to resend the previous data-frame.
  • #32 When data-frame is transmitted, there is a probability that data-frame may be lost in the transit, or it is received corrupted. In both cases, the receiver does not receive the correct data-frame and sender does not know anything about any loss. In such case, both sender and receiver are equipped with some protocols which helps them to detect transit errors such as loss of data-frame. Hence, either the sender retransmits the data-frame or the receiver may request to resend the previous data-frame.
  • #35 When data-frame is transmitted, there is a probability that data-frame may be lost in the transit, or it is received corrupted. In both cases, the receiver does not receive the correct data-frame and sender does not know anything about any loss. In such case, both sender and receiver are equipped with some protocols which helps them to detect transit errors such as loss of data-frame. Hence, either the sender retransmits the data-frame or the receiver may request to resend the previous data-frame.