Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flows with the same source but different periods #29

Open
gkrait opened this issue Aug 9, 2022 · 0 comments
Open

Flows with the same source but different periods #29

gkrait opened this issue Aug 9, 2022 · 0 comments

Comments

@gkrait
Copy link

gkrait commented Aug 9, 2022

Hey there,
thank you for the nice tool!. While trying to use Tsn-Sched, I noticed that when defining flows of the same source node but with different periods, the resulting model is (most of the time) unsatisfiable (even for a simple topology)
For example, suppose we have the topology :


dev1 --> swt1 --> swt2 --> dev2

and 3 flows f1,f2, and f3 (with periods 250, 500, and 1000 respectively) starting from dev1 and ending at dev2.
Even with the simple setup, the solver does not find any solution, so I would like to learn more about the reason behind the unsatisfiability.

So is there anything wrong with my understanding?
Thank you in advance,
George

P.S: The network of the example is defined as follows:

        ////////////////////////////////////////////
        // defining devices && switches
        ////////////////////////////////////////////
        Device dev1 = new Device(250, 0, 10000000, 250);
        Device dev2 = new Device(250, 0, 10000000, 150);
        TSNSwitch swt1 = new TSNSwitch("swt1", 1500, 1, 250, 1, 1, 200000);
        TSNSwitch swt2 = new TSNSwitch("swt2", 1500, 1, 250, 1, 1, 200000);
        ////////////////////////////////////////////
        // defining Cycles && ports
        ////////////////////////////////////////////
        Cycle c1 = new Cycle(200000);
        Cycle c2 = new Cycle(200000);
        Cycle c3 = new Cycle(200000);
        swt1.createPort(swt2, c1);
        swt1.createPort(dev1, c2);
        swt2.createPort(dev2, c3);
        ////////////////////////////////////////////
        // defining Flows
        ////////////////////////////////////////////
        Flow f1 = new Flow("f1", Flow.PUBLISH_SUBSCRIBE);
        f1.setStartDevice(dev1);
        PathNode root1 = f1.getPathTree().getRoot();
        root1.addChild(swt1);
        PathNode pathNode = f1.getPathTree().searchNode("swt1", root1);
        pathNode.addChild(swt2);
        PathNode pathNode2 = f1.getPathTree().searchNode("swt2", root1);
        pathNode2.addChild(dev2);
        f1.setFixedPriority(true);
        f1.setPriorityValue(7);

        Flow f2 = new Flow("f2", Flow.PUBLISH_SUBSCRIBE);
        f2.setStartDevice(dev1);
        PathNode root2 = f2.getPathTree().getRoot();
        root2.addChild(swt1);
        PathNode pathNode3 = f2.getPathTree().searchNode("swt1", root2);
        pathNode3.addChild(swt2);
        PathNode pathNode4 = f2.getPathTree().searchNode("swt2", root2);
        pathNode4.addChild(dev2);
        f2.setFixedPriority(true);
        f2.setPriorityValue(7);

        Flow f3 = new Flow("f3", Flow.PUBLISH_SUBSCRIBE);
        f3.setStartDevice(dev1);
        PathNode root3 = f3.getPathTree().getRoot();
        root3.addChild(swt1);
        PathNode pathNode5 = f3.getPathTree().searchNode("swt1", root3);
        pathNode5.addChild(swt2);
        PathNode pathNode6 = f3.getPathTree().searchNode("swt2", root3);
        pathNode6.addChild(dev2);
        f3.setFixedPriority(true);
        f3.setPriorityValue(7);
        ////////////////////////////////////////////
        // setting periods for the flows
        ////////////////////////////////////////////
        f1.setFlowSendingPeriodicity(250);
        f2.setFlowSendingPeriodicity(500);
        f3.setFlowSendingPeriodicity(1000);
        ////////////////////////////////////////////
        // Defining network
        ////////////////////////////////////////////
        Network net = new Network();
        net.addDevice(dev2);
        net.addDevice(dev1);
        net.addSwitch(swt2);
        net.addSwitch(swt1);
        net.addFlow(f2);
        net.addFlow(f1);
        net.addFlow(f3);
        
        ////////////////////////////////////////////
        // checking the module
        ////////////////////////////////////////////
        ScheduleGenerator scheduleGenerator = new ScheduleGenerator();
        scheduleGenerator.setEnableLoggerFile(true);
        scheduleGenerator.setEnableConsoleOutput(true);
        scheduleGenerator.generateSchedule(net);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant