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

[Fix] Load interfaces as inactive #116

Merged
merged 3 commits into from
Dec 6, 2022
Merged

[Fix] Load interfaces as inactive #116

merged 3 commits into from
Dec 6, 2022

Conversation

viniarck
Copy link
Member

Fixes #113

  • Load interfaces as inactive

This PR is on top of #114 and it should be merged after Aldo's PR #115 (to facilitate merging things in order)

Local tests

I've explored it simulating the original issues, and with mef_eline and link liveness enabled. It behaved as expected, since interfaces are initially loaded as inactive, they only will turn into active when handling port description or port status (when handling port description I found another issue though kytos-ng/of_core#89):

Here's the topology output with the interfaces disabled when the topology gets loaded:

{
    "topology": {
        "links": {
            "cf0f4071be426b3f745027f5d22bc61f8312ae86293c9b28e7e66015607a9260": {
                "active": false,
                "enabled": true,
                "endpoint_a": {
                    "active": false,
                    ...
        },
        "switches": {
            "00:00:00:00:00:00:00:01": {
                "active": false,
                "connection": "",
                "data_path": "s1",
                "dpid": "00:00:00:00:00:00:00:01",
                "enabled": true,
                "hardware": "Open vSwitch",
                "id": "00:00:00:00:00:00:00:01",
                "interfaces": {
                    "00:00:00:00:00:00:00:01:1": {
                        "active": false,
                        "enabled": true,
                        "id": "00:00:00:00:00:00:00:01:1",
                        "link": "",
                        "lldp": true,
                        "mac": "12:39:a8:f9:11:b9",
                        "metadata": {},
                        "name": "s1-eth1",
                        "nni": false,
                        "port_number": 1,
                        "speed": 1250000000.0,
                        "switch": "00:00:00:00:00:00:00:01",
                        "type": "interface",
                        "uni": true
                    },
                    "00:00:00:00:00:00:00:01:2": {
                        "active": false,
                        "enabled": true,
                        ...

Liveness init state as expected as well:

{
    "interfaces": [
        {
            "id": "00:00:00:00:00:00:00:01:2",
            "last_hello_at": null,
            "status": "init"
        },
        {
            "id": "00:00:00:00:00:00:00:02:2",
            "last_hello_at": null,
            "status": "init"
        },
        {
            "id": "00:00:00:00:00:00:00:02:3",
            "last_hello_at": null,
            "status": "init"
        },
        {
            "id": "00:00:00:00:00:00:00:03:2",
            "last_hello_at": null,
            "status": "init"
        }
    ]
}

Once the switch connects again and send port description the states are as expected:

{
    "interfaces": [
        {
            "id": "00:00:00:00:00:00:00:01:2",
            "last_hello_at": "2022-11-30T16:40:29",
            "status": "up"
        },
        {
            "id": "00:00:00:00:00:00:00:02:2",
            "last_hello_at": "2022-11-30T16:40:29",
            "status": "up"
        },
        {
            "id": "00:00:00:00:00:00:00:02:3",
            "last_hello_at": "2022-11-30T16:40:29",
            "status": "up"
        },
        {
            "id": "00:00:00:00:00:00:00:03:2",
            "last_hello_at": "2022-11-30T16:40:29",
            "status": "up"
        }
    ]
}
{
    "topology": {
        "links": {
            "cf0f4071be426b3f745027f5d22bc61f8312ae86293c9b28e7e66015607a9260": {
                "active": true,
                "enabled": true,
                "endpoint_a": {
                    "active": true,
                    "enabled": true,
                    "id": "00:00:00:00:00:00:00:01:2",
                    "link": "cf0f4071be426b3f745027f5d22bc61f8312ae86293c9b28e7e66015607a9260",
                    ...
        },
        "switches": {
            "00:00:00:00:00:00:00:01": {
                "active": true,
                "connection": "127.0.0.1:42036",
                "data_path": "s1",
                "dpid": "00:00:00:00:00:00:00:01",
                "enabled": true,
                "hardware": "Open vSwitch",
                "id": "00:00:00:00:00:00:00:01",
                "interfaces": {
                    "00:00:00:00:00:00:00:01:1": {
                        "active": true,
                        "enabled": true,
                        "id": "00:00:00:00:00:00:00:01:1",
                        "link": "",
                        "lldp": true,
                        "mac": "12:da:54:64:fe:5b",
                        "metadata": {},
                        "name": "s1-eth1",
                        "nni": false,
                        "port_number": 1,
                        "speed": 1250000000.0,
                        "switch": "00:00:00:00:00:00:00:01",
                        "type": "interface",
                        "uni": true
                    },
                    "00:00:00:00:00:00:00:01:2": {
                        "active": true,
                        "enabled": true,
                        "id": "00:00:00:00:00:00:00:01:2",
                        "link": "cf0f4071be426b3f745027f5d22bc61f8312ae86293c9b28e7e66015607a9260",
                        "lldp": true,
                        ...

@viniarck viniarck requested a review from a team November 30, 2022 17:39
@viniarck
Copy link
Member Author

I'll dispatch end-to-end tests for this PR for compleness. I'll post the results later on here.

Base automatically changed from fix/link_up_notify to master December 1, 2022 13:42
@viniarck
Copy link
Member Author

viniarck commented Dec 2, 2022

I'll dispatch end-to-end tests for this PR for compleness. I'll post the results later on here.

Tests have passed

------------------------------- start/stop times -------------------------------
= 172 passed, 2 skipped, 18 xfailed, 7 xpassed, 793 warnings in 10319.84s (2:51:59) =

@viniarck viniarck merged commit d036b97 into master Dec 6, 2022
@viniarck viniarck deleted the fix/load_inactive branch December 6, 2022 13:48
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

Successfully merging this pull request may close these issues.

When loading the topology it's assuming links and interfaces can still be active
1 participant