4. What do we mean by absence of global clock? Give the impact of the absence of global time. What is logical clock? Explain. A global clock in a distributed system is a physical and practical impossibility. Computer systems are bounded by the laws of physics and messages can not travel faster than the speed of light. Readings from a “global clock” would necessarily be delayed due to the time taken for the messaging and this is substantial in a distributed system. For the same reasons shared memory in a distributed system is a practical and physical impossibility. However, one can in software create an abstraction for “shared memory” in a distributed system and the consequence of clock differences will be inconsistency unless Consensus schemes are used. In addition to the use of consensus, it is possible to reduce clock differences to more manageable levels with the use of GPS clocks and Atomic clock . By reducing the potential of clock drift to manageable levels it is possible to process some messages locally during the messaging interval required for global consensus. This is only possible for transformations where results merge without conflicts once global ordering is established. The only non-clock-based approach to this, that I know of, is to eschew global consensus for an equally strong proof of consensus known as “gossip about gossip”. Updates are not instantaneous, but consistency is maintained and decentralized without a global clock or even global authority. Hello future | Hedera Hashgraph The absence of starvation is a fairness condition. Another fairness issue is the order in which processes enter the critical section. It is not possible to order entry to the critical section by the times that the processes requested it, because of the absence of global clocks. But a useful fairness requirement that is sometimes made makes use of the happened-before ordering (Section 14.4) between messages that request entry to the critical section: The essential problem is the absence of global time. If all processes had perfectly synchronized clocks, then we could agree on a time at which each process would record its state – the result would be an actual global state of the system. From the collection of process states we could tell, for example, whether the processes were deadlocked. But we cannot achieve perfect clock synchronization, so this method is not available to us. So we might ask whether we can assemble a meaningful global state from local states recorded at different real times. The answer is a qualified ‘yes’, but in order to see this we must first introduce some definitions. Let us return to our general system � of N processes pi ( i = 1� 2� �� N ), whose execution we wish to study. We said above that a series of events occurs at each process, and that we may characterize the execution of each process by its history: Logical clocks • Lamport [1978] invented a simple mechanism by which the happened be fore ordering can be captured numerically, called a logical clock. A Lamport logical clock is a monotonically increasing software counter, whose value need bear no particular relationship to any physical clock. Each process pi keeps its own logical clock, Li , which it uses to apply socalled Lamport timestamps to events. We denote the timestamp of event e at pi by Li�e� , and by L�e� we denote the timestamp of event e at whatever process it occurred at. To capture the happened-before relation �, processes update their logical clocks and transmit the values of their logical clocks in messages as follows: LC1: Li is incremented before each event is issued at process pi : Li := Li + 1. LC2: (a) When a process pi sends a message m, it piggybacks on m the value t = Li . (b) On receiving (m, t), a process pj computes Lj := max�Lj� t� and then applies LC1 before timestamping the event receive(m). 11. Proof RSA using number theory (this question available on chapter 4, slide #22) The RSA algorithm is the basis of a cryptosystem -- a suite of cryptographic algorithms that are used for specific security services or purposes -- which enables public key encryption and is widely used to secure sensitive data, particularly when it is being sent over an insecure network such as the internet. Why the RSA algorithm is used RSA derives its security from the difficulty of factoring large integers that are the product of two large prime numbers. Multiplying these two numbers is easy, but determining the original prime numbers from the total -- or factoring -- is considered infeasible due to the time it would take using even today's supercomputers. The public and private key generation algorithm is the most complex part of RSA cryptography. Two large prime numbers, p and q, are generated using the RabinMiller primality test algorithm. A modulus, n, is calculated by multiplying p and q. This number is used by both the public and private keys and provides the link between them. Its length, usually expressed in bits, is called the key length. The public key consists of the modulus n and a public exponent, e, which is normally set at 65537, as it's a prime number that is not too large. The e figure doesn't have to be a secretly selected prime number, as the public key is shared with everyone. The private key consists of the modulus n and the private exponent d, which is calculated using the Extended Euclidean algorithm to find the multiplicative inverse with respect to the totient of n. Read on or watch the video below for a more detailed explanation of how the RSA algorithm works. Number Theory - RSA The following function creates a key with the given number of bits; for example, if bits equals 10, it creates a key n=pq such that n is approximately 2^{10}=1024. In real life example, bits should be chosen to be 512, 1024, or 2048 long. def rsa(bits): # only prove correctness up to 1024 bits proof = (bits <= 1024) p = next_prime(ZZ.random_element(2**(bits//2+1)), proof=proof) q = next_prime(ZZ.random_element(2**(bits//2+1)), proof=proof) n = p*q phi_n = (p-1)*(q-1) while True: e = ZZ.random_element(1,phi_n) if gcd(e,phi_n) == 1: break d = lift(Mod(e,phi_n)^(-1)) return e, d, n Mod(2,5)^(-1) 3 rsa(5) (3, 11, 25) rsa(10) (1283, 1251, 2491) e,d,n = rsa(20) e,d,n (40927, 16887, 98191) factor(n) 149 * 659 rsa(1024) (67126724203886314541441069277551673113265859694562273366855445139 15\ 142840686866213399560441976979884711650408505466930786369486347817 56\ 893289528603789098385185342389004594308344353306864820151664766818 33\ 792129204011396495302831002879081581505901087691046782796842130834 85\ 710781728326845905238452050845617037, 263202682873866035805076021107834162694245132784438692275245577601 46\ 016597882812459249708133680598646745972050879961149271422538954572 85\ 741720845517972462396670289099963270620956739272905419747952685421 79\ 894187564205941792559112853166268995781354226220627908892499270658 83\ 0573478825598943632530274529907813, 690734888285305065814588451932094017368525397769180965915250740131 44\ 304835364836039643211736461928822583756591179580351707464667064065 51\ 640718882738591820563612192258069333654724623186011858095295514095 58\ 349418811954911112459460117748479000559183124893956492993432926170 58\ 54987100436127511815064358289899819) The next two functions encrypt a message m using the public key (e,n) and decrypt the cipher c using the private key d. def encrypt(m, e, n): return lift(Mod(m,n)^e) def decrypt(c, d, n): return lift(Mod(c,n)^d) e,d,n = rsa(20) e,d,n (693361, 58681, 1092407) c = encrypt(1000,e,n) c 100736 decrypt(c,d,n) 1000 The next two functions encode and decode a string of ASCII code (such as letters A,B,C,... and symbols !,..) into a number. Each symbol in ASCII code is assigned a number from 0 to 255. This is transformed into a number using base 256. def encode(s): s = str(s) return sum(ord(s[i])*256^i for i in range(len(s))) def decode(n): n = Integer(n) v = [] while n != 0: v.append(chr(n % 256)) n //= 256 # this replaces n by floor(n/256) return ''.join(v) m = encode('Run away!'); m 617488957642785060178 decode(m) 'Run away!' ord('a') 97 ord('!') 33 chr(33) '!' chr(97) 'a' Now let's do a complete example: First Alice makes her public and private key. e,d,n = rsa(1024) n 199168436531162816703762808371714489384360480810986576217546459569 10\ 692722851776757939346619086750398925168583886873734984268321401665 25\ 507608199865958297881190497534414353005864523259003065352501233766 57\ 857062050075646069324597424758050625935045013123244701784302913861 56\ 9057246863092659608859833524175647453 She gives Bob her public key (e,n). He then first encodes his message into a number and then encrypts it using Alice's public key. m = encode('Meet me at 4.'); m 3660627931379277721006992876877 c = encrypt(m,e,n); c 281386522029515423656637851095374775020481967641204982285752176592 08\ 225116216264633584085234306357141189109675307950167425348270015357 00\ 671394204772759398133846140547616530153376277583715239485266127673 52\ 913634408662444528341769037157642927599086142431488004343925668865 74\ 146602550773431639536043092865645320 He sends Alice c. Alice then decrypts the message using her private key d that only she knows. M = decrypt(c,d,n); M 3660627931379277721006992876877 decode(M) 'Meet me at 4.' It is hard to factor this big n: factor(n) 14. What is the use of Middleware? Define CORBA explicitly. Middleware is software which lies between an operating system and the applications running on it. Essentially functioning as hidden translation layer, middleware enables communication and data management for distributed applications. It is sometimes called plumbing, as it connects two applications together so data and databases can be easily passed between the “pipe.” Using middleware allows users to perform such requests as submitting forms on a web browser or allowing the web server to return dynamic web pages based on a user’s profile. Middleware • The term middleware applies to a software layer that provides a programming abstraction as well as masking the heterogeneity of the underlying networks, hardware, operating systems and programming languages. 15. What Are the Security Mechanisms Used in Distributed Computing? Distributed systems are critical to modern computing, but are difficult to secure. The cornerstone of providing distributed system security tends to be ensuring that the insecure network connecting system components does not introduce new security problems. Messages sent between the components are encrypted and authenticated, protecting their privacy and integrity, and offering exclusive access to the distributed service to the intended users. Standard tools like SSL/TLS and public keys distributed through X.509 certificates are used to provide these security services. Passwords are often used to authenticate remote human users.