SlideShare a Scribd company logo
1 of 119
Download to read offline
Computer Networking
Unit 2
Dr. V Dutta
Agenda :Unit 2
Data Link Layer :- Design Issues : Framing, Error
Control, Flow Control, Elementary Data Link
Protocols, Sliding window protocol, Example
Data link protocols :HDLC, SLIP and PPP.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 2
The Main Design Issues
Reliability Resource Allocation
Scalability Routing
Addressing Error Control
Flow Control Statistical Multiplexing
Security
The most possible issues with the Data Link can be :
– Induced traffic:
– Power and bandwidth constraints
– Interpretation unfairness
– Interpretation of congestion
– Dynamic topology
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 3
Data Link Layer
The data link layer is the protocol layer in a program that
handles the moving of data into and out of a physical link in a
network. The data link layer is Layer 2 in the Open Systems
Interconnection (OSI) architecture model for a set of
telecommunication protocols.
The main service provided is to transfer data packets from
the network layer on the sending machine to the network
layer on the receiving machine. In actual communication,
the data link layer transmits bits via the physical layers and
physical medium.
The main design issues are related to services provided to the
Network Layer, Framing, Error Control and Flow Control.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 4
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 5
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 6
Responsibilities/services of the Data Link
Layer:
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 7
Unacknowledged connectionless service
Here, the data link layer of the sending machine
sends independent frames to the data link layer
of the receiving machine. The receiving machine
does not acknowledge receiving the frame. No
logical connection is set up between the host
machines. Error and data loss is not handled in
this service. This is applicable in Ethernet
services and voice communications.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 8
Acknowledged connectionless service
Here, no logical connection is set up between
the host machines, but each frame sent by the
source machine is acknowledged by the
destination machine on receiving. If the source
does not receive the acknowledgment within a
stipulated time, then it resends the frame. This
is used in Wifi (IEEE 802.11) services.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 9
Acknowledged connection-oriented service
This is the best service that the data link layer can offer to the
network layer. A logical connection is set up between the two
machines and the data is transmitted along this logical path.
The frames are numbered, that keeps track of loss of frames
and also ensures that frames are received in correct order.
The service has three distinct phases −
• Set up of connection – A logical path is set up between the source
and the destination machines. Buffers and counters are initialized to
keep track of frames.
• Sendingframes – The frames are transmitted.
• Release connection – The connection is released, buffers and other
resources arereleased.
• It is appropriate for satellite communications and long-distance
telephone circuits.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 10
Parts of a Frame
A frame has the following parts −
• 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.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 11
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 12
Framing
• Advantage: Data is broken up into recoverablechunks thatcan
easily be checked for corruption.
• Problemsin Framing–
• Detecting start of the frame: When a frame is transmitted, every
station must be able to detect it. Station detect frames by looking
out for special sequence of bits that marks the beginning of the
frame i.e. SFD (Starting Frame Delimeter).
• How do station detect a frame: Every station listen to link for SFD
pattern through a sequential circuit. If SFD is detected, sequential
circuit alerts station. Station checks destination address to accept or
rejectframe.
• Detectingendof frame: When to stop readingthe frame.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 13
Methods of Framing
There are basically four methods of framing as
given below –
1. Character Count
2. Flag Byte with Character Stuffing
3. Starting and Ending Flags, with Bit Stuffing
4. Encoding Violations
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 14
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 15
Framing Types
1. Fixed size – The frame is of fixed size and there is no need to
provide boundaries to the frame, length of the frame itself acts as
delimiter.
Drawback: It suffers from internal fragmentation if data size is less
than frame size
Solution: Padding
2. Variable size – In this there is need to define end of frame as well as
beginningof next frame to distinguish.Thiscan be donein two ways:
Length field – We can introduce a length field in the frame to indicate
the length of the frame. Used in Ethernet(802.3). The problem with
this is that sometimes the length field might get corrupted.
End Delimeter (ED) – We can introduce an ED(pattern) to indicate the
end of the frame. Used in Token Ring.
The problem with this is that ED can occur in the data.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 16
Solutions to End Delimeter (ED) occurrence in
data
1. Character/ByteStuffing: Used when frames
consistof character. If data containsED then,
byte is stuffedinto data to differentiateit from
ED. Let ED = “$” –> if data contains ‘$’
anywhere, it can be escaped using ‘O’
character.
–> if data contains‘O$’ then, use ‘OOO$'($ is
escaped using O and O is escaped using O).
2. Disadvantage – It is very costly and obsolete
method.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 17
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 18
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 19
Contd..
3. Bit Stuffing:
• Let ED = 01111 and if data = 01111
• –> Sender stuffs a bit to break the pattern i.e. here appends
a 0 in data = 011101.
• –> Receiver receives the frame.
• –> If data contains 011101, receiver removes the 0 and
reads the data.
E.g.–
• If Data –> 011100011110and ED –> 0111 then, find data
after bit stuffing ?–> 01110000111010
• If Data –> 110001001 and ED –> 1000 then, find data after
bit stuffing ?–> 11001010011
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 20
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 21
Physical Layer Coding Violations
Encoding violation is method that is used only
for network in which encoding on physical
medium includes some sort of redundancy i.e.,
use of more than one graphical or visual
structure to simply encode or represent one
variable of data.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 22
Noiseless channel means that there will not be any kind of interference or
disturbancein the path of communicationor transmission.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 23
Simplex Protocol
Simplex Protocol is one that has no flow or error control
and it is a unidirectional protocol in which data frames are
traveling in only one direction-from the sender to receiver.
We assume that the receiver can immediately handle any
frame it receives with a processing time that is small
enough to be negligible. The data link layer of the receiver
immediately removes the header from the frame and hands
the data packet to its network layer, which can also accept
the packet immediately.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 24
Stop and Wait Protocol
Stop and Wait means, whatever the data that sender wants to
send, he sends the data to the receiver. After sending the
data, he stops and waits until he receives the
acknowledgment from the receiver. The stop and wait
protocol is a flow control protocol where flow control is one of
the services of the data link layer.
It is a data-link layer protocol which is used for transmitting
the data over the noiseless channels. It provides
unidirectional data transmission which means that either
sending or receiving of data will take place at a time. It
provides flow-control mechanism but does not provide any
error control mechanism.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 25
Error control in Data Link Layer
Error control in data link layer is the process of
detecting and correcting data frames that have been
corrupted or lost during transmission.
In case of lost or corrupted frames, the receiver does
not receive the correct data-frame and sender is
ignorant about the loss. Data link layer follows a
technique to detect transit errors and take necessary
actions, which is retransmission of frames whenever
error is detected or frame is lost. The process is called
Automatic Repeat Request (ARQ).
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 26
Phases in Error Control
Detection of Error − Transmission error, if any, is detected by
either the sender or the receiver.
Acknowledgment − acknowledgment may be positive or negative.
– Positive ACK − On receiving a correct frame, the receiver
sends a positive acknowledge.
– Negative ACK − On receiving a damaged frame or a
duplicate frame, the receiver sends a negative
acknowledgment back to the sender.
Retransmission − The sender maintains a clock and sets a timeout
period. If an acknowledgment of a data-frame previously
transmitted does not arrive before the timeout, or a negative
acknowledgment is received, the sender retransmits the frame.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 27
Error and Flow Control
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 28
Stop and Wait –
The sender sends the packet and waits for the ACK
(acknowledgement) of the packet. Once the ACK reaches the
sender, it transmits the next packet in row. If the ACK is not
received, it re-transmits the previous packet again.
Go Back N –
The sender sends N packets which is equal to the window size. Once
the entire window is sent, the sender then waits for a cumulative
ACK to send more packets. On the receiver end, it receives only in-
order packets and discards out-of-order packets. As in case of
packet loss, the entire window would be re-transmitted.
Selective Repeat –
The sender sends packet of window size N and the receiver
acknowledges all packet whether they were received in order or
not. In this case, the receiver maintains a buffer to contain out-of-
order packets and sorts them. The sender selectively re-transmits
the lost packet and moves the window forward.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 29
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 30
ARQ
For the same function of ARQ, there are various
applications:
• TransmissionControl Protocol (TCP)
• Specific Service OrientationProtocol: Error-
correction of message signals in ATM networks.
• High-LevelData Link protocol.
• IBM Binary synchronous Communications
Protocol.
• Xmodem : modem file transfer protocol.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 31
Stop and Wait ARQ
• Used in Connection-orientedcommunication.
• It offerserrorand flow control
• It is used in Data Link and TransportLayers
• Stop and Wait ARQ mainly implements Sliding WindowProtocol
conceptwith WindowSize 1
Sender:
Send one data packet at a time.
Send next packetonly after receivingacknowledgementfor previous.
Receiver:
Acknowledgementafter receivingand consumingof data packet.
After consumingpacketacknowledgementneed to be sent (Flow
Control)
Problems: Lost Data, Lost Acknowledgement,Delayed
Acknowledgement/Data
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 32
Solution: Stop and Wait ARQ
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 33
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 34
Stop and Wait ARQ
• Propagation Delay: Amount of time taken by a packet
to make a physical journey from one router to
another router.
• Propagation Delay = (Distance between routers) /
(Velocity of propagation)
• RoundTripTime (RTT) = 2* Propagation Delay
• TimeOut (TO) = 2* RTT
• Time To Live (TTL) = 2* TimeOut. (Maximum TTL is
180 seconds)
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 35
Features: Stop and Wait ARQ
• It uses link between sender and receiver ashalf duplexlink
• Throughput= 1 Data packet/frame per RTT
• If Bandwidth*Delay product is very high, then stop and wait
protocol is not so useful. The sender has to keep waiting for
acknowledgements before sendingthe processed nextpacket.
• It is an example for “Closed Loop OR connection oriented “
protocols
• It is an special category of SWP whereits window size is 1
• Irrespective of number of packets sender is having stop and wait
protocol requires only 2 sequence numbers0 and 1
Stop and Wait ARQ may work fine where propagation delay is very less
for example LAN connections, but performs badly for distant
connections like satellite connection.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 36
Go Back-N ARQ
• Go Back-N ARQ uses the concept of protocol pipelining i.e.
the sender can send multiple frames before receiving the
acknowledgement for the first frame.
• N is the sender’s window size.
• There are finite numbers of frames numbered in sequential
order. e.g. if the sending window size is 4(or 22), then the
sequence no. will be 0,1,2,3, 0,1,2,3,0,1….
• The no. of frames that can be sent depends on the window
size of the sender.
• If the acknowledgement of the frame is not received within
time then all frames in the current window are re-
transmitted.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 37
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 38
Selective Repeat ARQ
• In Selective Repeat ARQ, only the erroneous
or lost frames are retransmitted, while correct
frames are received and buffered.
• The receiver keeps track of sequence number;
it buffers the frames in memory and sends the
negative acknowledgment for missing or
defected frames,
• The sender then re-sends only for the negative
acknowledgment received.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 39
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 40
Question
1. Station A needs to send a message consisting
of 9 packets to station B using a sliding window
(size 3) and go-back-n error control strategy. All
packets are ready and immediately available for
transmission. If every 5th packet that A transmits
gets lost (not acknowledgment), then find the
number of packets transmitted by A to B.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 41
Question
2. Host A wants to send 10 frames to Host B. The
hosts agreed to go with selective repeat ARQ.
How many numbers of frames are transmitted
by Host A if every 6th frame that is transmitted
by host A is either destroyed or lost? Also find
the number of frames sent if he could have used
Go-Back-4 ARQ.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 42
PROPERTIES
STOP AND
WAIT GO BACK N SELECTIVE REPEAT
Sender window size 1 N N
Receiver Window size 1 1 N
Minimum Sequence number 2 N+1 2N
Efficiency 1/(1+2*a) N/(1+2*a) N/(1+2*a)
Type of Acknowledgement Individual Cumulative Individual
Supported order at Receiving
end –
In-order
delivery only
Out-of-order
delivery as well
Number of retransmissions in
case of packet drop 1 N 1
a = Ratio of Propagation delayand Transmissiondelay
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 43
Error Detection & Correction
Data-link layer uses some error control
mechanism to ensure that frames (data bit
streams) are transmitted with certain level of
accuracy. But to understand how errors is
controlled, it is essential to know what types of
errors may occur.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 44
Types of Errors
• Single bit error
• Burst error (More than 1, continuous or non-
continuous bit)
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 45
Error Detecting Techniques:
Basic approach used for error detection is the
use of redundancy bits, where additional bits
are added to facilitate detection of errors.
• Single parity check/Vertical redundancy check
(VRC)
• Two-dimensional parity check/Longitudinal
(LRC)
• Checksum
• Cyclic redundancy check
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 46
Simple Parity check
Blocks of data from the source are subjected to
a check bit or parity bit generator form, where a
parity of :
• 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
• This scheme makes the total number of 1’s
even, that is why it is called even parity
checking.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 47
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 48
Limitation of VRC
• Single bit error
• Burst error is checked if number of error is
odd.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 49
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.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 50
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 51
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 52
Limitations of LRC
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 53
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.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 54
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 55
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 56
Question
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 57
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 58
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 59
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 60
Cyclic redundancy check (CRC)
• Unlike checksum scheme, which is based on addition, CRC
is based on binary division.
• In CRC, a sequence of redundant bits, called cyclic
redundancy check bits, are appended to the end of data
unit so that the resulting data unit becomes exactly
divisible by a second, predetermined binary number.
• At the destination, the incoming data unit is divided by the
same number. If at this step there is no remainder, the data
unit is assumed to be correct and is therefore accepted.
• A remainder indicates that the data unit has been damaged
in transit and therefore must be rejected.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 61
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 62
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 63
Question: To find the CRC for the data blocks 100100with the divisor1101.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 64
CRC is 001
Data Transmitted:100100001
Find the CRC for the data blocks100100withthe divisor 1101.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 65
Question:
Find the CRC for 1110010101with a divisor of X3 + X2 +1.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 66
Hint
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 67
Error-correcting codes
Error-correcting codes (ECC) are a sequence of numbers
generated by specific algorithms for detecting and removing
errors in data that has been transmitted over noisy channels.
Error correcting codes ascertain the exact number of bits that
has been corrupted and the location of the corrupted bits, within
the limitations in algorithm.
ECCs can be broadly categorized into two types −
Block codes − The message is divided into fixed-sized blocks of
bits, to which redundant bits are added for error detection or
correction.
Convolutional codes − The message comprises of data streams
of arbitrary length and parity symbols are generated by the
sliding application of a Boolean function to the data stream.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 68
Error Correction Techniques
Error correction techniquesfind out the exact number of bits
that have been corrupted and as well as their locations.
• Backward Error Correction (Retransmission)
• Forward Error Correction
Codes used:
– Hamming Codes
– Binary ConvolutionCode
– Reed – Solomon Code
– Low-Density Parity-Check Code
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 69
Backward Error Correction
Technique of error correction that occurs in a channel
through the detection of errors by the receiver: the receiver
responds to any errors in a block by requesting the
transmitter to retransmit the affected block. Backward
correction requires a return channel, by contrast with
forward error correction. BEC (also known as Automatic
Repeat reQuest, ARQ) uses feedback from the receiver to
the transmitter: the receiver signals to the transmitter
whether a block of data was received correctly or not. If the
reception is erroneous, then the transmissionis repeated.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 70
Forward error correction (FEC)
Forward error correction (FEC) is a method of obtaining
error control in data transmission in which the source
(transmitter) sends redundant data and the destination
(receiver) recognizes only the portion of the data that
contains no apparent errors.
FEC works by adding redundant bits to a bitstream to
help the decoder detect and correct some
transmission errors without the need for retransmission.
The name forward stems from the fact that the flow of
data is always in the forward direction (i.e., from encoder
to decoder).
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 71
Hamming code
Hamming code is a set of error-correction codes that can be
used to detect and correct the errors that can occur when the
data is moved or stored from the sender to the receiver.
The number of redundant bits(parity) can be calculated using
the following formula:
Redundant bits –
Redundant bits are extra binary bits that are generated and
added to the information-carrying bits of data transfer to
ensure that no bits were lost during the data transfer.
The number of redundant bits can be calculated using the
following formula:
2^r ≥ m + r + 1 where, r = redundant bit, m = data bit
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 72
Encoding a message by Hamming Code
The procedure used by the sender to encode the
message encompasses the following steps:
• Step 1 − Calculation of the number of redundant bits.
• Step 2 − Positioning the redundant bits.
• Step 3 − Calculating the values of each redundant bit.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 73
Step 1 − Calculation of the number of
redundant bits
If the message contains m𝑚number of data bits, r𝑟number of
redundant bits are added to it so that m𝑟 is able to indicate at
least (m + r+ 1) different states. Here, (m + r) indicates location of
an error in each of (𝑚 + 𝑟) bit positions and one additional state
indicates no error. Since, r𝑟 bits can indicate 2r 𝑟 states, 2r 𝑟 must
be at least equal to (m + r + 1). Thus the following equation
should hold 2r ≥ m+r+1
e.g.
Suppose the number of data bits is 7, then the number of
redundant bits can be calculated using:
= 2^4 ≥ 7 + 4 + 1 [check putting values r = 1,2,3,4]
Thus, the number of redundant bits= 4 as it satisfies the
condition.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 74
Positioning the redundant bits
The r redundant bits placed at bit positions of powers of 2, i.e. 1,
2, 4, 8, 16 etc. They are referred in the rest of this text as r1 (at
position 1), r2 (at position 2), r3 (at position 4), r4 (at position 8)
and so on.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 75
Calculating the values of each redundant bit
The redundant bits are parity bits. A parity bit is an extra bit that makes the
number of 1s either even or odd. The two types of parity are −
• Even Parity − Here the total number of bits in the message is made even.
• Odd Parity − Here the total number of bits in the message is made odd.
• Each redundant bit, ri, is calculated as the parity, generally even parity,
based upon its bit position. It covers all bit positions whose binary
representation includes a 1 in the ith position except the position of ri.
Thus −
• r1 is the parity bit for all data bits in positions whose binary representation
includes a 1 in the least significant position excluding 1 (3, 5, 7, 9, 11 and
so on)
• r2 is the parity bit for all data bits in positions whose binary representation
includes a 1 in the position 2 from right except 2 (3, 6, 7, 10, 11 and so on)
• r3 is the parity bit for all data bits in positions whose binary representation
includes a 1 in the position 3 from right except 4 (5-7, 12-15, 20-23 and so
on)
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 76
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 77
Decoding a message in Hamming Code
Once the receiver gets an incoming message, it
performs recalculations to detect errors and correct
them. The steps for recalculation are −
• Step 1 − Calculation of the number of redundant bits.
• Step 2 − Positioning the redundant bits.
• Step 3 − Parity checking.
• Step 4 − Error detection and correction
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 78
Decoding a message in Hamming Code
Step 1 − Calculation of the number of redundant bits
• Using the same formula as in encoding, the number of redundant bits are
ascertained.
• 2r ≥ m + r + 1 where m is the number of data bits and r is the number of
redundant bits.
Step 2 − Positioning the redundant bits
• The r redundant bits placed at bit positions of powers of 2, i.e. 1, 2, 4, 8,
16 etc.
Step 3 − Parity checking
• Parity bits are calculated based upon the data bits and the redundant bits
using the same rule as during generation of c1,c2 ,c3 ,c4 etc. Thus
• c1 = parity(1, 3, 5, 7, 9, 11 and so on)
• c2 = parity(2, 3, 6, 7, 10, 11 and so on)
• c3 = parity(4-7, 12-15,20-23 and so on)
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 79
Error Correction part
Step 4 − Error detection and correction
The decimal equivalent of the parity bits binary
values is calculated. If it is 0, there is no error.
Otherwise, the decimal value gives the bit
position which has error.
Note:Read the detail in solved examplewith diagramsin the class notessent in PDF.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 80
Questions
• The 7-bit hamming code word received by a
receiver is 1011011. For the even parity, state
whether the received code word is correct or
wrong. If wrong locate the bit having error.
• A(7,4) hamming code is received as 1010111.
Determine the correct code when there is
even parity.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 81
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 82
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 83
Block Codes as Correcting Codes
Block Codes (No memory is required) : (n,k) block code is
generate when the channel encoder accepts information in
successive k bit blocks. At the end of each such block, (n-k)
parity bit is added, which contains no information and termed
as redundant bits.
In block coding, we divide our message into blocks, each of k bits,
called data-words. We add r redundant bits to each block to make the
length n = k + r. The resulting n-bit blocks are called code-words. For
the moment, it is important to know that we have a set of data-words,
each of size k, and a set of code-words, each of size of n. With k bits,
we can create a combination of 2 𝑘data-words; with n bits, we can
create a combination of 2 𝑛 code-words. The block coding process is
one-to-one; the same data-word is always encoded as the same code-
word.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 84
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 85
Convolutional Codes
Convolutional Codes (Memory is required):
Here the code words are generated by discrete–
time convolution of the input sequence with
impulse response of the encoder. Unlike block
codes, channel encoder accepts messages as a
continuous sequence and generates a
continuous sequence of encoded bits at the
output.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 86
ConvolutionEncoder
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 87
Convolutional codes rate (r) : r= k/n , here k is number of message bits and ‘n’ is number of
encoded output bits for one message bit.
ConstraintLength(k) It is the number of shifts over which a single message bit can
influence the encoder output.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 88
m1 m2 state
0 0 a
0 1 b
1 0 c
1 1 d
I/P PS
(m1,m2)
NS
0 00 00
1 00 10
0 10 01
1 10 11
0 01 00
1 01 10
0 11 01
1 11 11
m m1 m2 X1 X2 PS NS
0 0 a
0 0 a
0 1 b
0 1 b
1 0 c
1 0 c
1 1 d
1 1 d
m m1 m2 X1 X2 PS NS
0 0 0 a
1 0 0 a
0 0 1 b
1 0 1 b
0 1 0 c
1 1 0 c
0 1 1 d
1 1 1 d
Assignment
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 89
Assignment
Hamming( Distance, vector, bound)
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 90
HDLC, PPP, SLIP
Unit 2 Part III
IIPS DAVV,MCA VIIB ClassNotes: Dr. V
Dutta
91
High-level data link control (HDLC)
It was actually called SDLC(Synchronous data link
control), developed by IBM and is a bit oriented
protocol.
High-level data link control (HDLC), documented in
ISO 3309, specifies a packet forming standard for
serial links. HDLC supports several modes of
operation, including a simple sliding window mode
for reliable delivery. Since Internet provide
retransmission at higher levels (i.e. TCP), most
Internet applications use HDLC's unreliable delivery
mode, Unnumbered Information.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 92
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 93
HDLC history
• It was developed for Terminal Networks
• Extended for WAN to WAN PTP serial links
• Extended for WAN to LAN PTP Serial Links
• Extended for PTMP for LAN Multi drop links
• Support Half-duplex and full-duplex modes
• Support PTP and PTMP networks
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 94
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 95
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 96
FIELD NAME SIZE (BITS)
Flag Field 8 bits
Address Field 8 bits
Control Field 8 or 16 bits
Information Field
Variable (not used in some
type of HDLC frames)
FCS (Frame Check Sequence)
Field
16 or 32 bits
Closing Flag Field 8 bits
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 97
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 98
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 99
1. I-frame
I-frame stands for Information frames. This frame is
generally used for transporting user data from network
layer. These frames actually carry actual data or
information of upper layer and some control information.
This frame carries data along with both send sequence
number and an acknowledgment number. It can also be
used to piggyback acknowledgment information in case
of ABM (Asynchronous Balanced Mode). The first bit of
this frame of control filed is 0.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 100
2. S-frame
S-frame stands for Supervisory frames. These frames are
basically required and essential for error control and flow
control. They also provide control information. It contains
or includes only an Acknowledgment number.
First two bit of this frame of control filed is 10. S-frame
does not have any information fields. This frame contains
send and receive sequence numbers. E.g.
• Receive Ready (RR)
• Receive Not Ready (RNR)
• Reject on frame N(R) (REJ)
• Selective reject on N(R) (SREJ), etc.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 101
3. U-frame
U-frame stands for Unnumbered frames. These frames are also required in
various functions like link setup and disconnections. These frames basically
support control purposes and are not sequenced. First two bit of this frame of
control filed is 11. Some of U-frame contain an information field depending
upon type.
These frames are also used for different miscellaneous purposes along with
link management. U-frame is required for managing link itself. This frame
does not include any type of acknowledgment information i.e. in turn it
includes or contained in sequence number. These frames are generally
reserved for system management. E.g.
• Set Normal Response Mode (SNRM)
• Set Asynchronous Response Mode (SARM)
• Set Asynchronous Balanced Mode (SABM)
• Unnumbered Polling (UP)
• Unnumbered Acknowledge (UA), etc.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 102
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 103
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 104
P/F if 1 then primary to secondary if 0 then secondary to primary
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 105
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 106
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 107
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 108
Point-to-Point Protocol (PPP)
In computer networking, Point-to-Point Protocol (PPP) is a Data
link layer (layer 2) communications protocol between
two routers directly without any host or any other networking in
between. It can provide connection authentication, transmission
encryption, and compression, load balancing and error detection
and link quality monitoring. Originally, PPP was often used for
dial-up connections. Nowadays it's still used for DSL with PPPoE
(PPP over Ethernet) and PPPoA (PPP over ATM). One of the
advantages of still using PPP is that it allows authentication
through PAP and CHAP.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 109
Contd..
Its main component are Encapsulation, Authentication
protocols, Link Control Protocol(LCP) and Network control
protocol(LCP).
It is Character oriented, WAN protocol, commonly run over
internet links. It is mainly used in broadband communications
having heavy loads and high speeds. It is used to transmit
multiprotocol data between two directly connected point to
point computers.
It does not provide services of flow control, multipoint, error
correction and retransmission, or delivery in order.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 110
Functions of PPP protocol
• To define the following:
• The frame format
• Link establishment
• Data exchange process
• Method of encapsulation of network layer
data in the data link frame
• And the authentication process between two
devices.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 111
FrameFormatof PPP
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 112
Difference between HDLC and PPP
The main difference between High-level Data Link Control
(HDLC) and Point-to-Point Protocol (PPP) is that High-level
Data Link Control is the bit-oriented protocol, on the other
hand, Point-to-Point Protocol is the byte-oriented protocol.
Another difference between HDLC and PPP is that HDLC is
implemented by Point-to-point configuration and also multi-
point configurations on the other hand while PPP is
implemented by Point-to-Point configuration only.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 113
The Serial Line Internet Protocol (SLIP)
The Serial Line Internet Protocol (SLIP) is an encapsulation of the
Internet Protocol designed to work over serial ports and modem
connections. SLIP was developed by Rick Adams in 1984. It is
documented in RFC 1055. SLIP has been largely replaced by the
Point-to-Point Protocol (PPP), which has more features
and does not require a predefined IP address configuration. As
SLIP does not provide error detection, it is not recommended for
error-prone dial-up connections.
However, embedded applications running on microcontrollers
are still using SLIP for encapsulating IP packets due to its
very small overhead.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 114
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 115
SLIP Frame
SLIP frame has a very simple format, comprising of payload and a
flag that acts as an end delimiter. The flag is generally a special
character equivalent to decimal 192. If this flag is present in the
data, then an escape sequence precedes it, so that the receiver
does not consider it as the end of the frame.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 116
Advantages of SLIP
• It has a very small overhead. So, it is suitable
for usage in microcontrollers.
• It reuses the existing dial-up connections and
telephone lines.
• It supports the most widely used protocol,
Internet Protocol (IP). So, there is ease of
deployment.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 117
SLIP limitations
It cannot support or provide services for :
• multiple physical connections within a link (multilink)
• CHAP or PAP authentication
• packet filtering
• error detection
• negotiation of IP addresses
• Bring up on demand of links
• automatic reacquisition of links
• timing out of inactive links
• extensibility to network protocols other than IP
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 118
Point-to-Point Protocol
Serial Line Internet
Protocol
High-level Data Link
Control
Currently used protocol Older protocol Older protocol
Used in establishing a direct
connection
Used to handle TCP/IP
traffic
Used for point to multipoint
connections
Data link layer Physical layer protocol Data link layer protocol
Provide error checking
Doesn’t
provide error checking
Provide error correction
Comprehensive
framing mechanism
Single ended character is
there
Frames can be transmitted
over synchronous or
asynchronous links
Flag to indicate the start and
end of a frame
Used escaped character
that is 0Xco to start and end
of the frame
Beginning and end of each
frame has to be identified
More robust Less robust Less robust
Identifies the protocol in the
data field of the frame
It has no type field
Provide reliable
data transfer field
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 119

More Related Content

What's hot

Csma protocols
Csma protocolsCsma protocols
Csma protocolsManal Shah
 
Computer Communication Networks- Introduction to Transport layer
Computer Communication Networks- Introduction to Transport layerComputer Communication Networks- Introduction to Transport layer
Computer Communication Networks- Introduction to Transport layerKrishna Nanda
 
Overview of Spanning Tree Protocol
Overview of Spanning Tree ProtocolOverview of Spanning Tree Protocol
Overview of Spanning Tree ProtocolArash Foroughi
 
HDLC(High level Data Link Control)
HDLC(High level Data Link Control)HDLC(High level Data Link Control)
HDLC(High level Data Link Control)sonangrai
 
Message queuing telemetry transport (mqtt) message format
Message queuing telemetry transport (mqtt) message formatMessage queuing telemetry transport (mqtt) message format
Message queuing telemetry transport (mqtt) message formatHamdamboy (함담보이)
 
Transport layer services (cn)
Transport layer services (cn)Transport layer services (cn)
Transport layer services (cn)Jay Limbachiya
 
Chapter 2 - Network Models
Chapter 2 - Network ModelsChapter 2 - Network Models
Chapter 2 - Network ModelsWayne Jones Jnr
 
ATM Networking Concept
ATM Networking ConceptATM Networking Concept
ATM Networking ConceptTushar Ranjan
 
Congestion control and quality of services
Congestion control and quality of servicesCongestion control and quality of services
Congestion control and quality of servicesJawad Ghumman
 
Routing in Multicast Communication
Routing in Multicast CommunicationRouting in Multicast Communication
Routing in Multicast CommunicationSahil Jain
 
TCP protocol flow control
TCP protocol flow control TCP protocol flow control
TCP protocol flow control anuragjagetiya
 
4. concurrency control
4. concurrency control4. concurrency control
4. concurrency controlAbDul ThaYyal
 
Computer Communication Networks- TRANSPORT LAYER PROTOCOLS
Computer Communication Networks- TRANSPORT LAYER PROTOCOLSComputer Communication Networks- TRANSPORT LAYER PROTOCOLS
Computer Communication Networks- TRANSPORT LAYER PROTOCOLSKrishna Nanda
 

What's hot (20)

Csma protocols
Csma protocolsCsma protocols
Csma protocols
 
Computer Communication Networks- Introduction to Transport layer
Computer Communication Networks- Introduction to Transport layerComputer Communication Networks- Introduction to Transport layer
Computer Communication Networks- Introduction to Transport layer
 
Overview of Spanning Tree Protocol
Overview of Spanning Tree ProtocolOverview of Spanning Tree Protocol
Overview of Spanning Tree Protocol
 
Arp
ArpArp
Arp
 
Packet switching
Packet switchingPacket switching
Packet switching
 
HDLC(High level Data Link Control)
HDLC(High level Data Link Control)HDLC(High level Data Link Control)
HDLC(High level Data Link Control)
 
Message queuing telemetry transport (mqtt) message format
Message queuing telemetry transport (mqtt) message formatMessage queuing telemetry transport (mqtt) message format
Message queuing telemetry transport (mqtt) message format
 
Transportlayer tanenbaum
Transportlayer tanenbaumTransportlayer tanenbaum
Transportlayer tanenbaum
 
Datalinklayer tanenbaum
Datalinklayer tanenbaumDatalinklayer tanenbaum
Datalinklayer tanenbaum
 
Frame relay
Frame relayFrame relay
Frame relay
 
Transport layer services (cn)
Transport layer services (cn)Transport layer services (cn)
Transport layer services (cn)
 
Chapter 2 - Network Models
Chapter 2 - Network ModelsChapter 2 - Network Models
Chapter 2 - Network Models
 
ATM Networking Concept
ATM Networking ConceptATM Networking Concept
ATM Networking Concept
 
Congestion control and quality of services
Congestion control and quality of servicesCongestion control and quality of services
Congestion control and quality of services
 
Routing in Multicast Communication
Routing in Multicast CommunicationRouting in Multicast Communication
Routing in Multicast Communication
 
Data Link Layer
Data Link LayerData Link Layer
Data Link Layer
 
TCP protocol flow control
TCP protocol flow control TCP protocol flow control
TCP protocol flow control
 
4. concurrency control
4. concurrency control4. concurrency control
4. concurrency control
 
OSI reference model
OSI reference modelOSI reference model
OSI reference model
 
Computer Communication Networks- TRANSPORT LAYER PROTOCOLS
Computer Communication Networks- TRANSPORT LAYER PROTOCOLSComputer Communication Networks- TRANSPORT LAYER PROTOCOLS
Computer Communication Networks- TRANSPORT LAYER PROTOCOLS
 

Similar to Networking lectures unit 2, MCA VII

datalinklayermukesh-150130061041-conversion-gate01.pptx
datalinklayermukesh-150130061041-conversion-gate01.pptxdatalinklayermukesh-150130061041-conversion-gate01.pptx
datalinklayermukesh-150130061041-conversion-gate01.pptxlathass5
 
U2CH1Data Link Layerxxxxxxxxxxxxxxxxx.pptx
U2CH1Data Link Layerxxxxxxxxxxxxxxxxx.pptxU2CH1Data Link Layerxxxxxxxxxxxxxxxxx.pptx
U2CH1Data Link Layerxxxxxxxxxxxxxxxxx.pptxk2w9psdb96
 
Module 5 high speed swan,atm,transport layer
Module 5 high speed swan,atm,transport layerModule 5 high speed swan,atm,transport layer
Module 5 high speed swan,atm,transport layerDeepak John
 
Module 4 netwok layer,routing ,vlan,x.25doc
Module 4 netwok layer,routing ,vlan,x.25docModule 4 netwok layer,routing ,vlan,x.25doc
Module 4 netwok layer,routing ,vlan,x.25docDeepak John
 
UNIT-2 PPT Data link layer.pptx
UNIT-2 PPT Data link layer.pptxUNIT-2 PPT Data link layer.pptx
UNIT-2 PPT Data link layer.pptxdiptijilhare
 
Computer Network Notes UNIT II
Computer Network Notes UNIT IIComputer Network Notes UNIT II
Computer Network Notes UNIT IINANDINI SHARMA
 
Presentation of computer network on data link layer
Presentation of computer network on data link layerPresentation of computer network on data link layer
Presentation of computer network on data link layersumit gyawali
 
High speed Networking
High speed NetworkingHigh speed Networking
High speed Networkingsdb2002
 
CN R16 -UNIT-3.pdf
CN R16 -UNIT-3.pdfCN R16 -UNIT-3.pdf
CN R16 -UNIT-3.pdfJoshuaeeda1
 
Computer networks high speed swan,atm,frame realy
Computer networks high speed swan,atm,frame realyComputer networks high speed swan,atm,frame realy
Computer networks high speed swan,atm,frame realyDeepak John
 

Similar to Networking lectures unit 2, MCA VII (20)

datalinklayermukesh-150130061041-conversion-gate01.pptx
datalinklayermukesh-150130061041-conversion-gate01.pptxdatalinklayermukesh-150130061041-conversion-gate01.pptx
datalinklayermukesh-150130061041-conversion-gate01.pptx
 
III_UNIT.pptx
III_UNIT.pptxIII_UNIT.pptx
III_UNIT.pptx
 
III_UNIT.pptx
III_UNIT.pptxIII_UNIT.pptx
III_UNIT.pptx
 
III_UNIT.ppt
III_UNIT.pptIII_UNIT.ppt
III_UNIT.ppt
 
U2CH1Data Link Layerxxxxxxxxxxxxxxxxx.pptx
U2CH1Data Link Layerxxxxxxxxxxxxxxxxx.pptxU2CH1Data Link Layerxxxxxxxxxxxxxxxxx.pptx
U2CH1Data Link Layerxxxxxxxxxxxxxxxxx.pptx
 
Unit 2
Unit 2Unit 2
Unit 2
 
DLL
DLLDLL
DLL
 
datalinklayermukesh
datalinklayermukeshdatalinklayermukesh
datalinklayermukesh
 
Module 5 high speed swan,atm,transport layer
Module 5 high speed swan,atm,transport layerModule 5 high speed swan,atm,transport layer
Module 5 high speed swan,atm,transport layer
 
Module 4 netwok layer,routing ,vlan,x.25doc
Module 4 netwok layer,routing ,vlan,x.25docModule 4 netwok layer,routing ,vlan,x.25doc
Module 4 netwok layer,routing ,vlan,x.25doc
 
Data link layer
Data link layer Data link layer
Data link layer
 
Seamless and Secured wide Fidelity enhancement in moving vehicles Using Eeack...
Seamless and Secured wide Fidelity enhancement in moving vehicles Using Eeack...Seamless and Secured wide Fidelity enhancement in moving vehicles Using Eeack...
Seamless and Secured wide Fidelity enhancement in moving vehicles Using Eeack...
 
UNIT-2 PPT Data link layer.pptx
UNIT-2 PPT Data link layer.pptxUNIT-2 PPT Data link layer.pptx
UNIT-2 PPT Data link layer.pptx
 
Unit 2 ppt 3.ppt
Unit 2 ppt 3.pptUnit 2 ppt 3.ppt
Unit 2 ppt 3.ppt
 
Computer Network Notes UNIT II
Computer Network Notes UNIT IIComputer Network Notes UNIT II
Computer Network Notes UNIT II
 
Presentation of computer network on data link layer
Presentation of computer network on data link layerPresentation of computer network on data link layer
Presentation of computer network on data link layer
 
High speed Networking
High speed NetworkingHigh speed Networking
High speed Networking
 
Unit 3 - Data Link Layer - Part A
Unit 3 - Data Link Layer - Part AUnit 3 - Data Link Layer - Part A
Unit 3 - Data Link Layer - Part A
 
CN R16 -UNIT-3.pdf
CN R16 -UNIT-3.pdfCN R16 -UNIT-3.pdf
CN R16 -UNIT-3.pdf
 
Computer networks high speed swan,atm,frame realy
Computer networks high speed swan,atm,frame realyComputer networks high speed swan,atm,frame realy
Computer networks high speed swan,atm,frame realy
 

More from Vasanti Dutta

More from Vasanti Dutta (6)

MCA-5 unit1
MCA-5 unit1MCA-5 unit1
MCA-5 unit1
 
Networking lec1 4
Networking lec1 4Networking lec1 4
Networking lec1 4
 
Networking lecture1
Networking lecture1Networking lecture1
Networking lecture1
 
Jcv course contents
Jcv course contentsJcv course contents
Jcv course contents
 
Lecture notesmap
Lecture notesmapLecture notesmap
Lecture notesmap
 
Servlet classnotes
Servlet classnotesServlet classnotes
Servlet classnotes
 

Recently uploaded

Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajanpragatimahajan3
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024Janet Corral
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...fonyou31
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 

Recently uploaded (20)

Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 

Networking lectures unit 2, MCA VII

  • 2. Agenda :Unit 2 Data Link Layer :- Design Issues : Framing, Error Control, Flow Control, Elementary Data Link Protocols, Sliding window protocol, Example Data link protocols :HDLC, SLIP and PPP. IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 2
  • 3. The Main Design Issues Reliability Resource Allocation Scalability Routing Addressing Error Control Flow Control Statistical Multiplexing Security The most possible issues with the Data Link can be : – Induced traffic: – Power and bandwidth constraints – Interpretation unfairness – Interpretation of congestion – Dynamic topology IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 3
  • 4. Data Link Layer The data link layer is the protocol layer in a program that handles the moving of data into and out of a physical link in a network. The data link layer is Layer 2 in the Open Systems Interconnection (OSI) architecture model for a set of telecommunication protocols. The main service provided is to transfer data packets from the network layer on the sending machine to the network layer on the receiving machine. In actual communication, the data link layer transmits bits via the physical layers and physical medium. The main design issues are related to services provided to the Network Layer, Framing, Error Control and Flow Control. IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 4
  • 5. IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 5
  • 6. IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 6
  • 7. Responsibilities/services of the Data Link Layer: IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 7
  • 8. Unacknowledged connectionless service Here, the data link layer of the sending machine sends independent frames to the data link layer of the receiving machine. The receiving machine does not acknowledge receiving the frame. No logical connection is set up between the host machines. Error and data loss is not handled in this service. This is applicable in Ethernet services and voice communications. IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 8
  • 9. Acknowledged connectionless service Here, no logical connection is set up between the host machines, but each frame sent by the source machine is acknowledged by the destination machine on receiving. If the source does not receive the acknowledgment within a stipulated time, then it resends the frame. This is used in Wifi (IEEE 802.11) services. IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 9
  • 10. Acknowledged connection-oriented service This is the best service that the data link layer can offer to the network layer. A logical connection is set up between the two machines and the data is transmitted along this logical path. The frames are numbered, that keeps track of loss of frames and also ensures that frames are received in correct order. The service has three distinct phases − • Set up of connection – A logical path is set up between the source and the destination machines. Buffers and counters are initialized to keep track of frames. • Sendingframes – The frames are transmitted. • Release connection – The connection is released, buffers and other resources arereleased. • It is appropriate for satellite communications and long-distance telephone circuits. IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 10
  • 11. Parts of a Frame A frame has the following parts − • 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. IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 11
  • 12. IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 12
  • 13. Framing • Advantage: Data is broken up into recoverablechunks thatcan easily be checked for corruption. • Problemsin Framing– • Detecting start of the frame: When a frame is transmitted, every station must be able to detect it. Station detect frames by looking out for special sequence of bits that marks the beginning of the frame i.e. SFD (Starting Frame Delimeter). • How do station detect a frame: Every station listen to link for SFD pattern through a sequential circuit. If SFD is detected, sequential circuit alerts station. Station checks destination address to accept or rejectframe. • Detectingendof frame: When to stop readingthe frame. IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 13
  • 14. Methods of Framing There are basically four methods of framing as given below – 1. Character Count 2. Flag Byte with Character Stuffing 3. Starting and Ending Flags, with Bit Stuffing 4. Encoding Violations IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 14
  • 15. IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 15
  • 16. Framing Types 1. Fixed size – The frame is of fixed size and there is no need to provide boundaries to the frame, length of the frame itself acts as delimiter. Drawback: It suffers from internal fragmentation if data size is less than frame size Solution: Padding 2. Variable size – In this there is need to define end of frame as well as beginningof next frame to distinguish.Thiscan be donein two ways: Length field – We can introduce a length field in the frame to indicate the length of the frame. Used in Ethernet(802.3). The problem with this is that sometimes the length field might get corrupted. End Delimeter (ED) – We can introduce an ED(pattern) to indicate the end of the frame. Used in Token Ring. The problem with this is that ED can occur in the data. IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 16
  • 17. Solutions to End Delimeter (ED) occurrence in data 1. Character/ByteStuffing: Used when frames consistof character. If data containsED then, byte is stuffedinto data to differentiateit from ED. Let ED = “$” –> if data contains ‘$’ anywhere, it can be escaped using ‘O’ character. –> if data contains‘O$’ then, use ‘OOO$'($ is escaped using O and O is escaped using O). 2. Disadvantage – It is very costly and obsolete method. IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 17
  • 18. IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 18
  • 19. IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 19
  • 20. Contd.. 3. Bit Stuffing: • Let ED = 01111 and if data = 01111 • –> Sender stuffs a bit to break the pattern i.e. here appends a 0 in data = 011101. • –> Receiver receives the frame. • –> If data contains 011101, receiver removes the 0 and reads the data. E.g.– • If Data –> 011100011110and ED –> 0111 then, find data after bit stuffing ?–> 01110000111010 • If Data –> 110001001 and ED –> 1000 then, find data after bit stuffing ?–> 11001010011 IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 20
  • 21. IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 21
  • 22. Physical Layer Coding Violations Encoding violation is method that is used only for network in which encoding on physical medium includes some sort of redundancy i.e., use of more than one graphical or visual structure to simply encode or represent one variable of data. IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 22
  • 23. Noiseless channel means that there will not be any kind of interference or disturbancein the path of communicationor transmission. IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 23
  • 24. Simplex Protocol Simplex Protocol is one that has no flow or error control and it is a unidirectional protocol in which data frames are traveling in only one direction-from the sender to receiver. We assume that the receiver can immediately handle any frame it receives with a processing time that is small enough to be negligible. The data link layer of the receiver immediately removes the header from the frame and hands the data packet to its network layer, which can also accept the packet immediately. IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 24
  • 25. Stop and Wait Protocol Stop and Wait means, whatever the data that sender wants to send, he sends the data to the receiver. After sending the data, he stops and waits until he receives the acknowledgment from the receiver. The stop and wait protocol is a flow control protocol where flow control is one of the services of the data link layer. It is a data-link layer protocol which is used for transmitting the data over the noiseless channels. It provides unidirectional data transmission which means that either sending or receiving of data will take place at a time. It provides flow-control mechanism but does not provide any error control mechanism. IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 25
  • 26. Error control in Data Link Layer Error control in data link layer is the process of detecting and correcting data frames that have been corrupted or lost during transmission. In case of lost or corrupted frames, the receiver does not receive the correct data-frame and sender is ignorant about the loss. Data link layer follows a technique to detect transit errors and take necessary actions, which is retransmission of frames whenever error is detected or frame is lost. The process is called Automatic Repeat Request (ARQ). IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 26
  • 27. Phases in Error Control Detection of Error − Transmission error, if any, is detected by either the sender or the receiver. Acknowledgment − acknowledgment may be positive or negative. – Positive ACK − On receiving a correct frame, the receiver sends a positive acknowledge. – Negative ACK − On receiving a damaged frame or a duplicate frame, the receiver sends a negative acknowledgment back to the sender. Retransmission − The sender maintains a clock and sets a timeout period. If an acknowledgment of a data-frame previously transmitted does not arrive before the timeout, or a negative acknowledgment is received, the sender retransmits the frame. IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 27
  • 28. Error and Flow Control IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 28
  • 29. Stop and Wait – The sender sends the packet and waits for the ACK (acknowledgement) of the packet. Once the ACK reaches the sender, it transmits the next packet in row. If the ACK is not received, it re-transmits the previous packet again. Go Back N – The sender sends N packets which is equal to the window size. Once the entire window is sent, the sender then waits for a cumulative ACK to send more packets. On the receiver end, it receives only in- order packets and discards out-of-order packets. As in case of packet loss, the entire window would be re-transmitted. Selective Repeat – The sender sends packet of window size N and the receiver acknowledges all packet whether they were received in order or not. In this case, the receiver maintains a buffer to contain out-of- order packets and sorts them. The sender selectively re-transmits the lost packet and moves the window forward. IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 29
  • 30. IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 30
  • 31. ARQ For the same function of ARQ, there are various applications: • TransmissionControl Protocol (TCP) • Specific Service OrientationProtocol: Error- correction of message signals in ATM networks. • High-LevelData Link protocol. • IBM Binary synchronous Communications Protocol. • Xmodem : modem file transfer protocol. IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 31
  • 32. Stop and Wait ARQ • Used in Connection-orientedcommunication. • It offerserrorand flow control • It is used in Data Link and TransportLayers • Stop and Wait ARQ mainly implements Sliding WindowProtocol conceptwith WindowSize 1 Sender: Send one data packet at a time. Send next packetonly after receivingacknowledgementfor previous. Receiver: Acknowledgementafter receivingand consumingof data packet. After consumingpacketacknowledgementneed to be sent (Flow Control) Problems: Lost Data, Lost Acknowledgement,Delayed Acknowledgement/Data IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 32
  • 33. Solution: Stop and Wait ARQ IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 33
  • 34. IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 34
  • 35. Stop and Wait ARQ • Propagation Delay: Amount of time taken by a packet to make a physical journey from one router to another router. • Propagation Delay = (Distance between routers) / (Velocity of propagation) • RoundTripTime (RTT) = 2* Propagation Delay • TimeOut (TO) = 2* RTT • Time To Live (TTL) = 2* TimeOut. (Maximum TTL is 180 seconds) IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 35
  • 36. Features: Stop and Wait ARQ • It uses link between sender and receiver ashalf duplexlink • Throughput= 1 Data packet/frame per RTT • If Bandwidth*Delay product is very high, then stop and wait protocol is not so useful. The sender has to keep waiting for acknowledgements before sendingthe processed nextpacket. • It is an example for “Closed Loop OR connection oriented “ protocols • It is an special category of SWP whereits window size is 1 • Irrespective of number of packets sender is having stop and wait protocol requires only 2 sequence numbers0 and 1 Stop and Wait ARQ may work fine where propagation delay is very less for example LAN connections, but performs badly for distant connections like satellite connection. IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 36
  • 37. Go Back-N ARQ • Go Back-N ARQ uses the concept of protocol pipelining i.e. the sender can send multiple frames before receiving the acknowledgement for the first frame. • N is the sender’s window size. • There are finite numbers of frames numbered in sequential order. e.g. if the sending window size is 4(or 22), then the sequence no. will be 0,1,2,3, 0,1,2,3,0,1…. • The no. of frames that can be sent depends on the window size of the sender. • If the acknowledgement of the frame is not received within time then all frames in the current window are re- transmitted. IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 37
  • 38. IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 38
  • 39. Selective Repeat ARQ • In Selective Repeat ARQ, only the erroneous or lost frames are retransmitted, while correct frames are received and buffered. • The receiver keeps track of sequence number; it buffers the frames in memory and sends the negative acknowledgment for missing or defected frames, • The sender then re-sends only for the negative acknowledgment received. IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 39
  • 40. IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 40
  • 41. Question 1. Station A needs to send a message consisting of 9 packets to station B using a sliding window (size 3) and go-back-n error control strategy. All packets are ready and immediately available for transmission. If every 5th packet that A transmits gets lost (not acknowledgment), then find the number of packets transmitted by A to B. IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 41
  • 42. Question 2. Host A wants to send 10 frames to Host B. The hosts agreed to go with selective repeat ARQ. How many numbers of frames are transmitted by Host A if every 6th frame that is transmitted by host A is either destroyed or lost? Also find the number of frames sent if he could have used Go-Back-4 ARQ. IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 42
  • 43. PROPERTIES STOP AND WAIT GO BACK N SELECTIVE REPEAT Sender window size 1 N N Receiver Window size 1 1 N Minimum Sequence number 2 N+1 2N Efficiency 1/(1+2*a) N/(1+2*a) N/(1+2*a) Type of Acknowledgement Individual Cumulative Individual Supported order at Receiving end – In-order delivery only Out-of-order delivery as well Number of retransmissions in case of packet drop 1 N 1 a = Ratio of Propagation delayand Transmissiondelay IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 43
  • 44. Error Detection & Correction Data-link layer uses some error control mechanism to ensure that frames (data bit streams) are transmitted with certain level of accuracy. But to understand how errors is controlled, it is essential to know what types of errors may occur. IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 44
  • 45. Types of Errors • Single bit error • Burst error (More than 1, continuous or non- continuous bit) IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 45
  • 46. Error Detecting Techniques: Basic approach used for error detection is the use of redundancy bits, where additional bits are added to facilitate detection of errors. • Single parity check/Vertical redundancy check (VRC) • Two-dimensional parity check/Longitudinal (LRC) • Checksum • Cyclic redundancy check IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 46
  • 47. Simple Parity check Blocks of data from the source are subjected to a check bit or parity bit generator form, where a parity of : • 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 • This scheme makes the total number of 1’s even, that is why it is called even parity checking. IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 47
  • 48. IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 48
  • 49. Limitation of VRC • Single bit error • Burst error is checked if number of error is odd. IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 49
  • 50. 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. IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 50
  • 51. IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 51
  • 52. IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 52
  • 53. Limitations of LRC IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 53
  • 54. 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. IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 54
  • 55. IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 55
  • 56. IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 56
  • 57. Question IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 57
  • 58. IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 58
  • 59. IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 59
  • 60. IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 60
  • 61. Cyclic redundancy check (CRC) • Unlike checksum scheme, which is based on addition, CRC is based on binary division. • In CRC, a sequence of redundant bits, called cyclic redundancy check bits, are appended to the end of data unit so that the resulting data unit becomes exactly divisible by a second, predetermined binary number. • At the destination, the incoming data unit is divided by the same number. If at this step there is no remainder, the data unit is assumed to be correct and is therefore accepted. • A remainder indicates that the data unit has been damaged in transit and therefore must be rejected. IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 61
  • 62. IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 62
  • 63. IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 63
  • 64. Question: To find the CRC for the data blocks 100100with the divisor1101. IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 64
  • 65. CRC is 001 Data Transmitted:100100001 Find the CRC for the data blocks100100withthe divisor 1101. IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 65
  • 66. Question: Find the CRC for 1110010101with a divisor of X3 + X2 +1. IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 66
  • 67. Hint IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 67
  • 68. Error-correcting codes Error-correcting codes (ECC) are a sequence of numbers generated by specific algorithms for detecting and removing errors in data that has been transmitted over noisy channels. Error correcting codes ascertain the exact number of bits that has been corrupted and the location of the corrupted bits, within the limitations in algorithm. ECCs can be broadly categorized into two types − Block codes − The message is divided into fixed-sized blocks of bits, to which redundant bits are added for error detection or correction. Convolutional codes − The message comprises of data streams of arbitrary length and parity symbols are generated by the sliding application of a Boolean function to the data stream. IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 68
  • 69. Error Correction Techniques Error correction techniquesfind out the exact number of bits that have been corrupted and as well as their locations. • Backward Error Correction (Retransmission) • Forward Error Correction Codes used: – Hamming Codes – Binary ConvolutionCode – Reed – Solomon Code – Low-Density Parity-Check Code IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 69
  • 70. Backward Error Correction Technique of error correction that occurs in a channel through the detection of errors by the receiver: the receiver responds to any errors in a block by requesting the transmitter to retransmit the affected block. Backward correction requires a return channel, by contrast with forward error correction. BEC (also known as Automatic Repeat reQuest, ARQ) uses feedback from the receiver to the transmitter: the receiver signals to the transmitter whether a block of data was received correctly or not. If the reception is erroneous, then the transmissionis repeated. IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 70
  • 71. Forward error correction (FEC) Forward error correction (FEC) is a method of obtaining error control in data transmission in which the source (transmitter) sends redundant data and the destination (receiver) recognizes only the portion of the data that contains no apparent errors. FEC works by adding redundant bits to a bitstream to help the decoder detect and correct some transmission errors without the need for retransmission. The name forward stems from the fact that the flow of data is always in the forward direction (i.e., from encoder to decoder). IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 71
  • 72. Hamming code Hamming code is a set of error-correction codes that can be used to detect and correct the errors that can occur when the data is moved or stored from the sender to the receiver. The number of redundant bits(parity) can be calculated using the following formula: Redundant bits – Redundant bits are extra binary bits that are generated and added to the information-carrying bits of data transfer to ensure that no bits were lost during the data transfer. The number of redundant bits can be calculated using the following formula: 2^r ≥ m + r + 1 where, r = redundant bit, m = data bit IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 72
  • 73. Encoding a message by Hamming Code The procedure used by the sender to encode the message encompasses the following steps: • Step 1 − Calculation of the number of redundant bits. • Step 2 − Positioning the redundant bits. • Step 3 − Calculating the values of each redundant bit. IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 73
  • 74. Step 1 − Calculation of the number of redundant bits If the message contains m𝑚number of data bits, r𝑟number of redundant bits are added to it so that m𝑟 is able to indicate at least (m + r+ 1) different states. Here, (m + r) indicates location of an error in each of (𝑚 + 𝑟) bit positions and one additional state indicates no error. Since, r𝑟 bits can indicate 2r 𝑟 states, 2r 𝑟 must be at least equal to (m + r + 1). Thus the following equation should hold 2r ≥ m+r+1 e.g. Suppose the number of data bits is 7, then the number of redundant bits can be calculated using: = 2^4 ≥ 7 + 4 + 1 [check putting values r = 1,2,3,4] Thus, the number of redundant bits= 4 as it satisfies the condition. IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 74
  • 75. Positioning the redundant bits The r redundant bits placed at bit positions of powers of 2, i.e. 1, 2, 4, 8, 16 etc. They are referred in the rest of this text as r1 (at position 1), r2 (at position 2), r3 (at position 4), r4 (at position 8) and so on. IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 75
  • 76. Calculating the values of each redundant bit The redundant bits are parity bits. A parity bit is an extra bit that makes the number of 1s either even or odd. The two types of parity are − • Even Parity − Here the total number of bits in the message is made even. • Odd Parity − Here the total number of bits in the message is made odd. • Each redundant bit, ri, is calculated as the parity, generally even parity, based upon its bit position. It covers all bit positions whose binary representation includes a 1 in the ith position except the position of ri. Thus − • r1 is the parity bit for all data bits in positions whose binary representation includes a 1 in the least significant position excluding 1 (3, 5, 7, 9, 11 and so on) • r2 is the parity bit for all data bits in positions whose binary representation includes a 1 in the position 2 from right except 2 (3, 6, 7, 10, 11 and so on) • r3 is the parity bit for all data bits in positions whose binary representation includes a 1 in the position 3 from right except 4 (5-7, 12-15, 20-23 and so on) IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 76
  • 77. IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 77
  • 78. Decoding a message in Hamming Code Once the receiver gets an incoming message, it performs recalculations to detect errors and correct them. The steps for recalculation are − • Step 1 − Calculation of the number of redundant bits. • Step 2 − Positioning the redundant bits. • Step 3 − Parity checking. • Step 4 − Error detection and correction IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 78
  • 79. Decoding a message in Hamming Code Step 1 − Calculation of the number of redundant bits • Using the same formula as in encoding, the number of redundant bits are ascertained. • 2r ≥ m + r + 1 where m is the number of data bits and r is the number of redundant bits. Step 2 − Positioning the redundant bits • The r redundant bits placed at bit positions of powers of 2, i.e. 1, 2, 4, 8, 16 etc. Step 3 − Parity checking • Parity bits are calculated based upon the data bits and the redundant bits using the same rule as during generation of c1,c2 ,c3 ,c4 etc. Thus • c1 = parity(1, 3, 5, 7, 9, 11 and so on) • c2 = parity(2, 3, 6, 7, 10, 11 and so on) • c3 = parity(4-7, 12-15,20-23 and so on) IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 79
  • 80. Error Correction part Step 4 − Error detection and correction The decimal equivalent of the parity bits binary values is calculated. If it is 0, there is no error. Otherwise, the decimal value gives the bit position which has error. Note:Read the detail in solved examplewith diagramsin the class notessent in PDF. IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 80
  • 81. Questions • The 7-bit hamming code word received by a receiver is 1011011. For the even parity, state whether the received code word is correct or wrong. If wrong locate the bit having error. • A(7,4) hamming code is received as 1010111. Determine the correct code when there is even parity. IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 81
  • 82. IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 82
  • 83. IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 83
  • 84. Block Codes as Correcting Codes Block Codes (No memory is required) : (n,k) block code is generate when the channel encoder accepts information in successive k bit blocks. At the end of each such block, (n-k) parity bit is added, which contains no information and termed as redundant bits. In block coding, we divide our message into blocks, each of k bits, called data-words. We add r redundant bits to each block to make the length n = k + r. The resulting n-bit blocks are called code-words. For the moment, it is important to know that we have a set of data-words, each of size k, and a set of code-words, each of size of n. With k bits, we can create a combination of 2 𝑘data-words; with n bits, we can create a combination of 2 𝑛 code-words. The block coding process is one-to-one; the same data-word is always encoded as the same code- word. IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 84
  • 85. IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 85
  • 86. Convolutional Codes Convolutional Codes (Memory is required): Here the code words are generated by discrete– time convolution of the input sequence with impulse response of the encoder. Unlike block codes, channel encoder accepts messages as a continuous sequence and generates a continuous sequence of encoded bits at the output. IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 86
  • 87. ConvolutionEncoder IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 87
  • 88. Convolutional codes rate (r) : r= k/n , here k is number of message bits and ‘n’ is number of encoded output bits for one message bit. ConstraintLength(k) It is the number of shifts over which a single message bit can influence the encoder output. IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 88
  • 89. m1 m2 state 0 0 a 0 1 b 1 0 c 1 1 d I/P PS (m1,m2) NS 0 00 00 1 00 10 0 10 01 1 10 11 0 01 00 1 01 10 0 11 01 1 11 11 m m1 m2 X1 X2 PS NS 0 0 a 0 0 a 0 1 b 0 1 b 1 0 c 1 0 c 1 1 d 1 1 d m m1 m2 X1 X2 PS NS 0 0 0 a 1 0 0 a 0 0 1 b 1 0 1 b 0 1 0 c 1 1 0 c 0 1 1 d 1 1 1 d Assignment IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 89
  • 90. Assignment Hamming( Distance, vector, bound) IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 90
  • 91. HDLC, PPP, SLIP Unit 2 Part III IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 91
  • 92. High-level data link control (HDLC) It was actually called SDLC(Synchronous data link control), developed by IBM and is a bit oriented protocol. High-level data link control (HDLC), documented in ISO 3309, specifies a packet forming standard for serial links. HDLC supports several modes of operation, including a simple sliding window mode for reliable delivery. Since Internet provide retransmission at higher levels (i.e. TCP), most Internet applications use HDLC's unreliable delivery mode, Unnumbered Information. IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 92
  • 93. IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 93
  • 94. HDLC history • It was developed for Terminal Networks • Extended for WAN to WAN PTP serial links • Extended for WAN to LAN PTP Serial Links • Extended for PTMP for LAN Multi drop links • Support Half-duplex and full-duplex modes • Support PTP and PTMP networks IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 94
  • 95. IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 95
  • 96. IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 96
  • 97. FIELD NAME SIZE (BITS) Flag Field 8 bits Address Field 8 bits Control Field 8 or 16 bits Information Field Variable (not used in some type of HDLC frames) FCS (Frame Check Sequence) Field 16 or 32 bits Closing Flag Field 8 bits IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 97
  • 98. IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 98
  • 99. IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 99
  • 100. 1. I-frame I-frame stands for Information frames. This frame is generally used for transporting user data from network layer. These frames actually carry actual data or information of upper layer and some control information. This frame carries data along with both send sequence number and an acknowledgment number. It can also be used to piggyback acknowledgment information in case of ABM (Asynchronous Balanced Mode). The first bit of this frame of control filed is 0. IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 100
  • 101. 2. S-frame S-frame stands for Supervisory frames. These frames are basically required and essential for error control and flow control. They also provide control information. It contains or includes only an Acknowledgment number. First two bit of this frame of control filed is 10. S-frame does not have any information fields. This frame contains send and receive sequence numbers. E.g. • Receive Ready (RR) • Receive Not Ready (RNR) • Reject on frame N(R) (REJ) • Selective reject on N(R) (SREJ), etc. IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 101
  • 102. 3. U-frame U-frame stands for Unnumbered frames. These frames are also required in various functions like link setup and disconnections. These frames basically support control purposes and are not sequenced. First two bit of this frame of control filed is 11. Some of U-frame contain an information field depending upon type. These frames are also used for different miscellaneous purposes along with link management. U-frame is required for managing link itself. This frame does not include any type of acknowledgment information i.e. in turn it includes or contained in sequence number. These frames are generally reserved for system management. E.g. • Set Normal Response Mode (SNRM) • Set Asynchronous Response Mode (SARM) • Set Asynchronous Balanced Mode (SABM) • Unnumbered Polling (UP) • Unnumbered Acknowledge (UA), etc. IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 102
  • 103. IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 103
  • 104. IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 104
  • 105. P/F if 1 then primary to secondary if 0 then secondary to primary IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 105
  • 106. IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 106
  • 107. IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 107
  • 108. IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 108
  • 109. Point-to-Point Protocol (PPP) In computer networking, Point-to-Point Protocol (PPP) is a Data link layer (layer 2) communications protocol between two routers directly without any host or any other networking in between. It can provide connection authentication, transmission encryption, and compression, load balancing and error detection and link quality monitoring. Originally, PPP was often used for dial-up connections. Nowadays it's still used for DSL with PPPoE (PPP over Ethernet) and PPPoA (PPP over ATM). One of the advantages of still using PPP is that it allows authentication through PAP and CHAP. IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 109
  • 110. Contd.. Its main component are Encapsulation, Authentication protocols, Link Control Protocol(LCP) and Network control protocol(LCP). It is Character oriented, WAN protocol, commonly run over internet links. It is mainly used in broadband communications having heavy loads and high speeds. It is used to transmit multiprotocol data between two directly connected point to point computers. It does not provide services of flow control, multipoint, error correction and retransmission, or delivery in order. IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 110
  • 111. Functions of PPP protocol • To define the following: • The frame format • Link establishment • Data exchange process • Method of encapsulation of network layer data in the data link frame • And the authentication process between two devices. IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 111
  • 112. FrameFormatof PPP IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 112
  • 113. Difference between HDLC and PPP The main difference between High-level Data Link Control (HDLC) and Point-to-Point Protocol (PPP) is that High-level Data Link Control is the bit-oriented protocol, on the other hand, Point-to-Point Protocol is the byte-oriented protocol. Another difference between HDLC and PPP is that HDLC is implemented by Point-to-point configuration and also multi- point configurations on the other hand while PPP is implemented by Point-to-Point configuration only. IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 113
  • 114. The Serial Line Internet Protocol (SLIP) The Serial Line Internet Protocol (SLIP) is an encapsulation of the Internet Protocol designed to work over serial ports and modem connections. SLIP was developed by Rick Adams in 1984. It is documented in RFC 1055. SLIP has been largely replaced by the Point-to-Point Protocol (PPP), which has more features and does not require a predefined IP address configuration. As SLIP does not provide error detection, it is not recommended for error-prone dial-up connections. However, embedded applications running on microcontrollers are still using SLIP for encapsulating IP packets due to its very small overhead. IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 114
  • 115. IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 115
  • 116. SLIP Frame SLIP frame has a very simple format, comprising of payload and a flag that acts as an end delimiter. The flag is generally a special character equivalent to decimal 192. If this flag is present in the data, then an escape sequence precedes it, so that the receiver does not consider it as the end of the frame. IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 116
  • 117. Advantages of SLIP • It has a very small overhead. So, it is suitable for usage in microcontrollers. • It reuses the existing dial-up connections and telephone lines. • It supports the most widely used protocol, Internet Protocol (IP). So, there is ease of deployment. IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 117
  • 118. SLIP limitations It cannot support or provide services for : • multiple physical connections within a link (multilink) • CHAP or PAP authentication • packet filtering • error detection • negotiation of IP addresses • Bring up on demand of links • automatic reacquisition of links • timing out of inactive links • extensibility to network protocols other than IP IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 118
  • 119. Point-to-Point Protocol Serial Line Internet Protocol High-level Data Link Control Currently used protocol Older protocol Older protocol Used in establishing a direct connection Used to handle TCP/IP traffic Used for point to multipoint connections Data link layer Physical layer protocol Data link layer protocol Provide error checking Doesn’t provide error checking Provide error correction Comprehensive framing mechanism Single ended character is there Frames can be transmitted over synchronous or asynchronous links Flag to indicate the start and end of a frame Used escaped character that is 0Xco to start and end of the frame Beginning and end of each frame has to be identified More robust Less robust Less robust Identifies the protocol in the data field of the frame It has no type field Provide reliable data transfer field IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 119