Homework 7

22C:116, Spring 1999

Due Friday Mar 26, 1999, in class

Douglas W. Jones
  1. Background: Consider the flow of ASCII data from one computer to another over a 1200 baud asynchronous bidirectional RS-232 channel using DB-9 connectors, where the receiving computer has a 4K byte data buffer and the transmitter must not overrun this buffer. To control this, the transmitter sends an ENQ character after each 1K bytes. If the receiver has not lost any of the preceeding 1K bytes, as soon as it has space for 1K more bytes, it responds with an ACK character. If it is necessary for the transmitter to resend the previous 1K bytes, the receiver responds with a NAK character.

    In the ISO OSI protocol hierarchy, everything described above is part of the data link and physical layers, yet there is obviously quite a bit here!

    Part A: The ISO OSI protocol hierarchy is not the final word in hierarchic analysis of communication protocols. What layers or sublayers can you identify in the protocol hierarchy described above?

    Part B: Give a top-level design for the code running on the transmitting computer. assume that the application level code calls put-byte(ch) every time it has a character ch to send over the link, and that the transmitter has a commonplace UART interface, and that the UART is served by two interrupt service routines, one called when input arrives, and one called when output can be sent.

  2. The Problem: Explain how the concepts of remote-procedure-call and client-server design are related, and explain why, despite these relationships, these ideas are distinct.

  3. Background: RPC protocol design poses two challenges: 1) to make the RPC very compact and efficient for small frequently called procedures with minimal parameters, and 2) to make the RPC protocol flexible enough to accomodate arbitrary parameter and result structures across a variety of machines, some with radically different native data representations.

    Part A: Some RPC advocates urge us to use canonical data representations in all intermachine data transmission. Which of the above problems does this solve and why might this conflict with the other problem.

    Part B: Suggest a canonical data representation for data sent by a C program on one machine to a C program on another. Consider the possibility that one machine may be bigendian, the other littleendian, one may use ASCII as its native character set, while the other uses EBCDIC, one may use 32-bit words while the other uses 36-bit words. Assume there is no such thing as floating point data!