CSC 290e Mobile Computing Introduction to Distributed Computing (cont.) 19 September 2001 Deadlocks - preventing processes from waiting for one another indefinitely possible strategies: 1. ignore it 2. detection: let them occur, detect them, then try to recover 3. prevention: statically make it impossible for deadlocks to occur 4. avoidance: avoid deadlocks by allocating resources carefully Snapshots - getting a consistent state of the distributed system Banking example: There is a constant amount of money in the bank system The money is transferred among banks in messages Problem: Find out of any money has been lost accidentally Simple solution: stop all processes. Let all channels empty. Record the state. Start everything back up. Distributed Solution: Chandy-Lamport Distributed Snapshot Initiate a snapshot by: 1. recording internal state 2. sending a token on all outgoing channels 3. start recording local snapshot (keep track of messages arriving on every incoming channel) Token receiving rule: If not already recording local snapshot 1. record internal state 2. send token on all outgoing channels 3. start recording local snapshot in any case stop recording incoming message on channel the token arrived along If a message arrives on a channel which is tracking messages, record the arrival of the message, then process the message as normal. Otherwise, just process the message as normal. Snapshot complete when token has arrived on all incoming channels --------------------------- ONTO Mobile Computing!! Resource: Mobile Communications: Jochen Schiller: Chapter 2/3 Frequencies AM - amplitude modulation - 520kHz to 1605.5kHz FM - frequency modulation - 87.5MHz to 198MHz typically fixed by national regulation analog TV 174-230 MHz VHF (very high frequency) 470-790 MHz UHF (ultra high frequency) digital TV 470-862MHz - overlaps some with analog tv analog mobile phones 450-465MHz digital GSM mobile phones 890-960 MHz, 1710-1880MHz IEEE 802.11 2.4GHz (unlicensed band) HIPERLAN (Eurpoean wireless LAN) 5.2 GHz Multiplexing - sharing the medium without interference analogy to cars. medium = highway. interference = accidents lanes allow space division multiplexing cars in same lane at different points in time allow time division multiplexing 4 dimensions 1. space 2. time 3. frequency 4. code Goal: minimum interference/ maximum medium utilization Space: * give each user a different frquency, divide space into non-overlapping regions, need buffer space between regions * old analog telephones, separate copper wire to each home * used for FM radio station, range limited by geography (note, this is not what allows multiple radio stations in each city, that's next) frequency * subdivide the frequency dimnsion, need buffer space between frequencies * senders assigned a frequency, and can use it continuously * no coordination between sender and receiver * good for radio (24hrs per day), not good for mobile communication (a few minutes per day) time * Give the whole bandwidth of a channel for a certain period of time. All senders use the same frequency, but at diff. points in time. * co-channel interference is if two transmissions overlap in time * need synchronization among senders. cont... code * analogy to crowded party, can tune to different languages, languages can use same frequency ------------------------ Project 1 is out Policies: working together is ok, but don't take notes copying code is NOT allowed What is expected in the turnin part 1 - short answers, email only part 2 - code readme : NEVER TURN IN A WORD DOCUMENT, .ps is ok, .pdf is better design and motivation if not working, detailed status how to compile and run your application Resources: examples available for download Thinking in Java book in pdf in cs290E directory Use the Java API! Write incrementally, even write little test apps first