Communications in Distributed Systems Study Guide

Basics of Communication Systems in Distributed Systems

  • In uniprocessor operating systems, inter-process communication (IPC) implicitly assumes the existence of shared memory (for example, shared memory solutions for the Producer-Consumer problem).

  • In distributed systems, there is no shared memory. All inter-process communication relies entirely on message passing across a communication network.

  • Protocols are predefined sets of rules adhered to by communicating processes to manage message structure, timing, sequence, and error control.

  • In Wide-Area Distributed Systems, protocols are structured into multiple hierarchical layers.

  • Major platforms for inter-process communication include:

    • Open Systems Interconnection (OSI) model

    • Asynchronous Transfer Mode (ATM)

    • Remote Procedure Calls (RPC)

    • Group Communication

Network Connections, Physical Topologies, and Network Types

  • Network: Two or more devices connected through physical or logical links.

  • Link: A communications pathway that transfers data from one device to another.

  • Types of Connections:

    • Point-to-Point: A dedicated communication channel shared exclusively between two devices or nodes.

    • Multi-Point: A single communication channel shared simultaneously among multiple devices or nodes (for example, a Bus topology).

  • Physical Topology: The geometric representation of the layout of links and connecting nodes in a network.

    • Mesh Topology (Fully Connected):

    • Every device has a dedicated point-to-point link to every other device.

    • For NN connected devices, the total number of dedicated physical links required is given by the combination formula:       Total Links=(N2)=N(N−1)2\text{Total Links} = \binom{N}{2} = \frac{N(N-1)}{2}

    • Example: For N=5N = 5 devices, the required number of links is:       Total Links=5×(5−1)2=10\text{Total Links} = \frac{5 \times (5 - 1)}{2} = 10       

      Fully connected mesh topology
    • Star Topology:

    • All nodes connect directly to a central networking device (such as a router, switch, or hub).

    • The central device acts as a server/relay, while attached nodes act as clients.       

      Star topology
    • Bus Topology (Line Topology):

    • All devices connect to a single primary backbone cable (the bus) via drop lines and cable taps.

    • All attached nodes receive transmitted signals simultaneously.       

      Bus topology
    • Ring Topology:

    • Devices are connected in a closed circular loop.

    • Each node connects directly to two adjacent neighbors using repeaters.

    • Data travels unidirectionally around the ring passing through intermediate nodes until it reaches its destination.       

      Ring topology
  • Network Classifications:

    • Local Area Network (LAN):

    • Connects devices within a limited physical site (building, office, home).

    • Scale ranges from single-user home networks to enterprise networks serving thousands of devices.

    • Built using components like cables, wireless access points, switches, and routers.

    • Evolution of Isolated LANs:

      • Past: Shared common coaxial cable with physical taps.

      • Today: Star-configured topology driven by central link-layer switches.       

        Isolated LAN past vs present
    • Wide Area Network (WAN):

    • Spans large geographical distances to interconnect individual LANs or subnets.

    • Primary technologies: Packet switching, TCP/IP protocol suite, router overlay networks (network virtualization).

    • Switched WAN: Utilizes internal switches across backbone networks with multiple connection endpoints.       

      Switched WAN diagram
    • Point-to-Point WAN: Dedicated point-to-point leased line connecting routers across long distances (for example, connecting a West Coast office LAN to an East Coast office LAN).       

      Point-to-Point WAN connecting LANs
    • Heterogeneous Networks: Complex interconnections involving switched WANs, point-to-point WANs, routers, modems, and local subnets.       

      Heterogeneous network topology
    • The Internet:

    • internet (lowercase i): Any collection of two or more distinct networks communicating together.

    • Internet (uppercase I): The global network of millions of interconnected networks.

    • Structural hierarchy: Customer networks connect to Provider networks, which interface via Peering Points to major high-speed Backbones.       

      Internet structural view

Protocol Layering, TCP/IP Suite, and OSI Model

  • Principles of Protocol Layering:

    • Principle 1: Each layer must perform two opposite complementary tasks in each direction (for example, talk/listen, encrypt/decrypt, send/receive).

    • Principle 2: The protocols and shared objects at corresponding peer layers across communicating nodes must be identical.

  • Conceptual Protocol Models:

    • Single-Layer Protocol: Communication occurs directly through a single medium (for example, two people, Maria and Ann, speaking over air at Layer 1: Listen/Talk).     

      Single-layer protocol diagram
    • Three-Layer Protocol:

    • Layer 3: Listen/Talk (Plaintext objects shared logically).

    • Layer 2: Encrypt/Decrypt (Ciphertext objects shared logically).

    • Layer 1: Send/Receive Mail (Postal carrier mail objects transferred physically).

    • Logical connections exist horizontally between peer layers, while actual data moves vertically down through layers at the sender and up at the receiver.     

      Three-layer protocol diagram

          

      Logical connections between peer layers
  • TCP/IP Protocol Suite:

    • Consists of 5 functional layers:

    1. Layer 5: Application Layer (Identical objects: Messages) — Responsible for process-to-process communication.

    2. Layer 4: Transport Layer (Identical objects: Segments or User Datagrams) — Responsible for end-to-end service delivery between application processes.

    3. Layer 3: Network Layer (Identical objects: Datagrams) — Responsible for host-to-host routing across intermediate routers.

    4. Layer 2: Data Link Layer (Identical objects: Frames) — Responsible for moving datagrams across individual physical links.

    5. Layer 1: Physical Layer (Identical objects: Bits) — Responsible for transmitting individual bits across physical media.   

      TCP/IP protocol layersCommunication through an internetworkLogical connections in TCP/IPIdentical objects per layer in TCP/IP
  • Open Systems Interconnection (OSI) Reference Model:

    • Established in 1947 by the International Organization for Standardization (ISO); introduced in the late 1970s.

    • Defines 7 standard layers:

    • Layer 7: Application

    • Layer 6: Presentation

    • Layer 5: Session

    • Layer 4: Transport

    • Layer 3: Network

    • Layer 2: Data Link

    • Layer 1: Physical   

      OSI 7-layer reference model
  • Comparison Between OSI and TCP/IP Models:

    • Session (Layer 5) and Presentation (Layer 6) layers are explicitly defined in OSI, but are absent as distinct layers in TCP/IP.

    • The Application Layer in TCP/IP combines the functionality of OSI's Application, Presentation, and Session layers.   

      TCP/IP vs OSI model comparison

Asynchronous Transfer Mode (ATM) Architecture

  • Overview of ATM:

    • High-speed, connection-oriented networking technology standardized by ITU-T (International Telecommunication Union - Telecommunication Standardization Sector).

    • Transfers voice, video, and data concurrently using fixed-size 53-byte53\text{-byte} cells over virtual circuits.

    • Combines the predictable performance of circuit switching with the efficiency of packet switching.

  • ATM Operational Steps:

    1. Sender establishes a virtual circuit connection to the receiver.

    2. A designated route is calculated across intermediate switches.

    3. Routing information is stored in lookup tables within switches along the path.

    4. Data stream is segmented into fixed 53-byte53\text{-byte} cells by hardware.

    5. Routing state is cleared from switches when the connection terminates.

  • ATM Reference Layer Model:

    • Maps to OSI Layers 1 and 2:

    • ATM Physical Layer: Handles physical transmission media.

    • ATM Layer: Manages cell header generation, multiplexing, and virtual path/channel routing.

    • ATM Adaptation Layer (AAL): Serves as the interface between upper-layer application requirements and raw ATM cell transfer.   

      ATM reference model comparison
  • ATM Physical Layer Details:

    • Operates synchronously by transmitting empty cells when no data is queued.

    • Frequently deployed over SONET (Synchronous Optical NETwork).

    • SONET frame structure: Total size 810 bytes810\,\text{bytes} (36 bytes36\,\text{bytes} overhead + 744 bytes744\,\text{bytes} payload), yielding a gross data rate of 51.840 Mbps51.840\,\text{Mbps}.

    • Basic channel standard: Optical Carrier 1 (OC-1) at 51.840 Mbps51.840\,\text{Mbps}. OC-12 and OC-48 are used for long-haul backbones.

  • ATM Layer and Cell Header Architecture:

    • Total cell size: Fixed at 53 bytes53\,\text{bytes} (5 bytes5\,\text{bytes} header + 48 bytes48\,\text{bytes} payload).

    • Header Fields (User-to-Network Interface - UNI):

    • GFC (Generic Flow Control): 4 bits4\,\text{bits} — Controls local traffic flow at the user interface.

    • VPI (Virtual Path Identifier): 8 bits8\,\text{bits} — Identifies the virtual path bundle.

    • VCI (Virtual Channel Identifier): 16 bits16\,\text{bits} — Identifies the specific virtual channel.

    • Payload Type: 3 bits3\,\text{bits} — Distinguishes between user data cells and control cells.

    • CLP (Cell Loss Priority): 1 bit1\,\text{bit} — Indicates priority; cells with CLP =1= 1 are dropped first during congestion.

    • CRC / HEC (Header Error Control): 8 bits8\,\text{bits} — Cyclic redundancy check for error detection and single-bit error correction in the header.

  • ATM Adaptation Layer (AAL) Traffic Classes:

    • Constant Bit Rate (CBR): For real-time, uncompressed audio and video streams.

    • Variable Bit Rate (VBR): For delay-sensitive, compressed stream traffic.

    • Connection-oriented Data Traffic: For bursty, connection-oriented network protocols.

    • Connectionless Data Traffic: For standard datagram traffic.

    • SEAL (Simple and Efficient Adaptation Layer):

    • Uses 1 bit of the Payload Type field set to 11 on the final cell of a frame.

    • Appends an 8-byte8\text{-byte} trailer in the last cell containing:

      • Reserved fields: 2 bytes2\,\text{bytes} (1 byte1\,\text{byte} each, unused).

      • Packet Length: 2 bytes2\,\text{bytes}.

      • Checksum: 4 bytes4\,\text{bytes}.

  • ATM Switching:

    • Connects input lines to output lines through a switching fabric.

    • Head-of-Line (HOL) Blocking: Occurs when a cell at the front of an input queue is delayed, blocking all subsequent queued cells.

    • Solution: Implement copy buffering within output queues.   

      ATM switching network and switch detail
  • Evaluation of ATM Technology:

    • Advantages: High speed; unified transmission of voice, video, and data; standardized QoS guarantees (delay, jitter, cell loss ratio, bandwidth); fast hardware switching due to fixed cell size.

    • Disadvantages: Expensive specialized switches; complex configuration; fixed cell header overhead (5 bytes5\,\text{bytes} header per 48 bytes48\,\text{bytes} payload = ≈9.4%\approx 9.4\% overhead); sub-optimal for bursty data; setup latency for virtual circuit establishment; largely superseded by Ethernet, MPLS, and IP networks.

Client-Server Model and IPC Addressing

  • Inter-Process Communication (IPC):

    • Absence of shared memory in distributed systems mandates message-passing architectures.

    • Protocols dictate communication semantics.

  • Client-Server Architecture:

    • Based on a simple request/reply pattern.

    • Highly efficient: No connection setup before transmission and no connection teardown afterward.

    • Requires only 3 effective protocol layers (Physical/Data Link at Layers 1–2, Request/Reply at Layer 5).

    • Operating system micro-kernels provide two primary primitives:

    • send(dest, &mptr)

    • receive(addr, &mptr)

    • where mptr points to the message buffer, dest is the destination process ID, and addr is the source address.   

      Client-Server protocol layer representation
  • Implementation Source Code Examples:

    • Header Definitions (header.h):

/* Definitions needed by clients and servers. */
#define TRUE 1
#define MAX_PATH 255   /* maximum length of file name */
#define BUF_SIZE 1024  /* how much data to transfer at once */
#define FILE_SERVER 243/* file server's network address */

