chapter 2- Layered Architectures Based DSs using UDP TCP and Multicast

Overview of Layered Architectures

  • Prof. Mourad Elhadef, Ph. D. teaches CSC408 focusing on distributed information systems.

  • Chapter 02A covers key topics: UDP (User Datagram Protocol), TCP (Transmission Control Protocol), and Multicast.

  • The applications discussed revolve around simple client-server systems and group communication.

Learning Objectives

  • Students will learn to develop distributed systems utilizing:

    • UDP Datagram Communication: Implementing systems using UDP.

    • TCP Stream Communication: Implementing systems using TCP.

    • Multicast Group Communication: Exploring communication strategies for groups.

Key Themes

  • Introduction: Understand the fundamentals of client-server communication.

  • UDP Datagram Communication: Insights into how datagrams are transmitted.

  • TCP Stream Communication: Characteristics and strategies for using TCP.

  • Group Communication (Multicast): Techniques for utilizing multicast in distributed systems.

Characteristics of Interprocess Communication

Types of Communication

  • Synchronous: Processes synchronize for every message.

  • Asynchronous: Flexible, with no synchronization between sending and receiving processes.

Operations

  • Send/Receive Operations:

    • Synchronous: blocking operations that wait for completion.

    • Asynchronous: non-blocking, allowing processes to continue execution.

Message Characteristics

  • Destinations: Messages are sent to secure addresses defined by Internet address and ports.

  • Reliability:

    • Integrity: Confirmation that messages are received intact.

    • Validity: Ensuring messages hold necessary content.

    • Ordering: Required for applications needing messages in sequence.

Sockets in Communication

  • Sockets: Endpoints for communications, bound to local ports and an Internet address.

  • Each protocol (UDP or TCP) correlates to a specific socket, with 216 possible ports available for binding.

Client-Server Communication: Mechanisms

Synchronous Communication

  • Client processes wait for server replies; reliability hinges on acknowledgment of requests.

Failure Models

  • Types of faults:

    • Omission Faults: Messages may be lost, requiring robust handling strategies like timeouts and idempotent operations.

Request-Reply Protocols

  • Variants define how messages (Request, Reply) are sent and acknowledged.

UDP Datagram Communication

Characteristics

  • UDP transmits datagrams without acknowledgments or retries, which speeds up communication but lacks delivery guarantees.

  • Failure Modes: Messages can be dropped (omission failures) or arrive out of order.

Advantages of UDP

  • Efficient performance as it minimizes overheads typically found in guaranteed delivery methods.

Java API for UDP Communication

Key Components

  • InetAddress class: Represents Internet addresses for communication.

  • DatagramPacket class: For creating packets of data for transmission.

Basic Operations

  • Structure includes socket creation and operations to send/receive data, handling various exceptions.

TCP Stream Communication

Characteristics of TCP

  • Utilizes streams with guaranteed delivery mechanisms. Handles message sizes, lost messages, flow control, and data integrity.

  • Flow matching: TCP servers synchronize their read/write speeds with connected processes.

Java API for TCP Communication

  • Socket class: Facilitates connection to servers.

  • ServerSocket class: Used for accepting new client connections.

Sample TCP Client and Server Implementation

  • Code examples illustrate how a client sends messages and how a server responds, handling potential exceptions during communication.

Multicast Group Communication

Concepts and Infrastructure

  • Sends one message to multiple group members, promoting fault tolerance and efficiency through replicated services.

  • IP multicast is primarily executed within UDP.

Java API for Multicast

  • MulticastSocket Class: Provides functionalities for joining/leaving groups, sending/receiving messages, and setting network interfaces for multicast packets.

Example Multicast Implementation

  • Code snippets demonstrate a multicast peer's behavior, including how to send and receive datagrams efficiently.

robot