Professional Documents
Culture Documents
36559d0e9a D
36559d0e9a D
LTP
31-
Class Work: 50
Exam:100
Total: 150
Duration of Exam: 3 Hrs.
NOTE: For setting up the question paper, question no 1 will be set up from all the four sections which will be compulsory and of short
answer type. Two questions will be set from each of the four sections. The students have to attempt first common question, which is
compulsory, and one question from each of the four sections. Thus students will have to attempt 5 questions out of 9 questions.
Section A
Introduction: Introduction to Distributed System, Goals of Distributed system, Hardware and Software concepts, Design issues, Communication
in distributed system: Layered protocols, ATM networks, Client Server model, Remote Procedure Calls and Group Communication.
Middleware and Distributed Operating Systems.
Section B
Synchronization in Distributed System: Clock synchronization, Mutual exclusion, Election algorithm, the Bully algorithm, Ring algorithm,
Atomic Transactions, Deadlock in Distributed Systems, Distributed Deadlock Prevention, Distributed Deadlock Detection.
Section C
Processes and Processors in distributed systems: Threads, System models, Processors Allocation, Scheduling in Distributed System, Real Time
Distributed Systems. Distributed file systems: Distributed file system Design, Distributed file system Implementation, Trends in Distributed FS.
Section D
Distributed Shared Memory: What is shared memory, Consistency models, Page based distributed shared memory, shared variables distributed
shared memory.
Case study MACH: Introduction to MACH, process management in MACH, communication in MACH, UNIX emulation in MACH.
Text Book:
1. Distributed Operating System Andrew S. Tanenbaum, PHI.
2. Operating System Concepts, P.S.Gill, Firewall Media
CSE-423F
Distributed Operating System
Mrs. Jyoti Arora
A.P. (CSE)
PDMCE
jyoti.arora08@yahoo.com
PDM CSE
1/189
PDM CSE
2/189
References
Background History
http://www.cs.pitt.edu/~mosse/cs2510/class-notes/clocks.pdf
http://web.info.uvt.ro/~petcu/distrib/SD6.pdf
PDM CSE
3/189
PDM CSE
4/189
Section-A
Section-A
PDM CSE
5/189
PDM CSE
6/189
PDM CSE
PDM CSE
Disadvantages of Distributed
System
PDM CSE
10
Distributed Programming
Architectures/Categories
Distributed Programming
Architectures/Categories(contd..)
Client -Server
3-tier Architecture
N-tier Architecture
Tightly coupled
Peer to Peer
Client-Server- Small Clients code contacts the server for data then formats
& displays it to the user. Input at the client is committed back to server
when it represents a permanent change
3-tier Architecture- 3-tier system move the client intelligence to a middle
tier so that stateless clients can be used. This simplifies application
deployment. Most web applications are 3-tier.
PDM CSE
11
PDM CSE
12
Characteristics of Distributed
System
Hardware concepts
PDM CSE
13
PDM CSE
14
Hardware Concepts(contd..)
Hardware concepts(contd..)
PDM CSE
15
PDM CSE
16
Hardware Concepts
(contd)
Hardware concepts(contd..)
17
PDM CSE
18
Hardware Concepts
(contd..)
Hardware concepts(contd..)
Multicomputer Every machine has its own private memory
Inter machine message delay is large
Data rate is low (i.e. number of bits per second that can be transferred is
large)
Used as distributed system
Works on many unrelated problems
Types of Multicomputer
Bus based multicomputer
Switched based multicomputer
PDM CSE
19
PDM CSE
20
Hardware concepts(contd..)
Software Concepts
PDM CSE
21
PDM CSE
22
Software Concepts
(contd.)
Design Issues
PDM CSE
23
24
Design Issues(contd..)
25
Reliability-If a machine goes down, some other machine takes over the job.
Availability- It refers to the fraction of time that the system is usable. A highly
reliable system must be highly available.
Security Files and other resources must be protected from unauthorized
usage.
Fault tolerance-Suppose that a server crashes and then quickly reboots. what
happens? Does the server crash bring users down with it?
PDM CSE
26
Design Issues
(contd.)
Layered Protocol
OSI MODEL
PDM CSE
27
28
Layered Protocol
OSI MODEL (contd..)
OSI MODEL
(contd.)
Bit Timings
Types of Topology
PDM CSE
29
Network Layer
Control Subnet Operations
Congestion Control
Switching
Create Virtual Circuit
Protocols-IP
PDM CSE
30
OSI MODEL
(contd.)
OSI MODEL
(contd.)
Transport Layer
Segmentation & Reassembly
Multiplexing & Demultiplexing
Flow Control
Provide end to end delivery
Protocols-TCP, UDP
Session Layer
Establish Sessions
Token Management
Synchronization
Graceful close
Protocols- SIP ,RPC
PDM CSE
31
Presentation Layer
Deals with syntax & semantics
Encoding Decoding
Compression decompression
Protocols-JPG,ZIP
Application Layer
File Transfer Protocol
Email services
Telnet
Protocols-NNTP,SMTP
PDM CSE
32
OSI MODEL
(contd.)
33
PDM CSE
34
Asynchronous Transfer
Mode(contd.)
ATM Switching
(a) An ATM switching network. (b) Inside one switch.
35
PDM CSE
36
PDM CSE
37
Operations of client
Managing user interface
Accepts & checks the syntax of user inputs
Processes application logic
Generates Database request & transmits to server
Operations of server
Accepts & process database requests from client
Checks authorization
Ensures that integrity constraints are not violated
Maintains system catalogue
Provide recovery control
Perform Query/update processing & transmits responses to client
PDM CSE
38
Client-Server Topologies
Single Client, Single Server- One client is directly connected to one
server
Multiple Client, Single Server- Several clients are directly connected to
only one server
Multiple Client, Multiple Server- Several clients are connected to
several servers
Types of servers
File server
Database server
Transaction server
Object server
Web server
PDM CSE
39
PDM CSE
40
Disadvantages of Client-Server
Model
PDM CSE
41
PDM CSE
42
PDM CSE
43
PDM CSE
44
Acknowledgements
Stop-and-wait protocol- In this client send packet 0 with the first 1K,
then wait for an acknowledgement from the server. Then the client
sends the second 1K, waits for another acknowledgement, and so on.
Blast protocol- The client send all the packets as fast as it can. With
this method, the server acknowledges the entire message when all the
packets have been received, not one by one
(a) A 4K message. (b) A stop-and-wait protocol. (c) A blast protocol
PDM CSE
45
PDM CSE
46
Group Communication
(contd..)
Group Communication
Group- A group is a collection of processes that act together in some system or
Groups are dynamic in nature. New groups can be created & old groups
can be destroyed.
A process can join the group or leave one. A process can be a member of
several groups at same time. e.g. a person might be a member of a book
club, a tennis club & an environmental organization.
Multicasting-Create a special network address to which multiple machines
can listen.
Broadcasting- Packets containing a certain address are delivered to all
machines.
Unicasting- Sending of a message from a single sender to a single receiver
user-specified way.
Types of Groups:
Point-to-point communication is from one sender to one receiver
One-to-many communication is from one sender to multiple receivers.
PDM CSE
47
PDM CSE
48
PDM CSE
49
PDM CSE
50
Peer vs. Hierarchical Group-In peer groups, all the processes are equal.
No one is boss and all decisions are made collectively. In Hierarchical
groups, some kind of hierarchy exists. For example, one process is the
coordinator and all the others are workers.
PDM CSE
51
PDM CSE
52
PDM CSE
53
PDM CSE
54
Middleware
Middleware is an software glue between Client & server which helps the
communication between client & server
Forms of Middleware
Transaction Processing Monitor
Remote Procedure Call
Message Oriented Middleware
Object Request Broker
PDM CSE
Section-B
55
PDM CSE
56
Section-B
Clock Synchronization
Clock Synchronization
Mutual Exclusion
Election Algorithm
Bully Algorithm
Ring Algorithm
Atomic Transactions
Deadlock in Distributed Systems
Distributed Deadlock Prevention
Distributed Deadlock Detection
PDM CSE
Logical Clocks
Quartz crystal It oscillates at a well defined frequency
Counter Register- It is used to keep track of the oscillations of the quartz
crystal
Constant register- It is used to store a constant value that is decided based
on the frequency of oscillations of the quartz crystal.
Clock tick- When the value of counter register becomes zero an interrupt is
generated & its value is reinitialized to the value in the constant register.
Each interrupt is called a clock tick.
Clock skew-The difference in time values in two clocks is called clock
skew.
57
PDM CSE
58
Clock Synchronization
(contd..)
Lamport Logical Clock-If a & b are two events & c is the timestamp of
event
If a happens before b in the same process, C(a)<C(b).
If a and b represent the sending and receiving of a message, C(a)<C(b).
For all events a and b, C(a)C(b).
Physical Clocks
Transit of the sun-The event of the sun's reaching its highest apparent
point in the sky is called the transit of the sun. This event occurs at about
noon each day.
Solar Day-The interval between two consecutive transits of the sun is
called the solar day.
PDM CSE
Clock
Synchronization
Algorithm
Centralized
Passive Time
Server
(Cristian
Algorithm)
59
Active Time
Server
(Berkeley
Algorithm)
PDM CSE
Distributed
Averaging
Algorithm
60
61
In the absence of any other information, the best estimate of the message
propagation time is (T1T0)/2. This estimate can be improved if it is known
approximately how long it takes the time server to handle the interrupt and
process the incoming message. Let us call the interrupt handling time I.
Then the amount of the interval from T0 to T1 that was devoted to message
propagation is T1-T0-I, so the best estimate of the one-way propagation time
is half this.
The Berkeley Algorithm- In this algorithm, the time server is active.
polling every machine periodically to ask what time it is there. Based on
the answers, it computes an average time and tells all the other machines to
advance their clocks to the new time or slow their clocks down until some
specified reduction has been achieved. This method is suitable for a system
in which no machine has a WWV receiver. The time daemon's time must
be set manually by the operator periodically.
PDM CSE
62
Mutual Exclusion
.
PDM CSE
63
PDM CSE
64
Centralized Algorithm
PDM CSE
65
(a) Process 1 asks the coordinator for permission to enter a critical region.
Permission is granted
(b) Process 2 then asks permission to enter the same critical region. The
coordinator does not reply.
(c) When process 1 exits the critical region, it tells the coordinator, which then
replies to 2 [2]
PDM CSE
66
Centralized algorithm
(contd..)
Distributed Algorithm
PDM CSE
67
PDM CSE
68
Distributed Algorithm
(contd..)
If the receiver wants to enter the critical region but has not yet done so, it
compares the timestamp in the incoming message with the one contained in
the message that it has sent everyone. The lowest one wins. If the incoming
message is lower, the receiver sends back an OK message. If its own
message has a lower timestamp, the receiver queues the incoming request
and sends nothing.
After sending out requests asking permission to enter a critical region, a
process sits back and waits until everyone else has given permission. As
soon as all the permissions are in, it may enter the critical region. When it
exits the critical region, it sends OK messages to all processes on its queue
and deletes them all from the queue.
PDM CSE
69
a)
b)
c)
Two processes want to enter the same critical region at the same
moment.
Process 0 has the lowest timestamp, so it wins.
When process 0 is done, it sends an OK also, so 2 can now enter the
critical region.
PDM CSE
70
Distributed Algorithm
(contd..)
Token Ring
PDM CSE
71
72
a)
b)
PDM CSE
73
PDM CSE
74
Bully Algorithm
Election Algorithm
Election algorithms attempt to locate the process with the highest process
number and designate it as coordinator.
The Bully Algorithm
The Ring Algorithm
The Bully Algorithm When a process notices that the coordinator is no
longer responding to requests, it initiates an election. A process, P, holds an
election as follows:
a. P sends an ELECTION message to all processes with higher numbers.
b. If no one responds, P wins the election and becomes coordinator.
c. If one of the higher-ups answers, it takes over. P's job is done.
PDM CSE
75
PDM CSE
76
Bully Algorithm(contd..)
When 4 gets this message, it can now continue with the operation it was
trying to do when it discovered that 7 was dead, but using 6 as the
coordinator this time. In this way the failure of 7 is handled and the work
can continue.
If process 7 is ever restarted, it will just send all the others a
COORDINATOR message and bully them into submission.
PDM CSE
77
The bully election algorithm. (a) Process 4 holds an election. (b) Processes 5
and 6 respond, telling 4 to stop. (c) Now 5 and 6 each hold an election. (d)
Process 6 tells 5 to stop. (e) Process 6 wins and tells everyone.
PDM CSE
78
Ring Algorithm
In Ring algorithm if any process notices that the current coordinator has
failed, it starts an election by sending message to the first neighbor on the
ring.
The election message contains the nodes process identifier and is
forwarded on around the ring.
Each process adds its own identifier to the message.
When the election message reaches the originator, the election is complete.
Coordinator is chosen based on the highest numbered process.
PDM CSE
79
PDM CSE
80
Atomic Transaction
A transaction that happens completely or not at all (No Partial results)
e.g.
Cash machine hands you cash and deducts amount from your
account
Airline confirms your reservation and
Reduces number of free seats
Charges your credit card
Stable storage
write to disk atomically
Log file
record actions in a log before committing them
Log in stable storage
Locking protocols
Serialize Read and Write operations of same data by separate
transactions
Begin transaction
Place a begin entry in log
Write
Write updated data to log
Fundamental principles A C I D
Atomicity to outside world, transaction happens indivisibly
Consistency transaction preserves system invariants
Isolated transactions do not interfere with each other
Durable once a transaction commits, the changes are permanent
PDM CSE
81
PDM CSE
82
Abort transaction
Place abort entry in log
End transaction (commit)
Place commit entry in log
Copy logged data to files
Place done entry in log
PDM CSE
83
PDM CSE
84
Concurrency Control
(contd.)
PDM CSE
85
Distributed Deadlocks
Communication Deadlocks- A communication deadlock occurs, for
example, when process A is trying to send a message to process B,
which in turn is trying to send one to process C, which is trying to send
one to A.
Resource Deadlocks -A resource deadlock occurs when processes are
fighting over exclusive access to I/O devices, files, locks, or other
resources.
Strategies are used to handle deadlocks
The ostrich algorithm (ignore the problem)
Detection (let deadlocks occur, detect them, and try to recover)
Prevention (statically make deadlocks structurally impossible)
Avoidance (avoid deadlocks by allocating resources carefully)
PDM CSE
86
False Deadlock
PDM CSE
87
(a) Initial resource graph for machine 0(b) Initial resource graph for machine 1
(c) The coordinator's view of the world. (d) The situation after the delayed
message.
PDM CSE
88
PDM CSE
89
PDM CSE
90
Section - C
PDM CSE
91
PDM CSE
92
Section - C
Thread
Threads
System models
Processors Allocation
Real Time Distributed Systems
Distributed file system Design
PDM CSE
93
PDM CSE
94
Thread (contd..)
Thread states
Running-A running thread currently has the CPU & is active
Blocked-A blocked thread is waiting for another thread to unblock it
Ready- A ready thread is scheduled to run & will as soon as its turn comes
up
Terminated A terminated thread is one that has exited
Dispatcher/worker Model
Team Model
Pipeline Model
Per Thread items-Program counter, Stack, register set, Child thread, State
Per Process items-Open files, Child processes, Global variables, Timers,
Signals, Semaphores
PDM CSE
95
PDM CSE
96
PDM CSE
97
98
PDM CSE
99
User Level Thread ApproachPut the thread package entirely in user space.
Kernel knows nothing about them.
Run time system (RTS) maintains status information table of threads,
threads states, threads priority, context switching.
PDM CSE
100
System Models
Workstation Model
Workstation Model
Processor pool Model
Workstation Model-A network of personal workstations, each with a local
file system. The system consists of workstations scattered throughout a
building or campus and connected by a high-speed LAN.
PDM CSE
101
102
Processor Allocation
Allocation Models
Non-migratory Allocation Algorithm-When a process is created, a
decision is made about where to put it. Once placed on a machine, the
process stays there until it terminates. It may not move, no matter how
badly overloaded its machine becomes and no matter how many other
machines are idle.
Migratory Allocation Algorithm-A process can be moved even if it has
already started execution.
PDM CSE
103
PDM CSE
104
PDM CSE
105
PDM CSE
106
All the algorithms assume that machines know their own load, so they can
tell if they are under loaded or overloaded, and can tell other machines
about their state.
Count the number of processes on each machine and use that number as the
load.
Count only processes that are running or ready.
Count the fraction of time the CPU is busy.
Take into account the CPU time, memory usage, and network bandwidth
consumed by the processor allocation algorithm itself.
PDM CSE
107
PDM CSE
108
PDM CSE
109
hierarchy independent of the physical structure of the network. For each group of
k workers, one manager machine is assigned the task of keeping track of who is
busy and who is idle. What happens when a department head, or worse yet, a big
cheese, stops functioning (crashes)? One answer is to promote one of the direct
subordinates of the faulty manager to fill in for the boss. The choice of which can
be made by the subordinates themselves, by the deceased's peers, or in a more
autocratic system, by the sick manager's boss.
A processor hierarchy can be modeled as an organizational hierarchy.
PDM CSE
110
111
112
PDM CSE
113
PDM CSE
114
Fault Tolerance-Some real-time systems have the property that they can
be stopped cold when a serious failure occurs. For instance, when a railroad
signaling system unexpectedly blacks out, it may be possible for the control
system to tell every train to stop immediately. If the system design always
spaces trains far enough apart and all trains start braking more-or-less
simultaneously, it will be possible to avert disaster and the system can
recover gradually when the power comes back on. A system that can halt
operation like this without danger is said to be fail-safe.
Language Support-Real-time systems and applications are programmed in
general-purpose languages such as C. The language cannot support general
while loops. Iteration must be done using for loops with constant
parameters. Recursion cannot be tolerated.
PDM CSE
115
Hard real time versus soft real time- Hard real-time algorithms must
guarantee that all deadlines are met. Soft real time algorithms can live with
a best efforts approach.
Preemptive versus non-preemptive scheduling- Preemptive scheduling
allows a task to be suspended temporarily when a higher-priority task
arrives, resuming it later when no higher-priority tasks are available to run.
Non preemptive scheduling runs each task to completion. Once a task is
started, it continues to hold its processor until it is done.
Dynamic versus static-Dynamic algorithms make their scheduling
decisions during execution. In Static algorithms, the scheduling decisions,
whether preemptive or not, are made in advance, before execution.
Centralized versus decentralized- In centralized, one machine collecting
all the information and making all the decisions, in decentralized, each
processor making its own decisions.
PDM CSE
116
117
PDM CSE
118
119
120
121
(b) Remote access model- In this model, the file service provides a large
number of operations for opening and closing files, reading and writing
parts of files, moving around within files, examining and changing file
attributes, and so on.
Advantages:
Client gets only whats needed
Server can manage coherent view of file system
Problem:
Possible server and network congestion
Servers are accessed for duration of file access
Same data may be requested repeatedly
PDM CSE
122
PDM CSE
123
PDM CSE
124
PDM CSE
125
PDM CSE
126
DFS Implementation
File usage
System Structure
Caching
Replication
Update Protocols
Sun's Network File System
File usage
Most files are <10 Kbytes
Feasible to transfer entire files (simpler)
Still have to support long files
Most files have short lifetimes( keep them local)
Few files are shared
PDM CSE
127
System structure
Stateful Server
Server maintains client-specific state
Shorter requests
Better performance in processing requests
Cache coherence is possible
Server can know whos accessing what
File locking is possible
PDM CSE
128
Caching in DFS
Implementation
Caching
Caching Location- It refers to the place where the cached data is stored.
Whether it is servers main memory or client disk or clients main memory.
Four different places of cache location
Servers disk
Servers buffer cache
Clients buffer cache
Clients disk
Approaches to caching
o Write-through-What if another client reads its own (out-of-date) cached
copy? All accesses will require checking with server, server maintains state
and sends invalidations
Stateless
Server maintain no information on client accesses
Each request must identify file and offsets
Server can crash and recover (No state to lose)
Client can crash and recover (No open/close needed)
No server space used for state
No limits on number of open files
No problems if a client crashes
PDM CSE
129
PDM CSE
130
PDM CSE
131
132
(a) Explicit file replication. (b) Lazy file replication. (c) File replication using a
group.
Two important issues related to replication transparency-Naming of
Replicas & replication control
PDM CSE
133
PDM CSE
134
135
136
137
PDM CSE
138
Section -D
Section-D
PDM CSE
139
Shared Memory
Consistency Models
Page based distributed shared memory
Shared variables distributed shared memory
Introduction to MACH
Process Management in MACH
Communication in MACH
UNIX Emulation in MACH
PDM CSE
140
Shared Memory
On-Chip Memory-Some computers have an external memory, selfcontained chips containing a CPU and all the memory also exist. Such
chips are used in cars, appliances, and even toys. In this, the CPU portion
of the chip has address and data lines that directly connect to the memory
portion.
(a)A single-chip computer(b)A hypothetical shared-memory multiprocessor.
PDM CSE
141
PDM CSE
142
Write through Protocol- When a CPU first reads a word from memory,
that word is fetched over the bus and is stored in the cache of the CPU
making the request.
write-through cache consistency protocol
Read miss Fetch data from memory & store in cache
Read hit Fetch data from local cache
Write miss update data in memory & store in cache
Write hit update memory & cache
cache consistency protocol has three important properties:
Consistency is achieved by having all the caches do bus snooping.
The protocol is built into the memory management unit.
The entire algorithm is performed in well under a memory cycle.
PDM CSE
143
PDM CSE
144
Switched Multiprocessors in
Shared Memory (contd..)
(a) The Memnet ring. (b) A single machine. (c) The block table.
PDM CSE
145
PDM CSE
146
Switched Multiprocessors in
Shared Memory (contd..)
(a) Three clusters connected by an inter cluster bus to form one super
cluster. (b) Two super clusters connected by a super cluster bus.
PDM CSE
147
PDM CSE
148
PDM CSE
149
PDM CSE
150
Consistency Models
Consistency model - a contract between the software and the memory.
Types of Consistency Models
Strict Consistency -Any read to a memory location x returns the value
stored by the most recent write operation to x.
Sequential Consistency-The result of any execution is the same as if the
operations of all processors were executed in some sequential order, and
the operations of each individual processor appear in this sequence in the
order specified by its program.
Causal Consistency-The causal consistency model represents a weakening
of sequential consistency in that it makes a distinction between events that
are potentially causally related and those that are not.
PDM CSE
151
PDM CSE
152
Basic design
Replication
Granularity
Finding the owner
Finding the copies
Page replacement
Synchronization
Replication-To replicate chunks that are read only, for example, program
text, read only constants, or other read-only data structures.
PDM CSE
153
PDM CSE
154
155
PDM CSE
156
PDM CSE
157
PDM CSE
158
Here the page manager forwards the request directly to the owner, which
then replies directly back to P, saving one message. A problem with this
protocol is the potentially heavy load on the page manager, handling all the
incoming requests.
PDM CSE
159
Finding the Copies-The detail of how all the copies are found when they
must be invalidated. Two possibilities present. one is to broadcast a
message giving the page number and ask all processors holding the page to
invalidate it. This approach works only if broadcast messages are totally
reliable and can never be lost. Second possibility is to have the owner or
page manager maintain a list or copyset telling which processors hold
which pages, here page 4, for example, is owned by a process on CPU 1.
When a page must be invalidated, the old owner, new owner, or page
manager sends a message to each processor holding the page and waits for
an acknowledgement. When each message has been acknowledged, the
invalidation is complete.
PDM CSE
160
161
162
PDM CSE
163
PDM CSE
164
165
PDM CSE
166
Introduction to MACH
167
Goals of Mach
The Mach Microkernel
The Mach BSD UNIX Server
Goals of Mach
Providing a base for building other operating systems
Supporting large sparse address spaces.
Allowing transparent access to network resources.
Exploiting parallelism in both the system and the applications.
Making Mach portable to a larger collection of machines.
The Mach Microkernel-The kernel manages five principal abstractions:
Processes -A process is basically an environment in which execution can
take place. It has an address space holding the program text and data, and
usually one or more stacks. The process is the basic unit for resource
allocation.
PDM CSE
168
Introduction to MACH
(Contd.)
Introduction to MACH
(contd.)
169
Messages-A process can give the ability to send to (or receive from) one of
its ports to another process. This permission takes the form of a capability,
and includes not only a pointer to the port, but also a list of rights that the
other process has with respect to the port (e.g., SEND right). Once this
permission has been granted, the other process can send messages to the
port, which the first process can then read.
The abstract model for UNIX emulation using Mach.
PDM CSE
170
171
PDM CSE
172
PDM CSE
173
PDM CSE
174
PDM CSE
175
PDM CSE
176
Communication in MACH
PDM CSE
177
178
(Contd.)
A MACH Port
PDM CSE
179
PDM CSE
180
Capabilities- Each process has exactly one capability list. When a thread
asks the kernel to create a port for it, the kernel does so and enters a
capability for it in the capability list for the process to which the thread
belongs. Each capability consists not only of a pointer to a port, but also a
rights field telling what access the holder of the capability has to the port.
Three rights exist: RECEIVE, SEND, and SEND-ONCE.
Capability List
PDM CSE
181
PDM CSE
182
Inter machine communication in MACH proceeds in five steps First, the client sends a message to the server's proxy port.
Second, the network message server gets this message. Since this message
is strictly local, out-of-line data may be sent to it and copy-on-write works
in the usual way.
Third, the network message server looks up the local port, 4 in this
example, in a table that maps proxy ports onto network ports. Once the
network port is known, the network message server looks up its location in
other tables. It then constructs a network message containing the local
message, plus any out-of-line data and sends it over the LAN to the
network message server on the server's machine. In some cases, traffic
between the network message servers has to be encrypted for security.
When the remote network message server gets the message, it looks up the
network port number contained in it and maps it onto a local port number.
PDM CSE
183
PDM CSE
184
In fourth step, it writes the message to the local port just looked up.
Finally, the server reads the message from the local port and carries out the
request. The reply follows the same path in the reverse direction.
PDM CSE
185
Mach has various servers that run on top of it. A program that contains a
large amount of Berkeley UNIX inside itself. This server is the main UNIX
emulator.
The implementation of UNIX emulation on Mach consists of two pieces UNIX server-Contains a large amount of UNIX code, has the routines
corresponding to the UNIX system calls. It is implemented as a collection
of C threads
System call emulation library-It is linked as a region into every process
emulating a UNIX process. This region is inherited from /etc/init by all
UNIX processes when they are forked off.
PDM CSE
186
PDM CSE
187
PDM CSE
188
PDM CSE
THE END
189