Skip to content

Commit

Permalink
examples/gnrc_border_router: update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
benpicco committed Mar 12, 2020
1 parent 27ef080 commit f6a254e
Showing 1 changed file with 38 additions and 40 deletions.
78 changes: 38 additions & 40 deletions examples/gnrc_border_router/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,35 @@ and routes on the BR.

The script `start_network.sh` enables a *ready-to-use* BR in only one command.

## Uplink

The border router will route packets between a 6Lo network (PAN) and a 'normal'
IPv6 network (i.e. the Internet).

This requires the border router to have two interfaces, a downstream, 6lo-interface
and an IPv6 uplink.

This setup comes with support for three uplink types pre-configured.
To select e.g. a SLIP uplink, add `UPLINK=slip` to your `make` command.

`ethos` and `slip` will make use of the existing serial interface that is used for the
RIOT shell to provide an upstream interface. Your computer will act as the upstream
router, stdio is multiplexed over the same line.

The `wifi` uplink will connect to an existing WiFi (IEEE 802.11) network.
The network must provide a DHCPv6 server that supports prefix delegation (IA_PD).

Use `WIFI_SSID="SSID" WIFI_PASS="password"` in your `make` command to set your WiFi
credentials. You can alternatively edit the `Makefile`.

Currently this requires an esp8266 or esp32 for the border router.
On the downstream interface the proprietary `esp_now` link is used. It behaves similar
to IEEE 802.15.4 but is only availiably on Espressif's wireless MCUs.

You can of course replace this with e.g. an IEEE 802.15.4 radio that you connected to
your board. In this case make sure to edit `Makefile.board.dep` to select the appropriate
driver.

## Requirements
This functionality works only on Linux machines.
Mac OSX support will be added in the future (lack of native `tap` interface).
Expand Down Expand Up @@ -41,21 +70,8 @@ Linux might not recognize the interface as connected.
[KEA]: https://kea.isc.org/

## Setup
First, you need to compile `ethos`.
Go to `/dist/tools/ethos` and type:

```bash
make clean all
```

Then, you need to compile UHCP.
This tool is found in `/dist/tools/uhcpd`. So, as for `ethos`:

```bash
make clean all
```

Afterwards, proceed to compile and flash `gnrc_border_router` to your board:
To compile and flash `gnrc_border_router` to your board:

```bash
make clean all flash
Expand All @@ -69,18 +85,19 @@ USE_DHCPV6=1 make clean all flash
```

## Usage
Start the `start_network.sh` script by doing on `dist/tools/ethos`:
The `start_network.sh` script needed for `ethos` and `slip` is automatically run
if you type

```bash
sudo sh start_network.sh /dev/ttyACMx tap0 2001:db8::/64
make term
```

This will execute the needed commands to setup a `tap` interface
and configure the BR.
This will execute the needed commands to setup a `tap` (`ethos`) or `tun` (`slip`)
interface and configure the BR.
Notice that this will also configure `2001:db8::/64` as a prefix.
This prefix should be announced to other motes through the wireless interface.

As said previously, `ethos` allows to send IP packets and shell commands.
As said previously, `ethos` and `slip` allow to send IP packets and shell commands.
This is done through the same serial interface.
By typing `help` you will get the list of available shell commands.

Expand Down Expand Up @@ -208,7 +225,7 @@ standard [1]. The example application in this folder assumes as a default to be
run on an Atmel SAM R21 Xplained Pro evaluation board using an external UART
adapter for the second serial interface. However, it is feasible to run the
example on any RIOT supported platform that offers either more than one UART or
be equipped with an IPv6 capable network device. In this case only the Makefile
be equipped with an IPv6 capable network device. In this case only the Makefile.board.dep
of this application has to be slightly modified, e.g. by replacing the line
```
USEMODULE += ethos
Expand All @@ -218,32 +235,14 @@ with something like
USEMODULE += encx24j600
```
and specify the target platform as `BOARD = myplatform`.
In order to use the border router over SLIP, please check the `periph_conf.h`
of the corresponding board and look out for the `UART_NUMOF` parameter. Its
value has to be bigger than 1.

Be sure that you have replaced on your `Makefile` the lines to use SLIP.
You should have something like this:

```make
ifeq (,$(SLIP_UART))
# set default (last available UART)
SLIP_UART="UART_DEV(UART_NUMOF-1)"
endif
ifeq (,$(SLIP_BAUDRATE))
# set default
SLIP_BAUDRATE=115200
endif

GNRC_NETIF_NUMOF := 2
INCLUDES += -I$(CURDIR)
CFLAGS += -DSLIP_UART=$(SLIP_UART)
CFLAGS += -DSLIP_BAUDRATE=$(SLIP_BAUDRATE)
# Include SLIP package for IP over Serial communication
USEMODULE += slipdev
UPLINK ?= slip
```


## Configuration

In order to connect a RIOT 6LoWPAN border router over SLIP you run a small
Expand Down Expand Up @@ -288,4 +287,3 @@ for further help.
[1] https://tools.ietf.org/html/rfc1055

[2] https://github.com/contiki-os/contiki/blob/master/tools/tunslip.c

0 comments on commit f6a254e

Please sign in to comment.