Skip to content

Two flows with different cycle merge into the same link #27

Description

@mopean

Hi,
Thanks for your code. I am running an example on the project.
My example has two flows as follows:

Flow flow0 = new Flow(Flow.UNICAST);
flow0.setStartDevice(dev4);
flow0.addToPath(switch0);
flow0.addToPath(switch2);
flow0.setEndDevice(dev10);
flow0.setFlowSendingPeriodicity(2000);


Flow flow1 = new Flow(Flow.UNICAST);
flow1.setStartDevice(dev5);
flow1.addToPath(switch1);
flow1.addToPath(switch2);
flow1.setEndDevice(dev10);
flow1.setFlowSendingPeriodicity(3000);

The topology is:

Dev4 -> SW0 -> SW2 -> Dev10
                ^
                |
Dev5 -> Sw1 -> 

And the result is:

>>>> INFORMATION OF SWITCH: switch0 <<<<
    Port list - 
        => Port name:       switch0Port1
        Connects to:     switch2
        Cycle start:    0.0
        Cycle duration: 2000.0
        Fragments:       flow1Fragment1, 
        Priority number: 7
          Index 0 Slot start:      1949.088
          Index 0 Slot duration:   8.004
        ------------------------


>>>> INFORMATION OF SWITCH: switch1 <<<<
    Port list - 
        => Port name:       switch1Port1
        Connects to:     switch2
        Cycle start:    0.0
        Cycle duration: 3000.0
        Fragments:       flow2Fragment1, 
        Priority number: 7
          Index 0 Slot start:      2940.996
          Index 0 Slot duration:   8.0
        ------------------------


>>>> INFORMATION OF SWITCH: switch2 <<<<
    Port list - 
        => Port name:       switch2Port9
        Connects to:     dev10
        Cycle start:    0.0
        Cycle duration: 1000.0
        Fragments:       flow1Fragment2, flow2Fragment2, 
        Priority number: 7
          Index 0 Slot start:      949.992
          Index 0 Slot duration:   50.0
        ------------------------

I notice that Cycle duration of Switch2 is 1ms. It means that there is a slot in 1ms. But cycle of flow0 is 2ms, and cycle of flow1 is 3ms. There will has two slot without packets within every 6ms.

I think it is better that the Cycle duration of Switch2 shall be 6ms (i.e. Least Common Multiple of two flow). In each cycle, there are four time slots .
dbe31be1-9365-4c04-b278-f14dcfd5f216

Which part of the code do I need to modify?
Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions