-
Notifications
You must be signed in to change notification settings - Fork 38
Issue 294 solution #383
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
Open
ilq1
wants to merge
15
commits into
main
Choose a base branch
from
issue294
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Issue 294 solution #383
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
536def3
1.if one user creates multiply emulations, the task queue is cleared.…
ilq1 6db9b24
reformatted file
ilq1 c3f71f9
delete unused import
ilq1 d08b96c
Merge branch 'main' of github.com:mimi-net/miminet into issue294
ilq1 da9a9d8
implement switch jobs and tests for them:
ilq1 7cbaf7a
fix linter
ilq1 77415a8
fix linter
ilq1 69645f8
FIX LINTER
ilq1 68a9576
function names changed, shorter constructs were used in configurators.py
ilq1 44d4901
changed MODE=dev to MODE=prod
ilq1 b976410
Merge branch 'main' into issue294
ilq1 50b1171
Update uwsgi.ini
ilq1 9301bc4
edit time_check range
ilq1 adc713f
Merge branch 'main' of github.com:mimi-net/miminet into issue294
ilq1 de34a2c
Merge branch 'issue294' of github.com:mimi-net/miminet into issue294
ilq1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,110 @@ | ||
| [ | ||
| [ | ||
| { | ||
| "data": { | ||
| "id": "", | ||
| "label": "ARP-request\nWho has 192.168.0.2? Tell 192.168.0.1", | ||
| "type": "packet" | ||
| }, | ||
| "config": { | ||
| "type": "ARP-request\nWho has 192.168.0.2? Tell 192.168.0.1", | ||
| "path": "edge_mjcztrism9ezamqqda", | ||
| "source": "host_1", | ||
| "target": "l2sw1", | ||
| "loss_percentage": 0.0, | ||
| "duplicate_percentage": 0.0 | ||
| }, | ||
| "timestamp": "" | ||
| } | ||
| ], | ||
| [ | ||
| { | ||
| "data": { | ||
| "id": "", | ||
| "label": "ARP-request\nWho has 192.168.0.2? Tell 192.168.0.1", | ||
| "type": "packet" | ||
| }, | ||
| "config": { | ||
| "type": "ARP-request\nWho has 192.168.0.2? Tell 192.168.0.1", | ||
| "path": "edge_mjcztsiqna2lxz6nnwd", | ||
| "source": "l2sw1", | ||
| "target": "l2sw2", | ||
| "loss_percentage": 0.0, | ||
| "duplicate_percentage": 0.0 | ||
| }, | ||
| "timestamp": "" | ||
| } | ||
| ], | ||
| [ | ||
| { | ||
| "data": { | ||
| "id": "", | ||
| "label": "ARP-request\nWho has 192.168.0.2? Tell 192.168.0.1", | ||
| "type": "packet" | ||
| }, | ||
| "config": { | ||
| "type": "ARP-request\nWho has 192.168.0.2? Tell 192.168.0.1", | ||
| "path": "edge_mjcztrism9ezamqqda", | ||
| "source": "host_1", | ||
| "target": "l2sw1", | ||
| "loss_percentage": 0.0, | ||
| "duplicate_percentage": 0.0 | ||
| }, | ||
| "timestamp": "" | ||
| } | ||
| ], | ||
| [ | ||
| { | ||
| "data": { | ||
| "id": "", | ||
| "label": "ARP-request\nWho has 192.168.0.2? Tell 192.168.0.1", | ||
| "type": "packet" | ||
| }, | ||
| "config": { | ||
| "type": "ARP-request\nWho has 192.168.0.2? Tell 192.168.0.1", | ||
| "path": "edge_mjcztsiqna2lxz6nnwd", | ||
| "source": "l2sw1", | ||
| "target": "l2sw2", | ||
| "loss_percentage": 0.0, | ||
| "duplicate_percentage": 0.0 | ||
| }, | ||
| "timestamp": "" | ||
| } | ||
| ], | ||
| [ | ||
| { | ||
| "data": { | ||
| "id": "", | ||
| "label": "ARP-request\nWho has 192.168.0.2? Tell 192.168.0.1", | ||
| "type": "packet" | ||
| }, | ||
| "config": { | ||
| "type": "ARP-request\nWho has 192.168.0.2? Tell 192.168.0.1", | ||
| "path": "edge_mjcztrism9ezamqqda", | ||
| "source": "host_1", | ||
| "target": "l2sw1", | ||
| "loss_percentage": 0.0, | ||
| "duplicate_percentage": 0.0 | ||
| }, | ||
| "timestamp": "" | ||
| } | ||
| ], | ||
| [ | ||
| { | ||
| "data": { | ||
| "id": "", | ||
| "label": "ARP-request\nWho has 192.168.0.2? Tell 192.168.0.1", | ||
| "type": "packet" | ||
| }, | ||
| "config": { | ||
| "type": "ARP-request\nWho has 192.168.0.2? Tell 192.168.0.1", | ||
| "path": "edge_mjcztsiqna2lxz6nnwd", | ||
| "source": "l2sw1", | ||
| "target": "l2sw2", | ||
| "loss_percentage": 0.0, | ||
| "duplicate_percentage": 0.0 | ||
| }, | ||
| "timestamp": "" | ||
| } | ||
| ] | ||
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,181 @@ | ||
| { | ||
| "nodes": [ | ||
| { | ||
| "classes": [ | ||
| "host" | ||
| ], | ||
| "config": { | ||
| "default_gw": "", | ||
| "label": "host_1", | ||
| "type": "host" | ||
| }, | ||
| "data": { | ||
| "id": "host_1", | ||
| "label": "host_1" | ||
| }, | ||
| "interface": [ | ||
| { | ||
| "connect": "edge_mjcztrism9ezamqqda", | ||
| "id": "iface_60266344", | ||
| "ip": "192.168.0.1", | ||
| "name": "iface_60266344", | ||
| "netmask": 24 | ||
| } | ||
| ], | ||
| "position": { | ||
| "x": 208.25, | ||
| "y": 192.5999984741211 | ||
| } | ||
| }, | ||
| { | ||
| "classes": [ | ||
| "l2_switch" | ||
| ], | ||
| "config": { | ||
| "label": "l2sw1", | ||
| "stp": 0, | ||
| "type": "l2_switch" | ||
| }, | ||
| "data": { | ||
| "id": "l2sw1", | ||
| "label": "l2sw1" | ||
| }, | ||
| "interface": [ | ||
| { | ||
| "connect": "edge_mjcztrism9ezamqqda", | ||
| "id": "l2sw1_1", | ||
| "name": "l2sw1_1", | ||
| "type_connection": null, | ||
| "vlan": null | ||
| }, | ||
| { | ||
| "connect": "edge_mjcztsiqna2lxz6nnwd", | ||
| "id": "l2sw1_2", | ||
| "name": "l2sw1_2", | ||
| "type_connection": null, | ||
| "vlan": null | ||
| } | ||
| ], | ||
| "position": { | ||
| "x": 277.75, | ||
| "y": 184.8000030517578 | ||
| } | ||
| }, | ||
| { | ||
| "classes": [ | ||
| "l2_switch" | ||
| ], | ||
| "config": { | ||
| "label": "l2sw2", | ||
| "stp": 0, | ||
| "type": "l2_switch" | ||
| }, | ||
| "data": { | ||
| "id": "l2sw2", | ||
| "label": "l2sw2" | ||
| }, | ||
| "interface": [ | ||
| { | ||
| "connect": "edge_mjcztsiqna2lxz6nnwd", | ||
| "id": "l2sw2_1", | ||
| "name": "l2sw2_1", | ||
| "type_connection": null, | ||
| "vlan": null | ||
| }, | ||
| { | ||
| "connect": "edge_mjczttixwtd2jtzl29", | ||
| "id": "l2sw2_2", | ||
| "name": "l2sw2_2", | ||
| "type_connection": null, | ||
| "vlan": null | ||
| } | ||
| ], | ||
| "position": { | ||
| "x": 345.75, | ||
| "y": 178.3000030517578 | ||
| } | ||
| }, | ||
| { | ||
| "classes": [ | ||
| "host" | ||
| ], | ||
| "config": { | ||
| "default_gw": "", | ||
| "label": "host_2", | ||
| "type": "host" | ||
| }, | ||
| "data": { | ||
| "id": "host_2", | ||
| "label": "host_2" | ||
| }, | ||
| "interface": [ | ||
| { | ||
| "connect": "edge_mjczttixwtd2jtzl29", | ||
| "id": "iface_65503551", | ||
| "ip": "192.168.0.2", | ||
| "name": "iface_65503551", | ||
| "netmask": 24 | ||
| } | ||
| ], | ||
| "position": { | ||
| "x": 410.75, | ||
| "y": 182.5999984741211 | ||
| } | ||
| } | ||
| ], | ||
| "edges": [ | ||
| { | ||
| "data": { | ||
| "duplicate_percentage": 0, | ||
| "id": "edge_mjcztrism9ezamqqda", | ||
| "loss_percentage": 0, | ||
| "source": "host_1", | ||
| "target": "l2sw1" | ||
| } | ||
| }, | ||
| { | ||
| "data": { | ||
| "duplicate_percentage": 0, | ||
| "id": "edge_mjcztsiqna2lxz6nnwd", | ||
| "loss_percentage": 0, | ||
| "source": "l2sw1", | ||
| "target": "l2sw2" | ||
| } | ||
| }, | ||
| { | ||
| "data": { | ||
| "duplicate_percentage": 0, | ||
| "id": "edge_mjczttixwtd2jtzl29", | ||
| "loss_percentage": 0, | ||
| "source": "l2sw2", | ||
| "target": "host_2" | ||
| } | ||
| } | ||
| ], | ||
| "jobs": [ | ||
| { | ||
| "arg_1": "l2sw2_2", | ||
| "arg_2": "host_2", | ||
| "host_id": "l2sw2", | ||
| "id": "179fdf3667d84b6ca28e127bf12387f6", | ||
| "job_id": 6, | ||
| "level": 0, | ||
| "print_cmd": "link down host_2" | ||
| }, | ||
| { | ||
| "arg_1": "192.168.0.2", | ||
| "host_id": "host_1", | ||
| "id": "a4e92ee1d12b4f499821de2f03693be4", | ||
| "job_id": 1, | ||
| "level": 1, | ||
| "print_cmd": "ping -c 1 192.168.0.2" | ||
| } | ||
| ], | ||
| "config": { | ||
| "zoom": 2, | ||
| "pan_x": -183.5437076535751, | ||
| "pan_y": 107.00501192502065 | ||
| }, | ||
| "pcap": [], | ||
| "packets": "" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Не очень понимаю, у нас весь эмулятор будет засыпать когда для какого-то хоста включается sleep? Это точно то, что требуется?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
кажется что да, для демонстрации отказоустойчивости rstp нужно время на подумать после отключения линка.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
мне по описанию PR показалось, что должно в сон уходить конкретное устройство. Не очень понимаю как тогда эта задача должна работать. Добавляешь её и весь эмулятор спит, не запуская другие задачи, но устройства при этом продолжают работать (отправлять/принимать пакеты)?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
да, именно так и работает. при этом у rstp/stp появляется время на перерасчет маршрута. Я ориентировался на то, что подход с time.sleep также используется для расчета stp/rstp перед тем как команды начинают выполнятся
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А имеет значение на каком устройстве запущена эта задача и какая она в очереди? Её нужно добавлять сразу после задачи с STP или это не обязательно?
Просто как будто делать отдельной задачей для устройства команду, которая стопарит весь эмулятор и при этом нужна только для STP странно. Может тогда сделать это как параметр STP. Ползунок какой-то добавить с временем ожидания и соответственно после запуска STP делать sleep. Тогда понятно будет и зачем он нужен и когда сработает.
Ну либо я просто не понимаю как оно должно использоваться на практике
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
думаю что на каком устройстве запущена значение не имеет, а вот в каком порядке имеет. ее нужно добавлять не после задачи stp (вообще в коде stp это даже не задача в как другие в файлике jobs, если stp активирован он настраивается раньше всех задач) а после задачи link_down
приведу пример использования
строим такую сеть: https://miminet.ru/web_network?guid=c26e21be-d2af-4394-8ad8-dc4b0035c32f
затем пишем в хост 1 задачу пинг до хоста 2
пишем link down на свиче l2sw1 (например отключим линк до l2sw3)
потом пишем sleep 7 (примерно столько нужно чтобы rstp перестроился)
затем отправляем еще один пинг из хоста 1 в хост 2 и смотрим результат
если нам повезло и первый пинг пошел по пути который затем мы отключим, то после того как произойдет Link down rstp начнет перестраиваться и в итоге второй пинг пойдет уже по другому маршруту
(у всех задач которые я использовал наименьший приоритет выполнения, поэтому они все будут выполнятся в порядке добавления)
в целом идея добавлении задачи sleep возникла тогда, когда я осознал что для перестройки rstp и stp нужно разное время. сначала я просто сделал так, чтобы после link down эмулятор засыпал, но столкнулся с проблемой выше + пользователю ничего не мешает сделать обычный link down без всяких stp/rstp, не придется же ему ждать несколько секунд дополнительно