Define Routes and Flows

Following the idea discussed here we developed new classes to support the definition of Routes and Flows. These classes are used by the networking model (server, router, links, etc) to generate and transmit packets.
The idea now is to allow easy creation of these objects in c++, maybe for one day a high-level language can generate the necessary c++ code.

Routes

A route is a path that packets take in order to go from a source node (eJ: a Server) to a destination node (ej: aPacketSink), traversing other network nodes (Ej: Routers).

In our network models routes are used by the Router model to decide which output port to use to forward an incoming packet.

A Route (atomics/PhaseI/NetworkData/Route.h) is basically a wrapper around a dequeue<Node>. A queue where nodes are popped once they have been used (by a Router).

In the future, once the topology is defined, routes could be automatically calculated (according to the chosen routeing algorithm: SpanningTree, Infiniband, SBP, Trill, etc)

Creating a Route

The route class has several constructors to allow easy creating using brace bracket initialization.

auto route = Route({
{0, "Felix1Router"},
{1, "Router1"},
});

This route says that the packets using this route will exit from port0 when arriving at FelixRouter router, and then exit from port 1 when arriving Router1 router. This way it is very easy to implement the Router models, as they just look at the route to decide which output port to forward.

Creating a packet with a route (RoutingProtocol)

Route objects "travel" in the RoutingProtocol which can be set to the NetworkPackets:

// Create packet
auto packet = std::make_shared<NetworkPacket>(t);

// create Route
std::shared_ptr<Route> route (new Route({
{0, "Felix1Router"},
{0, "Router1"},
}));

std::shared_ptr<IProtocol> routeProtocol = std::make_shared<RoutingProtocol>(route);
packet->addProtocol(routeProtocol);

OR ( simpler, without explicitly creating a route)
std::shared_ptr<RoutingProtocol> routeProtocol (new RoutingProtocol ({
{0, "Felix1Router"},
{1, "Router1"},
}));
packet->addProtocol(routeProtocol);

Flows

Flows (or classes in the the MVA parlance) define the communication between different nodes.
Flows define the rate at which packets are generated, the size of the packets, and the route these packets will take.

Creating a Flow

// implicitly definig the route. Not a shared_ptr!!!std::shared_ptr<Flow> flow (new Flow(0, std::make_shared<ExponentialDistributionParameter>((double)1/35),
std::make_shared<ExponentialDistributionParameter>(1000*8),{
{0, "FelixServer2"},
{0, "Router1"},
{1, "Router2"},
}));

Defining flows

Each server need to know which flows it should deliver. For the time being, we created a static FlowDefinitions class which acts as a central place where all the flows of the system can be defined. In the future this might change, specially if flows are defined in a high-level language.

Servers use the FlowDefinitions::getSourceFlows(std::string sourceName) to get the flows starting at that server.

To define the flows in the system, you change the implementation of FlowDefinitions::defineFlows, using the FlowDefinitions::addFlow methods. For example in order to define 2 flows:

void FlowDefinitions::defineFlows(){
// Flow 1, starting at FelixServer1

FlowDefinitions::addFlow(0, std::make_shared<ExponentialDistributionParameter>((double)1/15),
std::make_shared<ExponentialDistributionParameter>(1000*8), {
{0, "FelixServer1"},
{0, "Router1"},
{0, "Router2"},
});

// Flow 2, starting at FelixServer2
std::shared_ptr<Flow> flow (new Flow(0, std::make_shared<ExponentialDistributionParameter>((double)1/35),
std::make_shared<ExponentialDistributionParameter>(1000*8),{
{0, "FelixServer2"},
{0, "Router1"},
{1, "Router2"},
}));
FlowDefinitions::addFlow(flow);
}

TODOS:

  • How to read flow parameters from config file (startTime, rate and size distributions). It would be ideal to specify route too in configuration.
  • In the future, once the topology is defined, routes could be automatically calculated (according to the chosen routeing algorithm: SpanningTree, Infiniband, SBP, Trill, etc)
-- MatiasAlejandroBonaventura - 2016-06-14
Edit | Attach | Watch | Print version | History: r2 < r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r2 - 2016-06-15 - 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-2020 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback