Main Flashcards
How does a client-server model look?
What type of network is a network of scale: Vicinity?
(PAN) Personal Area Network
Connect devices over the range of a person:
Example of a Bluetooth PAN:
(The word Vicinity means: “the area near or surrounding a particular place”)
What type of network is a network of scale: Building?
(LAN) Local Area Network
Connect devices in a home or office building
Called enterprise network in a company
What type of network is a network of scale: City?
(MAN) Metropolitan Area Networks
Connect devices over a metropolitan area
Example of a MAN based on cable TV:
What type of network is a network of scale: Country?
(WAN) Wide Area Network
Three different kinds:
- Connect devices over a country
- Example of a WAN conneting three branch offices:
- An Internet Service Provider (ISP) network.
- Customers buy connectivity from the ISP to use it.
- A Virtual Private Network (VPN) is built from virtual links that run on top of the Internet.
What type of network is a network of scale: Planet?
The Internet (the network of all networks)
What are protocol layers?
Protocol layering is the main structuring method used to divide up network functionality.
- Each protocol instance talks virtually to its peer
- Each layer communicates only by using the one below
- Lower layer services are accessed by an interface
- At bottom, messages are carried by the medium (means: data are then sent over physical cables)
How does headers work with protocol layers?
Each lower layer adds its own header (with control information) to the message to transmit and removes it on recieve.
What is a Connection-Oriented service?
Must be set up for ongoing use (and torn down after use), e.g. a phone call
What is a Connectionless service?
Messages are handled separately, e.g. postal delivery
What are the different Reference Models?
- OSI reference model
- TCP/IP reference model
- Model used for this course
Name the layers of the OSI reference model
A principled, international standard, seven layer model to connect different systems
- Application
- Presentation
- Session
- Transport
- Network
- Data link
- Physical
Explain the TCP/IP reference model:
A four layer model; omits some OSI layers and uses the IP as the network layer.
Explain the reference model used in this course:
It is based on the TCP/IP model but we call out the physical layer and look beyond Internet protocols.
What is a distributed system?
Definition:
A distributed system is the one in which hardware and software components at networked computers communicate and coordinate their activity only by passing messages.
What are service layers?
It is a conceptual layer within a network service provider architecture.
What is Middleware?
It is computer software that provides services to software applications beyond those available from the operating system. It can be described as “software glue”.
Middleware makes it easier for software developers to perform communication and input/output, so they can focus on the specific purpose of their application.
- Masks heterogenity
- Provides a convenient programming model
- Objects / processes
- Communication primitives
- Synchronization
- Group and multicasting
- Naming and Localization services
- Event notification
What is an Asynchronous interaction model?
The most significant aspect of asynchronous communications is that data is not transmitted at regular intervals, thus making possible variable bit rate, and that the transmitter and receiver clock generators do not have to be exactly synchronized all the time.
- No known bounds for:
- The execution speed of a process
- Message delay on the network
- Clock drift
What is a (partly) Synchronous interaction model
- Known upper and lower bound for each process step
- Known upper bound for the time it takes for a message to be recieved
- Known upper bound for clock drift
What does Heterogeneity mean?
A heterogeneous network is a network connecting computers and other devices with different operating systems and/or protocols.
For example, local area networks (LANs) that connect Microsoft Windows and Linux based personal computers with Apple Macintosh computers are heterogeneous.
What are Timing failures?
- Class of Failure: Clock
- Affects: Processes
- Process’s local clock exceeds the bounds on its rate of drift from real time
- Class of Failure: Performance
- Affects: Processes
- Process exceeds the bounds on the interval between two steps
- Class of Failure: Performance
- Affects: Channel
- A message’s transmission takes longer than the stated bound
What is the MAC Sublayer?
- Responsible for deciding who sends next on a multi-access link
- An important part of the link layer, especially for LANs
Explain Static channel allocation
- You divide up the bandwidth using FTM, TDM, CDMA, etc.
- Like radio (different channels)
- Static allocation performs poorly for busy traffic
- Allocation to a user will also sometimes go unused
Explain dynamic allocation
Dynamic allocation gives the channel to a user when they need it. Potentially N times as efficient for N users.
Explain Pure ALOHA
- Users transmit frames when they have data to send
- If, while you are transmitting data, you receive any data from another station, there has been a message collision. All transmitting stations will need to try resending “later”.
- Collisions happen during what is called a “vulnerable period” that is twice the frame time
“Efficient and low-delay under low load”
Explain Slotted ALOHA
- Divide time into frame-size slots
- Transmission can only start at the beginning of a slot
- Twice as effective as pure ALOHA
- But we need a way to sync users to the beginning of the slot
Explain Carrier Sence, Multiple Access (CSMA)
Carrier Sence, Multiple Access improves ALOHA by sensing the channel to see if it is idle before transmitting.
- Users doesn’t send if they sense someone else
Variations on what to do if the channel is busy:
- 1-persistent(greedy)
- Send as soon as idle
- Nonpersistent
- Wait a random time then try again
- p-persistent
- Send with probability p when idle
“CSMA outperforms ALOHA, and being less persistent is better under high load.”
Explain Carrier Sence, Multiple Access Collision Detection (CSMA/CD)
CSMA/Collision Detection
It uses a carrier sensing scheme in which a transmitting data station detects other signals while transmitting a frame, and stops transmitting that frame, transmits a jam signal, and then waits for a random time interval before trying to resend the frame.
CSMA/CD is used to improve CSMA performance by terminating transmission as soon as a collision is detected, thus shortening the time required before a retry can be attempted.
Explain Collision-Free: Bitmap
- The basic bit-map protocol:
- Sender set a bit in contention slot if they have data
- Senders send in turn; everyone knows who has data
What is a Collision-Free protocol?
- Collision-free protocols avoid collisions entirely
- Senders must know when it is their turn to send
Explain Collision-Free - Token Ring
A token is sent round ring and defines the sending order
- Station with token may send a frame before passing
- Idea can be used without ring too, e.g., token bus
Explain Binary Countdown
Data is transmitted as binary. If several nodes on a network start transmitting simultaneously, all transmit their network ID as a binary number.
These numbers are compared starting with the first number in the sequence, representing the highest value in the byte.
All those containing a zero at this bit are knocked out, if there are still more than one node in contention, the next bit along is compared. Again, those with 1 stay in and those with 0 are out.
This process continues along the bits of the network ID until there is only one node left and that gets control of the media.
What are Limited-Contention Protocols?
Idea is to divide stations into groups within which only a very small number are likely to want to send
- Avoids wastage due to idle periods and collisions
Limited-Contention Protocol: Explain Adaptive Tree Walk
Initially all nodes are allowed to try to aquire the channel. If a node is able to aquire the channel, it sends its frame.
If collision then the nodes are divided into two equal groups and only one of these groups compete for slot 1.
If one of its members aquire the channel then the next slot is reserved for the other group.
On the other hand, if there is a collision again then that group is also subdivided and the same process is followed. This can be better understood if the nodes are thought of as being organised in a binary tree
- Depth first search under nodes with poll collisions
- Start search at lower levels if more than one station expected
What complications does Wireless have compared to Wired?
Wireless has complications compared to wired.
- Nodes may have different coverage regions
- Leads to hidden and exposed terminals
- Nodes can’t detect collisions, i.e., sense while sending
- Makes collisions expensive and to be avoided
What are Hidden terminals?
Hidden terminals are senders that cannot sense each other but nonetheless collide at intended receiver
- Want to prevent; loss of efficiency
- A and C are hidden terminals when sending to B
What are Exposed terminals?
Exposed terminals are senders who can sense each other but still transmit safely (to different receivers)
- Desirably concurrency; improves performance
- B -> A and C -> D are exposed terminals
Wireless LANs: What is Multiple Access with Collision Avoidance (MACA)?
- When a wireless network node wants to transmit, it sends a signal called Request-To-Send (RTS) with the length of the data frame to send.
- If the receiver allows the transmission, it replies the sender a signal called Clear-To-Send (CTS) with the length of the frame that is about to receive.
- Meanwhile, a node that hears RTS should remain silent to avoid conflict with CTS; a node that hears CTS should keep silent until the data transmission is complete.
Classic Ethernet: Explain the Physical Layer
One shared coaxial cable to which all hosts attached
- Up to 10 Mbps, with Manchester encoding
- Hosts ran the classic Ethernet protocol for access
Classic Ethernet: Explain MAC protocol
MAC protocol is 1-persistent CSMA/CD (earlier)
- Random delay (backoff) after collision is computed with BEB (Binary Exponential Backoff)
How is the Classic Ethernets performance?
- Efficient for large frames, even with many senders
- Degrades for small frames (and long LANs)
Explain Switched/Fast Ethernet
Fast Ethernet extended Ethernet from 10 to 100 Mbps
- Hubs wire all lines into a single CSMA/CD domain
- Switches isolate each port to a separate domain
- Much greater throughput for multiple ports
- No need for CSMA/CD with full-duplex lines
- Switches can be wired to computers, hubs and switches
- Hubs concentrate traffic from computers
What does Idempotent mean?
An idempotent operation can be repeated an arbitrary number of times and the result will be the same as if it had been done only once.
What does Non-Idempotent mean?
A Non-idempotent operation will have a different result depending on the amount of times the operation was done.
OSI-model: Explain the Physical layer
- Defines electrical and physical specifications of the data connection
- Defines transmission mode: Simplex, half duplex, full duplex
- Defines network topology: bus, mesh, ring, etc.
OSI-model: Explain the Data link layer
The data link layer provides node-to-node data transfer—a link between two directly connected nodes. It detects and possibly corrects errors that may occur in the physical layer.
It, among other things, defines the following protocols:
- Protocols for establish and terminate a connection between two physically connected devices.
- Protocol for flow control between the two physically connected devices.
It is divided into two sublayers:
- Media Access Control (MAC) layer - responsible for controlling how devices in a network gain access to medium and permission to transmit it.
- Logical Link Control (LLC) layer - responsible for identifying Network layer protocols and then encapsulating them and controls error checking and frame synchronization.
OSI-model: Explain the Network layer
- A key design issue is determining how packets are routed from source to destination.
- Handling congestion is also a responsibility of the network layer.
- The quality of service (delay, transit time, etc.) is also a network layer issue.
- It is up to the network layer to allow heterogeneous networks to be interconnected.
OSI-model: Explain the Transport layer
The basic function of the transport layer is to accept data from above it, split it up into smaller units if need be, pass these to the network layer, and ensure than the pieces all arrive correctly at the other end.
OSI-model: Explain the Session layer
The session layer allows users on different machines to establish sessions between them.
Sessions offer various services, including:
- Dialog Control (keeping track of whose turn it is to transmit)
- Token Management (preventing two parties from attempting the same critical operation simultaneously)
- Synchronization (checkpointing long transmissions to allow them to pick up from where they left off in the event of a crash and subsequent recovery)
OSI-model: Explain the Presentation layer
Unlike the lower layers, which are mostly concerned with moving bits around, the presentation layer is concerned with the syntax and semantics of the information transmitted.
In order to make it possible for computers with different internal data representations to communicate, the data structures to be exchanged can be defined in an abstract way, along with a standard encoding to be used ‘‘on the wire.’’
The presentation layer manages these abstract data structures and allows higher-level data structures (e.g., banking records) to be defined and exchanged.
OSI-model: Explain the Application layer
The application layer contains a variety of protocols that are commonly needed by users.
One widely used application protocol is HTTP (HyperText Transfer Protocol), which is the basis for the World Wide Web.
Other application protocols are used for file transfer, electronic mail, and network news.
What is Remote Procedure Call (RPC)?
Remote Procedure Call (RPC) is a protocol that one program can use to request a service from a program located in another computer in a network without having to understand network details. (A procedure call is also sometimes known as a function call or a subroutine call.)
- RPC uses the client/server model.
- The requesting program is a client and the service-providing program is the server.
- Like a regular or local procedure call, an RPC is a synchronous operation requiring the requesting program to be suspended until the results of the remote procedure are returned.
- However, the use of lightweight processes or threads that share the same address space allows multiple RPCs to be performed concurrently.
Explain Remote Method Invocation (RMI)?
RMI is the Java version of what is generally known as a remote procedure call (RPC), but with the ability to pass one or more objects along with the request.
What is Marshalling?
Marshalling is the process of taking a collection of data items and assembling them into a form suitable for transmission in a message.
What is Unmarshalling?
Unmarshalling is the process of disassembling data on arrival.
- Values are converted to an agreed external format before transmission, and converted to the local format on receipt.
- Values are transmitted in the sender’s format together with an indication of the format used.
- Translate at sender side, receiver side, or both!
What is Request-reply communication?
It is one of the basic methods computers use to communicate with each other, in which the first computer sends a request for some data and the second computer responds to the request.
What are the different Failure models?
- Fail-stop
- Process halts and remains halted. Other processes may detect this state.
- Crash
- Process halts and remains halted. Other processes may not be able to detect this state.
- Omission
- A message inserted in an outgoing message buffer never arrives at the other end’s incoming message buffer.
- Send-omission
- A process completes a send but the message is not put in its outgoing message buffer.
- Receive-omission
- A message is put in a process’s incoming message buffer, but that process does not receive it.
- Arbitrary (Byzantine)
- Process/channel exhibits arbitrary behaviour: it may send/transmit arbitrary messages at arbitrary times,
commit omissions; a process may stop or take an incorrect step.
- Process/channel exhibits arbitrary behaviour: it may send/transmit arbitrary messages at arbitrary times,
Request-reply protocols: How do they cope with lost requests and lost repliests?
- Lost Replies
- Client: Times out and retransmits request
- Server:
- If idempotent operation
- Re-execute
- If non-idempotent
- Use a history (buffer) of results and retransmit
- If idempotent operation
- Lost Requests
- Client: Times out and retransmits
Define the properties of Objects
- Interfaces and services
- Each object is an instance of a type that defines a set of methods (interface) that can be invoked to operate on the object.
- Separation of interfaces and implementation: independent (re-)implementation of C/S
- Invocation is syntactically and (semantically) independent of an object’s location or implementation.
- Defines “type”
- Encapsulated
- The only way to operate on an object is through its methods; the internal representation/implementation is hidden from view.
- State only accessible via message passing / RMI
- Already logically partitioned physical distribution
- Unit for persistence, caching, location, replication, and/or access control.
- Dynamically allocated/destroyed/binding
- Objects are created as needed and destroyed when no longer needed; not bound to specific program scope
- Client dynamically locates and binds to servers
- Uniquely referenced
- Each object is uniquely identified during its existence by reference that can be held/passed/stored/shared.
- For Distr sys: add mapping between id and (current) location
What is an Interface Definition Language (IDL)?
It is a specification language used to describe a software component’s application programming interface (API).
IDLs describe an interface in a language-independent way, enabling communication between software components that do not share one language.
For example, between those written in C++ and those written in Java.
What is a remote object?
A remote object is the object that contains the methods that can be invoked when using RMI.
What are Distributed Objects?
They create the illusion of a “method call” on a different machine.
Distributed Objects can be located on the server while being invoked by the client.
The marshalled invocation is passed accross the network to the server.
What is a Remote Object Reference?
Uniquely identifies an object system-wide in time and space.
Fx (first 4 blocks are 32 bits):
| Internet address | Port nr | Time | Object nr | Interface of remote obj |
Problem: What if objects migrate?
Add a service that maps object refs to current (last known) location.
What is a servant?
A servant is an instance of a class that provides the body of a remote object.
It is the servant that eventually handles the remote requests passed on by the corresponding skeleton.
Servants live within a server process. They are created when remote objects are instantiated and remain in use until they are no longer needed, finally being garbage collected or deleted.
Implementation of RMI: Garbage collection
Other computers have remote references to objects. Such objects cannot be garbage collected purely locally.
- Distributed Garbage Collection
- Reclaim object when no object/node in the system can reference the object
- Tolerating (transient failures) and concurrency (add/release references)
Implementation of RMI: Parameter Passing
Should parameters (IN and OUT / return) be transferred by value or reference? Normally, anything is by reference, except primitive or valueTypes
Call-By-Value: a copy created at receiver
- Potentially expensive marshalling and communication of large objects state+code
- Side-effects made by receiver are not visible to calee
System objects cannot be marshalled eg. open files, threads…)
Implementation of RMI: Exceptions
- Where are exceptions that are generated on the server side directed?
- 2 kinds:
- server side handling
- client side handling
- Which can take suitable recovery action?
- 2 kinds:
- What about new exception types introduced by the RMI subsystem?
- Remote object may be/become inaccessible
RIM: What are Stubs?
- A client stub is responsible for conversion (Marshalling) of parameters used in a function call and deconversion of results passed from the server after execution of the function.
- A server skeleton, the stub on server side, is responsible for deconversion of parameters passed by the client and conversion of the results after the execution of the function.
RMI: What are the security problems with Distributed Class Files?
- Dynamically loaded code from remote clients (perhaps programmed by other people) cannot / should not be trusted
- Anybody that knows the interface can access the remote object!
- Before a Java application is allowed to download code dynamically, a suitable security manager and security policy must be set.
- If no security manager is set, stubs and classes can only be loaded from the local CLASSPATH.
What is a stateless server?
Stateless means there is no record of previous interactions and each interaction request has to be handled based entirely on information that comes with it.
Semantics of File Sharing: Unix semantics
- Every operation on a file is instantly visible to all processes: a read operation returns the effect of the last write operation
- Can only be implemented for remote access models in which there is only a single copy of the file
Semantics of File Sharing: Session semantics
- No changes are visible to other processes until the file is closed.
- The effects of read and write operations are seen only to the client that has opened (a local copy) of the file.
- When the file is closed, only one client’s writes remain
Semantics of File Sharing: Immutable files
No updates are possible; simplifies sharing and replication
Semantics of File Sharing: Transaction semantics
- All changes occur atomically.
- The file system supports transactions on a single file
- Issue: how to allow concurrent access to a physically distributed file
File System Models: Remote Access Model vs Upload/Download Model
- Remote Access Model
- The client requests to access the remote file on the server.
- The file always stays on the server.
- Upload/Download Model
- File is deleted from the server and moved to the client
- The client accesses the file
- File is saved as a new file on the server
Explain Network File System (NFS)?
An implementation and a specification (RFC) of a software system for accessing remote files across LANs (or WANs)
- RPC/XDR based protocol
- Goals
- Access transparency
- Heterogeneous,
- OS Independent
Explain NFS
- Made by SUN in 1985
- Provides a set of RPCs (searching, read/write, ect.)
- Stateless
- Does not provide concurrency-control mechanism
Use separate lock-service. - Fault tolerance
- Operations are idempotent
- Server is stateless
Fault-Tolerance of NFS
- No RPC for open / close!
- File-handle supplied at each invocation
- Operations are Idempotent
- Repeated invocations leaves server in same state
- Server is State-less!
- Server crash: Client can continue unaffected when server recovers
- Client crash: No state to be remembered/ or leaned up at server
Explain Caching in NFS
Both (in main memory):
- Server-side caching:
- Read operations: easy.
- Write operations:
- Write-through, or
- Delayed-write: flush on commit operation (+file close)
- Client-side caching:
- Similarly caches read/write/getattr/lookup results
- Consistency problems when several clients holds copies of the same blocks
Client cache validation check in NFS
- Time-stamp based validation
- Client validation before use of cache contents
- TC is the time of the last validation of cached block
- Tm-server is the modification timestamp stored at server
- Tm-client is the modification timestamp stored at client
- T=current time
- t is the freshness interval
- TC is the time of the last validation of cached block
- Valid if: (T- TC < t) or (Tm-client = Tm-server)
- Tm-client obtained through getattr polling before cache entry is used
- t is 3-30s adaptive (compromise between consistency and efficiency (files/directories))
What is a Daemon?
A daemon is a computer program that runs as a background process, rather than being under the direct control of an interactive user.
- Systems often start daemons at boot time and serve the function of responding to network requests, hardware activity, or other programs by performing some task.
- Daemons can also configure hardware, run scheduled tasks, and perform a variety of other tasks.
Explain main pointers of The Andrew File System (AFS)
- A distributed computing environment
- Design objectives
- Highly scalable: targeted to span over 5000 workstations.
- Whole-file-serving:
- Entire contents of directories and files transfered from server to client.
- Whole-file-caching:
- When file transfered to client it will be stored on that client’s local disk
- Clients more independent of server than NFS
What happens when a user opens a file in the Andrew Files System (AFS)?
- A user process opens a shared file not in local cache.
- Client requests a copy of the file from server
- The copy is cached on the local file system.
- Read and write operations are performed on the local copy
- When the user process performs a close operation, and if the file has been modified, it is copied back to the server.
- The server installs the new version of the file, and updates the last modified timestamp for the file.
Why use The Andrew Files System (AFS)?
- For infrequently updated files, the cached copies remain valid for long periods (e.g. system binaries)
- Large caches are possible
What is a call-back promise?
A token representing a promise made by server that it will notify the client when the cached file is modified by other clients
- Stored in client disk-cache
- States: valid or cancelled
- Moves from valid to cancelled state when callback is received
- Client access to file with cancelled call-back promise => fetch fresh copy from server
- Client access to file with valid call-back promise => use local copy
Update Semantics of Unix, NFS and AFS
- Unix: one-copy semantics
- there is one copy of the file, and each write is destructive (i.e., “last write wins”)
- NFS: one-copy semantics, except:
- clients may have out-of-date cache entries for brief periods of time when files are shared, can lead to invalid writes at the server.
- AFS: session semantics
- if a callback message is lost, a client will continue working with an out-of-date copy for at most T minutes
- if two clients writes to the same file concurrently => last to close wins (Use locking if needed)
Failure Performance: NFS vs AFS
- When an NFS server fails, everything fails
- all accesses have apparent local semantics (except for “soft mounts”)
- when a server fails, it is as though the local disk has become unobtainable
- since authentication files are often stored on NFS servers, this brings down the entire system
- When an AFS server fails, life (partly) goes on
- all locally cached files remain available
- work is still possible, though there is a higher chance of conflict for shared files
Explain Microsoft Message Queueing (MSMQ)
MSMQ is essentially a messaging protocol that allows applications running on separate servers/processes to communicate in a failsafe manner.
A queue is a temporary storage location from which messages can be sent and received reliably, as and when conditions permit. This enables communication across networks and between computers, running Windows, which may not always be connected.
By contrast, sockets and other network protocols assume that direct connections always exist.
What is a socket?
- An interface between application and network
- The application creates a socket
- The socket type dictates the style of communication
- reliable vs. best effort
- connection-oriented vs. connectionless
- Once configured the application can
- pass data to the socket for network transmission
- receive data from the socket (transmitted through the network by some other host)
Name the different kinds of System Queues for messages
- Journal queues
- stores copies of messages sent to/through/from this machine
- read-only (can’t be directly sent to); much like database logs
- Dead-letter queues
- final resting place of undeliverable messages
- one each for transactional and non-transactional Q’s
- read-only (can only be read and deleted, not sent to)
- Connector queues
- used for store-and-forward messaging in route
Name the different Communication Modes in Distributed Systems (something-cast)
- Uni-cast
- Messages are sent from exactly one process to one process
- Broad-cast
- Messages are sent from exactly one process to all processes on the network.
- Multi-cast
- Messages are sent from exactly one process to several processes on the network (named group).
- Any-cast
- Message is sent to one (eg “best” or “nearest”) of a set of possible receivers
- Geo-cast:
- Message sent to geographically close neighbors
Explain the Unicast use
- With 4 receivers, the sender must replicate the stream 4 times.
- Consider good quality audio/video streams are about 1.5Mb/s (a T1)
- Each additional receiver requires another 1.5Mb/s of capacity on the sender network
- Multiple duplicate streams over expensive WAN links
Explain the Publish-Subscribe Model
It is a messaging pattern where senders of messages, called publishers, do not program the messages to be sent directly to specific receivers, called subscribers, but instead characterize published messages into classes without knowledge of which subscribers, if any, there may be.
Similarly, subscribers express interest in one or more classes and only receive messages that are of interest, without knowledge of which publishers, if any, there are.
Pub/sub is a sibling of the message queue paradigm, and is typically one part of a larger message-oriented middleware system.