Distributed systems Flashcards
What is a distributed system?
• A collection of loosely coupled nodes interconnected by a communication network.
• Each node views its own resources as local; others are remote.
Why are nodes in distributed systems referred to as sites or hosts?
• ‘Site’ indicates the location of a machine.
• ‘Node’ refers to a specific system at a site.
What are the main benefits of distributed systems?
• Reliability
• Scalability
• Flexibility
• Speedup
• Openness
• High performance
What challenges do distributed systems face?
• Troubleshooting difficulties
• Software support limitations
• High network infrastructure costs
• Security vulnerabilities
How do distributed systems improve reliability?
• By continuing operation despite individual site failures, leveraging redundancy.
How do processes communicate across different hosts?
• By exchanging messages over a communication network.
What defines a client and server in communication?
• Client: Initiates the communication session.
• Server: Waits to be contacted.
What is a socket in networking?
• A logical door between processes across networks, allowing data sending and receiving.
What does a socket’s destination address include?
• Destination host’s IP address
• Destination port number
What are the two main types of sockets?
• UDP Socket: Connectionless, unreliable, datagram-oriented
• TCP Socket: Connection-oriented, reliable, byte stream-oriented
In the basic client-server diagram, what role does Site A play?
- Site A acts as the server.
What is happening between Site A and Site B?
- Communication between the server at Site A and the client at Site B over a network.
How is the socket used in the UDP client-server diagram?
- Client creates a socket and sends a datagram to the server without handshaking.
- Server reads the datagram and responds via the socket.
What Python function is used by the UDP client to send data?
- clientSocket.sendto()
In the UDP server Python script, what happens inside the while True loop?
- Server reads a message, capitalizes it, and sends it back to the client.
How are messages transmitted in UDP communication?
- As independent, connectionless datagrams.
What buffer size is used for receiving messages in the UDP examples?
- 2048 bytes
What is the TCP three-way handshake?
- A connection setup procedure involving SYN, SYN-ACK, ACK messages.
In TCP server code, what does serverSocket.listen(1) do?
- Listens for incoming TCP connection requests.
After accepting a client connection, what socket is used for data transfer?
- connectionSocket
How does TCP differ from UDP regarding reliability?
- TCP guarantees reliable, ordered, and error-checked delivery.
What happens when a TCP client connects to a server?
- The server spawns a new socket to manage communication with that specific client.
What is the main functionality of the EchoServer application?
- Receives a message from the client and sends it back unchanged.
How does the client handle messages in the EchoServer protocol?
- Read message from user
- Send message to server
- Receive echoed message
- Display message