1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

examples/gnrc_border_router: automatically start ZEP dispatcher

This commit is contained in:
Benjamin Valentin 2020-08-13 18:43:31 +02:00 committed by Benjamin Valentin
parent ecd40ff824
commit 0ffe5a09f4
3 changed files with 27 additions and 7 deletions

View File

@ -14,4 +14,5 @@ ifeq (,$(filter native,$(BOARD)))
endif
else
USEMODULE += socket_zep
USEMODULE += socket_zep_hello
endif

View File

@ -9,11 +9,17 @@ CFLAGS += -DASYNC_READ_NUMOF=$(shell expr $(ZEP_DEVICES) + 1)
# Set CFLAGS if not being set via Kconfig
CFLAGS += $(if $(CONFIG_KCONFIG_MODULE_DHCPV6),,-DCONFIG_DHCPV6_CLIENT_PFX_LEASE_MAX=$(ZEP_DEVICES))
# -z [::1]:$PORT for each ZEP device
TERMFLAGS += $(patsubst %,-z [::1]:%, $(shell seq $(ZEP_PORT_BASE) $(ZEP_PORT_MAX)))
ifneq (1,$(USE_DHCPV6))
# We don't need to start ethos so just start the UHCPD daemon in the
# background
TERMDEPS += uhcpd-daemon
ifeq (1,$(USE_DHCPV6))
FLAGS_EXTRAS += --use-dhcpv6
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)))

View File

@ -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
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`
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.
### 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
You can use `ethos` as a standalone driver, if you want to setup the BR manually.