CITS3002 Computer Networks  
prev
next CITS3002 help3002 CITS3002 schedule  

Detecting Frame Loss

There is still the possibility that errors on the channel cause the frames to be lost entirely. In particular, the DLL_ACK and DLL_NACK frames themselves may be lost (or corrupted?) and the sender will be left waiting forever.

The big question is: how long should the sender wait for an acknowledgement?

To handle these new problems we need to change our programming paradigm, from the standard iterative one (of C) to an event-driven one (as with Java's windowing APIs).

Moreover, we'll now need to handle the concept of time in our programs and implement protocols which perform nominated actions when interesting events occurs.

In the sender:

#define ESTIMATED_ROUND_TRIP_TIME     20000    // microseconds

FRAME frame;                   // global variables
int   len;

void network_layer_ready(...)  // called iff ready
{
    READ_NETWORK_LAYER(frame.data, &len);

    STOP_NETWORK_LAYER();

    frame.type     = DLL_DATA;
    frame.len      = len;
    frame.checksum = 0;
    frame.checksum = checksum_crc16(&frame, FRAME_SIZE(frame));

    link = 1;
    WRITE_PHYSICAL_LAYER(link, &frame, FRAME_SIZE(frame));
    start_timer( ESTIMATED_ROUND_TRIP_TIME );
}




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