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

[simulation] support simulating radio over IPv6 #10194

Merged
merged 1 commit into from
May 13, 2024

Conversation

bukepo
Copy link
Member

@bukepo bukepo commented May 6, 2024

This commit adds support to simulate Thread radio over IPv6.

With this commit, a simulation will be simulated over either IPv6 or IPv4. If it's simulated on IPv6, it communicates with other simulation nodes in IPv6 group ff02::116. And if it's simulated on IPv4, it communicates with other simulation nodes in IPv4 group 224.0.0.116.

Note that simulating virtual time is not included in this commit.

Copy link

size-report bot commented May 6, 2024

Size Report of OpenThread

Merging #10194 into main(1fceb22).

name branch text data bss total
ot-cli-ftd main 466864 856 66364 534084
#10194 466864 856 66364 534084
+/- 0 0 0 0
ot-ncp-ftd main 435740 760 61576 498076
#10194 435740 760 61576 498076
+/- 0 0 0 0
libopenthread-ftd.a main 235964 95 40310 276369
#10194 235964 95 40310 276369
+/- 0 0 0 0
libopenthread-cli-ftd.a main 57533 0 8075 65608
#10194 57533 0 8075 65608
+/- 0 0 0 0
libopenthread-ncp-ftd.a main 31863 0 5916 37779
#10194 31863 0 5916 37779
+/- 0 0 0 0
ot-cli-mtd main 364512 760 51220 416492
#10194 364512 760 51220 416492
+/- 0 0 0 0
ot-ncp-mtd main 347036 760 46448 394244
#10194 347036 760 46448 394244
+/- 0 0 0 0
libopenthread-mtd.a main 158089 0 25182 183271
#10194 158089 0 25182 183271
+/- 0 0 0 0
libopenthread-cli-mtd.a main 39756 0 8059 47815
#10194 39756 0 8059 47815
+/- 0 0 0 0
libopenthread-ncp-mtd.a main 24743 0 5916 30659
#10194 24743 0 5916 30659
+/- 0 0 0 0
ot-cli-ftd-br main 550240 864 131212 682316
#10194 550240 864 131212 682316
+/- 0 0 0 0
libopenthread-ftd-br.a main 324056 100 105134 429290
#10194 324056 100 105134 429290
+/- 0 0 0 0
libopenthread-cli-ftd-br.a main 71320 0 8099 79419
#10194 71320 0 8099 79419
+/- 0 0 0 0
ot-rcp main 62248 564 20604 83416
#10194 62248 564 20604 83416
+/- 0 0 0 0
libopenthread-rcp.a main 9542 0 5052 14594
#10194 9542 0 5052 14594
+/- 0 0 0 0
libopenthread-radio.a main 18870 0 214 19084
#10194 18870 0 214 19084
+/- 0 0 0 0

@bukepo bukepo force-pushed the ipv6-local-host branch 7 times, most recently from 13ac684 to 9fb08a1 Compare May 7, 2024 04:18
inet_pton(AF_INET, UTILS_SOCKET_GROUP_ADDR, &mreq.imr_multiaddr);
for (struct ifaddrs *ifa = ifaddr; ifa != NULL; ifa = ifa->ifa_next)
{
if (ifa->ifa_addr == NULL || strcmp(ifa->ifa_name, aLocalHost) != 0)
Copy link
Contributor

Choose a reason for hiding this comment

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

ifa_name seems to be the interface name. https://man7.org/linux/man-pages/man3/getifaddrs.3.html

It's comparing the interface name with an IP address. Is this expected?

Copy link
Member Author

@bukepo bukepo May 7, 2024

Choose a reason for hiding this comment

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

aLocalHost can be an interface name.

Copy link
Contributor

Choose a reason for hiding this comment

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

Can we rename the parameter aLocalHost and the global variable gLocalHost?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm fine with renaming it in a separate PR.

examples/platforms/simulation/simul_utils.c Outdated Show resolved Hide resolved
examples/platforms/simulation/simul_utils.c Outdated Show resolved Hide resolved
@bukepo bukepo force-pushed the ipv6-local-host branch 2 times, most recently from 14c3669 to 777ebea Compare May 7, 2024 06:11
Copy link
Contributor

@superwhd superwhd left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@bukepo bukepo requested review from abtink and lanyuwen and removed request for abtink and lanyuwen May 10, 2024 03:02
Copy link
Member

@abtink abtink left a comment

Choose a reason for hiding this comment

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

Looks good overall. Thanks.
Some style and smaller suggestions below.

examples/platforms/simulation/simul_utils.c Outdated Show resolved Hide resolved
examples/platforms/simulation/simul_utils.c Outdated Show resolved Hide resolved
examples/platforms/simulation/simul_utils.c Outdated Show resolved Hide resolved
examples/platforms/simulation/simul_utils.c Outdated Show resolved Hide resolved
examples/platforms/simulation/simul_utils.c Outdated Show resolved Hide resolved
examples/platforms/simulation/simul_utils.c Outdated Show resolved Hide resolved
examples/platforms/simulation/simul_utils.c Outdated Show resolved Hide resolved
examples/platforms/simulation/simul_utils.c Outdated Show resolved Hide resolved
examples/platforms/simulation/simul_utils.c Outdated Show resolved Hide resolved
examples/platforms/simulation/simul_utils.c Outdated Show resolved Hide resolved
This commit adds support to simulate Thread radio over IPv6.

With this commit, a simulation will be simulated over either IPv6 or IPv4.
If it's simulated on IPv6, it communicates with other simulation nodes
in IPv6 group `ff02::116`. And if it's simulated on IPv4, it communicates
with other simulation nodes in IPv4 group `224.0.0.116`.

Note that simulating virtual time is not included in this commit.
@bukepo
Copy link
Member Author

bukepo commented May 11, 2024

Looks good overall. Thanks. Some style and smaller suggestions below.

All make sense! Fixed and uploaded. Thanks!

@bukepo bukepo requested a review from abtink May 11, 2024 01:50
Copy link
Member

@abtink abtink left a comment

Choose a reason for hiding this comment

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

LGTM. 👍

@jwhui jwhui merged commit 39ce811 into openthread:main May 13, 2024
103 checks passed
bukepo added a commit to bukepo/openthread that referenced this pull request May 15, 2024
This commit renames command line argument --local-host to
--local-interface to reduce confusion as discussed in openthread#10194.
bukepo added a commit to bukepo/openthread that referenced this pull request May 15, 2024
This commit renames command line argument --local-host to
--local-interface to reduce confusion as discussed in openthread#10194.

This commit also add help message for local interface.
bukepo added a commit to bukepo/openthread that referenced this pull request May 15, 2024
This commit renames command line argument --local-host to
--local-interface to reduce confusion as discussed in openthread#10194.

This commit also add help message for local interface.
jwhui pushed a commit that referenced this pull request May 15, 2024
This commit renames command line argument --local-host to
--local-interface to reduce confusion as discussed in #10194.

This commit also add help message for local interface.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants