Después de lo que hablamos con Rodri sobre como definir topologias, se me ocurrio que pdemos usar directamente C++ para definir topologia, ruteo y clases.

Idea

mininet: programan la topología en python.
OMNET++ con NED practicamente se programan en C++.


Una estrategia similar y super simple para nuestro caso es programar el acoplado directo en C++ y olvidarse de la GUI drag&drop de powerdevs!

Ahora por ejemplo el código para conectar un router con otros 2 routers es asi:

//D0[6] is Router0
D0[5] = new Router("Router0");
D0[7]->init(0.0 /*init time*/,"100" /*Capacity*/,"1" /*Delay*/, "500" /*BufferSize*/);
//D0[6] is Router1
D0[6] = new Router("Router1");
D0[6]->init(0.0,"100","","500"

);
//D0[7] is Router2
D0[7] = new Router("Router2");
D0[7]->init(0.0,"100","1", "500");

// Connections
IC0[1] = new Connection();
IC0[1]->setup(5/*index src*/,0 /*port src*/,6 /*index dst*/,0 /*port dst*/);
IC0[2] = new Connection();
IC0[2]->setup(5,0,7,0);


Inline image 1

Que te parece?


Tal vez emprolijando un poco la sintaxis para hacerla mas facil ya estamos, no?

Posibles problemas

  • Si en algún momento queremos volver a la interfaz grafica habria que hacer el proceso inverso del que existe ahora: ahora es de la GUI->C++, debería ser muy fácil hacer de C++->GUI.
  • Que se vea lindo ya es otra cosa! (por ejemplo si usamos los puertos DEVS como puertos de los routers en la GUI se ven horribles 10 puertos, 100 ni te cuento).
  • Mas genericamente, dado el modelo acoplado definido en C++, generar cualquier otro formato que permita graficar una red (YANG, AMNl, o lo que sea).

Definición

Nos gustaria poder simplificar la forma de declarar y definir modelos en PowerDEVS usando C++, orientado a redes:

  • Source: generationPeriod, generationSize, startTime
  • Router: bufferSize
  • Link: Src, Dst, Capacity or Bandwidth (bit/s), Delay
  • Flow: (Src, Dst, Route, Priorities).
Otras caracteristicas:
  • Los parametros especificados como Strings, para que se lean los valores de configuracion (Scilab, linea de comando)

Posible codigo de ejemplo

// Adding a node
auto felix1 = this->addNode<FelixServer>("Felix1", "felix.period", "felix.size", "felix.start"); // All strings as they are retrieved from config. Could also be "5*10^9" to be evaluated by Scilab, but hardcoded its not nice.

auto felix2 = std::make_shared<FelixServer> ("Felix2", "felix.period", "felix.size", "felix.start"); // first create it, then add it.
this->addNode(felix2);

// Adding a switch
auto switch1 = this->addNode<Switch>("Switch1", "swtich1.buffer"); // A switch is also a Node.

// Connecting

auto link = this->addLink<Link>("Link1", felix1, 0, switch1, 0, "link.capacity", "link.delay" ); // Connect felix1.0 to switch1.0

auto link = this->addFullDuplexLink<Link>("Link2", felix2, 0, switch1, 1, "link.capacity", "link.delay" ); // A bidirectional link from felix2.0 to switch1.1

auto link = this->addFullDuplexLink<Link>("Link3", felix1, 0, felix2, 2, "link.capacity", "link.delay" ); // Error, link felix1.0 is already in use

-- MatiasAlejandroBonaventura - 2016-06-02

Edit | Attach | Watch | Print version | History: r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r1 - 2016-06-02 - MatiasAlejandroBonaventura
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    Main All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright &© 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback