0% found this document useful (0 votes)
54 views

Unit - IV: Issues in Data Link Layer Design: Dr. K. K. Patel

The document describes issues related to data link layer design in computer networks. It discusses functions of the data link layer like providing an interface to the network layer, regulating data flow, and dealing with transmission errors. It also describes services provided to the network layer, including unacknowledged connectionless, acknowledged connectionless, and acknowledged connection-oriented services. Additionally, it covers data link layer mechanisms like framing using character count, byte stuffing and bit stuffing, error control, and flow control using techniques like sliding windows.

Uploaded by

romit
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
54 views

Unit - IV: Issues in Data Link Layer Design: Dr. K. K. Patel

The document describes issues related to data link layer design in computer networks. It discusses functions of the data link layer like providing an interface to the network layer, regulating data flow, and dealing with transmission errors. It also describes services provided to the network layer, including unacknowledged connectionless, acknowledged connectionless, and acknowledged connection-oriented services. Additionally, it covers data link layer mechanisms like framing using character count, byte stuffing and bit stuffing, error control, and flow control using techniques like sliding windows.

Uploaded by

romit
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 61

Unit - IV:

Issues in
Data Link Layer Design
Hours: 08
FCN

Dr. K. K. Patel
• Unit - I: Basics of Computer Network Hours: 05
• Definition of Computer Network,
• Goals of Computer Network: For Businesses, For
People,
• Advantages & Disadvantages of Computer Network,
• Applications of Computer Network,
• Components of Computer Network,
• Types of Networks, Network Topologies.

Dr. K. K. Patel
1.2
 Unit - II: Network Communication Concepts
Hours: 07
 Parallel & Serial Communication,
 Synchronous & Asynchronous Communication.
 Modes of Communication: Simple, Half-Duplex, Full-
Duplex,
 Multiplexing, De-Multiplexing: FDA, TDM.
 Communication Media: Guided Media, Unguided
Media.
 Switching Techniques: Circuit Switching, Message
Switching, Packet Switching.

Dr. K. K. Patel
4.3
Unit - III: Reference Models
Hours: 05

• LAYERED TASKS
• THE OSI MODEL
• LAYERS IN THE OSI MODEL
• TCP/IP PROTOCOL SUITE
• ADDRESSING

Dr. K. K. Patel 2.4


• Unit - IV: Issues in Data Link Layer Design
Hours: 08
• Functions of the Data Link Layer
• Services provided to the Network Layer,
• Framing,
• Error Control (error detection and correction
code),
• Flow Control

Dr. K. K. Patel
1.5
Functions of the Data Link Layer

•Provide service interface to the network layer

•Regulating data flow


•Slow receivers not swamped by fast
senders

•Dealing with transmission errors


Functions of the Data Link Layer (2)
Relationship between packets and frames.
Services Provided to Network Layer
(a) Virtual communication.
(b) Actual communication.

L3 - NL
L2 – DLL
L1 – Physical
P D N T S PA
Types of services provided
to the Network Layer
• Unacknowledged Connectionless service

• Acknowledged Connectionless service

• Acknowledged Connection-Oriented service


Unacknowledged Connectionless service
• Used on reliable medium
like coax cables or optical fiber,
where the error rate is low.

• Appropriate for voice,


where delay is worse than bad data.

• Losses are taken care of at higher layers


Acknowledged Connectionless service
• Useful on unreliable medium like wireless.
• Disadvantage: Acknowledgements add delays.

• Adding ack in the DLL rather than in the NL is


just an optimization and not a requirement.
- Leaving it for the NL is inefficient
as a large message (packet) has to be resent in
that case
in contrast to small frames here.
• On reliable channels, like fiber, the overhead associated with the ack
is not justified.
Acknowledged Connection-oriented service
• is the Most reliable,
• Guaranteed service –
• Each frame sent is indeed received
• Each frame is received exactly once
• Frames are received in order
• Special care has to be taken to ensure this in connectionless services
• Unit - IV: Issues in Data Link Layer Design
Hours: 08
• Services provided to the Network Layer,
• Framing,
• Error Control (error detection and correction
code),
• Flow Control,

Dr. K. K. Patel
1.13
Framing
• Framing is the process to create FRAMEs from PACKETs
• Methods for framing
• Character Count
• Flag bytes with byte stuffing
• Flag bytes with bit stuffing
Framing with Character Count

A character stream

(a) Without errors.

(b) With one error.


Problem with Framing with CC
• What if the count is garbled (i.e. corrupted)
1. Even if with checksum,
the receiver knows that the frame is bad
there is no way to tell where the next frame starts.
2. Asking for retransmission doesn’t help either
b’cs the start of the retransmitted frame is not known
• No longer used

With one error.


Framing with byte stuffing
Flag bytes with byte stuffing
Byte FLAG is placed in beginning of frame…

- If flag is part of data

- If ESC is part of data

- If ESC & flag are part


of data

- If two ESC are part of


data
Framing with byte stuffing
Flag bytes with byte stuffing

• Problem :
• Worked for fixed character size only :
• For ex., assumes character size to be 8 bits :
Consequence:
• can’t handle heterogeneous environment.
Framing with bit stuffing
Flag bytes with bit stuffing
• Bit stuffing is the process of inserting non-information bits
into data
to break up bit patterns to affect the
synchronous transmission
of information.

• It is to limit the number of consecutive bits of


the same value included
in the transmitted data
for run-length limited coding.
Flag bytes with bit stuffing

• This procedure includes a bit of the opposite value


after the maximum allowed number of
consecutive bits of the same value.

• For instance, if a number of zero bits are transmitted consecutively,


the receiving end loses synchronization because a lot of time has
passed without voltage sensing.
Framing with bit stuffing
Flag bytes with bit stuffing

Bit stuffing
(a) The original data.
(b) The data as they appear on the line.
(c) The data as they are stored in receiver’s memory after de-stuffing.
Data Link Layer Design Issues
• Services Provided to the Network Layer
• Framing

• Flow Control
• Error Control
Flow Control
Events At S end er Site Network M es s ag es Events At Receiver Site

It is the S end Packet 1


process of Receive Packet 1
S e nd ACK 1
regularizing Receive ACK 1
S end Packet 2
the flow of Receive Pa cket 2
S e nd ACK 2
data
Receive ACK 2

between
Sender and
Time moves from top to bottom in the diagram
Receiver

5
Flow Control
• what happens when a frame completely vanishes :
• receiver neither sends a +ack nor –ack

• Retransmission: how?

• Timers
Providing Reliability
Traditional technique:
Positive Acknowledgement with Retransmission (PAR)

–Receiver sends acknowledgement when data arrives

–Sender starts timer whenever transmitting

–Sender retransmits if timer expires before


acknowledgement arrives
4
Illustration Of Recovery After Packet Loss
Events At S end er Site Network M es s ag es Events At Receiver Site

Packet lost
Send Packet 1
Start Timer
Packet should arrive
ACK should be sent
ACK would normally
arrive at this time

Timer Expires

Retransmit Packet 1
Start Timer
Receive Packet 1
S e nd ACK 1
Receive ACK 1
Cancel Timer

6
• Problem with Timers :
• It may result in
a frame being sent more than once
and
received more than once :

• solution :
• assign sequence numbers to frames
The Problem With Simplistic PAR

A simple positive acknowledgement protocol


wastes a substantial amount of network bandwidth
because it must delay sending a new frame until it receives
an acknowledgement for the previous packet.

Problem is especially severe if network has long latency

7
Solving The Problem of Simplistic PAR

Allow multiple frames to be


outstanding at any time
Still require acknowledgements and
retransmission
known as
sliding window
8
Illustration Of
Sliding Window
initial window

1 2 3 4 5 6 7 8 9 10 . . .

(a)

window slides

1 2 3 4 5 6 7 8 9 10 . . .

(b)

Window size is fixed


As acknowledgement arrives, window moves forward

9
1
1

Illustration Of Sliding Window


Events At S end er Site Network M es s ag es Events At Receiver Site

S end Packet 1

Receive Pa cket 1
S end Packet 2 S end ACK 1
Receive Pa cket 2
S end Packet 3 S e nd ACK 2
Receive Packet 3
Receive ACK 1 S e nd ACK 3

Receive ACK 2

Receive ACK 3
Why Sliding Window Works

Because a well-tuned sliding window protocol keeps the


network completely saturated with frames, it obtains
substantially higher throughput than a simple positive
acknowledgement protocol.
• Object Oriented Programming with C++ :
Class code zkz5qu
• Fundamentals of Computer Networks (FCN) -2019 :
Class code 6cm3opu

• Unit Test of OOPC:


11/Sep => Unit 4 (Inheritance) of OOPC
20 MARKS Objective Questions

Dr. K. K. Patel
Data Link Layer Design Issues
• Services Provided to the Network Layer
• Framing

• Flow Control

• Error Control
• Hamming distance and Even Parity bit
• CRC
Error Detection and Correction
• In some cases it is sufficient to detect an error and
in some,
it requires the errors to be corrected also.
For eg.
• On a reliable medium : ED is sufficient where
the error rate is low and
asking for retransmission after ED
would work efficiently

• In contrast, on an unreliable medium: EC is desirable b’cs


Retransmission after ED may result in another
error and still another and so on. Hence EC is desirable.
Hamming Codes : for ED n EC
• m data bits together with r error check bits
form an n = (m + r) bit codeword

• The number of bits two codewords differ in,


is called the hamming distance
between the two codewords
For ex., d(01101010,11011011) = 4.
• Significance : If two codewords are at HD d then
it requires d single bit errors
to convert one into the other
For eq .. Consider parity: 1 (r = 1) parity bit is appended with value
so that
the total number of 1’s
in the codeword
is even ..

Then 11011 is a legal codeword in this scheme but 11010 is not


Use of HD for error detection
• For ex.
Even parity bit
• Data is 11010 -> then parity 1 is added 111010
• Data is 10010 -> then parity 0 is added 010010

• When receiver receive 101010 instead of 111010 then


HD (01010, 11010) is 1
i.e. we can detect one bit error
• Even parity bit for 1:
• Data bits 10101  so checkbit is 1  code word is 110101
• Data bits 100101010101  so checkbit is 0  code word is
0100101010101
• Data bits 110101111101  so checkbit is 1  code word is
1110101111101

sender sent the code word 1110101111101


and receiver received code word as 1110101111111
there is error:
• Odd parity bit for 1:
• Data bits 10101  so checkbit is 0  code word is 010101

• Data bits 100101010101  so checkbit is 1  code word is


1100101010101
• Data bits 110101111101  so checkbit is 0  code word is
0110101111101
• Even parity bit for 0:
• Data bits 10101  so checkbit is 1  code word is 110101
• Data bits 100101010101  so checkbit is 1  code word is
1100101010101
• Data bits 110101111101  so checkbit is 0  code word is
0110101111101
• Odd parity bit for 0:
• Data bits 10101  so checkbit is 0  code word is 010101

• Data bits 100101010101  so checkbit is 0  code word is


0100101010101
• Data bits 110101111101  so checkbit is 1  code word is
1110101111101
• Even parity bit for 1s:

• Data bits is 1100101010101010


• Check bit: 0
• Code word: 01100101010101010

• Data bits is 1010101010101010


• Check bit: 0
• Code word: 01010101010101010
Use of HD for error detection

• To detect d single bit errors , we need (an algorithm that


creates)
a code list with HD at least d + 1

For eg . For the parity scheme ..


HD is 2 ..
hence it can be used
to detect single bit errors (d=1)
0101 => 0111
Continued…
• If the recvd codeword is legal .. We accept it ,
• And if it is illegal we report (detect) an error
• Object Oriented Programming with C++ :
Class code zkz5qu
• Fundamentals of Computer Networks (FCN) -2019 :
Class code 6cm3opu

• Unit Test of OOPC:


11/Sep => Unit 4 (Inheritance) of OOPC
20 MARKS Objective Questions

Dr. K. K. Patel
Data Link Layer Design Issues
• Services Provided to the Network Layer
• Framing
• Flow Control

• Error Control
• Hamming distance and Even Parity bit
• CRC

VVIMP - CRC
4-6 marks sum -> 100%
Error detecting code
• Polynomial code or CRC (Cyclic Redundancy Check )
Binary representation using polynomial
• Bit-string represents polynomial.
• e.g. 110001
represents as:

= 1 . x5 + 1 . x4 + 0 . x3 + 0 . x2 + 0 . x1 + 1 . x0
= x5 + x4 + x0
CRC
• A message m : a string of bits
corresponds to a polynomial denote it by M(x).
• r check bits …. polynomial R(x).
• Transmitted bits m + r …. polynomial
T(x) = M(x) + R(x)
• Generator polynomial G(x)

• r check-bits are computed so that


when G(x) divides T(x), the remainder is zero.
i.e. T(x) / G(x) = 0
XOR = Subtraction = Addition

Addition Subtraction Multi


0+0=0 0-0=0 0*0=0
0+1=1 0-1=1 0*1=0
1+0=1 1-0=1 1*0=0
1+1=0 1-1=0 1*1=1
Error-Detecting Codes

Calculation of the polynomial


code checksum.
CRC contd..
• At the receiving end,
receiver again divides the polynomial corresponding to
the received bits (i.e. T(x)) by G(x)
and accepts it iff the remainder is zero.

i.e. accept it iif T(x) / G(x) = 0


•1
• Find out CRC [R(x)] for
• M(x) = 11001100
• G(x) = 1101

• 100
•2
• Find out CRC [R(x)] for
• M(x) = 101010
• G(x) = 101

• 10
•3
• Find out CRC [R(x)] for
• M(x) = 100111000100
• G(x) = 1001

• 111
•4
• Find out CRC [R(x)] for
• M(x) = 1001100
• G(x) = 1101

• 001
1001100 % 1101
111
1001100 000
1101 1101
1001
1101
1000
1101
1010
1101
1110
1101
0110
• R(x) = 001
• T(x) = 1001100001

• On receiver
• T(x) / G(x)  0 then no error
1 then there is error
•5
• Find out CRC [R(x)] for
• M(x) = 11011
• G(x) = 111

• 00
• Questions

You might also like