7.1StartupOKWS is started by a launcher process. The launcher spawnsok-demux, site-specific workers requested by the site operator, and twoother processes seen in Figure 1,iddandok-dbproxy. The processes8
netdok-demuxiddWorkerW1.u’s TCP connection2. GrantuC?3. Lookup UN/PW4. GrantuG?,uT?5. GrantuT?6. GrantuC?,uG?,ContaminateuT37. CreateW[u]8. GrantuW?; read/writeFigure 5: OKWS message flow for handling useru’s Web request.exchange and inherit handles to establish the communication pathsseen in the diagram.Theok-demuxmust be certain that it is communicating with theworker processes that the launcher started and wants to avoid trust-ing workers to identify themselves correctly. Thus, the launchergrants a process-specificverification handleto each process itstarts. Theok-demuxcollects these handle values from the launcher.When a worker identifies itself to theok-demux, it must provide averification labelVcontaining its verification handle at level0, al-lowing theok-demuxto verify that it speaks for the relevant process.Other designs, such as having the launcher mediate initial commu-nication with the workers, would also be possible.In the current prototype, a process crash would necessitate arestart of the whole process suite, though a more mature versionof launcher could restart dead processes (as in OKWS on Unix).7.2Basic connection handlingWe now describe the data path of a simple Web request to OKWSrunning on Asbestos; Figure 5 shows the steps. When a userumakes an HTTP connection:1. The user-level network servernetdaccepts incoming TCP pack-ets from the network. Oncenetdhas acceptedu’s connection, itallocates a new portuCto act as a “socket” to which processescan send READ and WRITE messages. The port label,uCR, isset to{uC0,2}, so that no process can initially send to it. Sec-tion 7.7 describesnetdfurther.2. As it started up,ok-demuxregistered withnetdto listen for in-coming TCP connections on the machine’s Web port. Therefore,netdnotifiesok-demuxof the new connection by granting ituCat level?.3.ok-demuxreads network data fromuover portuCuntil it canauthenticateu. Currently, OKWS uses a simple username andpassword pair, though more sophisticated handshakes are pos-sible. It sendsu’s username and password to OKWS’s identityserver,idd, which is described in Section 7.4.4. Ifuprovided a valid login,iddgrantsok-demuxtwo handlescorresponding tou, ataint handle uTand agrant handle uG,both at level?. These handles function like the similarly-namedhandles in Section 5.5.ok-demuxgrantsuT?tonetd, which then raises its receive labelto containuT3and raisesuCRto{uC0,uT3,2}. These changesallowuT-tainted data to escape over the network, but only viauC. From now on,netdwill respond to all messages onuC(suchas READs) with replies contaminated withuT3.