Having multiple network interfaces up at once?

When both ethernet and WiFi are supported on one MCU (with both sharing the same L2 implementation, only one network device being active at a time), does it matter if both network interfaces are up at the same time? Are there any drawbacks (performance or other)? If the application switches from one network device to another (assuming the device is available and operable), should the interface corresponding to the unused device be brought down with net_if_down()?

Parents
  • Hi, 

    It might have potential drawbacks like resource contention or power consumption, etc, and the Zephyr networking stack documentation suggests that 

    "Network drivers or L2 implementations should not change administrative state on their own. The application must manage it."

    For proper resource management, it's generally good practice to bring down unused interfaces, especially when switching between them:

              "The administrative state indicates whether an interface is turned ON or OFF. This state is represented by NET_IF_UP flag and is controlled by the application." 

    Once this is in place, you can monitor the NET_EVENT_IF_UP and NET_EVENT_IF_DOWN events in order to check if the Ethernet cable is connected or disconnected. For an example of how to do this, please have a look at this code.

    Regards,
    Amanda H.

Reply
  • Hi, 

    It might have potential drawbacks like resource contention or power consumption, etc, and the Zephyr networking stack documentation suggests that 

    "Network drivers or L2 implementations should not change administrative state on their own. The application must manage it."

    For proper resource management, it's generally good practice to bring down unused interfaces, especially when switching between them:

              "The administrative state indicates whether an interface is turned ON or OFF. This state is represented by NET_IF_UP flag and is controlled by the application." 

    Once this is in place, you can monitor the NET_EVENT_IF_UP and NET_EVENT_IF_DOWN events in order to check if the Ethernet cable is connected or disconnected. For an example of how to do this, please have a look at this code.

    Regards,
    Amanda H.

Children
No Data
Related