/* Definitions of the allowed operations */
#define CREATE 1 /* create a new file */
#define READ 2   /* read data from a file and return it */
#define WRITE 3  /* write data to a file */
#define DELETE 4 /* delete an existing file */

/* Error codes. */
#define OK 0
#define E_BAD_OPCODE -1 /* unknown operation requested */
#define E_BAD_PARAM -2  /* error in a parameter */
#define E_IO -3         /* disk error or other I/O error */

/* Definition of the message format. */
struct message {
    long source;              /* sender's identity */
    long dest;                /* receiver's identity */
    long opcode;              /* requested operation */
    long count;               /* number of bytes to transfer */
    long offset;              /* position in file to start I/O */
    long result;              /* result of the operation */
    char name[MAX_PATH];      /* name of file being operated on */
    char data[BUF_SIZE];      /* data to be read or written */
};
  • Server Main Loop:

#include <header.h>

void main(void) {
    struct message m1, m2; /* incoming and outgoing messages */
    int r;                 /* result code */

    while(TRUE) {          /* server runs forever */
        receive(FILE_SERVER, &m1); /* block waiting for a message */
        switch(m1.opcode) {       /* dispatch on type of request */
            case CREATE:
                r = do_create(&m1, &m2);
                break;
            case READ:
                r = do_read(&m1, &m2);
                break;
            case WRITE:
                r = do_write(&m1, &m2);
                break;
            case DELETE:
                r = do_delete(&m1, &m2);
                break;
            default:
                r = E_BAD_OPCODE;
        }
        m2.result = r;             /* return result to client */
        send(m1.source, &m2);      /* send reply */
    }
}
  • Client Copy Procedure:

#include <header.h>

int copy(char *src, char *dst) {
    struct message m1; /* message buffer */
    long position;     /* current file position */
    long client = 110; /* client's address */

    initialize();      /* prepare for execution */
    position = 0;
    do {
        m1.opcode = READ;
        m1.offset = position;
        m1.count = BUF_SIZE;       /* how many bytes to read */
        strcpy(&m1.name, src);     /* copy name of file to be read to message */
        send(FILE_SERVER, &m1);    /* send the message to the file server */
        receive(client, &m1);      /* block waiting for the reply */

        /* Write the data just received to the destination file. */
        m1.opcode = WRITE;
        m1.offset = position;
        m1.count = m1.result;       /* how many bytes to write */
        strcpy(&m1.name, dst);     /* copy name of file to be written to buf */
        send(FILE_SERVER, &m1);    /* send the message to the file server */
        receive(client, &m1);      /* block waiting for the reply */

        position += m1.result;     /* m1.result is number of bytes written */
    } while(m1.result > 0);        /* iterate until done */

    return(m1.result >= 0 ? OK : m1.result); /* return OK or error code */
}
  • Addressing Alternatives in Client-Server Systems:

    • Alternative 1 (Two-Part Names): Addressed as machine.process (e.g., 243.4 or 4@243). Avoids global coordination because each host assigns process numbers locally.

    • Alternative 2 (machine.local-id): Process registers a local ID with its kernel. Lacks location transparency; if machine 243 crashes, compiled binaries referencing 243 fail even if service is migrated to machine 365.

    • Alternative 3 (Centralized Allocator): Centralized process address allocator issues globally unique IDs. Fails to scale due to central bottleneck.

    • Alternative 4 (Sparse Address Space + Broadcast): Processes choose random 64-bit64\text{-bit} integers. Senders broadcast a Locate packet; the matching node responds with a "here I am" message containing its physical address.

    • Drawback: High network overhead due to broadcasting.     

      Process locating via broadcast packet
    • Alternative 5 (Name Server Mapping): High-level ASCII service names are embedded in code. Senders query a Name Server to obtain the current machine address before sending requests.

    • Drawback: Replicated name servers present consistency challenges.

