Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
ODOG
Um ambiente para programação concorrente
e distribuída Baseada em Componentes
ivanjokerbr@gmail.com
Ivan Joker Jeuken...
Introduction
● Theory
– Concepts
– Related Work
– ODOG
– Interaction Semantics
● Code
● Demos
● Future Work
THEORY
Concepts
Component abstraction
Composition of components
A B
composition
interaction medium
communication channel
componen...
Concepts
Coordination language
syntax : block oriented
semantics : interaction semantics
Host language
programming languag...
Concepts
What are the advantages ?
Create programming abstractions more natural
to the application domain
more productivit...
Related work
Is this idea original ? No
Labview - National Instruments
Related Work (2)
Simulink - Mathworks
Related Work (3)
Scade – Esterel Technologies
ODOG
Project Requirements
support any interaction semantics
support any programming language
easily generate efficient cod...
Simple
Tree structure for the abstract syntax
XML
Template based code generation for interaction semantics
Avoid the need ...
Standard ODOG Flow
Component
selection and
composition
Component implementation
Interaction Semantics
selection
Rule Check...
ODOG v1.0
3 Interaction semantics
Discrete Events (DE) : simulation
Dataflow (DF): data stream processing
Synchronous (SR)...
Interaction Semantics
Dataflow (DF)
grafo onde nós são operações e arestas são filas
+
3
5
+
8
Considera um fluxo contínuo...
Interaction Semantics
Discrete Events (DE)
Baseado no processamento ordenado de eventos
um evento é um par (v, t), onde v ...
Interaction Semantics
Synchronous Reactive (SR)
● Tempo dividido em uma série de instantes
● Sistema deve entrar em “equil...
Interaction Semantics
Encontrar o menor ponto fixo (f(x) = x)
A
B
C
1 3
4
2
5
3
5
4
2
oo
i
d
A C
B
1
2
3
4
5
e(i) = d(i, e...
CODE
Syntax
odog.syntax.Nodes
Classes para todos os elementos
da sintaxe abstrata
odog.syntax.Parse
Parser que cria um modelo a...
Syntax
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE atomicComponent PUBLIC "-//ODOGSYNTAXATOMIC//DTD//EN" "">
<atomicC...
Rule Check
● Abstract syntax = Acyclic Graph
● Rule = first order logic
● Allows for efficient, clean and scalable checks ...
Rule Check
odog.ruleChecker
Classes para construir a regra e
comparar com o modelo do
componente
Code Generation
● Template based
odog.codegen.util
Classes para implementar um
template
<?xml version="1.0" encoding="UTF-...
Code Generation
odog.codegen
Classes básicas para
implemntação de um gerador de
código para uma plataforma e
semântica de ...
Host Language
● Currently only C
● Methods for communication
void send(char *connection, void *data, size_t length)
int nu...
Host language
● Methods for execution control
void init(void)
void finish(void)
void compute(void)
void fixpoint(void)
GUI
● Simple but functional GUI
GUI
odog.design
Classes para representar
bibliotecas e projetos com
componentes
odog.editor
A GUI central
odog.editor.*
Fr...
DEMO TIME!
Producer Consumer
● Projeto com um ator produtor e outro receptor
● 4 testes
– DF
– DE
– SR
– DE-SR
● Teste na plataforma ...
Susan
● Algoritmo para desenhar contornos em imagens
● Teste na plataforma OmapH2
SQLi
● 0d1n : Ferramenta feita pelo Antonio “Cooler”
What this it ?
0d1n is a tool for automating customized attacks again...
Twitter
● Tweepy : biblioteca em python para API do twitter
● Scripts para puxar informações
● Por enquanto, python no odo...
Future Work
● Plataformas distribuídas
– Clouds
– Big data
● Python como outra host language
Upcoming SlideShare
Loading in …5
×

Odog : A Framework for Concurrent and Distributed software design

256 views

Published on

Trata-se de um ambiente para facilitar a programação concorrente e distribuída, através do uso de componentes de software.

Published in: Software
  • Be the first to comment

Odog : A Framework for Concurrent and Distributed software design

  1. 1. ODOG Um ambiente para programação concorrente e distribuída Baseada em Componentes ivanjokerbr@gmail.com Ivan Joker Jeukens https://github.com/ivanjokerbr/odog.git
  2. 2. Introduction ● Theory – Concepts – Related Work – ODOG – Interaction Semantics ● Code ● Demos ● Future Work
  3. 3. THEORY
  4. 4. Concepts Component abstraction Composition of components A B composition interaction medium communication channel component Two different kinds of languages for the composition (coordination) for the components (host)
  5. 5. Concepts Coordination language syntax : block oriented semantics : interaction semantics Host language programming languages domain specific languages What can I do with such a model ? generate an executable code “simulation” or actual code production
  6. 6. Concepts What are the advantages ? Create programming abstractions more natural to the application domain more productivity better understanding better optimization opportunities Better semantics (no non-determinism, or a controlled one) Possibility to target to any desired platform, hiding the details from the programmer
  7. 7. Related work Is this idea original ? No Labview - National Instruments
  8. 8. Related Work (2) Simulink - Mathworks
  9. 9. Related Work (3) Scade – Esterel Technologies
  10. 10. ODOG Project Requirements support any interaction semantics support any programming language easily generate efficient code for the system being described have a strong validation flow be open source Common solution class libraries for syntax and semantics not good for 2, 3
  11. 11. Simple Tree structure for the abstract syntax XML Template based code generation for interaction semantics Avoid the need for (difficult and error prone) code analysis and transformation code “as good as it gets” ODOG's Solution
  12. 12. Standard ODOG Flow Component selection and composition Component implementation Interaction Semantics selection Rule Checking Code Generation Validation Concepts External Flow Solution to be characterized
  13. 13. ODOG v1.0 3 Interaction semantics Discrete Events (DE) : simulation Dataflow (DF): data stream processing Synchronous (SR): software based on response to events 2 Platforms host : generates code for your machine so you can test your ideas multicore : generates code for DF exploiting parallelism OmapH2 : deprected GUI for editing and Rule Checker for validation
  14. 14. Interaction Semantics Dataflow (DF) grafo onde nós são operações e arestas são filas + 3 5 + 8 Considera um fluxo contínuo de dados Noção de ativamento de um ator Restrição sobre o consumo e produção Muito concorrente e ótimo para fazer um workflow
  15. 15. Interaction Semantics Discrete Events (DE) Baseado no processamento ordenado de eventos um evento é um par (v, t), onde v é um valor de algum tipo e t é um  timestamp timestamp é um valor real utilizado para modelar um instante de  tempo eventos são mantidos em uma fila global, ordenados pelo timestamp Possui um modelo global de tempo discreto Ideal para fazer um modelo de  ambiente de operação, ou simulação AA B C t t
  16. 16. Interaction Semantics Synchronous Reactive (SR) ● Tempo dividido em uma série de instantes ● Sistema deve entrar em “equilíbrio”....dois requisitos – Valores ordenados nas saídas dos componentes – Funções monotônicas  ausente valor estado definido estado indefinido Encontrar o menor ponto fixo (f(x) = x) A B C 1 3 4 2 5 3 5 4 2 oo i d
  17. 17. Interaction Semantics Encontrar o menor ponto fixo (f(x) = x) A B C 1 3 4 2 5 3 5 4 2 oo i d A C B 1 2 3 4 5 e(i) = d(i, e(i)) Modelo bom para sistemas reativos e fortemente acoplados
  18. 18. CODE
  19. 19. Syntax odog.syntax.Nodes Classes para todos os elementos da sintaxe abstrata odog.syntax.Parse Parser que cria um modelo a partir do arquivo .xml
  20. 20. Syntax <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE atomicComponent PUBLIC "-//ODOGSYNTAXATOMIC//DTD//EN" ""> <atomicComponent name="Producer"> <dport name="out" isInput="false" isOutput="true"> <portType> <attribute name="portType"> <attrClassification visible="true" hasData="true" static="true"/> <value type="string" valueExpr="char *"> <attrRef completeAttrName="Producer.out.portType"/> </value> </attribute> </portType> </dport> <version name="DF"> <method name="compute" language="C" codeURL="ProdutorDF.c"> </method> <method name="finish" language="C" codeURL="ProdutorDF.c"> </method> <method name="init" language="C" codeURL="ProdutorDF.c"> </method> </version> </atomicComponent>
  21. 21. Rule Check ● Abstract syntax = Acyclic Graph ● Rule = first order logic ● Allows for efficient, clean and scalable checks during design time – Developers of the framework – Developers of applications using the framework PT.atomicComponent.a( EX.atomicVersion.x( a -> x) ) ● Check the Odog's manual for more info
  22. 22. Rule Check odog.ruleChecker Classes para construir a regra e comparar com o modelo do componente
  23. 23. Code Generation ● Template based odog.codegen.util Classes para implementar um template <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE fileGenerator PUBLIC "-//ODOGFILEGENERATOR//DTD//EN" ""> <fileGenerator> <text>vec = remove_dynamic_fifo(</text><argument name="arg0"/><text>, 1); *p2 = ((odog_data_pkg *)vec[0])->data; *p3 = ((odog_data_pkg *)vec[0])->length; free(vec[0]); free(vec);</text> </fileGenerator>
  24. 24. Code Generation odog.codegen Classes básicas para implemntação de um gerador de código para uma plataforma e semântica de interação
  25. 25. Host Language ● Currently only C ● Methods for communication void send(char *connection, void *data, size_t length) int numberOfConnections(char *port) char *nameOfConnection(char *port, int number) void sendDelayed(char *connection, void *data, size_t length, double instant) void sendAll(char *port, void *data, size_t length) void sendAllDelayed(char *port, void *data, size_t length, double instant) void receive(char *connection, void **data, size_t *length) char canReceiveAll( port , int size) char canSend( connection , int size)
  26. 26. Host language ● Methods for execution control void init(void) void finish(void) void compute(void) void fixpoint(void)
  27. 27. GUI ● Simple but functional GUI
  28. 28. GUI odog.design Classes para representar bibliotecas e projetos com componentes odog.editor A GUI central odog.editor.* Frames para editar os respectivos elementos de projeto
  29. 29. DEMO TIME!
  30. 30. Producer Consumer ● Projeto com um ator produtor e outro receptor ● 4 testes – DF – DE – SR – DE-SR ● Teste na plataforma Host quanto na Multicore
  31. 31. Susan ● Algoritmo para desenhar contornos em imagens ● Teste na plataforma OmapH2
  32. 32. SQLi ● 0d1n : Ferramenta feita pelo Antonio “Cooler” What this it ? 0d1n is a tool for automating customized attacks against web applications.. ● https://github.com/CoolerVoid/0d1n 0d1n -h 'http://testphp.vulnweb.com/listproducts.php?cat=!' -p payloads/sqli.txt -f response2find/find.txt -o out -T 10 ● Transformada em componente e acoplada com um spider. Plataforma multicore.
  33. 33. Twitter ● Tweepy : biblioteca em python para API do twitter ● Scripts para puxar informações ● Por enquanto, python no odog somente com stubs... Py_Initialize(); PyRun_SimpleFile(fp, "follow.py"); Py_Finalize(); close(fp);
  34. 34. Future Work ● Plataformas distribuídas – Clouds – Big data ● Python como outra host language

×