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

ipv6_netif: initialize device dependent values #2944

Merged
merged 3 commits into from
May 26, 2015

Conversation

miri64
Copy link
Member

@miri64 miri64 commented May 9, 2015

This auto-initializes device dependent values for IPv6 like the link-layer-address dependent IPv6 address or the 6LoWPAN flag. It also fixes some related output. ng_at86rf2xx needed an extra option for get.

Depends on #2901.

@miri64 miri64 added Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation Area: network Area: Networking State: waiting for other PR State: The PR requires another PR to be merged first NSTF labels May 9, 2015
@miri64 miri64 added this to the Network Stack Task Force milestone May 9, 2015
@miri64 miri64 force-pushed the ipv6_netif/opt/auto-init-addr branch from 6da46d5 to 2c053d5 Compare May 11, 2015 01:51
@miri64
Copy link
Member Author

miri64 commented May 11, 2015

Rebased to current #2901 and added some fixes

@miri64 miri64 force-pushed the ipv6_netif/opt/auto-init-addr branch 2 times, most recently from c159fa5 to a7dd794 Compare May 17, 2015 09:11
@miri64
Copy link
Member Author

miri64 commented May 17, 2015

Rebased to current master and #2901

@miri64 miri64 force-pushed the ipv6_netif/opt/auto-init-addr branch from a7dd794 to 8d02890 Compare May 22, 2015 11:15
@miri64 miri64 removed the State: waiting for other PR State: The PR requires another PR to be merged first label May 22, 2015
@miri64
Copy link
Member Author

miri64 commented May 22, 2015

Rebased to current master. It's also no more dependent on another PR

/* TODO: put this somewhere more central and L2 protocol dependent */
#define IID_LEN (8)

static bool _hwaddr_to_iid(uint8_t *iid, const uint8_t *hwaddr, size_t hwaddr_len)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually would like to see this publicly available for other layers. The rationale is that I would use such a function in RPL, where I need to add an ipv6 address to the interface (prefix given during runtime). Maybe with some more abstractions so that I do not have to deal with hardware addresses in RPL (:

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem is that it is not really specified anywhere that this is the general way to do it... This function basically assumes that the address is either an EUI-64, a MAC-48, one of the short address representations of IEEE 802.15.4 (with PAN or without), or the 1-bit format we used with the cc1100 in the old stack. This is however by no means generally applicable.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just out of curiosity: what do you need the link-layer addresses in RPL for?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RPL has an option to spread a prefix via control packets (very similar to the PIO of ND). Nodes receiving this prefix should use it to configure an ipv6 address on their interface.

I thought I can use the interface id to create a unique ipv6 address out of that prefix. Do you have any other suggestions how I can achieve this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regardless of this issue (which is pretty complex, because it also includes how to auto-initialize addresses in general) we should really talk about this option, especially with regard to substitutable features in 6LoWPAN ND which I'm currently working on. Are you at the Institute or the Hack'n'ACK today?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not at the institute right now, but I'll join the Hack'n'ACK later

iid[7] = hwaddr[i++];
break;

case 8:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we order the cases?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would mean more code.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I'm not mistaken

case 8:
...
break;
case 6:
...
break;
case 4:
...
case 2:
...
case 1:
...
break;
default:
...

should result in the same code.

@OlegHahm
Copy link
Member

Shouldn't this also have dependency to ng_netif?

@miri64
Copy link
Member Author

miri64 commented May 26, 2015

I think now it does

@miri64
Copy link
Member Author

miri64 commented May 26, 2015

Shouldn't this also have dependency to ng_netif?

What are you talking about it already has this dependency: https://github.com/RIOT-OS/RIOT/blob/master/Makefile.dep#L162

@miri64 miri64 force-pushed the ipv6_netif/opt/auto-init-addr branch from 8d02890 to 2459f50 Compare May 26, 2015 13:25
@miri64
Copy link
Member Author

miri64 commented May 26, 2015

Rebased to current master and addressed comments.

@miri64 miri64 force-pushed the ipv6_netif/opt/auto-init-addr branch from c7fa53c to 74053c9 Compare May 26, 2015 13:27
@OlegHahm
Copy link
Member

Shouldn't this also have dependency to ng_netif?

What are you talking about it already has this dependency: https://github.com/RIOT-OS/RIOT/blob/master/Makefile.dep#L162

Yes, sorry, somehow assumed that this would introduce a new module.

@OlegHahm OlegHahm added the CI: needs squashing Commits in this PR need to be squashed; If set, CI systems will mark this PR as unmergable label May 26, 2015
@OlegHahm
Copy link
Member

ACK

@miri64 miri64 force-pushed the ipv6_netif/opt/auto-init-addr branch from 74053c9 to 8633043 Compare May 26, 2015 16:47
@miri64
Copy link
Member Author

miri64 commented May 26, 2015

Squashed

@miri64 miri64 added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed CI: needs squashing Commits in this PR need to be squashed; If set, CI systems will mark this PR as unmergable labels May 26, 2015
@miri64
Copy link
Member Author

miri64 commented May 26, 2015

And go.

miri64 added a commit that referenced this pull request May 26, 2015
ipv6_netif: initialize device dependent values
@miri64 miri64 merged commit 475bfe6 into RIOT-OS:master May 26, 2015
@miri64 miri64 deleted the ipv6_netif/opt/auto-init-addr branch May 26, 2015 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: network Area: Networking CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants