Midterm Flashcards
Learn material from first 5 weeks
What is meant by a distributed system?
a group of computers working together as to appear as a single computer to the end-user.
What are the 4 main goals of a distributed system?
- Making resources accessible
- Distribution transparency
- Openness
- Scalability
What are the different types of transparency?
- Access transparency
- Location transparency
- Migration transparency
- Relocation transparency
- Replication transparency
- Concurrency transparency
- Failure transparency
Hide differences in data representation and how a resource is accessed.
Access transparency
Hide where a resource is located.
Location transparency
Hide that a resource may move to another location.
Migration transparency
Hide that a resource may be moved to another location while in use.
Relocation transparency
Hide that a resource is replicated
Replication transparency
Hide that a resource may be shared by several competitive users.
Concurrency transparency
Hide the failure and recovery of a resource.
Failure transparency
A distributed system that is able to present itself to users and applications as if it were only a single computer system is said to be __________.
transparent
A(n) ___________ is a system that offers services according to standard rules that describe the syntax and semantics of those services.
open distributed system
Characterizes the extent by which two implementations of systems or components from different manufacturers can co-exist and work together, by merely relying on each other’s services as specified by a common standard.
Interoperability
Characterizes to what extent an application developed for a distributed system A can be executed, without modification, on a different distributed system B that implements the same interface as A.
Portability
The notion that it should be relatively easy to add parts that run on a different operating system, or even to replace an entire file system.
Extensibility
List the three dimensions by which scalability can be measured,
- size
- geographically
- administratively
What is meant by scalability of size?
We can easily add more users and resources to the system.
What is meant by geographic scalability?
A system in which the users and resources may be far apart.
What is meant by administrative scalability?
It can still be easy to manage even if it spans many independent administrative organizations.
What are three scaling techniques?
- hiding communication latency
- distribution
- replication
Trying to avoid waiting for a response to remote (and potentially distant) service requests as much as possible.
Hiding communication latency
This involves taking a component, splitting it into smaller parts, and subsequently spreading those parts across the system.
Distribution
Name one real-world example of distribution.
DNS tree of domains that are divided into non-overlapping zones.
This technique increases availability, but also helps to balance the load between components, leading to better performance.
Replication
________ is a special form of replication, which results in making a copy of a resource generally in the proximity of the client accessing the resource.
Caching
List the eight false assumptions that everyone makes when developing a distributed application for the first time.
- The network is reliable
- The network is secure
- The network is homogeneous
- The topology does not change
- Latency is zero
- Bandwidth is infinite
- Transport cost is zero
- There is one administrator
What are the three main types of distributed systems?
- Distributed computing systems
- Distributed information systems
- Distributed pervasive systems
In ________ the underlying hardware consists of a collection of similar workstations or PCs, closely connected by means of high-speed local area network. In addition, each node runs the same operating system.
cluster computing
This subgroup consists of distributed systems that are often constructed as a federation of computer systems, where each system may fall under a different administrative domain, and may be very different when it comes to hardware, software and deployed network technology.
Grid computing
What are the two subtypes of distributed information systems?
- Transaction processing systems
2. Enterprise application integration (EAI)
What are the four characteristic properties that transactions have?
- Atomic
- Consistent
- Isolated
- Durable
(ACID)
To the outside world, the transaction happens indivisibly.
Atomic
The transaction does not violate system invariants.
Consistent
Concurrent transactions do not interfere with each other.
Isolated
Once a transaction commits, the changes are permanent.
Durable
An application component that can effectively send a request to another application component by doing a local procedure call, which results in the request being packaged as a message and sent to the callee.
Remote procedure call (RPC)
Type of distributed system in which instability is the default behavior, often characterized by being small, battery-powered, mobile, and having only a wireless connection, although not all of these characteristics apply to all devices.
Distributed pervasive systems
What are the three requirements for a pervasive system?
- Embrace contextual change
- Encourage ad hoc composition
- Recognize sharing as a default
________ form a collection of (fixed) nodes that communicate through wireless links. These networks may form the basis for many medium-scale distributed systems.
Mesh networks
A UNIX process is a(n) ________ of a program in execution.
instance
T/F: Each process has program code, data segment, program stack, etc.
True
What is the result of the following process?
$ ls | wc
Results in the shell creating two processes where the output of ls is sent (via the pipe) as in input to wc
Output would be a count of the number of files in the directory
T/F: A single program can only spawn a single process.
False - a single program may spawn multiple processes.
What are the four basic mechanisms for creating processes in Unix?
- fork
- exec
- wait
- exit
Which unix mechanism creates a new process by duplicating the calling process?
fork
Which Unix mechanism performs the transformation of a process by overlaying its memory space with a new program?
exec
Which Unix mechanism provides the ability for a process to be halted while a related process finished?
wait
Which Unix mechanism is used to terminate a process?
exit
T/F: A fork is typically followed by an exec.
True
T/F: After fork and before exec, the per process values cannot be modified.
False
The name for a newly created process after a successful fork.
child process
The process that makes a fork call is called the _______.
parent process
T/F: After the system call is made successfully, both processes begin execution at the statement after the call to fork.
True
T/F: After a fork, the parent and child process have unique data and code segments.
False - they have identical data and code segments
fork() returns the _____________ of the newly created process to the parent.
process ID
fork() returns a ________ to the newly created process.
0 (zero)
What is one way of distinguishing a parent from a child?
Use the 0 as a comparison of process ID. Child processes receive a PID of 0 after a fork.
_____ replicates the calling process, _____ will create a new process and destroy the called process.
fork; exec
T/F: During an exec call, the new process will inherit the process ID of the called process.
True
Which call initiates a new program in the same environment in which it is operating?
execl()
Which routine will perform the same purpose as execl() except that it will use environment variable PATH to determine which executable to process?
execlp()
What does execv do?
This is the same as execl(), but the arguments are passed as a null terminated array of pointers to the char.
T/F: The call to wait() returns the process ID of the child process that exits.
True
T/F: If there are n child processes, n wait statements would be needed if the parent is to continue after all of the child processes have exited
True
________ provides an interface for programs that need to wait for certain child processes
waitpid
__________ returns the process ID of the child process once terminated.
waitpid
When does a process become a zombie?
When a child process exits before the parent process issues a wait().
This results in the process occupying space in the system’s process table but nothing else.
If a parent process exits before a child process is done, that process is considered _________.
orphaned
It is “adopted” by the OS (and killed!)
This program extracts individual tokens from the command line constructed by userin.
gettok.c
A lexical unit such as a command name or argument.
Token
This program will parse a command line using gettok, constructing an argument list in the process.
procline.c
T/F: procline.c assumes that an input has already been read with userin.
True
This program actually starts any command process.
runcommand.c
This program takes an additional parameter (where) to indicate if the process is to be run in the foreground or background.
runcommand.c
This part of the Kernel Data Structure contains an entry for every process in the system.
Process Table
This part of the Kernel Data Structure contains at least one entry for every open file in the system.
Open File Table
A process can send data ‘down’ a pipe using a ______ system call and another process can receive the data by using _____ at the other end.
write; read
What does the following command do?
pr mydoc | lpr -Psunhp
A paginated version of the file mydoc sent to the sunhp printer
The pr program simply writes to the _______.
stdout
The lpr program simply reads the ______.
stdin
Regarding Pipes: Flow control is maintained automatically by the _______.
Operating System
A successful system call using pipe() returns which file descriptors?
- One for writing down the pipe
2. One for reading from the pipe
A two-integer array that will hold the file descriptors that will identify the pipe.
filedes
If successful, ________ will be open for reading from the pipe and ________ will be open for writing down it.
filedes[0]; filedes[1]
What is returned if a pipe cannot obtain the file descriptors?
-1
T/F: Pipes behave first-in-last-out, this cannot be changed.
False - first-in-first out (cannot be changed)
The size of read and write don’t have to match. (Write 512k blocks, read 1 char)
True
When a process attempts a single write larger than the size of the pipe, the write is _________ until a read ensues.
suspended
T/F: If several processes write to the pipe at the same time, data can be intermingled.
True
If the pipe is empty and a process attempts to read, it is usually _______ until some data is placed in the pipe.
blocked
If all processes close their write-end of the pipe and the pipe is empty, any process attempting a read will return _______.
no data (will return 0 like EOF)
If all processes close their read-end of the pipe and there are processes waiting to write to the pipe, the kernel will send a _________ signal.
SIGPIPE
_________ can be used to prevent reads and writes from blocking.
fcntl
fcntl allows a process to set the __________ flag for a file des in order to prevent future reads and writes from blocking.
O_NONBLOCK
stderr has which file descriptor?
2
______ is a system call that makes newfd be the copy of oldfd
dup2
T/F: dup2 closes the file represented by it’s second parameter before the assignment.
True
How does the join command work?
join will run both programs and pipe the stdout of com1 into the stdin of com2.
________ provide a simple programming interface which is consistent for processes on the same machine or across different machines.
Sockets
The aim of UNIX ________ is to provide a means of Inter process Communication that is sufficiently generic to allow bi-directional messages between two processes irrespective of where they reside.
sockets
What are the two ways in which processes that send messages across a network can communicate?
- The connection oriented model (or virtual circuit.)
2. The connectionless oriented model.
What type of communication model is the USPS? (Where we are not concerned that the clients get the message aka broadcast.)
Connectionless oriented model
UNIX uses _______ for connection oriented communication and _________ for connectionless oriented communication.
TCP; UDP
When processes are communicating across a network they must know the _____________ of the machine that the processes are residing on.
network address
What does a network address do?
It gives the physical location of a machine on a network.
At the programming level, IP addresses are stored in an ________ type.
in_addr_t
Which UNIX routine converts the four decinmal number representation to the in_addr_t representation?
inet_addr
The server process sets and listens for connections on a specified __________.
port number
T/F: A client process will ask for a connection to a specific machine and port.
True
These are handles used to establish a link between processes across a network.
transport end points
T/F: In all forms of communication, only the client needs to establish its own transport end point.
False - Both the client and server must establish their own transport end points.
Creation of transport end points is achieved using the ________ system call.
socket
In a socket system call: the ______ parameter tells the call where the socket is to be used.
domain
In a socket system call, which domain does AF_INET represent?
internet domain
In a socket system call, which domain does AF_UNIX represent?
same UNIX machine
In a socket system call, the ________ parameter specifies connection model.
type
In a socket system call, what represents a connection type model?
SOCK_STREAM (TCP)
In a socket system call, what represents a connectionless type model?
SOCK_DGRAM (UDP)
The ______ system call associates the true network address of a machine with a socket identifier.
bind
Which are the three parameters used with the bind system call?
sockid, sockaddr, size of the actual socket structure used
In a bind call, what does the sockid parameter represent?
The socket file descriptor, returned by the socket system call.
In a bind call, what does the sockaddr parameter represent?
A pointer to the sockaddr structure.
What does the listen system call do?
Allows the server to set itself up to wait for connections.
In a listen call, what are the two parameters?
int sockfd, int queue_size
In a listen call, what does the queue_size parameter represent?
It means the server can queue up to [queue_size] incoming connection requests.
T/F: When the server receives a connect request from a client, it has to create an entirely new socket to handle the specific communication.
True
In a connection request: the first socket is used to do what?
establish communication
In a connection request: the second socket is created how?
by an accept system call
What is the return value of an accept call?
the new socket id to be used for communication
What type of client call is used to request a connection to a server process and machine?
the connect system call
Which system calls are used for sending and receiving data in a stream?
read and write (or send and recv, if needed.)
What does a MSG_PEEK flag do?
Can look at the data with out actually ‘receiving’ it.
What does a MSG_OOB flag do?
Normal data is passed and the process only receives ‘Out Of Bound’ data, like signal (SIGINT)
What does a MSG_WAITALL flag do?
The recv call will only return when the full amount of data is available.
What does a MSG_DONTROUTE flag do?
The message will be sent, ignoring any routing conditions of the underlying protocol.
T/F: the close system call can be used on socket.
True
In a connectionless model, the packets transmitted between the client and server will arrive at their destination in ___________ order.
an indeterminate
What are the two system calls specific to the connectionless model?
sendto and recvfrom
T/F: recvfrom call works exactly the same way as recv if send_addr is set to NULL.
True
The ________ pointer is the buffer into which the received message will be placed.
message
T/F: In a connectionless model, the client must create a socket and bind its local address to that socket.
True