Message Passing Primitives

  • Synchronization Semantics:

    • Blocking (Synchronous) Send: The calling process is suspended until the message has been fully transmitted across the network interface.     

      Blocking send primitive execution
    • Non-blocking (Asynchronous) Send: Control returns to the caller immediately, allowing processing to continue in parallel with network transmission.

    • Buffer reuse issue: The sender must not modify the buffer while transmission is underway.

    • Solution 1: Kernel copies the message to an internal kernel buffer immediately.

      • Drawback: Adds copy overhead from user space to kernel space.       

        Non-blocking send with kernel buffer copy
    • Solution 2: User-level interrupt notifies the sender when the buffer becomes available.

    • Blocking Receive: The receiver halts until a message arrives in the designated buffer.

    • Non-blocking Receive: Control returns immediately after telling the kernel where the message buffer is located.

    • Arrival notification methods:

      • Polling: The receiver periodically checks buffer status using a test primitive.

      • Software Interrupt: The kernel asynchronously interrupts the receiver when a message arrives.

  • Buffering Semantics:

    • Unbuffered Primitives: Direct transfer without intermediate kernel queues.     

      Unbuffered message passing mechanism
    • Issue: If send() is invoked before receive(), the receiving kernel cannot determine target buffer placement and may drop the packet.

    • Mitigation: Pre-emptive receive design, timeouts, or buffered passing.

    • Buffered Primitives: Uses a mailbox data structure created by the process to store incoming messages until receive() is called.     

      Buffered message passing via mailbox
  • Reliability Semantics:

    • Unreliable: The system provides no delivery guarantees.

    • Request-ACK-Reply-ACK: Receiver kernel sends explicit acknowledgments for both request and reply packets.

    • Request-Reply-ACK: The server's reply acts as an implicit acknowledgment of the request; client kernel acknowledges the reply.

  • Client-Server Communication Implementation Options Matrix:

    • Addressing: Machine address | Sparse process addresses | Name Server lookup

    • Blocking: Blocking primitives | Nonblocking with kernel copy | Nonblocking with interrupt

    • Buffering: Unbuffered (discard unexpected) | Unbuffered (temporarily keep unexpected) | Mailboxes

    • Reliability: Unreliable | Request-ACK-Reply-ACK | Request-Reply-ACK

  • Packetization & Micro-Kernel Control Packet Types:

    • Large messages are split into multiple numbered packets containing sequence numbers.

    • Packet control codes:

    • REQ (Request): Client to Server — Request for service.

    • REP (Reply): Server to Client — Reply containing result.

    • ACK (Acknowledgment): Either direction — Confirms receipt of previous packet.

    • AYA (Are You Alive?): Client to Server — Checks if server has crashed during long processing.

    • IAA (I Am Alive): Server to Client — Confirms server is running.

    • TA (Try Again): Server to Client — Indicates buffer full, retry later.

    • AU (Address Unknown): Server to Client — Target process address does not exist.

Remote Procedure Call (RPC) Concepts and Mechanics

  • RPC Abstraction:

    • Allows programs to call procedures on remote hosts as if they were local procedure calls.

    • Calling and called procedures run in disjoint address spaces on different machines.

  • RPC Architectural Components:

    • Client Program, Client Stub, Client Kernel, Network Interface, Server Kernel, Server Stub, Server Program.   

      Remote Procedure Call structural architecture
  • 10-Step RPC Execution Sequence:

    1. Client procedure calls the client stub in the standard local way.

    2. Client stub builds a message packet and traps to the local kernel.

    3. Client kernel transmits the message across the network to the remote kernel.

    4. Remote server kernel passes the message to the server stub.

    5. Server stub unpacks (unmarshals) parameters and calls the local server procedure.

    6. Server procedure executes the computation and returns results to the server stub.

    7. Server stub packs (marshals) results into a reply message and traps to the kernel.

    8. Remote kernel sends the message back across the network to the client kernel.

    9. Client kernel delivers the reply message to the client stub.

    10. Client stub unpacks the result and returns execution control to the client caller.   

      10 steps for RPC packing and unpackingRPC parameter marshaling example
  • Parameter Marshaling and Data Representation:

    • Marshaling: Converting procedure parameters and identifier numbers into a standard network message format.

    • Heterogeneity Challenges:

    • Character encodings differ (for example, EBCDIC on IBM Mainframes vs. ASCII on personal computers).

    • Integer representation differs (Big-endian vs. Little-endian byte ordering).

    • Floating-point representations differ across hardware architectures.

    • Interface Definition Language (IDL) compilers generate client and server stubs automatically to convert between native and standardized data representations transparently.

  • Dynamic Binding via Binder:

    • Exporting Interface (Server Registration):

    • Server registers its availability with a daemon called the Binder.

    • Sends server name, version number, unique 32-bit32\text{-bit} identifier, and server handle (for example, Ethernet address, IP address, or process ID).

    • Importing Interface (Client Location):

    • Client stub queries Binder for a matching server name and version.

    • If found, Binder returns the handle and unique ID to the client stub, enabling direct communication.

RPC Failure Handling and Fault Tolerance

  • 5 Classes of RPC Failures:

    1. Client Unable to Locate Server:

    • Server may be down or running an incompatible interface version.

    • Handling mechanisms: Return error code (e.g., −1-1), set errno, or raise language exceptions.

    • Limitation: Returning −1-1 is ambiguous if −1-1 is a valid procedure return value (e.g., sum(7,−8)=−1\text{sum}(7, -8) = -1).

    1. Lost Request Messages:

    • Kernel starts a retransmission timer upon sending.

    • If timer expires before an ACK/reply arrives, the kernel retransmits the message.

    1. Lost Reply Messages:

    • Retransmission risks duplicate execution of operations.

    • Idempotent Operations: Safe to repeat multiple times without altering system state (for example, reading the first 1024 bytes1024\,\text{bytes} of a file).

    • Non-Idempotent Operations: Causes cumulative side effects if repeated (for example, transferring $1,000,000\$1,000,000 between bank accounts).

    • Safeguards: Client kernel assigns incremental sequence numbers; server kernel tracks sequence numbers to reject duplicate executions.

    1. Server Crashes:

    • Scenarios: Normal completion, Crash after execution (before reply), Crash before execution.      

      Server crash scenarios timeline
    • Semantics:

      • At-least-once semantics: Retransmits repeatedly until server reboots; guarantees execution ≥1\ge 1 times.

      • At-most-once semantics: Reports immediate failure upon crash; guarantees execution ≤1\le 1 times (0 or 1).

      • No guarantees: Execution occurs anywhere from 0 to many times.

    1. Client Crashes and Orphan Handling:

    • Orphan: An active remote computation whose calling client process has crashed.

    • Problems: Wasted CPU cycles, locked files/data, stale replies confusing rebooted clients.

    • Recovery Strategies:

      • Extermination: Client stub logs RPC intent to disk before sending. Upon reboot, disk logs are scanned to kill active orphans (expensive disk I/O).

      • Reincarnation: Time is divided into numbered epochs. Client reboot broadcasts a new epoch number, automatically killing remote computations tied to older epochs.

      • Gentle Reincarnation: Upon epoch broadcast, nodes verify owner status before terminating computations.

      • Expiration: Each RPC is allocated time quantum TT. If uncompleted, it must request extensions; after client crash, servers wait time TT before rebooting to ensure orphan expiration.

RPC Performance Optimization and Critical Path

  • Performance Factors:

    • System performance depends directly on communication speed.

    • Key optimization areas: Protocol Selection, Acknowledgments, Critical Path length, Memory Copying, Timer Management.

  • RPC Protocol Selection:

    • Connection-Oriented (WANs) vs. Connectionless (LANs).

    • Standard Protocols (IP/UDP) vs. Specialized RPC Protocols:

    • Standard protocols save development time, but IP overhead (13 header fields, checksum calculations, TCP layering) degrades local performance.

    • Specialized RPC protocols avoid unnecessary protocol bouncing across local subnets.

    • Packet/Message Length:

    • Large payload transfers (e.g., 64 KB64\,\text{KB}) split into many small packets (e.g., 64×1 KB64 \times 1\,\text{KB}) introduce high header overhead.

    • Constraints: Sun Microsystems limit is 8 KB8\,\text{KB}; Ethernet MTU limit is 1536 bytes1536\,\text{bytes}.

  • Automatic Repeat Request (ARQ) Algorithms:

    • Stop-and-Wait ARQ:

    • Sender transmits 1 packet and waits for an ACK before sending the next.

    • Uses a 1-bit sequence number (00 or 11) to detect duplicate frames and ACKs.

    • Inefficiency Analysis Example:

      • One-way propagation delay =15 ms= 15\,\text{ms}, Bandwidth =100 Mbps= 100\,\text{Mbps}, Packet size =1000 bytes= 1000\,\text{bytes}.

      • Transmission time =8×1000 bits108 bps=0.08 ms= \frac{8 \times 1000\,\text{bits}}{10^8\,\text{bps}} = 0.08\,\text{ms}.

      • Round-Trip Time (RTT) =2×15 ms=30 ms= 2 \times 15\,\text{ms} = 30\,\text{ms}.

      • Throughput =8000 bits0.03 s=0.2666 Mbps= \frac{8000\,\text{bits}}{0.03\,\text{s}} = 0.2666\,\text{Mbps}.

      • Link capacity utilization =0.2666100<0.3%= \frac{0.2666}{100} < 0.3\%.

    • Sliding Window Protocol:

    • Sender parameters: Sender Window Size (SWS), Last ACK Received (LAR), Last Frame Sent (LFS).

    • Receiver parameters: Receiver Window Size (RWS), Last Frame Received (LFR), Last Acceptable Frame (LAF).

    • Window boundary constraint:       LAF−LFR≤RWS\text{LAF} - \text{LFR} \le \text{RWS}

    • Sequence number space requirement:       Max Sequence Number≥SWS+RWS\text{Max Sequence Number} \ge \text{SWS} + \text{RWS}

    • Go-Back-N ARQ:

    • Receiver sends cumulative ACKs.

    • Upon timeout, sender retransmits all unacknowledged packets in the current window.     

      Go-Back-N protocol timeline
    • Selective Repeat / Selective ACK ARQ:

    • Receiver individually acknowledges all correctly received out-of-order packets and buffers them.

    • Sender retransmits only missing/unacknowledged packets.     

      Selective Repeat sender and receiver windows
  • RPC Critical Path Analysis:

    • Sequence of instructions executed on every RPC call.

    • 14 Steps in Client-to-Server Execution Path:

    1. Call stub procedure

    2. Get message buffer

    3. Marshal parameters into buffer

    4. Fill in message header fields

    5. Compute UDP checksum

    6. Trap to kernel

    7. Queue packet for transmission

    8. Move packet to controller over system bus

    9. Ethernet physical transmission

    10. Receive packet from controller on target machine

    11. Interrupt service routine execution

    12. Compute UDP checksum on receiver

    13. Context switch to user space

    14. Server stub execution

    • Primary performance bottlenecks: Marshaling parameters, kernel context switches, interrupt processing, timer maintenance.

  • Memory Copying Optimization:

    • RPC messages can be copied up to 8 times between user and kernel spaces during execution.

    • Elimination techniques:

    • Hardware Scatter-Gather: Network controller performs Direct Memory Access (DMA) transfers directly from user-space stub buffers.

    • Virtual Memory Page Mapping: Kernel updates page table maps instead of physically copying memory bytes.

  • Timer Management Systems:

    • Sorted List Approach: Maintains timeouts in a sorted linked list; requires list updates upon packet transmission and ACK arrival.

    • Process Table Approach (Kernel Sweep Algorithm): Each process table entry stores a timer value. The kernel periodically sweeps the process table to check active timers against current system time TcurrentT_{\text{current}}.

Summary Review Questions

  • Draw the block diagram of the OSI Reference Model and the TCP/IP Protocol Suite, detailing the synchronization and mapping between corresponding layers.

  • Explain the specific networking functionalities and operational layers of key hardware devices: Hub, Bridge, Unmanaged Switch, Managed Switch, Router, Brouter, and Gateway.