Department of Electrical Engineering and Computer Science MASSACHUSETTS INSTITUTE OF TECHNOLOGY 6 033 Computer Systems Engineering Spring 2004 Quiz I All problems on this quiz are multiple choice questions In order to receive credit you must fill in the blank s or mark the correct answer or answers for each question You have 50 minutes to answer this quiz Write your name on this cover sheet AND at the bottom of each page of this booklet Some questions may be much harder than others Read them all through first and attack them in the order that allows you to make the most progress If you find a question ambiguous be sure to write down any assumptions you make Be neat If we can t understand your answer we can t give you credit THIS IS AN OPEN BOOK OPEN NOTES QUIZ NO PHONES NO LAPTOP NO PDAS ETC CIRCLE your recitation section number 10 00 1 Ernst Strauss 2 Madden Hickey 11 00 3 Dabek Hickey 4 Ernst Chen 5 Madden Strauss 12 00 6 Dabek Chen 1 00 7 Katabi Bicket 8 Saltzer Garfinkel 9 Karger Lesniewski 2 00 10 Saltzer Bicket 11 Katabi Lesniewski 12 Karger Garfinkel Do not write in the boxes below 1 3 xx 30 Name 4 5 xx 20 6 10 xx 50 Total xx 100 6 033 Spring 2004 Quiz 1 I Page 2 of 9 Reading questions 1 10 points Which of the following is an example of a primitive designed for sequence coordination in UNIX reading 6 The UNIX time sharing system Circle ALL that apply A wait B read on a pipe C lseek D mount 2 12 points The Flash paper Flash An efficient and portable Web server reading 7 describes the architectures SPED AMPED MP and MT For each of the following statements circle the architectures that apply to the statement Circle ALL that apply A Suppose a single client issues requests serially i e starting the next request after the response on the current request has been received for files located on the disk Which of the following architectures provides a significant improvement in throughput over the SPED architecture Choose from MP MT AMPED None All B Provides the best performance when the cache miss rate is high when serving multiple clients Choose from SPED MP C Makes use multiple times of the UNIX fork supervisor call Choose from SPED APMED MT MP D Assume that the delay observed for a client for a web request for a cached page is broken down as follows 100 ms network latency to deliver the request packet to the server 1ms of processing time at the server 100 ms of network latency to deliver the page to the client in a return packet A number of clients issue requests at the same time Which of the following architectures can process more than one request every 201ms Choose from MP MT SPED AMPED None All Name 6 033 Spring 2004 Quiz 1 Page 3 of 9 3 8 points If eight stations on an Ethernet Ethernet distributed packet switching for local computer networks reading 8 all want to transmit one packet which of the following statements is true Circle best answer A It is guaranteed that all transmissions will succeed B It is most likely i e with high probability that all stations will eventually end up being able to transmit their data successfully C Some of the transmissions may eventually succeed but it is likely some may not D It is likely that none of the transmissions will eventually succeed Name 6 033 Spring 2004 Quiz 1 II Page 4 of 9 Local remote procedure call Ben Bitdiddle is hired to enforce modularity in a large banking application He splits the program into two pieces the client and the server Ben wants to use remote procedure calls to communicate between the client and server which both run on the same physical machine with one processor So he sets out to design a local remote procedure call LRPC system using the kernel interface from the class notes You can find this interface in Table 2 1 in Section 2 D 11 but you should be able to make it through the question without having to consult the notes The kernel interface is implemented by the kernel program which runs in the kernel address space The kernel manages the address spaces and threads The client and the server each run in their own user address space The client and server each start with one thread There are no user programs other than the client and server running on the machine Communicating messages To implement LRPC the client and server share a block of memory through which they communicate requests and responses This block is at physical address WELLKNOWNBLOCK and contains a request and a response each of the type structure message1 structure message char data 1024 int size bool present the data of the marshalled message at most 1024 bytes the size of the data is a message present structure message request request is an instance of structure message structure message response response is an instance of structure message The client and server both map the block of memory at physical address WELLKNOWNBLOCK into their address spaces The client maps it at the virtual address CLIENT and the server maps it at the virtual address SERVER Server operation To prepare for receiving an LPRC the server registers with the kernel a virtual address STACK to be used as stack pointer and an entry point the virtual address receive where the procedure RECEIVE is located The server maps the well known block in its address space server asn the identifier for the server address space Then it calls the supervisor call YIELD so that YIELD can schedule another thread which might perform an LRPC to the server procedure SERVER register gate STACK receive register entry point see below allocate block WELLKNOWNBLOCK allocate block of physical memory map server asn WELLKNOWNBLOCK SERVER map it at SERVER while true do yield 1 Read the code in this section II carefully it will take time but you should have enough time Name 6 033 Spring 2004 Quiz 1 Page 5 of 9 When a client thread performs an LRPC the kernel starts the LRPC at address receive in the server s address space invoking the procedure RECEIVE and running with the server s stack at virtual address STACK procedure RECEIVE do RP C SERVER request data SERVER request size SERVER response SERVER response present true The notation SERVER request data means the named data field data of the named structure request located on the page with the named virtual address SERVER The procedure RECEIVE invokes the procedure call DO RPC which takes the request message as an argument unmarshals the message processes it and when it returns it has filled in the response message with the marshalled result After
View Full Document
Unlocking...