ZeroMQ Chapter 4 Reliable Request-Reply Patterns

Slides:



Advertisements
Similar presentations
Interprocess Communication CH4. HW: Reading messages: User Agent (the user’s mail reading program) is either a client of the local file server or a client.
Advertisements

Remote Procedure Call (RPC)
ITIS 3110 Jason Watson. Replication methods o Primary/Backup o Master/Slave o Multi-master Load-balancing methods o DNS Round-Robin o Reverse Proxy.
Internet Networking Spring 2006 Tutorial 12 Web Caching Protocols ICP, CARP.
TCP/IP Protocol Suite 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 17 Introduction to the Application.
ECEN5053 SW Eng of Dist Systems, Arch Des Part 3, Univ of Colorado, Boulder1 Architectural Design of Distributed Systems, Part 3 ECEN5053 SW.
Lecture 19 Distributed Programming (Ch. 10) Other message-passing programming models  Channels vs mailboxes  Synchronous vs asynchronous.
source router Destination IP packet IP packet fragments Reassembly Required Fragments Created.
1 Spring Semester 2007, Dept. of Computer Science, Technion Internet Networking recitation #13 Web Caching Protocols ICP, CARP.
Distributed Systems Fall 2009 Replication Fall 20095DV0203 Outline Group communication Fault-tolerant services –Passive and active replication Highly.
1 CCNA 2 v3.1 Module Intermediate TCP/IP CCNA 2 Module 10.
Advanced UDP Sockets© Dr. Ayman Abdel-Hamid, CS4254 Spring CS4254 Computer Network Architecture and Programming Dr. Ayman A. Abdel-Hamid Computer.
WXES2106 Network Technology Semester /2005 Chapter 8 Intermediate TCP CCNA2: Module 10.
Computer Science Lecture 12, page 1 CS677: Distributed OS Last Class Vector timestamps Global state –Distributed Snapshot Election algorithms.
Lesson 3 Remote Method Invocation (RMI) Mixing RMI and sockets Rethinking out tic-tac-toe game.
11 SERVER CLUSTERING Chapter 6. Chapter 6: SERVER CLUSTERING2 OVERVIEW  List the types of server clusters.  Determine which type of cluster to use for.
DEMIGUISE STORAGE An Anonymous File Storage System VIJAY KUMAR RAVI PRAGATHI SEGIREDDY COMP 512.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
PA3: Router Junxian (Jim) Huang EECS 489 W11 /
Institute of Computer and Communication Network Engineering OFC/NFOEC, 6-10 March 2011, Los Angeles, CA Lessons Learned From Implementing a Path Computation.
Jump to first page Introduction to FIX Copyright© 2004 Jim Northey and Jordan & Jordan Jim Northey Jordan and Jordan Introduction to FIX The FIX Session.
1 CMPT 471 Networking II DHCP Failover and multiple servers © Janice Regan,
Data Link Control Protocols
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved Chapter 4 Communication.
Messaging is an important means of communication between two systems. There are 2 types of messaging. - Synchronous messaging. - Asynchronous messaging.
Chapter 4: Interprocess Communication‏ Pages
7/26/ Design and Implementation of a Simple Totally-Ordered Reliable Multicast Protocol in Java.
McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Data Link Control and Protocols.
Computing Infrastructure for Large Ecommerce Systems -- based on material written by Jacob Lindeman.
Chapter 2 Applications and Layered Architectures Sockets.
1 Chapter Six - Errors, Error Detection, and Error Control Chapter Six.
TCP Sockets Reliable Communication. TCP As mentioned before, TCP sits on top of other layers (IP, hardware) and implements Reliability In-order delivery.
Plug-in for Singleton Service in Clustered environment and improving failure detection methodology Advisor:By: Dr. Chung-E-WangSrinivasa c Kodali Department.
CS433/533 Assignment 4 Overview. Fishnet Network protocol simulator & emulator Read fishnet-intro.pdf Get started Network topology (.topo) for emulator.
Client-Server Model of Interaction Chapter 20. We have looked at the details of TCP/IP Protocols Protocols Router architecture Router architecture Now.
Interprocess Communications
Internet Control Message Protocol (ICMP) Chapter 7.
The Client-Server Model And the Socket API. Client-Server (1) The datagram service does not require cooperation between the peer applications but such.
NETWORK TOPOLOGY Network topology is the study of the arrangement or mapping of the elements of a network,especially the physical.
© 2002, Cisco Systems, Inc. All rights reserved..
RDA3 Transport Joel Lauener on behalf of the CMW team 26th June, 2013
ZEROMQ: CHAPTER 8 A FRAMEWORK FOR DISTRIBUTED COMPUTING.
ZOOKEEPER. CONTENTS ZooKeeper Overview ZooKeeper Basics ZooKeeper Architecture Getting Started with ZooKeeper.
Core and Framework DIRAC Workshop October Marseille.
GL TRADE Internal Use Only GL Stream Server Module Notification Sequence Diagram December 12th, 2007.
PERFORMANCE MANAGEMENT IMPROVING PERFORMANCE TECHNIQUES Network management system 1.
5. End-to-end protocols (part 1)
ZeroMQ-ofi sketch Kayla Seager.
PPP PROTOCOL The First semester
CHAPTER 3 Architectures for Distributed Systems
Working at a Small-to-Medium Business or ISP – Chapter 7
Internet Networking recitation #12
Working at a Small-to-Medium Business or ISP – Chapter 7
View Change Protocols and Reconfiguration
Sarah Diesburg Operating Systems COP 4610
Working at a Small-to-Medium Business or ISP – Chapter 7
Architectures of distributed systems Fundamental Models
Fault-tolerance techniques RSM, Paxos
PERSPECTIVES ON THE CAP THEOREM
Architectures of distributed systems Fundamental Models
Andy Wang Operating Systems COP 4610 / CGS 5765
William Stallings Data and Computer Communications
Computer Science 312 Concurrent Programming I Processes and Messages 1.
Architectures of distributed systems Fundamental Models
Host and Small Network Relaying Howard C. Berkowitz
Message Passing Systems Version 2
Computer Networks Protocols
Part II Application Layer.
Message Passing Systems
Presentation transcript:

ZeroMQ Chapter 4 Reliable Request-Reply Patterns Kieun Seong

Contents Definition and Design of Reliability Types of Reliable Request-Reply Patterns The Lazy Pirate pattern The Simple Pirate pattern The Paranoid Pirate pattern The Majordomo pattern The Binary Star pattern The Freelance pattern

Definition and Design of Reliability Related with terms of failure Keeping things working properly when code freezes or crashes Among 3 patterns, focus on request-reply pattern

The Lazy Pirate Pattern Client side reliability Resend a request, if no reply has arrived within a timeout period Abandon the transaction if there is still no reply after several requests

Lazy Pirate Client Code

Lazy Pirate Client Code

Lazy Pirate Server Code

The Simple Pirate Pattern Extends the Lazy Pirate pattern with a queue proxy that lets us talk to multiple servers(workers).

Simple Pirate Worker Code

Simple Pirate Worker Code

Simple Pirate Load Balancer Code frontend backend

Simple Pirate Load Balancer Code frontend backend

The Paranoid Pirate Pattern Simple Pirate is not robust when a queue crash The queue does not detect worker failure Use Heart beating

Heartbeating Solves the problem of knowing whether a peer is alive or dead One Way Heartbeats Sending a heartbeat message from each node to its peers, if one node hears nothing from another it will treat that peer as dead Inaccurate when sending large amounts of data

The Majordomo Pattern Improve version of Paranoid Pirate Pattern Adds a service name to requests Service oriented broker Workers are registered for specific services Synchronous / Asynchronous Major Pattern

Synchronous and Asynchronous Majordomo Socket Type REQ DEALER Function Send Send and Receive Retry Request 3 None

Synchronous Majordomo Client Code

Asynchronous Majordomo Client Code MSG_ SENDER Empty MDPC_ xy Service Name Message Client “” CLIENT “echo” “Hello world”

Majordomo Worker Code It’s a little misnamed since it first sends any reply and then waits for a new request. Send reply, if any, to broker and wait for next request.

Majordomo Worker API : connect to broker MSG_ SENDER Empty MDPW_ xy Command Service Name Worker “” WORKER READY “echo”

Majordomo Broker Code In s_broker_bind function, use a single socket for both clients and workers MSG_ SENDER Empty MDPW_ xy Command Service Name Worker “” WORKER READY “echo” MSG_ SENDER Empty MDPC_ xy Service Name Message Client “” CLIENT “echo” “Hello world”

Majordomo Broker Code MSG_ SENDER Empty MDPW_ xy Command Service Name Worker “” WORKER READY “echo” MSG_ SENDER Empty MDPC_ xy Service Name Message Client “” CLIENT “echo” “Hello world”

The Binary Star Pattern 2 servers in a primary–backup pair Primary : the server that is normally or initially ‘active’ Backup : the server that is normally ‘passive’. It will become active when the primary server disappears from the network, and the client applications ask the backup server to connect.

The Freelance Pattern Brokerless reliability Peer to peer architecture Name service, to get reliability uses pool(any size but practically 2 would be enough) Use DEALER sockets and blast out requests Use ROUTER sockets so clients can address specific servers

Brutal Shotgun Massacre Client use a DEALER socket Clients approach Connect to all servers When we have request, blast it out as many time as we have servers Wait for the first reply and take that Ignore any other replies

Brutal Shotgun Massacre : Client Code Request “random name”