SlideShare a Scribd company logo

Kamaelia Protocol Walkthrough

K
kamaelian

A walkthrough of what's going on in this example: http://tinyurl.com/4k3df2

1 of 50
Download to read offline
A walk through building & stacking
          protocols using Kamaelia




                       Michael Sparks
                        October 2008
The aim of this document is to guide you
through building a system where:

● A user connects to a server and
● Over a secure connection,

● Receives a sequence of JSON encode-able


  objects
The aim of this document is to guide you
through building a system where:

● A user connects to a server and
● Over a secure connection,
                    This doc also uses speech
● Receives a sequence of JSON make “aside”
                 bubbles like this to encode-able
                  comments regarding particlar
  objects        panels. You can skip these safely.
ServerCore




First of all, we start off with the ServerCore
component. The hole is for fitting a protocol
handler factory. eg a class, or function.
ServerCore



                     As an aside, this hole is pretty
                    crucial. Without filling this hole,
                   this component is pretty useless.
                         So we call this sort of
                        component a CHASSIS

First of all, we start off with the ServerCore
component. The hole is for fitting a protocol
handler factory. eg a class, or function.
ServerCore




           «factory»
           protocol




So, we provide a protocol factory.
ServerCore(protocol=protocol, port=2345)

Recommended

Zookeeper Architecture
Zookeeper ArchitectureZookeeper Architecture
Zookeeper ArchitecturePrasad Wali
 
Apache Cassandra in Bangalore - Cassandra Internals and Performance
Apache Cassandra in Bangalore - Cassandra Internals and PerformanceApache Cassandra in Bangalore - Cassandra Internals and Performance
Apache Cassandra in Bangalore - Cassandra Internals and Performanceaaronmorton
 
Non blocking io with netty
Non blocking io with nettyNon blocking io with netty
Non blocking io with nettyZauber
 
Udp socket programming(Florian)
Udp socket programming(Florian)Udp socket programming(Florian)
Udp socket programming(Florian)Flor Ian
 

More Related Content

What's hot

Chat Room System using Java Swing
Chat Room System using Java SwingChat Room System using Java Swing
Chat Room System using Java SwingTejas Garodia
 
Complex Event Processing with Esper and WSO2 ESB
Complex Event Processing with Esper and WSO2 ESBComplex Event Processing with Esper and WSO2 ESB
Complex Event Processing with Esper and WSO2 ESBPrabath Siriwardena
 
Advance Java Programs skeleton
Advance Java Programs skeletonAdvance Java Programs skeleton
Advance Java Programs skeletonIram Ramrajkar
 
解读server.xml文件
解读server.xml文件解读server.xml文件
解读server.xml文件wensheng wei
 
Nodejs 프로그래밍 ch.3
Nodejs 프로그래밍 ch.3Nodejs 프로그래밍 ch.3
Nodejs 프로그래밍 ch.3HyeonSeok Choi
 
Networking & Socket Programming In Java
Networking & Socket Programming In JavaNetworking & Socket Programming In Java
Networking & Socket Programming In JavaAnkur Agrawal
 
ikh331-06-distributed-programming
ikh331-06-distributed-programmingikh331-06-distributed-programming
ikh331-06-distributed-programmingAnung Ariwibowo
 
Dynamo: Not Just For Datastores
Dynamo: Not Just For DatastoresDynamo: Not Just For Datastores
Dynamo: Not Just For DatastoresSusan Potter
 
Socket programming using java
Socket programming using javaSocket programming using java
Socket programming using javaUC San Diego
 
From A to Z | WireShark Tutorial
From A to Z | WireShark TutorialFrom A to Z | WireShark Tutorial
From A to Z | WireShark TutorialTurkHackTeam EDU
 
Новый InterSystems: open-source, митапы, хакатоны
Новый InterSystems: open-source, митапы, хакатоныНовый InterSystems: open-source, митапы, хакатоны
Новый InterSystems: open-source, митапы, хакатоныTimur Safin
 
Java- Datagram Socket class & Datagram Packet class
Java- Datagram Socket class  & Datagram Packet classJava- Datagram Socket class  & Datagram Packet class
Java- Datagram Socket class & Datagram Packet classRuchi Maurya
 
Behind modern concurrency primitives
Behind modern concurrency primitivesBehind modern concurrency primitives
Behind modern concurrency primitivesBartosz Sypytkowski
 

What's hot (20)

Chat Room System using Java Swing
Chat Room System using Java SwingChat Room System using Java Swing
Chat Room System using Java Swing
 
OSGi Puzzlers
OSGi PuzzlersOSGi Puzzlers
OSGi Puzzlers
 
Complex Event Processing with Esper and WSO2 ESB
Complex Event Processing with Esper and WSO2 ESBComplex Event Processing with Esper and WSO2 ESB
Complex Event Processing with Esper and WSO2 ESB
 
Advance Java Programs skeleton
Advance Java Programs skeletonAdvance Java Programs skeleton
Advance Java Programs skeleton
 
Ad java prac sol set
Ad java prac sol setAd java prac sol set
Ad java prac sol set
 
解读server.xml文件
解读server.xml文件解读server.xml文件
解读server.xml文件
 
Java sockets
Java socketsJava sockets
Java sockets
 
Nodejs 프로그래밍 ch.3
Nodejs 프로그래밍 ch.3Nodejs 프로그래밍 ch.3
Nodejs 프로그래밍 ch.3
 
Networking & Socket Programming In Java
Networking & Socket Programming In JavaNetworking & Socket Programming In Java
Networking & Socket Programming In Java
 
ikh331-06-distributed-programming
ikh331-06-distributed-programmingikh331-06-distributed-programming
ikh331-06-distributed-programming
 
Dynamo: Not Just For Datastores
Dynamo: Not Just For DatastoresDynamo: Not Just For Datastores
Dynamo: Not Just For Datastores
 
Socket programming
Socket programmingSocket programming
Socket programming
 
Lecture10
Lecture10Lecture10
Lecture10
 
Java NIO.2
Java NIO.2Java NIO.2
Java NIO.2
 
Socket programming using java
Socket programming using javaSocket programming using java
Socket programming using java
 
From A to Z | WireShark Tutorial
From A to Z | WireShark TutorialFrom A to Z | WireShark Tutorial
From A to Z | WireShark Tutorial
 
Basic socket programming
Basic socket programmingBasic socket programming
Basic socket programming
 
Новый InterSystems: open-source, митапы, хакатоны
Новый InterSystems: open-source, митапы, хакатоныНовый InterSystems: open-source, митапы, хакатоны
Новый InterSystems: open-source, митапы, хакатоны
 
Java- Datagram Socket class & Datagram Packet class
Java- Datagram Socket class  & Datagram Packet classJava- Datagram Socket class  & Datagram Packet class
Java- Datagram Socket class & Datagram Packet class
 
Behind modern concurrency primitives
Behind modern concurrency primitivesBehind modern concurrency primitives
Behind modern concurrency primitives
 

Viewers also liked

Embracing concurrency for fun utility and simpler code
Embracing concurrency for fun utility and simpler codeEmbracing concurrency for fun utility and simpler code
Embracing concurrency for fun utility and simpler codekamaelian
 
Kamaelia Europython Tutorial
Kamaelia Europython TutorialKamaelia Europython Tutorial
Kamaelia Europython Tutorialkamaelian
 
Kamaelia lightning2010opensource
Kamaelia lightning2010opensourceKamaelia lightning2010opensource
Kamaelia lightning2010opensourcekamaelian
 
Practical concurrent systems made simple using Kamaelia
Practical concurrent systems made simple using KamaeliaPractical concurrent systems made simple using Kamaelia
Practical concurrent systems made simple using Kamaeliakamaelian
 
Bleach
BleachBleach
BleachKitara
 
Photoshop Club
Photoshop ClubPhotoshop Club
Photoshop ClubKitara
 
Kamaelia Grey
Kamaelia GreyKamaelia Grey
Kamaelia Greykamaelian
 
Managing Creativity
Managing CreativityManaging Creativity
Managing Creativitykamaelian
 
Timeshift Everything, Miss Nothing - Mashup your PVR with Kamaelia
Timeshift Everything, Miss Nothing - Mashup your PVR with KamaeliaTimeshift Everything, Miss Nothing - Mashup your PVR with Kamaelia
Timeshift Everything, Miss Nothing - Mashup your PVR with Kamaeliakamaelian
 
The Selfish Programmer
The Selfish ProgrammerThe Selfish Programmer
The Selfish Programmerkamaelian
 
RabbitMQ with python and ruby RuPy 2009
RabbitMQ with python and ruby RuPy 2009RabbitMQ with python and ruby RuPy 2009
RabbitMQ with python and ruby RuPy 2009Paolo Negri
 
Descriptors In Python
Descriptors In PythonDescriptors In Python
Descriptors In PythonAmit Upadhyay
 
Messaging with RabbitMQ and AMQP
Messaging with RabbitMQ and AMQPMessaging with RabbitMQ and AMQP
Messaging with RabbitMQ and AMQPEberhard Wolff
 
Data Analysis and Statistics in Python using pandas and statsmodels
Data Analysis and Statistics in Python using pandas and statsmodelsData Analysis and Statistics in Python using pandas and statsmodels
Data Analysis and Statistics in Python using pandas and statsmodelsWes McKinney
 
Django for Beginners
Django for BeginnersDjango for Beginners
Django for BeginnersJason Davies
 
Introduction To Django
Introduction To DjangoIntroduction To Django
Introduction To DjangoJay Graves
 
Python for Financial Data Analysis with pandas
Python for Financial Data Analysis with pandasPython for Financial Data Analysis with pandas
Python for Financial Data Analysis with pandasWes McKinney
 
Advance OOP concepts in Python
Advance OOP concepts in PythonAdvance OOP concepts in Python
Advance OOP concepts in PythonSujith Kumar
 
Python Advanced – Building on the foundation
Python Advanced – Building on the foundationPython Advanced – Building on the foundation
Python Advanced – Building on the foundationKevlin Henney
 

Viewers also liked (20)

Embracing concurrency for fun utility and simpler code
Embracing concurrency for fun utility and simpler codeEmbracing concurrency for fun utility and simpler code
Embracing concurrency for fun utility and simpler code
 
Kamaelia Europython Tutorial
Kamaelia Europython TutorialKamaelia Europython Tutorial
Kamaelia Europython Tutorial
 
Kamaelia lightning2010opensource
Kamaelia lightning2010opensourceKamaelia lightning2010opensource
Kamaelia lightning2010opensource
 
Practical concurrent systems made simple using Kamaelia
Practical concurrent systems made simple using KamaeliaPractical concurrent systems made simple using Kamaelia
Practical concurrent systems made simple using Kamaelia
 
Bleach
BleachBleach
Bleach
 
Photoshop Club
Photoshop ClubPhotoshop Club
Photoshop Club
 
Kamaelia Grey
Kamaelia GreyKamaelia Grey
Kamaelia Grey
 
Managing Creativity
Managing CreativityManaging Creativity
Managing Creativity
 
Timeshift Everything, Miss Nothing - Mashup your PVR with Kamaelia
Timeshift Everything, Miss Nothing - Mashup your PVR with KamaeliaTimeshift Everything, Miss Nothing - Mashup your PVR with Kamaelia
Timeshift Everything, Miss Nothing - Mashup your PVR with Kamaelia
 
The Selfish Programmer
The Selfish ProgrammerThe Selfish Programmer
The Selfish Programmer
 
RabbitMQ with python and ruby RuPy 2009
RabbitMQ with python and ruby RuPy 2009RabbitMQ with python and ruby RuPy 2009
RabbitMQ with python and ruby RuPy 2009
 
Descriptors In Python
Descriptors In PythonDescriptors In Python
Descriptors In Python
 
Messaging with RabbitMQ and AMQP
Messaging with RabbitMQ and AMQPMessaging with RabbitMQ and AMQP
Messaging with RabbitMQ and AMQP
 
Django introduction
Django introductionDjango introduction
Django introduction
 
Data Analysis and Statistics in Python using pandas and statsmodels
Data Analysis and Statistics in Python using pandas and statsmodelsData Analysis and Statistics in Python using pandas and statsmodels
Data Analysis and Statistics in Python using pandas and statsmodels
 
Django for Beginners
Django for BeginnersDjango for Beginners
Django for Beginners
 
Introduction To Django
Introduction To DjangoIntroduction To Django
Introduction To Django
 
Python for Financial Data Analysis with pandas
Python for Financial Data Analysis with pandasPython for Financial Data Analysis with pandas
Python for Financial Data Analysis with pandas
 
Advance OOP concepts in Python
Advance OOP concepts in PythonAdvance OOP concepts in Python
Advance OOP concepts in Python
 
Python Advanced – Building on the foundation
Python Advanced – Building on the foundationPython Advanced – Building on the foundation
Python Advanced – Building on the foundation
 

Similar to Kamaelia Protocol Walkthrough

Cassandra 2.1 boot camp, Overview
Cassandra 2.1 boot camp, OverviewCassandra 2.1 boot camp, Overview
Cassandra 2.1 boot camp, OverviewJoshua McKenzie
 
weblogic perfomence tuning
weblogic perfomence tuningweblogic perfomence tuning
weblogic perfomence tuningprathap kumar
 
The post release technologies of Crysis 3 (Slides Only) - Stewart Needham
The post release technologies of Crysis 3 (Slides Only) - Stewart NeedhamThe post release technologies of Crysis 3 (Slides Only) - Stewart Needham
The post release technologies of Crysis 3 (Slides Only) - Stewart NeedhamStewart Needham
 
Distribute Key Value Store
Distribute Key Value StoreDistribute Key Value Store
Distribute Key Value StoreSantal Li
 
Distribute key value_store
Distribute key value_storeDistribute key value_store
Distribute key value_storedrewz lin
 
Use perl creating web services with xml rpc
Use perl creating web services with xml rpcUse perl creating web services with xml rpc
Use perl creating web services with xml rpcJohnny Pork
 
Apache Con NA 2013 - Cassandra Internals
Apache Con NA 2013 - Cassandra InternalsApache Con NA 2013 - Cassandra Internals
Apache Con NA 2013 - Cassandra Internalsaaronmorton
 
WCF and WF in Framework 3.5
WCF and WF in Framework 3.5WCF and WF in Framework 3.5
WCF and WF in Framework 3.5ukdpe
 
Porting a Streaming Pipeline from Scala to Rust
Porting a Streaming Pipeline from Scala to RustPorting a Streaming Pipeline from Scala to Rust
Porting a Streaming Pipeline from Scala to RustEvan Chan
 
Porting is a Delicate Matter: Checking Far Manager under Linux
Porting is a Delicate Matter: Checking Far Manager under LinuxPorting is a Delicate Matter: Checking Far Manager under Linux
Porting is a Delicate Matter: Checking Far Manager under LinuxPVS-Studio
 
Kafka monitoring and metrics
Kafka monitoring and metricsKafka monitoring and metrics
Kafka monitoring and metricsTouraj Ebrahimi
 
Laboratory 2PRACTICE EXAMINING TRAFFIC WITH A PROTOCOL ANALYZER.docx
Laboratory 2PRACTICE EXAMINING TRAFFIC WITH A PROTOCOL ANALYZER.docxLaboratory 2PRACTICE EXAMINING TRAFFIC WITH A PROTOCOL ANALYZER.docx
Laboratory 2PRACTICE EXAMINING TRAFFIC WITH A PROTOCOL ANALYZER.docxsleeperfindley
 
Low latency microservices in java QCon New York 2016
Low latency microservices in java   QCon New York 2016Low latency microservices in java   QCon New York 2016
Low latency microservices in java QCon New York 2016Peter Lawrey
 
Learning spark ch10 - Spark Streaming
Learning spark ch10 - Spark StreamingLearning spark ch10 - Spark Streaming
Learning spark ch10 - Spark Streamingphanleson
 
Troubleshooting common oslo.messaging and RabbitMQ issues
Troubleshooting common oslo.messaging and RabbitMQ issuesTroubleshooting common oslo.messaging and RabbitMQ issues
Troubleshooting common oslo.messaging and RabbitMQ issuesMichael Klishin
 
Open Source XMPP for Cloud Services
Open Source XMPP for Cloud ServicesOpen Source XMPP for Cloud Services
Open Source XMPP for Cloud Servicesmattjive
 
Runtime Bytecode Transformation for Smalltalk
Runtime Bytecode Transformation for SmalltalkRuntime Bytecode Transformation for Smalltalk
Runtime Bytecode Transformation for SmalltalkESUG
 
Oracle Drivers configuration for High Availability
Oracle Drivers configuration for High AvailabilityOracle Drivers configuration for High Availability
Oracle Drivers configuration for High AvailabilityLudovico Caldara
 
Introduction to Thrift
Introduction to ThriftIntroduction to Thrift
Introduction to ThriftDvir Volk
 

Similar to Kamaelia Protocol Walkthrough (20)

Cassandra 2.1 boot camp, Overview
Cassandra 2.1 boot camp, OverviewCassandra 2.1 boot camp, Overview
Cassandra 2.1 boot camp, Overview
 
weblogic perfomence tuning
weblogic perfomence tuningweblogic perfomence tuning
weblogic perfomence tuning
 
The post release technologies of Crysis 3 (Slides Only) - Stewart Needham
The post release technologies of Crysis 3 (Slides Only) - Stewart NeedhamThe post release technologies of Crysis 3 (Slides Only) - Stewart Needham
The post release technologies of Crysis 3 (Slides Only) - Stewart Needham
 
Distribute Key Value Store
Distribute Key Value StoreDistribute Key Value Store
Distribute Key Value Store
 
Distribute key value_store
Distribute key value_storeDistribute key value_store
Distribute key value_store
 
Use perl creating web services with xml rpc
Use perl creating web services with xml rpcUse perl creating web services with xml rpc
Use perl creating web services with xml rpc
 
Apache Con NA 2013 - Cassandra Internals
Apache Con NA 2013 - Cassandra InternalsApache Con NA 2013 - Cassandra Internals
Apache Con NA 2013 - Cassandra Internals
 
WCF and WF in Framework 3.5
WCF and WF in Framework 3.5WCF and WF in Framework 3.5
WCF and WF in Framework 3.5
 
Porting a Streaming Pipeline from Scala to Rust
Porting a Streaming Pipeline from Scala to RustPorting a Streaming Pipeline from Scala to Rust
Porting a Streaming Pipeline from Scala to Rust
 
Porting is a Delicate Matter: Checking Far Manager under Linux
Porting is a Delicate Matter: Checking Far Manager under LinuxPorting is a Delicate Matter: Checking Far Manager under Linux
Porting is a Delicate Matter: Checking Far Manager under Linux
 
Kafka monitoring and metrics
Kafka monitoring and metricsKafka monitoring and metrics
Kafka monitoring and metrics
 
Laboratory 2PRACTICE EXAMINING TRAFFIC WITH A PROTOCOL ANALYZER.docx
Laboratory 2PRACTICE EXAMINING TRAFFIC WITH A PROTOCOL ANALYZER.docxLaboratory 2PRACTICE EXAMINING TRAFFIC WITH A PROTOCOL ANALYZER.docx
Laboratory 2PRACTICE EXAMINING TRAFFIC WITH A PROTOCOL ANALYZER.docx
 
Low latency microservices in java QCon New York 2016
Low latency microservices in java   QCon New York 2016Low latency microservices in java   QCon New York 2016
Low latency microservices in java QCon New York 2016
 
Learning spark ch10 - Spark Streaming
Learning spark ch10 - Spark StreamingLearning spark ch10 - Spark Streaming
Learning spark ch10 - Spark Streaming
 
XML-RPC and SOAP (April 2003)
XML-RPC and SOAP (April 2003)XML-RPC and SOAP (April 2003)
XML-RPC and SOAP (April 2003)
 
Troubleshooting common oslo.messaging and RabbitMQ issues
Troubleshooting common oslo.messaging and RabbitMQ issuesTroubleshooting common oslo.messaging and RabbitMQ issues
Troubleshooting common oslo.messaging and RabbitMQ issues
 
Open Source XMPP for Cloud Services
Open Source XMPP for Cloud ServicesOpen Source XMPP for Cloud Services
Open Source XMPP for Cloud Services
 
Runtime Bytecode Transformation for Smalltalk
Runtime Bytecode Transformation for SmalltalkRuntime Bytecode Transformation for Smalltalk
Runtime Bytecode Transformation for Smalltalk
 
Oracle Drivers configuration for High Availability
Oracle Drivers configuration for High AvailabilityOracle Drivers configuration for High Availability
Oracle Drivers configuration for High Availability
 
Introduction to Thrift
Introduction to ThriftIntroduction to Thrift
Introduction to Thrift
 

More from kamaelian

Sharing Data and Services Safely in Concurrent Systems using Kamaelia
Sharing Data and Services Safely in Concurrent Systems using KamaeliaSharing Data and Services Safely in Concurrent Systems using Kamaelia
Sharing Data and Services Safely in Concurrent Systems using Kamaeliakamaelian
 
Sociable Software
Sociable SoftwareSociable Software
Sociable Softwarekamaelian
 
Open Source at the BBC: When, Why, Why not & How
Open Source at the BBC: When, Why, Why not & HowOpen Source at the BBC: When, Why, Why not & How
Open Source at the BBC: When, Why, Why not & Howkamaelian
 
Open Source at the BBC
Open Source at the BBCOpen Source at the BBC
Open Source at the BBCkamaelian
 
Kamaelia - Fave 2005
Kamaelia - Fave 2005Kamaelia - Fave 2005
Kamaelia - Fave 2005kamaelian
 
SWP - A Generic Language Parser
SWP - A Generic Language ParserSWP - A Generic Language Parser
SWP - A Generic Language Parserkamaelian
 
Kamaelia - Networking Using Generators
Kamaelia - Networking Using GeneratorsKamaelia - Networking Using Generators
Kamaelia - Networking Using Generatorskamaelian
 
Scaling Streaming - Concepts, Research, Goals
Scaling Streaming - Concepts, Research, GoalsScaling Streaming - Concepts, Research, Goals
Scaling Streaming - Concepts, Research, Goalskamaelian
 
Kamaelia Internals
Kamaelia InternalsKamaelia Internals
Kamaelia Internalskamaelian
 
Building systems with Kamaelia
Building systems with KamaeliaBuilding systems with Kamaelia
Building systems with Kamaeliakamaelian
 
Free software: How does it work?
Free software: How does it work?Free software: How does it work?
Free software: How does it work?kamaelian
 

More from kamaelian (11)

Sharing Data and Services Safely in Concurrent Systems using Kamaelia
Sharing Data and Services Safely in Concurrent Systems using KamaeliaSharing Data and Services Safely in Concurrent Systems using Kamaelia
Sharing Data and Services Safely in Concurrent Systems using Kamaelia
 
Sociable Software
Sociable SoftwareSociable Software
Sociable Software
 
Open Source at the BBC: When, Why, Why not & How
Open Source at the BBC: When, Why, Why not & HowOpen Source at the BBC: When, Why, Why not & How
Open Source at the BBC: When, Why, Why not & How
 
Open Source at the BBC
Open Source at the BBCOpen Source at the BBC
Open Source at the BBC
 
Kamaelia - Fave 2005
Kamaelia - Fave 2005Kamaelia - Fave 2005
Kamaelia - Fave 2005
 
SWP - A Generic Language Parser
SWP - A Generic Language ParserSWP - A Generic Language Parser
SWP - A Generic Language Parser
 
Kamaelia - Networking Using Generators
Kamaelia - Networking Using GeneratorsKamaelia - Networking Using Generators
Kamaelia - Networking Using Generators
 
Scaling Streaming - Concepts, Research, Goals
Scaling Streaming - Concepts, Research, GoalsScaling Streaming - Concepts, Research, Goals
Scaling Streaming - Concepts, Research, Goals
 
Kamaelia Internals
Kamaelia InternalsKamaelia Internals
Kamaelia Internals
 
Building systems with Kamaelia
Building systems with KamaeliaBuilding systems with Kamaelia
Building systems with Kamaelia
 
Free software: How does it work?
Free software: How does it work?Free software: How does it work?
Free software: How does it work?
 

Recently uploaded

Cultivating Entrepreneurial Mindset in Product Management: Strategies for Suc...
Cultivating Entrepreneurial Mindset in Product Management: Strategies for Suc...Cultivating Entrepreneurial Mindset in Product Management: Strategies for Suc...
Cultivating Entrepreneurial Mindset in Product Management: Strategies for Suc...Product School
 
Transcript: Trending now: Book subjects on the move in the Canadian market - ...
Transcript: Trending now: Book subjects on the move in the Canadian market - ...Transcript: Trending now: Book subjects on the move in the Canadian market - ...
Transcript: Trending now: Book subjects on the move in the Canadian market - ...BookNet Canada
 
TrustArc Webinar - TrustArc's Latest AI Innovations
TrustArc Webinar - TrustArc's Latest AI InnovationsTrustArc Webinar - TrustArc's Latest AI Innovations
TrustArc Webinar - TrustArc's Latest AI InnovationsTrustArc
 
Roundtable_-_API_Research__Testing_Tools.pdf
Roundtable_-_API_Research__Testing_Tools.pdfRoundtable_-_API_Research__Testing_Tools.pdf
Roundtable_-_API_Research__Testing_Tools.pdfMostafa Higazy
 
Leonis Insights: The State of AI (7 trends for 2023 and 7 predictions for 2024)
Leonis Insights: The State of AI (7 trends for 2023 and 7 predictions for 2024)Leonis Insights: The State of AI (7 trends for 2023 and 7 predictions for 2024)
Leonis Insights: The State of AI (7 trends for 2023 and 7 predictions for 2024)Jay Zhao
 
CloudStack 101: The Best Way to Build Your Private Cloud – Rohit Yadav, VP Ap...
CloudStack 101: The Best Way to Build Your Private Cloud – Rohit Yadav, VP Ap...CloudStack 101: The Best Way to Build Your Private Cloud – Rohit Yadav, VP Ap...
CloudStack 101: The Best Way to Build Your Private Cloud – Rohit Yadav, VP Ap...ShapeBlue
 
GraphSummit London Feb 2024 - ABK - Neo4j Product Vision and Roadmap.pptx
GraphSummit London Feb 2024 - ABK - Neo4j Product Vision and Roadmap.pptxGraphSummit London Feb 2024 - ABK - Neo4j Product Vision and Roadmap.pptx
GraphSummit London Feb 2024 - ABK - Neo4j Product Vision and Roadmap.pptxNeo4j
 
ChatGPT's Code Interpreter: Your secret weapon for SEO automation success - S...
ChatGPT's Code Interpreter: Your secret weapon for SEO automation success - S...ChatGPT's Code Interpreter: Your secret weapon for SEO automation success - S...
ChatGPT's Code Interpreter: Your secret weapon for SEO automation success - S...SearchNorwich
 
IT Nation Evolve event 2024 - Quarter 1
IT Nation Evolve event 2024  - Quarter 1IT Nation Evolve event 2024  - Quarter 1
IT Nation Evolve event 2024 - Quarter 1Inbay UK
 
Harnessing the Power of GenAI for Exceptional Product Outcomes by Booking.com...
Harnessing the Power of GenAI for Exceptional Product Outcomes by Booking.com...Harnessing the Power of GenAI for Exceptional Product Outcomes by Booking.com...
Harnessing the Power of GenAI for Exceptional Product Outcomes by Booking.com...Product School
 
Confoo 2024 Gettings started with OpenAI and data science
Confoo 2024 Gettings started with OpenAI and data scienceConfoo 2024 Gettings started with OpenAI and data science
Confoo 2024 Gettings started with OpenAI and data scienceSusan Ibach
 
Q4 2023 Quarterly Investor Presentation - FINAL.pdf
Q4 2023 Quarterly Investor Presentation - FINAL.pdfQ4 2023 Quarterly Investor Presentation - FINAL.pdf
Q4 2023 Quarterly Investor Presentation - FINAL.pdfTejal81
 
Microsoft x 2toLead Webinar Session 1 - How Employee Communication and Connec...
Microsoft x 2toLead Webinar Session 1 - How Employee Communication and Connec...Microsoft x 2toLead Webinar Session 1 - How Employee Communication and Connec...
Microsoft x 2toLead Webinar Session 1 - How Employee Communication and Connec...2toLead Limited
 
HBR SERIES METAL HOUSED RESISTORS POWER ELECTRICAL ABSORBS HIGH CURRENT DURIN...
HBR SERIES METAL HOUSED RESISTORS POWER ELECTRICAL ABSORBS HIGH CURRENT DURIN...HBR SERIES METAL HOUSED RESISTORS POWER ELECTRICAL ABSORBS HIGH CURRENT DURIN...
HBR SERIES METAL HOUSED RESISTORS POWER ELECTRICAL ABSORBS HIGH CURRENT DURIN...htrindia
 
Learning About GenAI Engineering with AWS PartyRock [AWS User Group Basel - F...
Learning About GenAI Engineering with AWS PartyRock [AWS User Group Basel - F...Learning About GenAI Engineering with AWS PartyRock [AWS User Group Basel - F...
Learning About GenAI Engineering with AWS PartyRock [AWS User Group Basel - F...Chris Bingham
 
What’s New in CloudStack 4.19, Abhishek Kumar, Release Manager Apache CloudSt...
What’s New in CloudStack 4.19, Abhishek Kumar, Release Manager Apache CloudSt...What’s New in CloudStack 4.19, Abhishek Kumar, Release Manager Apache CloudSt...
What’s New in CloudStack 4.19, Abhishek Kumar, Release Manager Apache CloudSt...ShapeBlue
 
How AI and ChatGPT are changing cybersecurity forever.pptx
How AI and ChatGPT are changing cybersecurity forever.pptxHow AI and ChatGPT are changing cybersecurity forever.pptx
How AI and ChatGPT are changing cybersecurity forever.pptxInfosec
 
Synergy in Leadership and Product Excellence: A Blueprint for Growth by CPO, ...
Synergy in Leadership and Product Excellence: A Blueprint for Growth by CPO, ...Synergy in Leadership and Product Excellence: A Blueprint for Growth by CPO, ...
Synergy in Leadership and Product Excellence: A Blueprint for Growth by CPO, ...Product School
 
Launching New Products In Companies Where It Matters Most by Product Director...
Launching New Products In Companies Where It Matters Most by Product Director...Launching New Products In Companies Where It Matters Most by Product Director...
Launching New Products In Companies Where It Matters Most by Product Director...Product School
 

Recently uploaded (20)

Cultivating Entrepreneurial Mindset in Product Management: Strategies for Suc...
Cultivating Entrepreneurial Mindset in Product Management: Strategies for Suc...Cultivating Entrepreneurial Mindset in Product Management: Strategies for Suc...
Cultivating Entrepreneurial Mindset in Product Management: Strategies for Suc...
 
Transcript: Trending now: Book subjects on the move in the Canadian market - ...
Transcript: Trending now: Book subjects on the move in the Canadian market - ...Transcript: Trending now: Book subjects on the move in the Canadian market - ...
Transcript: Trending now: Book subjects on the move in the Canadian market - ...
 
TrustArc Webinar - TrustArc's Latest AI Innovations
TrustArc Webinar - TrustArc's Latest AI InnovationsTrustArc Webinar - TrustArc's Latest AI Innovations
TrustArc Webinar - TrustArc's Latest AI Innovations
 
Roundtable_-_API_Research__Testing_Tools.pdf
Roundtable_-_API_Research__Testing_Tools.pdfRoundtable_-_API_Research__Testing_Tools.pdf
Roundtable_-_API_Research__Testing_Tools.pdf
 
Leonis Insights: The State of AI (7 trends for 2023 and 7 predictions for 2024)
Leonis Insights: The State of AI (7 trends for 2023 and 7 predictions for 2024)Leonis Insights: The State of AI (7 trends for 2023 and 7 predictions for 2024)
Leonis Insights: The State of AI (7 trends for 2023 and 7 predictions for 2024)
 
CloudStack 101: The Best Way to Build Your Private Cloud – Rohit Yadav, VP Ap...
CloudStack 101: The Best Way to Build Your Private Cloud – Rohit Yadav, VP Ap...CloudStack 101: The Best Way to Build Your Private Cloud – Rohit Yadav, VP Ap...
CloudStack 101: The Best Way to Build Your Private Cloud – Rohit Yadav, VP Ap...
 
GraphSummit London Feb 2024 - ABK - Neo4j Product Vision and Roadmap.pptx
GraphSummit London Feb 2024 - ABK - Neo4j Product Vision and Roadmap.pptxGraphSummit London Feb 2024 - ABK - Neo4j Product Vision and Roadmap.pptx
GraphSummit London Feb 2024 - ABK - Neo4j Product Vision and Roadmap.pptx
 
In sharing we trust. Taking advantage of a diverse consortium to build a tran...
In sharing we trust. Taking advantage of a diverse consortium to build a tran...In sharing we trust. Taking advantage of a diverse consortium to build a tran...
In sharing we trust. Taking advantage of a diverse consortium to build a tran...
 
ChatGPT's Code Interpreter: Your secret weapon for SEO automation success - S...
ChatGPT's Code Interpreter: Your secret weapon for SEO automation success - S...ChatGPT's Code Interpreter: Your secret weapon for SEO automation success - S...
ChatGPT's Code Interpreter: Your secret weapon for SEO automation success - S...
 
IT Nation Evolve event 2024 - Quarter 1
IT Nation Evolve event 2024  - Quarter 1IT Nation Evolve event 2024  - Quarter 1
IT Nation Evolve event 2024 - Quarter 1
 
Harnessing the Power of GenAI for Exceptional Product Outcomes by Booking.com...
Harnessing the Power of GenAI for Exceptional Product Outcomes by Booking.com...Harnessing the Power of GenAI for Exceptional Product Outcomes by Booking.com...
Harnessing the Power of GenAI for Exceptional Product Outcomes by Booking.com...
 
Confoo 2024 Gettings started with OpenAI and data science
Confoo 2024 Gettings started with OpenAI and data scienceConfoo 2024 Gettings started with OpenAI and data science
Confoo 2024 Gettings started with OpenAI and data science
 
Q4 2023 Quarterly Investor Presentation - FINAL.pdf
Q4 2023 Quarterly Investor Presentation - FINAL.pdfQ4 2023 Quarterly Investor Presentation - FINAL.pdf
Q4 2023 Quarterly Investor Presentation - FINAL.pdf
 
Microsoft x 2toLead Webinar Session 1 - How Employee Communication and Connec...
Microsoft x 2toLead Webinar Session 1 - How Employee Communication and Connec...Microsoft x 2toLead Webinar Session 1 - How Employee Communication and Connec...
Microsoft x 2toLead Webinar Session 1 - How Employee Communication and Connec...
 
HBR SERIES METAL HOUSED RESISTORS POWER ELECTRICAL ABSORBS HIGH CURRENT DURIN...
HBR SERIES METAL HOUSED RESISTORS POWER ELECTRICAL ABSORBS HIGH CURRENT DURIN...HBR SERIES METAL HOUSED RESISTORS POWER ELECTRICAL ABSORBS HIGH CURRENT DURIN...
HBR SERIES METAL HOUSED RESISTORS POWER ELECTRICAL ABSORBS HIGH CURRENT DURIN...
 
Learning About GenAI Engineering with AWS PartyRock [AWS User Group Basel - F...
Learning About GenAI Engineering with AWS PartyRock [AWS User Group Basel - F...Learning About GenAI Engineering with AWS PartyRock [AWS User Group Basel - F...
Learning About GenAI Engineering with AWS PartyRock [AWS User Group Basel - F...
 
What’s New in CloudStack 4.19, Abhishek Kumar, Release Manager Apache CloudSt...
What’s New in CloudStack 4.19, Abhishek Kumar, Release Manager Apache CloudSt...What’s New in CloudStack 4.19, Abhishek Kumar, Release Manager Apache CloudSt...
What’s New in CloudStack 4.19, Abhishek Kumar, Release Manager Apache CloudSt...
 
How AI and ChatGPT are changing cybersecurity forever.pptx
How AI and ChatGPT are changing cybersecurity forever.pptxHow AI and ChatGPT are changing cybersecurity forever.pptx
How AI and ChatGPT are changing cybersecurity forever.pptx
 
Synergy in Leadership and Product Excellence: A Blueprint for Growth by CPO, ...
Synergy in Leadership and Product Excellence: A Blueprint for Growth by CPO, ...Synergy in Leadership and Product Excellence: A Blueprint for Growth by CPO, ...
Synergy in Leadership and Product Excellence: A Blueprint for Growth by CPO, ...
 
Launching New Products In Companies Where It Matters Most by Product Director...
Launching New Products In Companies Where It Matters Most by Product Director...Launching New Products In Companies Where It Matters Most by Product Director...
Launching New Products In Companies Where It Matters Most by Product Director...
 

Kamaelia Protocol Walkthrough

  • 1. A walk through building & stacking protocols using Kamaelia Michael Sparks October 2008
  • 2. The aim of this document is to guide you through building a system where: ● A user connects to a server and ● Over a secure connection, ● Receives a sequence of JSON encode-able objects
  • 3. The aim of this document is to guide you through building a system where: ● A user connects to a server and ● Over a secure connection, This doc also uses speech ● Receives a sequence of JSON make “aside” bubbles like this to encode-able comments regarding particlar objects panels. You can skip these safely.
  • 4. ServerCore First of all, we start off with the ServerCore component. The hole is for fitting a protocol handler factory. eg a class, or function.
  • 5. ServerCore As an aside, this hole is pretty crucial. Without filling this hole, this component is pretty useless. So we call this sort of component a CHASSIS First of all, we start off with the ServerCore component. The hole is for fitting a protocol handler factory. eg a class, or function.
  • 6. ServerCore «factory» protocol So, we provide a protocol factory. ServerCore(protocol=protocol, port=2345)
  • 7. ServerCore «factory» protocol In retrospect, “protocol” as the name of an example protocol handler is a bad idea, so let's change this slightly. So, we provide a protocol factory. ServerCore(protocol=protocol, port=2345)
  • 8. ServerCore «factory» stackedjson So, we provide a protocol factory. ServerCore(protocol=stackedjson, port=2345)
  • 9. ServerCore «factory» stackedjson We then activate it, which causes it to start a subcomponent. ServerCore( .... )
  • 10. ServerCore TCPServer «factory» stackedjson We then activate it. It starts TCPServer subcomponent, which listens for connections. ServerCore( .... ).activate()
  • 11. ServerCore Connected TCPServer SocketAdapter «factory» stackedjson A client then connects to the TCPServer which creates a ConnectedSocketAdapter to handle the mechanics of the connection.
  • 12. ServerCore Connected TCPServer SocketAdapter «factory» stackedjson stackedjson TCPServer tells ServerCore it has done this. ServerCore in response calls the protocol factory to create a handler component...
  • 13. ServerCore Connected TCPServer SocketAdapter «factory» stackedjson stackedjson ...which is wired up. The protocol handler just receives bytes and sends bytes, which are sent to the client via the ConnectedSocketAdapter
  • 14. ServerCore Connected TCPServer SocketAdapter «factory» stackedjson stackedjson There, the key thing in creating a server, is to create an appropriate protocol handler component.
  • 15. ServerCore Connected TCPServer SocketAdapter «factory» stackedjson stackedjson There, the key thing in creating a server, is to create an appropriate protocol handler component.
  • 16. stackedjson So, let's look inside this component
  • 17. stackedjson def protocol(*args,**argd): return Pipeline( PeriodicWakeup(message=quot;NEXTquot;, interval=1), Chooser(messages), MarshallJSON(), Encrypter(), DataChunker(), ) So, let's look inside this component
  • 18. stackedjson def protocol(*args,**argd): return Pipeline( PeriodicWakeup(message=quot;NEXTquot;, interval=1), Chooser(messages), MarshallJSON(), Encrypter(), DataChunker(), ) So, let's look inside this component. Clearly this is what actually handles the connection.
  • 19. PeriodicWakeup Chooser Pipeline( PeriodicWakeup(message=quot;NEXTquot;, MarshallJSON interval=1), Chooser(messages), Encrypter MarshallJSON(), Encrypter(), DataChunker DataChunker(), ) Let's expand that...
  • 20. PeriodicWakeup Chooser MarshallJSON Direction of Encrypter data flow DataChunker We see this is a uni-directional protocol – as soon as this pipeline starts up. Encrypted JSON data chunks get sent, ignoring client data.
  • 21. PeriodicWakeup Chooser ConsoleEchoer MarshallJSON DeMarshallJSON Direction of Encrypter data flow Decrypter DataChunker DataDeChunker TCPClient So, given the ServerCore infrastructure means we can more or less ignore the network, what does the client side pipeline look like?
  • 22. PeriodicWakeup Chooser ConsoleEchoer MarshallJSON DeMarshallJSON Encrypter Decrypter DataChunker DataDeChunker TCPClient Each component in the server, that is part of the user's protocol, has a matching component in the client.
  • 23. PeriodicWakeup Chooser ConsoleEchoer MarshallJSON DeMarshallJSON Encrypter Decrypter DataChunker DataDeChunker TCPClient Fundamentally, this protocol allows one side of it to securely throw dictionary objects to clients which can then do something with them
  • 24. PeriodicWakeup Chooser ConsoleEchoer MarshallJSON DeMarshallJSON Encrypter Decrypter DataChunker DataDeChunker TCPClient To understand what a client sees, we just look at these three components. The 2 highlighted server side components are the core behaviour.
  • 25. PeriodicWakeup Chooser ConsoleEchoer Let's rearrange these, showing the logical pipeline that drives what the user sees.
  • 26. PeriodicWakeup( PeriodicWakeup message=quot;NEXTquot;, interval=1) Chooser ConsoleEchoer First of all the PeriodicWakeupComponent sends out the message “NEXT” once per second.
  • 27. Messages = [ PeriodicWakeup {quot;helloquot;: quot;worldquot; }, {quot;helloquot;: [1,2,3] }, {quot;worldquot;: [1,2,3] }, {quot;worldquot;: {quot;gamequot;:quot;overquot;} }, Chooser ]*10 Chooser(messages) ConsoleEchoer These “NEXT” messages control the Chooser. The chooser steps through a list of messages, and when told “NEXT”, sends the next message.
  • 28. Messages = [ PeriodicWakeup {quot;helloquot;: quot;worldquot; }, {quot;helloquot;: [1,2,3] }, {quot;worldquot;: [1,2,3] }, It's worth noting that the Chooser Chooser can back backwards{quot;gamequot;:quot;overquot;} }, {quot;worldquot;: as well, just to ]*10 the start and end etc. For more Chooser(messages)at the docs :) details look ConsoleEchoer These “NEXT” messages control the Chooser. The chooser steps through a list of messages, and when told “NEXT”, sends the next message.
  • 29. PeriodicWakeup Chooser ConsoleEchoer(use_repr=True) ConsoleEchoer These messages arrive intact at the client - in this case a ConsoleEchoer. However it could be something more interesting – eg a game system.
  • 30. PeriodicWakeup Chooser ConsoleEchoer MarshallJSON DeMarshallJSON Encrypter Decrypter DataChunker DataDeChunker TCPClient Going back to the overview slide, this diagram shows the various protocols which are stacked on top of each other.
  • 31. PeriodicWakeup Chooser ConsoleEchoer MarshallJSON DeMarshallJSON Encrypter Decrypter DataChunker DataDeChunker TCPClient We have our core application protocol, stacked on top of a secure serialising communications channel. This truly is at the application level.
  • 32. PeriodicWakeup Chooser ConsoleEchoer MarshallJSON DeMarshallJSON Encrypter Decrypter DataChunker DataDeChunker TCPClient We have our serialisation protocol. Clearly this is a message oriented protocol – it requires the lower layer to preserve boundaries.
  • 33. PeriodicWakeup Chooser ConsoleEchoer MarshallJSON DeMarshallJSON Encrypter Decrypter DataChunker DataDeChunker TCPClient We have a secure transmission protocol. This is admittedly simplistic – it assumes predistributed keys. However it gives a flavour
  • 34. PeriodicWakeup Chooser ConsoleEchoer MarshallJSON DeMarshallJSON Encrypter Decrypter DataChunker DataDeChunker TCPClient We then have our chunking protocol, which preserves message boundaries – necessary because TCP does not guarantee to do so.
  • 35. PeriodicWakeup Chooser ConsoleEchoer MarshallJSON DeMarshallJSON Encrypter Decrypter DataChunker DataDeChunker TCPClient So let's go back and see where these things fit back into the system.
  • 36. ServerCore Connected TCPServer SocketAdapter «factory» stackedjson stackedjson So this is what we had ...
  • 37. ServerCore Connected TCPServer SocketAdapter «factory» stackedjson stackedjson The client really looks like this... Also, this is a one way protocol
  • 38. ServerCore Connected TCPServer SocketAdapter «factory» stackedjson The client really looks like this & this is a one way protocol. The protocol itself looks like this. And that's how those parts fit together.
  • 39. ServerCore Connected TCPServer SocketAdapter «factory» stackedjson So, finally, for completeness, we'll include the code.
  • 40. So, finally, for completeness, we'll include the code. Though, for code, this is a better location: http://tinyurl.com/4k3df2
  • 41. Bunch of imports... import cjson import Axon from Kamaelia.Chassis.Pipeline import Pipeline from Kamaelia.Util.Chooser import Chooser from Kamaelia.Util.Console import ConsoleEchoer from Kamaelia.Internet.TCPClient import TCPClient from Kamaelia.Chassis.ConnectedServer import ServerCore from Kamaelia.Protocol.Framing import DataChunker, DataDeChunker from Kamaelia.Apps.Grey.PeriodicWakeup import PeriodicWakeup from Crypto.Cipher import DES
  • 42. Define the messages being slung to clients messages = [ {quot;helloquot;: quot;worldquot; }, {quot;helloquot;: [1,2,3] }, {quot;worldquot;: [1,2,3] }, {quot;worldquot;: {quot;gamequot;:quot;overquot;} }, ]*10
  • 43. Then the JSON De/Marshalling components class MarshallJSON(Axon.Component.component): def main(self): while not self.dataReady(quot;controlquot;): for j in self.Inbox(quot;inboxquot;): j_encoded = cjson.encode(j) self.send(j_encoded, quot;outboxquot;) if not self.anyReady(): self.pause() yield 1 class DeMarshallJSON(Axon.Component.component): def main(self): while not self.dataReady(quot;controlquot;): for j in self.Inbox(quot;inboxquot;): j_decoded = cjson.decode(j) self.send(j_decoded, quot;outboxquot;) if not self.anyReady(): self.pause() yield 1
  • 44. Define our encoding layer using normal code...1 class Encoder(object): quot;quot;quot;Null encoder/base encoder - returns the same string for encode/decodequot;quot;quot; def __init__(self, key, **argd): super(Encoder, self).__init__(**argd) self.__dict__.update(argd) self.key = key def encode(self, some_string): return some_string def decode(self, some_string): return some_string
  • 45. Define our encoding layer using normal code...2 class DES_CRYPT(Encoder): def __init__(self, key, **argd): super(DES_CRYPT, self).__init__(key, **argd) self.key = self.pad_eight(key)[:8] self.obj = obj=DES.new(self.key, DES.MODE_ECB) def encode(self, some_string): padded = self.pad_eight(some_string) encrypted = self.obj.encrypt(padded) return encrypted def decode(self, some_string): padded = self.obj.decrypt(some_string) decoded = self.unpad(padded) return decoded # ... continued
  • 46. Define our encoding layer using normal code...3 # class DES_CRYPT(Encoder): # ... continued from before def pad_eight(self, some_string): X = len(some_string) if X % 8 != 0: pad_needed = 8-X % 8 else: pad_needed = 8 pad_needed = 8-(X % 8) PAD = pad_needed * chr(pad_needed) return some_string+PAD def unpad(self, some_string): x = ord(some_string[-1]) return some_string[:-x]
  • 47. Create Encryption components using this class Encrypter(Axon.Component.component): key = quot;ABCDquot; def main(self): crypter = DES_CRYPT(self.key) while not self.dataReady(quot;controlquot;): for j in self.Inbox(quot;inboxquot;): j_encoded = crypter.encode(j) self.send(j_encoded, quot;outboxquot;) if not self.anyReady(): self.pause() yield 1 Note, this is not a serious protocol, it is an illustration. This form of pre-shared key would be a bad idea, but the pattern of usage will be useful.
  • 48. Create Decryption components using this class Decrypter(Axon.Component.component): key = quot;ABCDquot; def main(self): crypter = DES_CRYPT(self.key) while not self.dataReady(quot;controlquot;): for j in self.Inbox(quot;inboxquot;): j_decoded = crypter.decode(j) self.send(j_decoded, quot;outboxquot;) if not self.anyReady(): self.pause() yield 1 Note, this is not a serious protocol, it is an illustration. This form of pre-shared key would be a bad idea, but the pattern of usage will be useful.
  • 49. Create the protocol handler factory & Client def stackedjson(*args,**argd): return Pipeline( PeriodicWakeup(message=quot;NEXTquot;, interval=1), Chooser(messages), MarshallJSON(), Encrypter(), # Encrypt on the way out DataChunker(), ) def json_client_prefab(ip, port): return Pipeline( TCPClient(ip, port=port), DataDeChunker(), Decrypter(), # Decrypt on the way in DeMarshallJSON(), ConsoleEchoer(use_repr=True) )
  • 50. And finally start the server and point a client at the server. ServerCore(protocol=protocol, port=2345).activate() json_client_prefab(quot;127.0.0.1quot;, 2345).run() ServerCore Connected TCPServer SocketAdapter «factory» stackedjson