Lecture 11, Part 1 Notes: Project 3 is due next Tuesday at midnight Project 4 has a deadline of December 16. No slip days. Reviewing "Reflecting on Trust" * The paper hits at the fundamental problem of computer security Suppose we wanted to hack the SSH binary and add a backdoor... (i.e. a secret password) If you uploaded a hacked binary, the change would not persist through to the next version What if you change the C compiler? Change the C compiler to change the SSH source code, as well as its own source code. When bootstrapping, the C compiler will give the bug to itself. -- On Compiler's "teaching" themselves -- Suppose you are writing C code. To insert a char into a string like a newline use an escape. printf("\n"); Code in compiler: c= next(); if (c != '\') return(c); c = next(); if (c == '\') return ('\); if (c == 'n') return('\n'); Suppose we want to add \v (perhaps its a tab). if (c == 'v') return (17); In the next version use: return('\v') To detect if a compiler has modified your program source code... You have two compilers, A and BB Compile A w/ A -> Aa Compile A w/ B -> Ab Compile program P with both compilers. Pa and Pb should be bit for bit identical. ##### Distributed Systems ###### A distributed system is a set of machines with no shared memory and no shared clock Machines communicate through the network. Some networks guarantee data will be delivered. The internet is "best effort," meaning there are no guarantees. You can use distributed systems to: Share resources (e.g. a printer) Speed up computation with parallelism Increase reliability Balance load Network Topology Which component of network is connected directly together. There are fully connected networks (not scalable) Tree structures (require a routing implementation) Ring network Star topology The most general form of a network is something like a hierarchical tree. Distributed Programming Event ordering: - impose a partial order - used to impose a global order A partial order is: E = {e1, e2, ... en } Global order says for all ei, ej ei -> ej || ej -> ei Define '->' to mean "happened before" (ei, ej) where ei -> ej If they share a clock then ei -> ej and ei was executed before ej For a message m, if ei is the sending of m, and ej is the recieving of m then ei->ej Implementing global ordering: Logical clock Each process will have a logical clock (Pi has LCi) For each e vent E on Pj, increment LCj (ei, ej) on Pk For each message m, include the local timestamp at time it was sent When message is recieved, if LC of reciever is < tm, set Lreciever = tm + 1 Suppose two events occur at some timestamp. They cannot causally affect each other.