CN 2
CN 2
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.
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.
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.
• Length Field − Here, a length field is used that determines the size of the frame. It
is used in Ethernet (IEEE 802.3).
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 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.
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 + 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
If the header of a frame allows m bits for the sequence number, the
sequence numbers range from 0 to (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.
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.
Solution:
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 .
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
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