-
Notifications
You must be signed in to change notification settings - Fork 8k
Improve Border Router packet forwarding logic #97531
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
base: main
Are you sure you want to change the base?
Improve Border Router packet forwarding logic #97531
Conversation
4524f47
to
3d4abde
Compare
"ff04::1", | ||
/** Site-Local scope multicast address */ | ||
"ff05::1", | ||
/** Organization-Local scope multicast address */ | ||
"ff08::1", | ||
/** Global scope multicast address */ | ||
"ff0e::1" |
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.
This looks like overkill as you could create IPv6 address dynamically.
So something like
int mcast_groups[] = {
/** Admin-Local scope multicast address */
4,
/** Site-Local scope multicast address */
5,
/** Organization-Local scope multicast address */
8,
/** Global scope multicast address */
e,
};
ARRAY_FOR_EACH(mcast_groups, i) {
struct in6_addr addr;
net_ipv6_addr_create(&addr, (0xff << 8) | i, 0, 0, 0, 0, 0, 0, 1);
...
}
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.
Updated. Thanks!
There are some cases when OpenThread opens a sockets and doesn't choose as default it's internal interface, this leading to usage of platform UDP module which will then send back the packet to the OpenThread interface. In this case, the packet should not be treated as originated from backbone interface. Backbone router multicast listener callback functionality is improved. A route with a prefix length of 128 is set and a multicast address is added for each listener registration. OpenThread interface joins that multicast address group. Enabled forwarding capabilities for Backbone interface. A border router should be able to perform default packet forwarding for destination addresses with a multicast scope greater than admin-local. In order to achieve this, multicast routes have been added to those addreses. [https://datatracker.ietf.org/doc/rfc7346/] For Border Router application, `ip6_addr_cb` is not installed. otIp6SubscribeMulticastAddress call would re-register an IPV6 multicast address which might have been registered by an OpenThread node using `ipmadd add` command and even if that node performed `ipmaddr del`, the address was still present in multicast listener table. This also led to a missing MLDv2 message with that specific multicast IPV6 address. Signed-off-by: Cristian Bulacu <[email protected]>
3d4abde
to
08b9ae7
Compare
static int mcast_group_idx[] = {/** Admin-Local scope multicast address */ | ||
0x04, | ||
/** Site-Local scope multicast address */ | ||
0x05, | ||
/** Organization-Local scope multicast address */ | ||
0x08, | ||
/** Global scope multicast address */ | ||
0x0e | ||
}; |
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.
Add a trailing comma for nicer formatting
static int mcast_group_idx[] = {/** Admin-Local scope multicast address */ | |
0x04, | |
/** Site-Local scope multicast address */ | |
0x05, | |
/** Organization-Local scope multicast address */ | |
0x08, | |
/** Global scope multicast address */ | |
0x0e | |
}; | |
static int mcast_group_idx[] = { | |
/** Admin-Local scope multicast address */ | |
0x04, | |
/** Site-Local scope multicast address */ | |
0x05, | |
/** Organization-Local scope multicast address */ | |
0x08, | |
/** Global scope multicast address */ | |
0x0e, | |
}; |
|
There are some cases when OpenThread opens a sockets and doesn't choose as default it's internal interface, this leading to usage of platform UDP module which will then send back the packet to the OpenThread interface. In this case, the packet should not be treated as originated from backbone interface.
Backbone router multicast listener callback functionality is improved. A route with a prefix length of 128 is set
and a multicast address is added for each listener registration. OpenThread interface joins that multicast address group.
Enabled forwarding capabilities for Backbone interface. A border router should be able to perform default packet forwarding for destination addresses with a multicast scope greater than admin-local. In order to achieve this, multicast routes have been added to those addreses. [https://datatracker.ietf.org/doc/rfc7346/]
For Border Router application,
ip6_addr_cb
is not installed. otIp6SubscribeMulticastAddress call would re-register an IPV6 multicast address which might have been registered by an OpenThread node usingipmadd add
command and even if that node performedipmaddr del
, the address was still present in multicast listener table. This also led to a missing MLDv2 message with that specific multicast IPV6 address.