0% found this document useful (0 votes)
9 views37 pages

CN 2

The document provides an overview of framing in data transmission, detailing the structure of frames, types of framing, and the roles of the data link layer in encapsulating packets into frames. It discusses transmission and propagation delays, the Stop and Wait ARQ protocol, and introduces sliding window protocols like Go-Back-N and Selective Repeat ARQ for improved efficiency. The document also highlights the importance of sequence numbers and acknowledgments in ensuring reliable data transmission.
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)
9 views37 pages

CN 2

The document provides an overview of framing in data transmission, detailing the structure of frames, types of framing, and the roles of the data link layer in encapsulating packets into frames. It discusses transmission and propagation delays, the Stop and Wait ARQ protocol, and introduces sliding window protocols like Go-Back-N and Selective Repeat ARQ for improved efficiency. The document also highlights the importance of sequence numbers and acknowledgments in ensuring reliable data transmission.
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/ 37

By

Ashish Kumar
 Framing is a point-to-point connection between two computers or devices consists
of a wire in which data is transmitted as a stream of bits.
 Frames are the units of digital transmission, particularly in computer networks and
telecommunications.

 In the physical layer, data transmission involves synchronised transmission of bits


from the source to the destination. The data link layer packs these bits into
frames.

 Data-link layer takes the packets from the Network Layer and encapsulates them
into frames. If the frame size becomes too large, then the packet may be divided
into small sized frames. Smaller sized frames makes flow control and error control
more efficient.
 It sends each frame bit-by-bit on the hardware. At receiver’s end, data link layer
picks up signals from hardware and assembles them into frames.
 Parts of a Frame
A frame has the following parts −

1. Frame Header − It contains the source and the destination addresses of the frame.

2. Payload field − It contains the message to be delivered.

3. Trailer − It contains the error detection and error correction bits.

4. Flag − It marks the beginning and end of the frame.


 Types of Framing
Framing can be of two types, fixed sized framing and variable sized framing.

1. Fixed-sized Framing

Here the size of the frame is fixed and so the frame length acts as delimiter of the
frame. Consequently, it does not require additional boundary bits to identify the start
and end of the frame.

2. Variable – Sized Framing

Here, the size of each frame to be transmitted may be different. So additional


mechanisms are kept to mark the end of one frame and the beginning of the next
frame. It is used in local area networks.
 Two ways to define frame delimiters in variable sized framing are −

• Length Field − Here, a length field is used that determines the size of the frame. It
is used in Ethernet (IEEE 802.3).

• End Delimiter − Here, a pattern is used as a delimiter to determine the size of


frame. It is used in Token Rings. If the pattern occurs in the message, then two
approaches are used to avoid the situation −

• Byte – Stuffing − A byte is stuffed in the message to differentiate from the


delimiter. This is also called character-oriented framing.

• Bit – Stuffing − A pattern of bits of arbitrary length is stuffed in the message to


differentiate from the delimiter. This is also called bit – oriented framing.
1. Transmission Delay: This is the amount of time required to push (that is, transmit)
all of the packet’s bits into the link. Transmission delays are typically on the order
of microseconds to milliseconds in practice.
Transmission Delay = Data Size/Bandwidth

2. Propagation Delay: Once a bit is pushed into the link, it needs to propagate to the
other end. The time required to propagate from the beginning of the link to end of
the link is the propagation delay.

 The bit propagates at the propagation speed of the link.

 The propagation speed depends on the physical medium of the link (that is, fiber
optics, twisted-pair copper wire, and so on) and is in the range of 2*108
meters/sec to 3*108 meters/sec.
Propagation Delay = Length of link / Speed
Round trip delay = 2 * Propagation Delay.
 Comparing Transmission and Propagation Delay
- The transmission delay is the amount of time required for the router to push out
the packet. It is a function of the packet’s length and the transmission rate of the
link, but has nothing to do with the length of a link.

- The propagation delay is the time it takes a bit to propagate from one router to the
next.
 It is a function of the distance between the two routers, but has nothing to do
with the packet’s length or the transmission rate of the link.
• Used in Connection-oriented communication.
• It offers error and flows control.
• It is used in Data Link and Transport Layers.
• Stop and Wait for ARQ mainly implements the Sliding Window Protocol concept with
Window Size 1.

 Sender:
1) Send one data packet at a time.

2) Send the next packet only after receiving acknowledgement for the previous.

 Receiver:
1) Send acknowledgement after receiving and consuming a data packet.

2) After consuming packet acknowledgement need to be sent (Flow Control)


 Problems with Stop and Wait

1. Lost Data – Sender waits for acknowledgement and receiver waits for data for
infinite time.
2. Lost Acknowledgement – Sender waits for acknowledgement for infinite time.

Solution

 Stop and Wait for ARQ (Automatic Repeat Request)

Stop and Wait + Time Out (Lost Data) + Data Sequence No. (Lost Ack) + Ack
Sequence No. (Delayed/repeated Ack)
 Working
1) Sender A sends a data frame or packet with sequence number 0.
2) Receiver B, after receiving the data frame, sends an acknowledgement with
sequence number 1 (the sequence number of the next expected data frame or
packet). There is only a one-bit sequence number that implies that both sender and
receiver have a buffer for one frame or packet only.

 The Stop and Wait ARQ solves the main problems of Stop and Wait protocol but
may cause big performance issues as the sender always waits for
acknowledgement even if it has the next packet ready to send.

 To solve this problem, we can send more than one packet at a time with a larger
sequence number.

 So 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
connections.
 Working
1) Sender A sends a data frame or packet with sequence number 0.
2) Receiver B, after receiving the data frame, sends an acknowledgement with
sequence number 1 (the sequence number of the next expected data frame or
packet). There is only a one-bit sequence number that implies that both sender and
receiver have a buffer for one frame or packet only.

 The Stop and Wait ARQ solves the main problems of Stop and Wait protocol but
may cause big performance issues as the sender always waits for
acknowledgement even if it has the next packet ready to send.

 To solve this problem, we can send more than one packet at a time with a larger
sequence number.

 So 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
connections.
 Is a method to combine a data frame with an acknowledgment.
 It can save bandwidth because data frame and an ACK frame can
combined into just one frame.
After each frame sent the host must wait for an ACK
inefficient use of bandwidth

To improve efficiency ACK should be sent after multiple frames

Alternatives: Sliding Window protocol


 Go-back-N ARQ
 Selective Repeat ARQ
Pipelining: A task is begun before the previous task has
ended

 There is no pipelining in stop and wait ARQ because we


need to wait for a frame to reach the destination and be
acknowledged before the next frame can be sent.

 Pipelining improves the efficiency of the transmission


Sliding window protocols apply Pipelining :
Go-Back-N ARQ
Selective Repeat ARQ
 Sliding window protocols improve the efficiency

 Multiple frames should be in transition while waiting for ACK. Let


more than one frame to be outstanding.

 Outstanding frames: frames sent but not acknowledged

 We can send up to W frames and keep a copy of these


frames(outstanding) until the ACKs arrive.

 This procedures requires additional feature to be added :sliding


window
Sequence Numbers
 Sent frames are numbered sequentially.
 Sequence number is stored in the header of the frame.

 If the header of a frame allows m bits for the sequence number, the
sequence numbers range from 0 to (2m - 1).

 The sequence numbers are modulo 2m , where m is the size of


sequence number field in bits.

 If m = 3, sequence number range from 0 to 7 (8 numbers):


0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, …..

 Sliding Window: Used to hold the unacknowledged outstanding


frames (frames sent but not acknowledged).
Sender sliding window
 The sender window is an abstract concept of defining an
imaginary box of size 2m – 1.

 The sender window can slide one or more slots when a valid
acknowledgement arrives.

If m = 3; sequence numbers =
8 and window size =7

Acknowledged frames
Receiver sliding window
 The receive window is an abstract concept defining an
imaginary box of size 1 with one single variable Rn.

 The window slides when a correct frame has arrived; sliding


occurs one slot at a time.
control variables
Outstanding frames: frames sent but
not acknowledged

S: hold the sequence number of the recently sent frame.


SF: holds sequence number of the first frame in the window
SL: holds the sequence number of the last frame
R: sequence number of the frame expected to received
In Go-Back-N ARQ we use one timer for the first outstanding frame
 The receiver sends a positive ACK if a frame has arrived safe and in
order.

 if a frame is damaged or out of order ,the receiver is silent and will


discard all subsequent frames

 When the timer of an unacknowledged frame at the sender site is


expired , the sender goes back and resend all frames , beginning
with the one with expired timer.( that is why the protocol is called
Go-Back-N ARQ)

 The receiver doesn't have to acknowledge each frame received . It


can send cumulative Ack for several frame
Normal operation

 How many frame scan


be transmitted Without
acknowledgment?

 ACK1 is not necessary if


ACK2 is sent:
Cumulative ACK
Damage or Lost Frame
Correctly received out of order packets are not Buffered
What is the disadvantage of this?
In Go-Back N ARQ, the size of the sender window must be less
than 2m; the size of the receiver window is always 1.

Bidirectional transmission : piggybacking

 As Stop-and-Wait we can use piggybacking to improve the efficiency of


bidirectional transmission .

 Each direction needs both a sender window and a receiver window.

 Stop and Wait ARQ is a special case of GO-Back N ARQ in which the size of the
send window is 1.
Go-Back-N ARQ is inefficient of a noisy link.

 In a noisy link frames have higher probability of damage , which


means the resending of multiple frames.
 this resending consumes the bandwidth and slow down the
transmission .

Solution:

 Selective Repeat ARQ protocol : resent only the damage frame

 It defines a negative Acknolgment (NAK) that report the sequence


number of a damaged frame before the timer expires

 It is more efficient for noisy link, but the processing at the receiver
is more complex
 The window size is reduced to one half of 2m .

 Sender window size = receiver window size = 2m/2.

 Window size = Sequence number/2.


 If m = 2, Window size = 4/2 = 2.
 Sequence number = 0, 1, 2, 3.
m=3
Lost Frame Sequences no=2m =8 : 0,1,2 ,3,4,5,6,7
Window size =2m/2= 8/2=4
 When frame 1 is lost, frame 2 arrives and is stored and marked , but it can not
be delivered because frame 1 is missing .

 At the next arrival , frame 3 arrives and is marked and stored , but still none of
the frames can be delivered .

 Only at the last arrival , when finally a copy of frame 1 arrives , can frames 1 , 2
, and 3 be delivered to the network layer.

 There are two conditions for the delivery of frames to the network layer:
1) a set of consecutive frames must have arrived.
2) the set starts from the beginning of the window.
Acknowledgement

 Here only two ACKs are sent.

 The first one acknowledges only the first frame and the second one
acknowledges three frames.

 In Selective Repeat, ACKs are sent when data are delivered to the network layer.

 If the data belonging to n frames are delivered in one shot , only one ACK is sent
for all of them.

Note:
In Selective Repeat ARQ, the size of the sender and the receiver window is at most
one-half of 2m.
m=2
THANK
YOU

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy