Bug 1704

Summary: IPv6 addresses State are not handled correctly
Product: ns-3 Reporter: Tommaso Pecorella <tommaso.pecorella>
Component: ipv6Assignee: Tommaso Pecorella <tommaso.pecorella>
Status: PATCH WANTED ---    
Severity: enhancement CC: clicksaswat, max.schettler, ns-bugs
Priority: P5    
Version: ns-3-dev   
Hardware: All   
OS: All   
Attachments: Fix for 1)

Description Tommaso Pecorella 2013-06-16 07:21:44 EDT
Iv6Addresses can have different States:
  enum State_e
    TENTATIVE, /**< Address is tentative, no packet can be sent unless DAD finished */
    DEPRECATED, /**< Address is deprecated and should not be used */
    PREFERRED, /**< Preferred address */
    PERMANENT, /**< Permanent address */
    HOMEADDRESS, /**< Address is a HomeAddress */
    TENTATIVE_OPTIMISTIC, /**< Address is tentative but we are optimistic so we can send packet even if DAD is not yet finished */
    INVALID, /**< Invalid state (after a DAD failed) */

The state transition is handled (i.e., an address starts at TENTATIVE_OPTIMISTIC, after the DAD is switched to PREFERRED, etc.).

The problems with the current implementation are:
1) Address state is not checked when the address is used, i.e., a node can use a DEPRECATED or INVALID address.
2) There is no fallback action when an address is marked as "to not be used". As a result, a node might not have any usable address.

This issue is partially related with the way the addresses are generated. Right now only a carefully built simulation might trigger this problem.
Nevertheless this might become an issue with the fd-netdevice.
Comment 1 Saswat K. Mishra 2015-04-21 15:35:50 EDT
Is this bug still open for patching???
Comment 2 Tommaso Pecorella 2015-04-22 04:14:53 EDT
(In reply to Saswat K. Mishra from comment #1)
> Is this bug still open for patching???

Yes, the bug is open and needing a patch.
Comment 3 Max Schettler 2016-05-07 18:56:43 EDT
Created attachment 2415 [details]
Fix for 1)

This patch should fix at least 1). As for 2) I'm not sure what you mean by "not to be used". Isn't the interface having no valid address a situation that can occur and should therefore be simulated as well?