Protocols Flashcards
Simple Stop and Wait protocol
Is a data link layer protocol for the transmission of frames over noiseless channels
Provides unidirectional data transmission with flow control
Simple Stop and Wait protocol operation
Sender sends 1 data frame
Receiver recieves the data frame and sends an acknowledgement(ACK)
Sender receives ACK and sends the next data frame
Simple Stop and Wait protocol disadvantages
Slow (sender has to wait for ACK before sending next frame)
Cannot be used in noisy channel
Simple Stop and Wait protocol problems
- Damaged frame: receiver sends ACK on success or NAK on damaged frame. Then sender can retransmit
- Lost data frame: if frame gets lost during transfer, we go into deadlock. Receiver is waiting for frame to arrive. Sender is waiting for ACK to arrive.
Prevent by: sender sets a timeout interval. if it doesn’t get an ACK within this timeframe, sender will assume data frame was lost and will re-transmit - Lost ACK: if ACK is lost, sender will detect a timeout and re-trasmit the same frame, meaning the receiver will get a duplicate frame.
Solve by: sender attaches a sequence number to each frame and receiver will check this on arrival and will discard any duplicates.
Simple Stop and Wait protocol. Why is the length of the timeout interval important?
If it is too long, the sender will wait unnecessarily long before retransmission, causing the link to be idle
if it is too short, the protocol may fail due to the occurrence of duplicate ACKs
Can be solved by including the sequence number of the acknowledged frame in the ACK itself.
However all frames are still sent twice, causing 50% loss of transmission capacity
ARQ(Automatic repeat ReQuest) protocols
Group of error - control protocols incorporated with stop and wait flow control protocol for transmission of data over noisy or unreliable networks
Provide automatic retransmission of frames that are corrupted or lost during transmission
Stop and wait ARQ protocol operation
The sender sends the frame(keeps a copy of it) with a unique sequence number, then waits for ACK from the receiver
If a timeout occurs(frame or ACK is lost), the frame is retransmitted again
Frames with CRC errors are rejected by the receiver and NAK is sent
Duplicate frames or ACKs are also rejected
Piggy-backing
similar to stop and wait ARQ, but data frame sent by a receiver carry acknowledgements of its received frames
advs:
better channel utilisation(fewer bits transmitted), less computation by the hosts(less work to pack, unpack and check the extra frames)
disadvs:
if the receiver waits too long to send a piggybacked ack, the sender will timeout and retransmit the frame
should only be a brief wait, if no data is available, the ACK is sent on its own. This requires a timeout from the server
Go-Back N ARQ protocol
Allows for sending N frames before receiving the ack for the first frame
Frames are sequentially numbered
uses concept of sliding windows at the sender and receiver.
Sender window size is greater than 1
Receiver window size is always 1
Receiver only accepts frames that arrive in order
On error, receiver discards all frames that follow a missing/errored frame. sender continues unaware until timeout. then resends all frames starting from that frame
Min range of sequence numbers that must be used is window size +1
Selective repeat ARQ protocol
Also provides for sending N frames before receiving ACK for first time
sender window size is greater than 1
receiver window is greater than 1
Receiever accepts frames anywhere in the receive window
On error, the receiver sends NAK. Receiver buffers frames. Sender continues unaware until NAK is received. Sender re sends corrupted/lost frame only.
Utilisation is much better than go back N if errors are common
Min range of sequence numbers that must be used is window size *2
Differences between Go back N and selective repeat ARQ protocols
Go Back N: the minimum range of sequence numbers that must be used for it to work properly is the window size +1
Selective repeat: the minimum range of sequence numbers that must be used for it to work properly is the window size*2
Go back N: when a NAK is received, the sender will continue to send the next frames until a timeout occurs and then will re send all the frames starting from the corrupted/lost frame
Selective repeat: when a NAK is received, the sender will re-send the corrupted/lost frame only
Go back N: the receiver will only accept frames sent in order
Selective repeat: the receiver will accept frames in any order
ALOHA protocols
Used on satellite channels
Pure ALOHA
Hosts transmit whenever they want, and colliding frames are destroyed
If a frame was destroyed, the sender just waits a random amount of time and sends again
Utilisation is bad under high load(18%)
Hosts cant listen to channel
Slotted ALOHA
Divide the time up into discrete intervals, each interval corresponding to one frame
Hosts can only transmit at the start of each time slot
This requires one special station to emit a “pip” at the start of each interval. for all others to synchronise. This is double the efficiency of pure ALOHA at 37%
Hosts cant listen to channel
CSMA(carrier sense multiple access) protocol
Hosts listen for the presence of a carrier signal and act accordingly
Only makes sense on systems with short delays such as LANs