
Networking and RPC in Distributed Systems
"Explore networking principles, layering, routing, and RPC in distributed systems. Learn about the four layers studied, IP addressing, packet transmission, and end-to-end communication at the transport layer."
Download Presentation

Please find below an Image/Link to download the presentation.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.
You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.
E N D
Presentation Transcript
Distributed Systems CS 15-440 Networking and RPC Lecture 4, August 29, 2023 Mohammad Hammoud 1
Today Last Session: Networks- Part II: Layering and routing Today s Session: Conclude networks and introduce RPC Announcement: PS1 is due on September 03 by midnight
Course Map Applications Programming Models Fast & Reliable or Efficient DS Replication & Consistency Fault-tolerance Communication Paradigms Architectures Naming Synchronization Correct or Effective DS Networks
Course Map Applications Programming Models Replication & Consistency Fault-tolerance Communication Paradigms Architectures Naming Synchronization Networks
Outline A Primer Network Considerations and Types Network Principles
Networking Principles Network Protocols Packet Transmission Network Layers
The Four Layers We Are Studying 1. Physical layer 2. Data-link layer 3. Network layer 4. Transport layer
Summary: Routing Over Internet Each machine over the Internet is identified by an IP Address Source machine transmits the packet over its local network Intermediate routers examine the packet, and forward it to the best next-hop router If the destination is directly attached to the local network of a router, the router forwards the packet over the respective local network Routers exchange information to keep up-to-date information about the network
The Four Layers We Are Studying 1. Physical layer 2. Data-link layer 3. Network layer 4. Transport layer
Transport Layer Transport layer protocols provide end-to-end communication for applications This is the lowest layer where messages (rather than packets) are handled Messages are addressed to communication ports attached to the processes Transport layer multiplexes each packet received to its respective port Destination machine P1 P2 P3 Transport layer protocol Network layer protocol
Simple Transport Layer Protocols Simple transport protocols provide the following services: 1. Multiplexing Service 2. Connection-less Communication: The sender and receiver processes do not initiate a connection before sending the message Each message is encapsulated in a packet (also called as datagram) Messages at the receiver can be in different order than the one sent by the sender E.g., User Datagram Protocol (UDP)
Advanced Transport Layer Protocols Advanced transport layer protocols typically provide more services than simple multiplexing Transmission Control Protocol (TCP) is a widely-used protocol that provides three additional services: 1. Connection-oriented Communication 2. Reliability 3. Congestion Control
1. Connection-Oriented Communication Sender and receiver will handshake before sending the messages Handshake helps to set-up connection parameters, and to allocate resources at destination to receive packets Destination provides in-order delivery of messages to the intended process Destination will buffer the packets until previous packets are received It will then deliver packets to the process in the order that the sender had used Source machine Destination machine P1 P1 P1 P2 P3 P3 Shall I send? TCP protocol TCP protocol OK. Start sending
2. Reliability Packets may be lost in the network due to buffer overflows at the router or transmission error(s) In TCP, destination sends an ACK to the sender If ACK is not received at the sender, the sender will infer a packet error, and retransmit the packet
3. Congestion Control The capacity of a network is limited by the individual communication links and routers Limited buffer space and link-bandwidth What happens if a source transmits packets at a rate that is greater than the capacity of the network? Packets drop at intermediate routers Corresponding ACKs will NOT be received at the source The source retransmits More packets build-up on the router queue The network collapses
3. Congestion Control (Contd) To avoid congestion, two functionalities can be adopted 1. Detect congestion at routers If a router expects a buffer overflow, it typically follows one of two strategies: It drops packets and lets sources regulate upon observing packet losses It sends an Explicit Congestion Notification (ECN) packet to sources 2. Regulate input at sources If the TCP-sender concludes congestion (e.g., it receives an ECN packet), then it reduces its sending rate
Recap: Introduction to Networking Learning Objectives You will identify how computers over the Internet communicate Specifically, after two lectures on networking you will be able to: Identify different types of networks Describe networking principles such as layering, encapsulation, and packet- switching Examine how packets are routed and how congestion is controlled Analyze scalability, reliability, and fault-tolerance over the Internet
Next Communication Paradigms - Part I
Course Map Applications Programming Models Fast & Reliable or Efficient DS Replication & Consistency Fault-tolerance Communication Paradigms Architectures Naming Synchronization Correct or Effective DS Networks
Course Map Applications Programming Models Replication & Consistency Fault-tolerance Communication Paradigms Architectures Naming Synchronization Networks
Communicating Entities in Distributed Systems Communicating entities in distributed systems can be classified into two types: System-oriented entities Processes Threads Nodes Problem-oriented entities Objects (in object-oriented programming based approaches) How can entities in distributed systems communicate?
Communication Paradigms Communication paradigms describe and classify a set of methods by which entities can interact and exchange data
Classification of Communication Paradigms Communication paradigms can be categorized into three types based on where the entities reside. If entities are running on: 1. Same Address-Space Global variables, Procedure calls, Today, we will study how entities that reside on networked computers communicate in distributed systems using socket communication and remote invocation 2. Same Computer but Different Address-Spaces Files, Signals, Shared Memory 3. Networked Computers Socket Communication Remote Invocation
Middleware Layers Applications, Services Remote Invocation Middleware Layers IPC Primitives (e.g., Sockets) Transport Layer (TCP/UDP) Network Layer (IP) Data-Link Layer Physical Layer 24
UDP Sockets UDP provides connectionless communication, with no acknowledgements or message retransmissions Communication mechanism: Server opens a UDP socket SS at a known port sp, Socket SS waits to receive a request Client opens a UDP socket CS at a random port cx Client socket CS sends a message to ServerIP and port sp Server socket SS may send back data to CS Server SS.receive(recvPacket) Client No ACK will be sent by the receiver CS.Send(msg, ServerIP, sp) CS cx SS sp SS.Send(msg, recvPacket.IP, recvPacket.port) H = Host computer H S = Socket S = Port n n
UDP Design Considerations Sender must explicitly fragment a long message into smaller chunks before transmission A maximum size of 548 bytes is suggested for transmission Messages may be delivered out-of-order If necessary, programmer must re-order packets Communication is not reliable Messages might be dropped due to check-sum errors or buffer overflows at routers Receiver should allocate a buffer that is big enough to fit the sender s message Otherwise the message will be truncated
TCP Sockets TCP provides in-order delivery, reliability, and congestion control Communication mechanism: Server opens a TCP server socket SS at a known port sp Server waits to receive a request (using accept call) Client opens a TCP socket CS at a random port cx CS initiatesa connection initiation message to ServerIP and port sp Server socket SS allocates a new socket NSS on random port nsp for the client CS can send data to NSS nSS = SS.accept() Client Server SS sp CS cx nSS nsp
Main Advantages of TCP TCP ensures in-order delivery of messages Applications can send messages of any size TCP ensures reliable communication via using acknowledgements and retransmissions Congestion control of TCP regulates sender rate, and thus prevents network overload
Middleware Layers Applications, Services Remote Invocation Middleware Layers IPC Primitives (e.g., Sockets) Transport Layer (TCP/UDP) Network Layer (IP) Data-Link Layer Physical Layer 29
Next Lecture Communication Paradigms- Part II