examples/gnrc_border_router: automatically start ZEP dispatcher
This commit is contained in:
parent
ecd40ff824
commit
0ffe5a09f4
@ -14,4 +14,5 @@ ifeq (,$(filter native,$(BOARD)))
|
|||||||
endif
|
endif
|
||||||
else
|
else
|
||||||
USEMODULE += socket_zep
|
USEMODULE += socket_zep
|
||||||
|
USEMODULE += socket_zep_hello
|
||||||
endif
|
endif
|
||||||
|
|||||||
@ -9,11 +9,17 @@ CFLAGS += -DASYNC_READ_NUMOF=$(shell expr $(ZEP_DEVICES) + 1)
|
|||||||
# Set CFLAGS if not being set via Kconfig
|
# Set CFLAGS if not being set via Kconfig
|
||||||
CFLAGS += $(if $(CONFIG_KCONFIG_MODULE_DHCPV6),,-DCONFIG_DHCPV6_CLIENT_PFX_LEASE_MAX=$(ZEP_DEVICES))
|
CFLAGS += $(if $(CONFIG_KCONFIG_MODULE_DHCPV6),,-DCONFIG_DHCPV6_CLIENT_PFX_LEASE_MAX=$(ZEP_DEVICES))
|
||||||
|
|
||||||
# -z [::1]:$PORT for each ZEP device
|
ifeq (1,$(USE_DHCPV6))
|
||||||
TERMFLAGS += $(patsubst %,-z [::1]:%, $(shell seq $(ZEP_PORT_BASE) $(ZEP_PORT_MAX)))
|
FLAGS_EXTRAS += --use-dhcpv6
|
||||||
|
|
||||||
ifneq (1,$(USE_DHCPV6))
|
|
||||||
# We don't need to start ethos so just start the UHCPD daemon in the
|
|
||||||
# background
|
|
||||||
TERMDEPS += uhcpd-daemon
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
# enable the ZEP dispatcher
|
||||||
|
FLAGS_EXTRAS += -z $(ZEP_PORT_BASE)
|
||||||
|
|
||||||
|
# Configure terminal parameters
|
||||||
|
TERMDEPS += host-tools
|
||||||
|
TERMPROG_FLAGS = $(FLAGS_EXTRAS) $(ELFFILE) $(IPV6_PREFIX)
|
||||||
|
TERMPROG ?= sudo $(RIOTTOOLS)/zep_dispatch/start_network.sh $(TERMPROG_FLAGS)
|
||||||
|
|
||||||
|
# -z [::1]:$PORT for each ZEP device
|
||||||
|
TERMFLAGS ?= $(patsubst %,-z [::1]:%, $(shell seq $(ZEP_PORT_BASE) $(ZEP_PORT_MAX)))
|
||||||
|
|||||||
@ -24,6 +24,8 @@ This example comes with support for three uplink types pre-configured:
|
|||||||
|
|
||||||
For `native` the host-facing [`netdev_tap`](https://doc.riot-os.org/netdev__tap_8h.html) device
|
For `native` the host-facing [`netdev_tap`](https://doc.riot-os.org/netdev__tap_8h.html) device
|
||||||
is configured, providing connectivity via a TAP interface to the RIOT instance.
|
is configured, providing connectivity via a TAP interface to the RIOT instance.
|
||||||
|
On the node-facing side [`socket_zep`](https://doc.riot-os.org/group__drivers__socket__zep.html)
|
||||||
|
is used to simulate a IEEE 802.15.4 network.
|
||||||
|
|
||||||
To select an uplink, set the UPLINK environment variable. For instance, use `UPLINK=slip`
|
To select an uplink, set the UPLINK environment variable. For instance, use `UPLINK=slip`
|
||||||
for a SLIP uplink.
|
for a SLIP uplink.
|
||||||
@ -143,6 +145,17 @@ On this example, such address can be pinged from 6lo motes:
|
|||||||
|
|
||||||
Thus far, IPv6 communication with between your PC and your motes is enabled.
|
Thus far, IPv6 communication with between your PC and your motes is enabled.
|
||||||
|
|
||||||
|
### Simulated network with native
|
||||||
|
|
||||||
|
On native a IEEE 802.15.4 network is simulated by encapsulating 802.15.4 frames
|
||||||
|
inside UDP packets. For this the `socket_zep` modules is used both on the border
|
||||||
|
router and on the virtual mote.
|
||||||
|
|
||||||
|
The UDP packets are sent to a dispatcher which forwards them to all other nodes.
|
||||||
|
By default a simple dispatcher is provided that will forward every packet to
|
||||||
|
every node (perfect broadcast), but it can be replaced by the user with alternative
|
||||||
|
dispatchers to simulate more advanced topologies.
|
||||||
|
|
||||||
# gnrc_border_router with manual config
|
# gnrc_border_router with manual config
|
||||||
You can use `ethos` as a standalone driver, if you want to setup the BR manually.
|
You can use `ethos` as a standalone driver, if you want to setup the BR manually.
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user