Qs from Prof Flashcards
- Provide a concise definition of a distributed system.
“A distributed system is a program that conisists of multiple parts running on more than one computer interconnected via a network”
- Describe three benefits that may be offered by using a distributed system
rather than a centralized one.
- Improved/broader access to the system
- Enhanced sharing
* resources can be easily shared by many users - Cost-effectiveness (because of sharing)
- Less systems admin effort
- Enhanced availability (multiple copies of data, replicated servers)
- Better performance
* content can be closer geographically
- Describe three possible problems that may arise when using a distributed
system rather than a centralized one.
- More complex (harder to build and maintain)
- Higher operational costs (os upgrades/patches)
- Security and trust issue
- Decreased availability (what if part of the system goes down)
- Briefly explain the difference between connection-oriented communication
and connectionless communication.
Connection Oriented (like TCP) creates a connection like a phone call, it is active until one side hangs up
Connectionless Communication(like UDP): Is like sending a letter. Each communication is treated as a single letter addressed and sent to the other party.
We must specific the communication partnet (port and IP) in every send/recieve op
- Explain why a connection-oriented protocol (like TCP/stream sockets) tends
to have higher overhead than a connectionless protocol (like UDP/datagram
sockets).
UDP is faster to setup and send, it doesn’t create and hold open a pipe for the entirety of communication.
- What is a network port number and why is it necessary?
Port number helps with ensuring we get unique PIDs across multiple machines.
We need a unique machine ID and a unique process ID
“A port number identifies a service provided by a process running on a given machine”
- What does DNS stand for? What function does DNS perform? In general terms,
what type of distributed application is DNS?
Domain Name System
Gives a name that is easier to remember than an IP address
DNS helps to locate a resource.
?A server farm?
- Briefly explain when *broadcasting* can be useful in locating some service.
Can be useful on a LAN, it will ask all machines network where a resource is.
- What are extended failure modes? Give two examples of such failure modes.
“ways of failingn that don’t occur in centralized systems”
- Concurrency: Having more than one thing happening at the same time
- Communication
Examples:
- One process fails but another still runs
- Communication fails between communicating processes
- Communication is garbled between communicating processes
- How are extended failure modes and the choice between connectionless and
connection-oriented communications related?
They both rely on communications over a network.
When communicating order, reliability are both factors
What is a timeout? Give an example of where a timeout might be useful in
a distributed system.
A timeout is a specific amount of time to wait for a response back when a communication is sent. It helps us to detect a failure.
This is useful, as we may be waiting on one machine to respond back and that can cause delays.
It is possible for the other side to be down.
A timeout allows for a retry with the same or a different server
- What is meant by the term scalability?
Scalability is simply defined as the ability of a system to grow (in scale) to larger sizes without making changes to the system design.
- We don’t have to change the techniques used as the system becomes 10/100/1000/… times bigger
- What is meant by the term consistency?
How does this relate to using replicated servers to enhance reliability?
Keeping the contents of replica servers identical.
If we replicate servers to increase reliability, we need to ensure all content is identical and don’t hand out incorrect/stale information to different web clients.
- Give an example of how design choices related to resource naming can affect
distributed system scalability.
When designing we need to consider:
- Information required to do discovery
- Cost of discovery
- Reliability of discovery
- The scale of the discovery mechanism
- What is the primary difference between a process and a thread?
Process can be though of as a program in execution includes:
- code that is executing
- data being operated on
- Execution state
- register contents, PC, call stack
processes run on a single machine
A thread is a cheaper alternative to processes
- A unit of actibity alone
Can having more than on thread in a memory space
a thread is a light-weight process, multiple running on a single machine
- Concisely describe what a *nix fork() call does.
A clone of the current running process is made.
It returns either:
- the process id (pid)of the created child process
- or 0 (to indicate that we are the child process)
This can then be used to continue on with the code or have a clone exec(…) another program.
- Why must each thread have its own stack?
In order for it to be concurrent is needs to be able to manipulate the program/data independently, which wouldn’t happen with a shared stack.
- What does the start() method on a Java Thread object do?
After a call to start( ), the original thread (the one that called start) and a new thread will both be running
The new thread, once it is started will be running it’s run( ) method. Every newly created thread starts by running this code.
So the thread is created but doesn’t actually start until the start( ) command is recieved.
- How do we normally define a correct *concurrent* execution?
Correctness is defined to be “The same as any sequential execution of the concurrent programs”
Correctness refers to access and modifying data at the same time (well one at a time)
it doesn’t matter who goes first, as long as one finishes before the other begins
- What is a critical section?
A section of code that acceses shared data
- “What are the shared variables?”
- Which critical sections are related
* Which access the same shared variables
What is RPC? Why does the lack of shared memory between the caller and the callee make RPC harder to implement than LPC?
RPC was originally designed to elimate sending messages (which was unfamiliar). It abstracts/hides the messaging.
An RPC system translates procedure calls into appropriate message passing for the programmer.
Instead of running a procedure call on a local machine, we are making a procedure call on a different machine than the caller.
In short, how do we deal with and pass data of different types. Long answer, see the image.