CITS3002 Computer Networks  
prev
next CITS3002 help3002 CITS3002 schedule  

The Half-Duplex Stop-and-Wait Protocol

Next, we'll remove the assumption that the receiver can safely receive and store an infinite amount of data.

When this happens, we say that the (fast) sender floods the receiver, and the "drowning" receiver needs to control the rate at which data is received.

For now, we'll keep the assumption that the unidirectional channel is error-free.

In the sender:

FRAME frame;
int   len, link;

while( true ) {
    READ_NETWORK_LAYER(frame.data, &len);
    frame.len  = len;
    link       = 1;
    WRITE_PHYSICAL_LAYER(link, &frame, FRAME_SIZE(frame));

    READ_PHYSICAL_LAYER(&link, &frame, &len);
}

In the receiver:

FRAME frame;
int   len, link;

while( true ) {
    READ_PHYSICAL_LAYER(&link, &frame, &len);
    WRITE_NETWORK_LAYER(frame.data, frame.len);

    link = 1;
    WRITE_PHYSICAL_LAYER(link, &frame, 1 /* one byte */); 
}




CITS3002 Computer Networks, Lecture 3, Data Link Layer protocols, p5, 13th March 2024.