2.5. Rehearsal

The purpose of this section is to sketch the principles and issues related to implementing the unicast communication protocols and relate those principles and issues to the middleware that relies on the protocols.

At this point, you should be able to explain how local unicast communication provided by hardware is extended to global scale through addressing and routing.

You should understand the principal character of the different types of communication failures and the approaches used to cope with the failures. You should be able to explain the limits of these approaches in providing the ideally reliable communication.

You should be able to characterize the communication performance in terms of both quantitative parameters and qualitative behavior. You should be able to explain the practical function of flow and congestion control mechanisms in face of typical situations requiring flow or congestion control.

Questions. 

  1. Define the properties of an ideally reliable communication mechanism in terms of messages sent and received by the participants.

    Hint

    What exactly does it mean that communication is reliable ? What is guaranteed when a participant sends a message ? What is guaranteed when a participant receives a message ?

  2. Describe the circumstances under which packet damage cannot be masked by the approaches used to provide reliable communication.

  3. Describe the circumstances under which packet loss and packet duplication cannot be masked by the approaches used to provide reliable communication.

  4. The TCP flow control mechanism is based on the receiver informing the sender of the number of bytes that it can still accept. Explain why this approach is used instead of the receiver simply telling the sender whether it can accept any data or not.

Exercises. 

  1. Navrhněte přenosový protokol, který bude zaručovat spolehlivé doručování zpráv od jednoho odesílatele jednomu příjemci. Váš návrh by měl definovat tyto funkce:

    void ReliableSend (tMsg *pMessage, tAddr *pTarget);
      // Odeslání zprávy, blokuje do přijetí zprávy
    
    void ReliableReceive (tMsg &*pMessage, tAddr &*pSource);
      // Příjem zprávy, blokuje do přijetí zprávy, zaručuje
      // právě jeden příjem nepoškozené odeslané zprávy
    

    Váš návrh by měl používat tyto funkce:

    void UnreliableSend (tMsg *pMessage, tAddr *pTarget);
      // Odeslání zprávy, neblokuje, nemusí odeslat
    
    void UnreliableReceive (tMsg &*pMessage, tAddr &*pSource, int iTimeout);
      // Příjem zprávy, blokuje do timeoutu, může přijmout
      // poškozenou zprávu nebo tutéž zprávu vícekrát
    

    Dále předpokládejte existenci rozumných funkcí pro manipulaci se zprávami jako je jejich vytváření a rušení, nastavování a dotazování atributů přenášených spolu s obsahem zprávy a podobně.

    Hint

    The point of this exercise is to cover the entire spectrum of failures possible with the UnreliableSend and UnreliableReceive functions. For every packet exchanged by the protocol, what happens when it gets damaged, lost, duplicated ?

    For those unfamiliar with the particular programming language, note that the sending functions expect the message and the address as their inputs, but the receiving functions as their outputs.